2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Create three DMAPI sessions,
8 # verify they have been created,
9 # then distroy first session
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "exit \$status" 0 1 2 3 15
22 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
23 echo "RET=$ret NEWSID=NUM"
28 $SED_PROG -e "s/sids=\"[0-9| ]*\"/sids=NUMS/"
34 CHECKED_SID=`${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions \
35 | perl -ne "if (/^sids.*[\"|\s]($i)[\"|\s].*/) {print \$1} ;"`
36 if [ -z "$CHECKED_SID" ] ; then
37 echo "ERROR: SID(s) not created"
38 ${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions >>$seqres.full
44 # get standard environment, filters and checks
49 # real QA test starts here
54 _scratch_mkfs_xfs >/dev/null 2>&1
57 echo "*** create 3 sessions"
65 echo "*** check 3 sessions exist"
66 _check_sids $sid1 $sid2 $sid3
68 echo "*** destroy first session"
69 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid1
72 echo "*** check first session no longer exists"
76 echo "*** check last 2 session exist"
77 _check_sids $sid2 $sid3
80 ${DMAPI_QASUITE1_DIR}../simple/dm_query_session -s $sid2
82 echo "*** remove remaining sessions"
83 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid2
84 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid3
86 echo "*** check second session no longer exists"
89 echo "*** check third session no longer exists"