4 # Placing holds on objects
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
31 # real QA test starts here
33 _supported_os Linux IRIX
36 _scratch_mkfs_xfs >/dev/null 2>&1
39 qa_file=$SCRATCH_MNT/dmapi_hole_file
42 echo "***create session"
43 eval `${DMAPI_QASUITE1_DIR}../simple/dm_create_session`
45 echo "***create user event"
46 token="`${DMAPI_QASUITE1_DIR}cmd/create_userevent -s $newsid OBJECT_HOLD_EVENT | perl -ne 'if (/token ([0-9]+)/) { print $1; } '`"
47 [ $? -ne 0 ] && echo "failed to create user event"
50 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
51 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_hold -s $newsid $token $qa_file
52 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
54 echo "***check holding an object thats already held"
55 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_hold -s $newsid $token $qa_file 2>/dev/null
56 [ $? -eq 0 ] && echo "obj_ref_hold should have failed"
58 echo "***release object"
59 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_rele -s $newsid $token $qa_file
60 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_query -s $newsid $token $qa_file
62 echo "***release object with no hold"
63 ${DMAPI_QASUITE1_DIR}cmd/obj_ref_rele -s $newsid $token $qa_file 2>/dev/null
64 [ $? -eq 0 ] && echo "obj_ref_rele should have failed"
66 echo "***respond to user event"
67 ${DMAPI_QASUITE1_DIR}cmd/respond_event $newsid $token 1 0
68 [ $? -ne 0 ] && echo "1st respond_event failed."
70 ${DMAPI_QASUITE1_DIR}../simple/dm_destroy_session -s $newsid