Skip to content

Commit

Permalink
Add execution/abort utility script
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Feb 17, 2011
1 parent 3852511 commit 23db88a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/api/util-exec-abort.sh
@@ -0,0 +1,29 @@
#!/bin/bash

#Usage:
# util-exec-abort.sh <URL> <id>
# Abort a running execution by ID.

DIR=$(cd `dirname $0` && pwd)
source $DIR/include.sh

execid=$1
shift
[ -z "$execid" ] && errorMsg "ID not specified" && exit 2

# now submit req
runurl="${APIURL}/execution/${execid}/abort"

echo "# Abort execution: ${execid}"

# get listing
$CURL ${runurl}?${params} > $DIR/curl.out || fail "failed request: ${runurl}"

sh $DIR/api-test-success.sh $DIR/curl.out || exit 2

xmlsel "/result/success/message" -n $DIR/curl.out
$XMLSTARLET sel -T -t -o "Abort status: " -v "/result/abort/@status" -n $DIR/curl.out
$XMLSTARLET sel -T -t -o "Execution status: " -v "/result/abort/execution/@status" -n $DIR/curl.out

rm $DIR/curl.out

0 comments on commit 23db88a

Please sign in to comment.