aboutsummaryrefslogtreecommitdiffstats
path: root/service/tests/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'service/tests/test.sh')
-rw-r--r--service/tests/test.sh32
1 files changed, 29 insertions, 3 deletions
diff --git a/service/tests/test.sh b/service/tests/test.sh
index 19d23ff..a4b1884 100644
--- a/service/tests/test.sh
+++ b/service/tests/test.sh
@@ -13,7 +13,11 @@ export ECHO_INPUT=1
SCRIPTPATH="$(dirname $(readlink -f "$0"))"
TESTDATA="$SCRIPTPATH/data"
-cd "$SRCDIR"
+shopt -s expand_aliases
+alias pushd="pushd &>/dev/null"
+alias popd="popd &>/dev/null"
+
+pushd "$SRCDIR"
announce() {
count=$(echo "$1" | wc -c)
@@ -52,7 +56,7 @@ cleanuploads() {
mkdir -p "$RESULTDIR"
}
-if [ "$1" == "stl" ]; then
+if [ "$1" == "stl-leaks" ]; then
cleanuploads
announce "Testing ASCII STL Parsing"
@@ -73,6 +77,26 @@ if [ "$1" == "stl" ]; then
echo "BIN-testname"
) | checkleaks
+elif [ "$1" == "stl-upload" ]; then
+ cleanuploads
+
+ popd
+ file="$(realpath $2)"
+ if [ ! -e "$file" ]; then
+ echo "Supply a file to upload"
+ exit 1
+ fi
+ pushd "$SRCDIR"
+
+ name="${3:-samplefile}"
+ (
+ echo "echo"
+ echo "upload"
+ cat "$file" | wc -c
+ cat "$file"
+ echo "$name"
+ ) | checkleaks
+
elif [ "$1" == "vuln1" ]; then
cleanuploads
@@ -149,7 +173,7 @@ elif [ "$1" == "vuln2" ]; then
echo "exit"
) | connect
-elif [ "$1" == "authupload" ]; then
+elif [ "$1" == "auth-upload" ]; then
cleanuploads
(
@@ -172,3 +196,5 @@ elif [ "$1" == "authupload" ]; then
else
connect
fi
+
+popd