4 # Check for DMAPI destroy events when removing files without attributes
5 # See PV960928 for details
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
15 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
33 # real QA test starts here
38 _scratch_mkfs_xfs >/dev/null 2>&1
41 qa_file_noattr=$SCRATCH_MNT/dmapi_file_noattr
42 qa_file_withattr=$SCRATCH_MNT/dmapi_file_withattr
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=$!
48 # give time for print_event to start capturing events
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
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
64 rm -f $qa_file_withattr
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
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