Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F2822920
crm_ticket
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
869 B
Referenced Files
None
Subscribers
None
crm_ticket
View Options
#!/bin/bash
#
# "fake" crm_ticket for unit tests.
# * Ignores set,grant,revoke actions
# * returns values it gets asked for from UNIT_TEST_AUX
function word_after()
{
# Per default $1 is printed
perl -e '
$search=shift();
$stg=shift();
print $'${3:-1}' if $stg =~ /$search/;' "$1" "$2"
}
function Get()
{
which=$(word_after " -G ('?)(\\w+)\\1" "$1" 2)
if [[ -z "$which" ]] ; then
exit 1
fi
word_after "\\b$which\\b (\\S+)" "$UNIT_TEST_AUX"
# provide a newline
echo ""
exit 0
}
# include resp. supersede with per-test functions
inc="${UNIT_TEST_FILE%.txt}.sh"
if [[ -e "$inc" ]] ; then
. "$inc"
fi
if [[ "$*" == *" -G "* ]] ; then
Get "$*"
elif [[ "$*" == *" -g "* ]] ; then
: # grant
elif [[ "$*" == *" -r "* ]] ; then
: # revoke
elif [[ "$*" == *" -S "* ]] ; then
: # set
else
echo "not understood" >&2
exit 1
fi
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Jan 25, 6:52 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1215611
Default Alt Text
crm_ticket (869 B)
Attached To
Mode
rB Booth
Attached
Detach File
Event Timeline
Log In to Comment