aboutsummaryrefslogtreecommitdiffstats
path: root/checker/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'checker/test.sh')
-rw-r--r--checker/test.sh23
1 files changed, 14 insertions, 9 deletions
diff --git a/checker/test.sh b/checker/test.sh
index f0b6159..f6326d6 100644
--- a/checker/test.sh
+++ b/checker/test.sh
@@ -2,6 +2,9 @@
ipstr="$1"
+SCRIPTPATH="$(dirname $(readlink -f "$0"))"
+export REVHASH_PATH="$SCRIPTPATH/src/revhash/revhash"
+
try() {
cmd="$1"
if [ $# -lt 2 ]; then
@@ -10,16 +13,18 @@ try() {
variant=$2
fi
echo "Executing $cmd with variant $variant.."
- output=$(enochecker_cli -A "http://localhost:8000/" -a "$ipstr" -v "$variant" -x 4000 "$cmd")
- echo $output
- [ -z "$(echo $output | grep OK)" ] && exit 1
+ python3 src/checker.py -j run -v "$variant" -x 4000 \
+ --flag ENOTESTFLAG123= --flag_regex 'ENO.*=' \
+ ${@:3} "$cmd" | tee /tmp/checker-log
+ [ -z "$(cat /tmp/checker-log | grep OK)" ] && exit 1
}
-if [ $# -lt 1 ]; then
- echo "USAGE: test.sh <IP>"
-elif [ $# -eq 3 ]; then
- try "$2" "$3"
+if [ $# -eq 2 ]; then
+ try $@
+elif [ "$1" == "test-exploits" ]; then
+ try exploit 0
+ try exploit 1
else
try putflag 0
try getflag 0
@@ -38,8 +43,8 @@ else
try havoc 2
try havoc 3
-# try exploit 0
-# try exploit 1
+ try exploit 0
+ try exploit 1
fi
exit 0