2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Placing holds on objects
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
23 # real QA test starts here
28 _scratch_mkfs_xfs >/dev/null 2>&1
31 qa_file=$SCRATCH_MNT/dmapi_hole_file
34 echo "***create session"
35 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
37 echo "***create user event"
38 token="`${DMAPI_QASUITE1_DIR}cmd/create_userevent -s $newsid OBJECT_HOLD_EVENT | perl -ne 'if (/token ([0-9]+)/) { print $1; } '`"
39 [ $? -ne 0 ] && echo "failed to create user event"
42 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
43 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_hold -s $newsid $token $qa_file
44 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
46 echo "***check holding an object thats already held"
47 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_hold -s $newsid $token $qa_file 2>/dev/null
48 [ $? -eq 0 ] && echo "obj_ref_hold should have failed"
50 echo "***release object"
51 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_rele -s $newsid $token $qa_file
52 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
54 echo "***release object with no hold"
55 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_rele -s $newsid $token $qa_file 2>/dev/null
56 [ $? -eq 0 ] && echo "obj_ref_rele should have failed"
58 echo "***respond to user event"
59 ${DMAPI_QASUITE1_DIR}cmd/respond_event $newsid $token 1 0
60 [ $? -ne 0 ] && echo "1st respond_event failed."
62 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $newsid