diff --git a/t/01_testssl_banner.t b/t/01_testssl_banner.t index 4eccadd..f68d6df 100755 --- a/t/01_testssl_banner.t +++ b/t/01_testssl_banner.t @@ -14,7 +14,6 @@ my $error_regexp2='testssl.sh: line'; my $error_regexp3='bash: warning'; my $error_regexp4='command not found'; my $error_regexp5='(syntax error|unexpected token)'; -# my $good_regexp='free software.*USAGE w/o ANY WARRANTY.*OWN RISK.*Using.*ciphers.*built(.*)platform'; my $good_regexp='free software([\s\S]*)USAGE w/o ANY WARRANTY([\s\S]*)OWN RISK([\s\S]*)Using([\s\S]*)ciphers([\s\S]*)built([\s\S]*)platform'; printf "\n%s\n", "Testing whether just calling \"./testssl.sh --banner\" produces no error ..."; diff --git a/t/03_set-x.t b/t/03_set-x.t new file mode 100755 index 0000000..abd8645 --- /dev/null +++ b/t/03_set-x.t @@ -0,0 +1,28 @@ +#!/usr/bin/env perl + +# Basics: is there a synatx error where already bash hiccups on? +# --banner is equal to --version + +use strict; +use Test::More; + +my $tests = 0; +my $fileout=""; +# Blacklists we use to trigger an error: +my $error_regexp='^(\|)+([0-9])+>\s+[a-z]'; + +printf "\n%s\n", "Testing whether we forgot \"set -x\" ..."; +$fileout = `./testssl.sh --help 2>&1`; +my $retval=$?; + +unlike($fileout, qr/$error_regexp/, "just ran help"); +$tests++; + +$fileout = `./testssl.sh --ssl-native --color=0 --fast --ip=one google.com 2>&1`; +unlike($fileout, qr/$error_regexp/, "ran --ssl-native --color=0 --fast --ip=one google.com"); +$tests++; + +printf "\n"; +done_testing($tests); + + diff --git a/t/07_isJSON_valid.t b/t/07_isJSON_valid.t index abba0f4..26814b8 100755 --- a/t/07_isJSON_valid.t +++ b/t/07_isJSON_valid.t @@ -22,6 +22,7 @@ die "Unable to open $prg" unless -f $prg; my $uri="cloudflare.com"; printf "\n%s\n", "Unit testing JSON output ..."; +unlink 'tmp.json'; #1 printf "%s\n", ".. plain JSON --> $uri "; diff --git a/t/08_isHTML_valid.t b/t/08_isHTML_valid.t index f8877a8..4642435 100755 --- a/t/08_isHTML_valid.t +++ b/t/08_isHTML_valid.t @@ -19,6 +19,7 @@ my $check2run="--color 0 --htmlfile tmp.html"; die "Unable to open $prg" unless -f $prg; printf "\n%s\n", "Doing HTML output checks"; +unlink 'tmp.html'; #1 printf "%s\n", " .. running $prg against $uri to create HTML and terminal outputs (may take 2~3 minutes)"; diff --git a/t/09_isJSON_severitylevel_valid.t b/t/09_isJSON_severitylevel_valid.t index ab78d94..e39d6ab 100755 --- a/t/09_isJSON_severitylevel_valid.t +++ b/t/09_isJSON_severitylevel_valid.t @@ -17,6 +17,7 @@ $tests = 0; printf "\n%s\n", "Doing severity level checks"; +unlink 'tmp.json'; #1 pass(" .. running testssl.sh against badssl.com to create a JSON report with severity level equal greater than LOW (may take 2~3 minutes)"); $tests++;