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"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
32 # real QA test starts here
37 _scratch_mkfs_xfs >/dev/null 2>&1
40 qa_file_noattr=$SCRATCH_MNT/dmapi_file_noattr
41 qa_file_withattr=$SCRATCH_MNT/dmapi_file_withattr
43 # run dmapi print_event in background to capture events triggered during test
44 ${DMAPI_QASUITE1_DIR}cmd/print_event $SCRATCH_MNT > $tmp.print_event_out 2>&1 &
45 dmapi_print_event_pid=$!
47 # enable DMAPI set_return_on_destroy for $SCRATCH_MNT
48 ${DMAPI_COMMON_DIR}cmd/set_return_on_destroy -F $SCRATCH_MNT ATTR_NAME_1
56 touch $qa_file_withattr
57 echo "# set dmapi attributes on file"
58 ${DMAPI_QASUITE1_DIR}cmd/set_dmattr $qa_file_withattr ATTR_NAME_1 ATTR_VALUE_1
60 rm -f $qa_file_withattr
62 # kill off background dmapi print_event process
63 kill $dmapi_print_event_pid
64 # give dmapi print_event time to finish writing out any events not yet output
67 # dmapi destroy events are asyncronous, don't rely on fixed ordering of events
68 # in print_event output, use sort.
69 echo "# here comes the dmapi print_event filtered and sorted output"
70 cat $tmp.print_event_out | tee -a $here/$seq.full | _filter_dmapi_print_event | LC_COLLATE=POSIX sort
71 rm $tmp.print_event_out