modify galah machine configuration.
[xfstests-dev.git] / 168
1 #! /bin/sh
2 # FSQA Test No. 168
3 #
4 # Check for DMAPI destroy events when removing files without attributes
5 # See PV960928 for details
6 #
7 #-----------------------------------------------------------------------
8 #  Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
9 #-----------------------------------------------------------------------
10 #
11 # creator
12 owner=ddiss@sgi.com
13
14 seq=`basename $0`
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 rm -f $seq.full
20 status=1    # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25     _cleanup_testdir
26 }
27
28 # get standard environment, filters and checks
29 . ./common.rc
30 . ./common.filter
31 . ./common.dmapi
32
33 # real QA test starts here
34 _supported_fs xfs
35 _supported_os Linux
36
37 _require_scratch
38 _scratch_mkfs_xfs >/dev/null 2>&1
39 _dmapi_scratch_mount
40
41 qa_file_noattr=$SCRATCH_MNT/dmapi_file_noattr
42 qa_file_withattr=$SCRATCH_MNT/dmapi_file_withattr
43
44 # run dmapi print_event in background to capture events triggered during test
45 ${DMAPI_QASUITE1_DIR}cmd/print_event $SCRATCH_MNT > $tmp.print_event_out 2>&1 &
46 dmapi_print_event_pid=$!
47
48 # give time for print_event to start capturing events
49 sleep 2
50
51 # enable DMAPI set_return_on_destroy for $SCRATCH_MNT
52 ${DMAPI_COMMON_DIR}cmd/set_return_on_destroy -F $SCRATCH_MNT ATTR_NAME_1
53
54 echo "# create file"
55 touch $qa_file_noattr
56 echo "# remove file"
57 rm -f $qa_file_noattr
58
59 echo "# create file"
60 touch $qa_file_withattr
61 echo "# set dmapi attributes on file"
62 ${DMAPI_QASUITE1_DIR}cmd/set_dmattr $qa_file_withattr ATTR_NAME_1 ATTR_VALUE_1
63 echo "# remove file"
64 rm -f $qa_file_withattr
65
66 # kill off background dmapi print_event process
67 kill $dmapi_print_event_pid
68 # give dmapi print_event time to finish writing out any events not yet output
69 wait
70
71 # dmapi destroy events are asyncronous,  don't rely on fixed ordering of events
72 # in print_event output, use sort.
73 echo "# here comes the dmapi print_event filtered and sorted output"
74 cat $tmp.print_event_out | tee -a $here/$seq.full | _filter_dmapi_print_event | LC_COLLATE=POSIX sort
75 rm $tmp.print_event_out
76
77 status=0
78 exit