]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
dns test: move to test.yaml
authorJason Ish <ish@unx.ca>
Tue, 9 Jan 2018 12:59:35 +0000 (06:59 -0600)
committerJason Ish <ish@unx.ca>
Tue, 9 Jan 2018 12:59:35 +0000 (06:59 -0600)
tests/dns-udp-dig-a-www-suricata-ids-org/check.sh [deleted file]
tests/dns-udp-dig-a-www-suricata-ids-org/test.yaml [new file with mode: 0644]

diff --git a/tests/dns-udp-dig-a-www-suricata-ids-org/check.sh b/tests/dns-udp-dig-a-www-suricata-ids-org/check.sh
deleted file mode 100755 (executable)
index 56e6cbc..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-
-. ../../util/functions.sh
-
-n=$(cat output/eve.json | jq -c 'select(.dns.type == "query")' | wc -l | xargs)
-assert_eq 1 $n
-
-n=$(cat output/eve.json | jq -c 'select(.dns.type == "answer")' | wc -l | xargs)
-assert_eq 3 $n
-
-n=$(cat output/eve.json | jq -c 'select(.dns.rrtype == "CNAME")' | wc -l | xargs)
-assert_eq 1 $n
-
-n=$(cat output/eve.json | jq -c 'select(.dns.rrtype == "A")' | wc -l | xargs)
-assert_eq 3 $n
diff --git a/tests/dns-udp-dig-a-www-suricata-ids-org/test.yaml b/tests/dns-udp-dig-a-www-suricata-ids-org/test.yaml
new file mode 100644 (file)
index 0000000..1285cba
--- /dev/null
@@ -0,0 +1,29 @@
+checks:
+
+  - filter:
+      comment: dns query count
+      count: 1
+      match:
+        event_type: dns
+        dns.type: query
+
+  - filter:
+      comment: cname count
+      count: 1
+      match:
+        event_type: dns
+        dns.rrtype: CNAME
+
+  - filter:
+      comment: a rrtype count
+      count: 3
+      match:
+        event_type: dns
+        dns.rrtype: A
+
+  - filter:
+      comment: answer count
+      count: 3
+      match:
+        event_type: dns
+        dns.type: answer