diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-05-18 14:45:50 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-05-18 14:46:23 +0200 |
| commit | 452885a387b3a1613defa378cee79eb97e7b4fc8 (patch) | |
| tree | d226bd9ffe720925fea752ea7b0d76c04ad4cdbc /service/src/test.sh | |
| parent | dafdcc3547ec786fac85486cbb77909fffe1a4de (diff) | |
| download | enowars5-service-stldoctor-452885a387b3a1613defa378cee79eb97e7b4fc8.tar.gz enowars5-service-stldoctor-452885a387b3a1613defa378cee79eb97e7b4fc8.zip | |
seperated modelname and solidname handling
Diffstat (limited to 'service/src/test.sh')
| -rw-r--r-- | service/src/test.sh | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/service/src/test.sh b/service/src/test.sh index c9e5af3..5af9a16 100644 --- a/service/src/test.sh +++ b/service/src/test.sh @@ -2,7 +2,10 @@ set -e -# RUN_REMOTE=1 +# RUNTYPE=1 + +SCRIPTPATH="$(dirname $(readlink -f "$0"))" +cd "$SCRIPTPATH" export RESULTDIR="../data/scans" export ECHO_INPUT=1 @@ -30,8 +33,10 @@ checkleaks() { } connect() { - if [ $RUN_REMOTE ]; then + if [ "$RUNTYPE" == "remote" ]; then nc localhost 9000 + elif [ "$RUNTYPE" == "debug" ]; then + checkleaks else ./stldoctor fi @@ -58,7 +63,7 @@ elif [ "$1" == "poc" ]; then announce "Testing Proof-Of-Concept" - rm -rf "$RESULTDIR"/* + [ ! -z "$RESULTDIR" ] && rm -rf "$RESULTDIR"/* echo -e "\n--- Uploading target STL ---\n" 1>&2 ( @@ -66,6 +71,7 @@ elif [ "$1" == "poc" ]; then echo "submit" cat tests/flag1.stl | wc -c cat tests/flag1.stl + echo "N0TaFL4G" echo "exit" ) | connect @@ -75,7 +81,7 @@ elif [ "$1" == "poc" ]; then echo "submit" cat tests/evil1.stl | wc -c cat tests/evil1.stl - echo -e "AAAA\xff" + echo "EV1L" echo "exit" ) | connect @@ -85,38 +91,26 @@ elif [ "$1" == "poc" ]; then # try index 0 echo "query" - echo -e "AAAA\xff" + echo "EV1L" echo "0" echo "n" - echo "query" + echo "query last" echo "0" echo "n" - # reset cached result - echo "submit" - echo "2" - echo "aa" - # try index 1 echo "query" - echo -e "AAAA\xff" + echo -e "EV1L" echo "0" echo "n" - echo "query" + echo "query last" echo "1" echo "n" echo "exit" ) | connect else - ( - echo "submit" - echo "2" - echo "AA" - echo "AAAA" - echo "exit" - ) | connect - + connect fi |
