2006-12-19 02:55:36 +00:00
|
|
|
##/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# dmapi functions
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# Commands relitive to dmapi qa
|
|
|
|
|
|
|
|
|
|
DMAPI_QASUITE1_DIR=$here/dmapi/src/suite1/
|
|
|
|
|
DMAPI_QASUITE2_DIR=$here/dmapi/src/suite2/
|
2007-06-04 06:13:28 +00:00
|
|
|
DMAPI_COMMON_DIR=$here/dmapi/src/common/
|
2006-12-19 02:55:36 +00:00
|
|
|
|
|
|
|
|
DMAPI_LS_TO_COPY_PATH=$DMAPI_QASUITE2_DIR/bindir/ls_to_copy
|
|
|
|
|
|
|
|
|
|
_dmapi_scratch_mount () {
|
2007-01-04 05:12:36 +00:00
|
|
|
if [ `echo "$MOUNT_OPTIONS" | grep -c dmapi` -gt 0 -o \
|
|
|
|
|
`echo "$MOUNT_OPTIONS" | grep -c dmi` -gt 0 ] ; then
|
|
|
|
|
#already got dmapi options set
|
|
|
|
|
_scratch_mount
|
|
|
|
|
dmapi_mount_result=$?
|
2006-12-19 02:55:36 +00:00
|
|
|
else
|
2007-01-04 05:12:36 +00:00
|
|
|
_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
|
|
|
|
|
dmapi_mount_result=$?
|
2006-12-19 02:55:36 +00:00
|
|
|
fi
|
2007-01-04 05:12:36 +00:00
|
|
|
|
|
|
|
|
if [ $dmapi_mount_result -ne 0 ] ; then
|
|
|
|
|
_notrun "Assuming DMAPI modules are not loaded"
|
|
|
|
|
fi
|
2007-06-04 06:13:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_filter_dmapi_print_event() {
|
|
|
|
|
$PERL_PROG -ne '
|
|
|
|
|
# replace session/file specific output with generic placeholders
|
|
|
|
|
s/token\s+\d+/token TOKEN/g ;
|
|
|
|
|
s/sequence\s+\d+/sequence SEQ/g ;
|
|
|
|
|
s/^\s+parent\s+dir\s+\w+/parent dir PARENT_DIR/g ;
|
|
|
|
|
s/^\s+name\s+.*/name FILE_NAME/g ;
|
|
|
|
|
s/^\s+mode\s+bits\s+mode\s+\d+:\s+/mode bits mode MODE: /g ;
|
|
|
|
|
s/perm\s+[\w|-]+\s[\w|-]+\s[\w|-]+/perm PERMISSIONS/g ;
|
|
|
|
|
s/,\s+type\s+.*/, type FILE_TYPE/g ;
|
|
|
|
|
s/^\s+object\s+\w+/object OBJECT/g ;
|
|
|
|
|
s/^\s+new\s+object\s+\w+/new object OBJECT/g ;
|
|
|
|
|
s/^\s+handle\s+\w+/handle HANDLE/g ;
|
|
|
|
|
s/^\s+attrcopy\s+\w+/attrcopy COPY/g ;
|
|
|
|
|
s/^\s+attrname\s+\w+/attrname NAME/g ;
|
|
|
|
|
|
|
|
|
|
# when print_event is killed, the following is output. trim it
|
|
|
|
|
s/^\s*print_event: Processing any undelivered event messages.*\n//g ;
|
|
|
|
|
s/^\s*print_event: Shutting down the session.*\n//g ;
|
|
|
|
|
|
|
|
|
|
# trim blank lines
|
|
|
|
|
s/^\s*\n//g ;
|
|
|
|
|
print ;'
|
|
|
|
|
}
|
|
|
|
|
|