fsx: Replace use of bcmp() with memcmp()
[xfstests-dev.git] / 159
1 #! /bin/sh
2 # FSQA Test No. 159
3 #
4 # Create DMAPI event and respond to it.
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=allanr@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1    # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     _cleanup_testdir
24 }
25
26 # get standard environment, filters and checks
27 . ./common.rc
28 . ./common.filter
29 . ./common.dmapi
30
31 # real QA test starts here
32 _supported_fs xfs
33 _supported_os Linux IRIX
34
35 _require_scratch
36 _scratch_mkfs_xfs >/dev/null 2>&1
37 _dmapi_scratch_mount
38
39 echo "***create session"
40 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
41
42 echo "***create user event"
43 token="`${DMAPI_QASUITE1_DIR}cmd/create_userevent -s $newsid TEST_USER_EVENT | perl -ne 'if (/token ([0-9]+)/) { print $1; } '`"
44 [ $? -ne 0 ] && echo "failed to create user event"
45
46 echo "***respond to user event"
47 ${DMAPI_QASUITE1_DIR}cmd/respond_event $newsid $token 1 0
48 [ $? -ne 0 ] && echo "1st respond_event failed."
49
50 #already responded should fail
51 ${DMAPI_QASUITE1_DIR}cmd/respond_event $newsid $token 1 0 2>/dev/null
52 [ $? -eq 0 ] && echo "2nd respond_event didn't fail."
53
54 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $newsid
55
56 status=0
57 exit