Provide conditions to show up problem for dioread on IRIX and Linux
[xfstests-dev.git] / 155
1 #! /bin/sh
2 # FSQA Test No. 155
3 #
4 # DMAPI event DM_EVENT_RENAME generation
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 DMAPI_FS_HANDLE="`${DMAPI_QASUITE1_DIR}cmd/path_to_fshandle $SCRATCH_MNT`"
40
41 rm -f $SCRATCH_MNT/dmapi_test_file1
42
43 echo "*** create DMAPI session"
44 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
45 sid1=$newsid
46
47 ${DMAPI_QASUITE1_DIR}cmd/set_eventlist $DMAPI_FS_HANDLE DM_EVENT_RENAME
48 echo "set_eventlist Returned: $?"
49
50 echo "*** setting DMAPI DM_EVENT_RENAME disposition."
51 ${DMAPI_QASUITE1_DIR}cmd/set_disp -s $sid1 $DMAPI_FS_HANDLE DM_EVENT_RENAME
52
53 echo "***creating file on dmapi filesystem"
54 touch $SCRATCH_MNT/dmapi_test_file
55
56 echo "***renameing file on dmapi filesystem"
57 mv $SCRATCH_MNT/dmapi_test_file $SCRATCH_MNT/dmapi_test_file1 &
58 MV_PID=$!
59
60 sleep 1
61
62 echo "***checking for dmapi event"
63 eval `${DMAPI_QASUITE1_DIR}cmd/get_events $sid1 \
64      | $PERL_PROG -ne 's/new parent/new_parent/g;
65                  s/old parent/old_parent/g;
66                  s/new name/new_name/g;
67                  s/old name/old_name/g;
68                  s/\s+/\n/g;
69                  print;'`
70
71 ${DMAPI_QASUITE1_DIR}cmd/respond_event $sid1 $token 1 0
72
73 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $sid1
74
75 status=0
76 exit