]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
remove more direct file comparisons
authorJason Ish <ish@unx.ca>
Thu, 4 May 2017 15:31:26 +0000 (09:31 -0600)
committerJason Ish <ish@unx.ca>
Thu, 4 May 2017 15:42:18 +0000 (09:42 -0600)
output-pcap-log/check.sh [new file with mode: 0755]
output-tcp-data/check.sh [new file with mode: 0755]
run.sh

diff --git a/output-pcap-log/check.sh b/output-pcap-log/check.sh
new file mode 100755 (executable)
index 0000000..f2253d9
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+exec cmp expected/log.pcap.1444144603 output/log.pcap.1444144603
diff --git a/output-tcp-data/check.sh b/output-tcp-data/check.sh
new file mode 100755 (executable)
index 0000000..9430bf3
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+exec cmp expected/tcp-data.log output/tcp-data.log
diff --git a/run.sh b/run.sh
index 025bf72ad22eca1c063c74e1257f32c0d6581ebd..e64c3c6301d3358592224be092038372001cc813 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -192,33 +192,11 @@ check_skip() {
     return 1
 }
 
-# Generic verification script. For any file in the expected directory,
-# a comparison is done with the actual output.
-generic_check() {
-    if [ ! -e "expected" ]; then
-       echo "error: test does not have a directory of expected output"
-       failed=yes
-       if [ "${continue}" != "yes" ]; then
-           exit 1
-       fi
-    fi
-    for filename in $(find expected/ -type f); do
-       if ! cmp -s ${filename} output/$(basename ${filename}); then
-           echo "FAIL: output/$(basename ${filename})"
-           failed=yes
-           if [ "${continue}" != "yes" ]; then
-               exit 1
-           fi
-       fi
-    done
-}
-
 # Check the output of Suricata. If a test doesn't provide its own
 # verification script, then the generic file compare will be
 # performed.
 check() {
     t="$1"
-
     (
        cd ${prefix}/${t}
        
@@ -227,9 +205,8 @@ check() {
                exit 1
            fi
        else
-           if ! generic_check; then
-               exit 1
-           fi
+           echo "error: test has no check.sh script"
+           exit 1
        fi
     )
     return $?