aboutsummaryrefslogtreecommitdiffstats
path: root/checker/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'checker/test.sh')
-rw-r--r--checker/test.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/checker/test.sh b/checker/test.sh
index 101ae55..d1c4e04 100644
--- a/checker/test.sh
+++ b/checker/test.sh
@@ -24,6 +24,7 @@ except:
" || nop
}
+taskid=""
try() {
cmd="$1"
pid=$BASHPID
@@ -34,7 +35,7 @@ try() {
else
variant=$2
fi
- taskid=$pid
+ taskid="$pid"
if [ ! -z "$REMOTE" ]; then
python3 enoreq.py -j True -A http://localhost:9091 -a $REMOTE \
--flag ENOTESTFLAG123= --flag_regex 'ENO.*=' -i $taskid \
@@ -57,11 +58,17 @@ try() {
docker-compose logs --tail=2000 | grep '"taskId": '$taskid | $ENOLOGMESSAGE_PARSER
fi
) > "$newfile"
+ echo -ne "Executing $cmd with variant $variant.. $res (TASK: $taskid)\n"
+ return 1
+ else
+ echo -ne "Executing $cmd with variant $variant.. $res (TASK: $taskid)\n"
+ return 0
fi
- echo -ne "Executing $cmd with variant $variant.. $res (TASK: $taskid)\n"
}
try-all() {
+ set -e
+
try putflag 0
try getflag 0
@@ -74,10 +81,9 @@ try-all() {
try putflag 1
try getflag 1
- try havoc 0
- try havoc 1
- try havoc 2
- try havoc 3
+ for i in $(seq 0 15); do
+ try havoc $i
+ done
try exploit 0
try exploit 1
@@ -92,6 +98,7 @@ one-of() {
if one-of "$1" putflag getflag putnoise getnoise havoc exploit; then
try $@
+ [ $? -ne 0 -a -e "$EDITOR" ] && "$EDITOR" "/tmp/checker-log-$taskid"
elif [ "$1" == "test-exploits" ]; then
try exploit 0
try exploit 1