3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # Create three DMAPI sessions,
24 # verify they have been created,
25 # then distroy first session
31 echo "QA output created by $seq"
35 status=1 # failure is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
45 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
46 echo "RET=$ret NEWSID=NUM"
51 $SED_PROG -e "s/sids=\"[0-9| ]*\"/sids=NUMS/"
57 CHECKED_SID=`${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions \
58 | perl -ne "if (/^sids.*[\"|\s]($i)[\"|\s].*/) {print \$1} ;"`
59 if [ -z "$CHECKED_SID" ] ; then
60 echo "ERROR: SID(s) not created"
61 ${DMAPI_QASUITE1_DIR}../simple/dm_getall_sessions >>$seq.full
67 # get standard environment, filters and checks
72 # real QA test starts here
74 _supported_os Linux IRIX
77 _scratch_mkfs_xfs >/dev/null 2>&1
80 echo "*** create 3 sessions"
88 echo "*** check 3 sessions exist"
89 _check_sids $sid1 $sid2 $sid3
91 echo "*** destroy first session"
92 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid1
95 echo "*** check first session no longer exists"
99 echo "*** check last 2 session exist"
100 _check_sids $sid2 $sid3
103 ${DMAPI_QASUITE1_DIR}../simple/dm_query_session -s $sid2
105 echo "*** remove remaining sessions"
106 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid2
107 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid3
109 echo "*** check second session no longer exists"
112 echo "*** check third session no longer exists"