4 # Create three DMAPI sessions,
5 # verify they have been created,
6 # then distroy first session
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
10 #-----------------------------------------------------------------------
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
30 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
31 echo "RET=$ret NEWSID=NUM"
36 $SED_PROG -e "s/sids=\"[0-9| ]*\"/sids=NUMS/"
42 CHECKED_SID=`${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions \
43 | perl -ne "if (/^sids.*[\"|\s]($i)[\"|\s].*/) {print \$1} ;"`
44 if [ -z "$CHECKED_SID" ] ; then
45 echo "ERROR: SID(s) not created"
46 ${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions >>$seq.full
52 # get standard environment, filters and checks
57 # real QA test starts here
59 _supported_os Linux IRIX
62 _scratch_mkfs_xfs >/dev/null 2>&1
65 echo "*** create 3 sessions"
73 echo "*** check 3 sessions exist"
74 _check_sids $sid1 $sid2 $sid3
76 echo "*** destroy first session"
77 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid1
80 echo "*** check first session no longer exists"
84 echo "*** check last 2 session exist"
85 _check_sids $sid2 $sid3
88 ${DMAPI_QASUITE1_DIR}../simple/dm_query_session -s $sid2
90 echo "*** remove remaining sessions"
91 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid2
92 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid3
94 echo "*** check second session no longer exists"
97 echo "*** check third session no longer exists"