Add the new tests and their golden outputs.
[xfstests-dev.git] / 160
1 #! /bin/sh
2 # FSQA Test No. 160
3 #
4 # Change and view DMAPI access rights.
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 touch $SCRATCH_MNT/dmapi_test
40
41 echo "***create session"
42 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
43
44 echo "***create user event"
45 token="`${DMAPI_QASUITE1_DIR}cmd/create_userevent -s $newsid ACCESS_RIGHT_EVENT | perl -ne 'if (/token ([0-9]+)/) { print $1; } '`"
46 [ $? -ne 0 ] && echo "failed to create user event"
47
48 echo "*** query & up/downgrade right"
49 ${DMAPI_QASUITE1_DIR}cmd/query_right -s $newsid $token $SCRATCH_MNT/dmapi_test
50
51 ${DMAPI_QASUITE1_DIR}cmd/request_right -s $newsid $token $SCRATCH_MNT/dmapi_test DM_RIGHT_SHARED
52 ${DMAPI_QASUITE1_DIR}cmd/query_right -s $newsid $token $SCRATCH_MNT/dmapi_test
53
54 ${DMAPI_QASUITE1_DIR}cmd/upgrade_right -s $newsid $token $SCRATCH_MNT/dmapi_test
55 ${DMAPI_QASUITE1_DIR}cmd/query_right -s $newsid $token $SCRATCH_MNT/dmapi_test
56
57 ${DMAPI_QASUITE1_DIR}cmd/downgrade_right -s $newsid $token $SCRATCH_MNT/dmapi_test
58 ${DMAPI_QASUITE1_DIR}cmd/query_right -s $newsid $token $SCRATCH_MNT/dmapi_test
59
60 echo "*** respond to event"
61 ${DMAPI_QASUITE1_DIR}cmd/respond_event $newsid $token 1 0
62
63 echo "*** destroy session"
64 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $newsid
65
66 status=0
67 exit