]> git.ipfire.org Git - thirdparty/suricata-verify.git/log
thirdparty/suricata-verify.git
6 years agofilestore: add testcases for filecontainer with http and smb 52/head
Andreas Herz [Fri, 3 May 2019 08:46:30 +0000 (10:46 +0200)] 
filestore: add testcases for filecontainer with http and smb

6 years agotests/anomaly: fix for mingw
Victor Julien [Mon, 29 Apr 2019 10:06:04 +0000 (12:06 +0200)] 
tests/anomaly: fix for mingw

6 years agotests: fix wrong jansson test
Victor Julien [Mon, 29 Apr 2019 10:04:59 +0000 (12:04 +0200)] 
tests: fix wrong jansson test

6 years agoAdds test case for JSON anomaly logging 50/head
Jeff Lucovsky [Wed, 17 Apr 2019 23:34:36 +0000 (16:34 -0700)] 
Adds test case for JSON anomaly logging

6 years agotests: fix test requirements for 4.1.x and 4.0.x
Victor Julien [Fri, 26 Apr 2019 08:27:14 +0000 (10:27 +0200)] 
tests: fix test requirements for 4.1.x and 4.0.x

6 years agorun: Make test result output compact
Shivani Bhardwaj [Thu, 25 Apr 2019 15:46:39 +0000 (21:16 +0530)] 
run: Make test result output compact

The new sub test routine causes the test result output cluttered. In
order to avoid that, only print the information of any sub-tests being
skipped or failed.

Before
```
===> alert-testmyids:
|
 --> Sub test #1: OK

|
 --> Sub test #2: SKIPPED : Suricata v6.0 not found

|
 --> Sub test #3: SKIPPED : Suricata v2.0 not found
OK
```

After this patch

```
===> alert-testmyids: Sub test #2: SKIPPED : Suricata v6.0 not found
Sub test #3: SKIPPED : Suricata v2.0 not found
OK
```

6 years agodetect-http-protocol: test inspect/mpm v2 apis
Giuseppe Longo [Tue, 23 Apr 2019 18:42:37 +0000 (20:42 +0200)] 
detect-http-protocol: test inspect/mpm v2 apis

6 years agoAdds a test case for http auth unrecognized
Philippe Antoine [Wed, 6 Mar 2019 07:57:48 +0000 (08:57 +0100)] 
Adds a test case for http auth unrecognized

6 years agoeve/flow: add vlan and double-tagged vlan test 48/head
Mark Janssen [Thu, 28 Feb 2019 15:15:25 +0000 (16:15 +0100)] 
eve/flow: add vlan and double-tagged vlan test

6 years agoSuricata-verify tests for http.{location,server}
Jeff Lucovsky [Sat, 2 Mar 2019 17:21:30 +0000 (09:21 -0800)] 
Suricata-verify tests for http.{location,server}

Add test cases to suricata-verify for new HTTP sticky buffers: location and server

6 years agoalert: verify test for distance/within keywords
jason taylor [Thu, 4 Apr 2019 00:33:52 +0000 (20:33 -0400)] 
alert: verify test for distance/within keywords

* this is based on https://redmine.openinfosecfoundation.org/issues/1

Signed-off-by: jason taylor <jtfas90@gmail.com>
6 years agorun: Add per test check for Suricata version
Shivani Bhardwaj [Sat, 20 Apr 2019 19:21:16 +0000 (00:51 +0530)] 
run: Add per test check for Suricata version

Some tests in the latest versions might fail due to compatibility issues
because of the changes in features with every version. In order to avoid
failure in such cases, add per test checks that allow to check for the
current Suricata version and in case it does not match the version of
Suricata required to run that particular test, skip that test with an
appropriate message. This feature allows to run different underlying
tests individually and observe their individual outputs.

Sample conf
-----------
```
requires:
  features:
    - HAVE_LIBJANSSON

checks:
  - filter:
     version: 2
      count: 1
      match:
        event_type: alert
  - filter:
      version: 5.0
      count: 1
      match:
          event_type: alert

  # Check how many lines were logged to fast.log.
  - shell:
      args: cat fast.log | wc -l | xargs
      expect: 1
```

Sample output
-------------
Running `tests/alert-testmyids` with above configuration (test.yaml)
gives the following output when run from a directory having Suricata
version 5.0.0-dev.
```
===> alert-testmyids:
|
 --> Sub test #1: SKIPPED: Suricata v2 not found

|
 --> Sub test #2: OK

|
 --> Sub test #3: OK
OK
```

Case handling
-------------
Case #1
=======
In case someone specifies `min-version` as well as `version` as a part
of the configuration, the test fails with an error as below.
```
===> alert-testmyids: FAIL: Specify either min-version or version
```

Case #2
=======
In case someone provides an old style `check.sh` as well as `checks` in
test.yaml, the test only performs the operations mentioned in tests.yaml
and ignores the presence of `check.sh`.

Case #3
=======
In case someone provides a faulty `check.sh`, entire test fails.

Closes redmine ticket #2924

6 years agoAdds smtp rset test
Philippe Antoine [Thu, 18 Apr 2019 13:43:17 +0000 (15:43 +0200)] 
Adds smtp rset test

Resetting BDAT chunks length

6 years agowindows: fixes for for windows
Victor Julien [Thu, 21 Feb 2019 09:37:00 +0000 (10:37 +0100)] 
windows: fixes for for windows

Support running tests on Windows. Fix unix-isms like 'command > /dev/null'
and use 'command > nil' in Windows.

Skip tests that use the 'check.sh' or 'command' logic.

Pass the run.py's env to the subprocess to make sure the PATH is passed
on correctly.

6 years agoeve/dns-v2: remove unnecessary include
Victor Julien [Thu, 21 Feb 2019 17:55:46 +0000 (18:55 +0100)] 
eve/dns-v2: remove unnecessary include

6 years agotests: add test for bug 2769
Victor Julien [Thu, 21 Feb 2019 11:12:39 +0000 (12:12 +0100)] 
tests: add test for bug 2769

6 years agorunner: use --disable-detection when no rules in test
Victor Julien [Fri, 29 Mar 2019 14:04:22 +0000 (15:04 +0100)] 
runner: use --disable-detection when no rules in test

6 years agoAdds test case for http range logging 44/head
Philippe Antoine [Thu, 4 Apr 2019 18:55:51 +0000 (20:55 +0200)] 
Adds test case for http range logging

6 years agoAdd test for IKEv2 Weak DH parameters detection
Pierre Chifflier [Mon, 4 Mar 2019 20:34:35 +0000 (21:34 +0100)] 
Add test for IKEv2 Weak DH parameters detection

6 years agosmtp: add raw extraction test
Maurizio Abba [Fri, 15 Feb 2019 17:51:46 +0000 (17:51 +0000)] 
smtp: add raw extraction test

6 years agotests: fix tls and eve tests for 4.0.x
Victor Julien [Sat, 16 Feb 2019 09:42:09 +0000 (10:42 +0100)] 
tests: fix tls and eve tests for 4.0.x

6 years agoAdds a readme and the dummy python script 8/head
Philippe Antoine [Fri, 18 Jan 2019 16:37:58 +0000 (17:37 +0100)] 
Adds a readme and the dummy python script

Commit to be squashed

6 years agoAdds smtp pipelining test
Philippe Antoine [Fri, 14 Dec 2018 10:21:31 +0000 (11:21 +0100)] 
Adds smtp pipelining test

See #1863

6 years agodns test: add check for dns object in alert
Jason Ish [Thu, 24 Jan 2019 16:51:31 +0000 (10:51 -0600)] 
dns test: add check for dns object in alert

Extend an existing test to check that the DNS object exists
on a DNS alert.

6 years agokrb5: Add parser test with fragmented packets
jason taylor [Tue, 18 Dec 2018 21:07:07 +0000 (16:07 -0500)] 
krb5: Add parser test with fragmented packets

- adds test case
- reference: https://github.com/OISF/suricata/pull/3583
- reference: https://redmine.openinfosecfoundation.org/issues/2528

Signed-off-by: jason taylor <jtfas90@gmail.com>
6 years agotls tests: don't include full yaml
Victor Julien [Fri, 8 Feb 2019 10:48:28 +0000 (11:48 +0100)] 
tls tests: don't include full yaml

6 years agoAdd test for TLS 1.3 draft 28
Mats Klepsland [Thu, 1 Nov 2018 22:22:07 +0000 (23:22 +0100)] 
Add test for TLS 1.3 draft 28

6 years agoAdd test for TLS 1.3 draft 23
Mats Klepsland [Thu, 1 Nov 2018 22:21:51 +0000 (23:21 +0100)] 
Add test for TLS 1.3 draft 23

6 years agoAdd test for TLS 1.3 draft 22
Mats Klepsland [Thu, 1 Nov 2018 22:21:26 +0000 (23:21 +0100)] 
Add test for TLS 1.3 draft 22

6 years agoAdd test for TLS 1.3 draft 19
Mats Klepsland [Thu, 1 Nov 2018 22:20:40 +0000 (23:20 +0100)] 
Add test for TLS 1.3 draft 19

6 years agoAdd test for TLS 1.3 draft 18
Mats Klepsland [Thu, 1 Nov 2018 22:18:04 +0000 (23:18 +0100)] 
Add test for TLS 1.3 draft 18

6 years agoAdd test for TLS 1.3 draft 14
Mats Klepsland [Thu, 1 Nov 2018 22:15:59 +0000 (23:15 +0100)] 
Add test for TLS 1.3 draft 14

6 years agodns tests: enable eve v1 tests for Rust builds. 4/head
Jason Ish [Mon, 3 Dec 2018 16:38:01 +0000 (10:38 -0600)] 
dns tests: enable eve v1 tests for Rust builds.

Suricata branch ish/rust-dns-v1/v1 brings DNS v1 logging
support for Rust.

6 years agoyamls: minimize included yaml use 2/head
Victor Julien [Fri, 30 Nov 2018 12:15:28 +0000 (13:15 +0100)] 
yamls: minimize included yaml use

Use more built-in defaults. The yaml setting just removed didn't work
on systems with lots of cores. The stream memcap was too low for the
number of threads.

7 years agofilestore tests: remove included Suricata
Jason Ish [Tue, 1 May 2018 16:44:18 +0000 (10:44 -0600)] 
filestore tests: remove included Suricata

Per Victor's observation that the suricata.yaml can be almost
empty.

7 years agorename some dns specific tests to start with dns
Jason Ish [Wed, 14 Mar 2018 17:28:34 +0000 (11:28 -0600)] 
rename some dns specific tests to start with dns

7 years agoskip many dns tests when rust is enabled...
Jason Ish [Wed, 14 Mar 2018 17:26:38 +0000 (11:26 -0600)] 
skip many dns tests when rust is enabled...

they depend on dns v1 logging, which is not supported by
rust builds

7 years agoreadme: example of skipping a test by feature
Jason Ish [Wed, 14 Mar 2018 17:26:24 +0000 (11:26 -0600)] 
readme: example of skipping a test by feature

7 years agopython 3 fix.
Jason Ish [Wed, 14 Mar 2018 13:32:55 +0000 (07:32 -0600)] 
python 3 fix.

7 years agoadd an eve dns v2 specific test
Jason Ish [Tue, 13 Mar 2018 19:13:32 +0000 (13:13 -0600)] 
add an eve dns v2 specific test

7 years agomake config requires a skip, not a requires
Jason Ish [Tue, 13 Mar 2018 18:41:38 +0000 (12:41 -0600)] 
make config requires a skip, not a requires

oops, reverse the logic on the previous commit.

7 years agorequire specific suricata config settings...
Jason Ish [Tue, 13 Mar 2018 17:31:54 +0000 (11:31 -0600)] 
require specific suricata config settings...

specific as a regex pattern on the key, for example:

requires:
  config:
    outputs.\d.eve-log.types.\d.dns.version: 2

To require version 2 of the eve dns logger without needing
to know exactly which list item its at.

Uses --dump-config to load the config.

7 years agoreadme: run.sh -> run.py
Jason Ish [Sat, 17 Feb 2018 20:26:36 +0000 (14:26 -0600)] 
readme: run.sh -> run.py

7 years agohttp/eve/alert/xff tests
Jason Ish [Fri, 16 Feb 2018 20:58:44 +0000 (14:58 -0600)] 
http/eve/alert/xff tests

7 years agotest: unified2 xff
Jason Ish [Fri, 16 Feb 2018 20:39:16 +0000 (14:39 -0600)] 
test: unified2 xff

7 years agorunner: pre-check script
Jason Ish [Fri, 16 Feb 2018 20:37:48 +0000 (14:37 -0600)] 
runner: pre-check script

Allow a script to be defined, "pre-check" that is run before the
checks are run. For example, a new test converts unified2 to
json before running filter checks.

Also allow the eve.json filename to be changed, useful for doing
filter checks on arbitrary json output.

7 years agorunner: remove usage of version.raw
Jason Ish [Thu, 8 Feb 2018 01:18:26 +0000 (19:18 -0600)] 
runner: remove usage of version.raw

deleted in previous commit

7 years agorequires: version: set a specific version
Jason Ish [Wed, 7 Feb 2018 16:56:42 +0000 (10:56 -0600)] 
requires: version: set a specific version

"4" would match any version 4 release.
"4.0" would match any 4.0.x release.
"4.0.3" would only match 4.0.3.

7 years agotest: eve/alert/metadata
Jason Ish [Tue, 30 Jan 2018 22:28:14 +0000 (16:28 -0600)] 
test: eve/alert/metadata

7 years agonew filter checks: has-key not has-key
Jason Ish [Tue, 30 Jan 2018 22:27:31 +0000 (16:27 -0600)] 
new filter checks: has-key not has-key

Match on the event having or not having a key.

7 years agorunner: output new line after cmdline
Jason Ish [Tue, 30 Jan 2018 15:12:40 +0000 (09:12 -0600)] 
runner: output new line after cmdline

7 years agorunner: don't fail if requires is empty
Jason Ish [Mon, 29 Jan 2018 20:45:28 +0000 (14:45 -0600)] 
runner: don't fail if requires is empty

7 years agoeve-metadata: update for recent changes
Jason Ish [Thu, 25 Jan 2018 22:26:44 +0000 (16:26 -0600)] 
eve-metadata: update for recent changes

7 years agoeve-metadata: eve metadata test
Jason Ish [Wed, 24 Jan 2018 22:49:56 +0000 (16:49 -0600)] 
eve-metadata: eve metadata test

7 years agorequires: allow require to be a script that returns true
Jason Ish [Wed, 24 Jan 2018 22:49:33 +0000 (16:49 -0600)] 
requires: allow require to be a script that returns true

7 years agorunner: prevent double output directory
Jason Ish [Mon, 22 Jan 2018 13:34:50 +0000 (07:34 -0600)] 
runner: prevent double output directory

7 years agorunner: add --valgrind opt
Victor Julien [Sun, 21 Jan 2018 21:03:30 +0000 (22:03 +0100)] 
runner: add --valgrind opt

Runs the tests inside valgrind. Uses the default suppressions from
the Suricata git tree.

7 years agorunner: allow --outdir to be relative (ie: ./output)
Jason Ish [Fri, 19 Jan 2018 21:27:41 +0000 (15:27 -0600)] 
runner: allow --outdir to be relative (ie: ./output)

7 years agorunner: rename --dir to --testdir
Victor Julien [Thu, 18 Jan 2018 17:55:38 +0000 (18:55 +0100)] 
runner: rename --dir to --testdir

7 years agorunner: add --outdir <dir> option
Victor Julien [Thu, 18 Jan 2018 17:52:59 +0000 (18:52 +0100)] 
runner: add --outdir <dir> option

Allow specifying an output dir to avoid poluting the work tree
or run tests off a read only file system.

7 years agosetup/check relative to output directory
Jason Ish [Fri, 19 Jan 2018 20:23:25 +0000 (14:23 -0600)] 
setup/check relative to output directory

Run the setup and check phases relative to the output directory.

7 years agoremove requires.not-features support: use skip instead
Jason Ish [Thu, 18 Jan 2018 16:21:47 +0000 (10:21 -0600)] 
remove requires.not-features support: use skip instead

7 years agofilestore-v2.3-fserror: skip if uid=0
Jason Ish [Thu, 18 Jan 2018 16:09:24 +0000 (10:09 -0600)] 
filestore-v2.3-fserror: skip if uid=0

7 years agotest.yaml: allow a test to be skipped if running as a specific uid
Jason Ish [Thu, 18 Jan 2018 16:08:55 +0000 (10:08 -0600)] 
test.yaml: allow a test to be skipped if running as a specific uid

7 years agotest: check fail if filestore v1 and v2 enabled
Jason Ish [Thu, 18 Jan 2018 15:23:38 +0000 (09:23 -0600)] 
test: check fail if filestore v1 and v2 enabled

7 years agotest.yaml: allow expected exit code to be set
Jason Ish [Thu, 18 Jan 2018 15:23:18 +0000 (09:23 -0600)] 
test.yaml: allow expected exit code to be set

7 years agotests/filestore: add test for meta file checks
Victor Julien [Thu, 18 Jan 2018 08:50:36 +0000 (09:50 +0100)] 
tests/filestore: add test for meta file checks

7 years agotests/filestore: add HAVE_NSS dependency
Victor Julien [Thu, 18 Jan 2018 08:50:11 +0000 (09:50 +0100)] 
tests/filestore: add HAVE_NSS dependency

7 years agofilestore v2 tests
Jason Ish [Wed, 17 Jan 2018 20:25:50 +0000 (14:25 -0600)] 
filestore v2 tests

7 years agotest.yaml: allow a pcap to be referenced
Jason Ish [Wed, 17 Jan 2018 20:25:05 +0000 (14:25 -0600)] 
test.yaml: allow a pcap to be referenced

So a single PCAP can be shared by multiple tests with only one
copy of the pcap.

7 years agorunner: sort the tests alphabetically then run
Jason Ish [Wed, 17 Jan 2018 19:40:11 +0000 (13:40 -0600)] 
runner: sort the tests alphabetically then run

7 years agorunner: fix skip on no pcap (and no test.yaml)
Jason Ish [Wed, 17 Jan 2018 12:49:48 +0000 (06:49 -0600)] 
runner: fix skip on no pcap (and no test.yaml)

7 years agoreadme: or pcapng files...
Jason Ish [Wed, 17 Jan 2018 12:39:28 +0000 (06:39 -0600)] 
readme: or pcapng files...

7 years agoclean: test that we are in a verify directory
Jason Ish [Wed, 17 Jan 2018 12:37:37 +0000 (06:37 -0600)] 
clean: test that we are in a verify directory

7 years agorunner: support pcapng extension
Victor Julien [Wed, 17 Jan 2018 10:19:05 +0000 (11:19 +0100)] 
runner: support pcapng extension

7 years agorunner: reinit output dir for each run
Victor Julien [Wed, 17 Jan 2018 08:57:59 +0000 (09:57 +0100)] 
runner: reinit output dir for each run

Otherwise counting filters fail due to the default behaviour of
Suricata to 'append' to existing files.

7 years agotest.yaml: count field to execute test X number of times
Jason Ish [Tue, 16 Jan 2018 20:28:02 +0000 (14:28 -0600)] 
test.yaml: count field to execute test X number of times

7 years agorunner: refactor use of test configuration
Jason Ish [Tue, 16 Jan 2018 20:20:48 +0000 (14:20 -0600)] 
runner: refactor use of test configuration

7 years agotest: show help
Jason Ish [Tue, 16 Jan 2018 20:14:40 +0000 (14:14 -0600)] 
test: show help

7 years agorunner: custom args and pcap requires option
Jason Ish [Tue, 16 Jan 2018 20:12:44 +0000 (14:12 -0600)] 
runner: custom args and pcap requires option

To specify additional args, test.yaml can have:
args:
  - --set field=val

Also, by default a pcap file is required for a test to run. Add
pcap option to requires that can turn this off.

7 years agorunner: treat missing pcap as condition to 'skip'
Victor Julien [Tue, 16 Jan 2018 11:07:53 +0000 (12:07 +0100)] 
runner: treat missing pcap as condition to 'skip'

This allows disabling of tests by renaming the pcap file to <pcap>.disabled
or similar.

7 years agorunner: allow tests to be loaded from external dir
Victor Julien [Sat, 13 Jan 2018 17:41:52 +0000 (18:41 +0100)] 
runner: allow tests to be loaded from external dir

Add --dir <directory> option to specify a external directory for loading
and running tests.

This allows external test repositories for tests that are private or too
large to be part of the repo.

7 years agorunner: add setup
Jason Ish [Tue, 16 Jan 2018 01:19:24 +0000 (19:19 -0600)] 
runner: add setup

A test.yaml can now have a setup section that is run
before Suricata is executed.

7 years agorunner: allow a test to require the existent of files
Jason Ish [Fri, 12 Jan 2018 18:59:28 +0000 (12:59 -0600)] 
runner: allow a test to require the existent of files

For example, a test could depend on src/output-filestore.c.

7 years agoallow optional reason for skip in non-features
Jason Ish [Fri, 12 Jan 2018 14:21:05 +0000 (08:21 -0600)] 
allow optional reason for skip in non-features

7 years agodns-lua-rules: skip on rust for now, issue.
Jason Ish [Fri, 12 Jan 2018 14:04:38 +0000 (08:04 -0600)] 
dns-lua-rules: skip on rust for now, issue.

7 years agorunner: fix error looking for filter comment
Jason Ish [Fri, 12 Jan 2018 14:02:48 +0000 (08:02 -0600)] 
runner: fix error looking for filter comment

7 years agorunner: another python 3 fixup
Jason Ish [Thu, 11 Jan 2018 18:55:11 +0000 (12:55 -0600)] 
runner: another python 3 fixup

7 years agorunner: py3 fixup
Jason Ish [Tue, 9 Jan 2018 22:06:43 +0000 (16:06 -0600)] 
runner: py3 fixup

7 years agoadd requires HAVE_LIBJANSSON to tests using eve
Jason Ish [Tue, 9 Jan 2018 20:46:26 +0000 (14:46 -0600)] 
add requires HAVE_LIBJANSSON to tests using eve

7 years agorunner: catch another exit case for --fail
Jason Ish [Tue, 9 Jan 2018 20:46:00 +0000 (14:46 -0600)] 
runner: catch another exit case for --fail

7 years agorunner: python3 fixes
Jason Ish [Tue, 9 Jan 2018 20:22:52 +0000 (14:22 -0600)] 
runner: python3 fixes

7 years agocheck for jq and xargs, fail with error if not found
Jason Ish [Tue, 9 Jan 2018 16:40:10 +0000 (10:40 -0600)] 
check for jq and xargs, fail with error if not found

7 years agoreadme: document check.yaml
Jason Ish [Tue, 9 Jan 2018 13:01:21 +0000 (07:01 -0600)] 
readme: document check.yaml

7 years agoadd requires check to lua tests
Jason Ish [Tue, 9 Jan 2018 13:00:39 +0000 (07:00 -0600)] 
add requires check to lua tests

remove check based on directory name

7 years agodns test: move to test.yaml
Jason Ish [Tue, 9 Jan 2018 12:59:35 +0000 (06:59 -0600)] 
dns test: move to test.yaml

7 years agoremove support for "skip" file test skips
Jason Ish [Thu, 21 Dec 2017 00:20:49 +0000 (18:20 -0600)] 
remove support for "skip" file test skips

wasn't being used anymore as there are other ways to
skip a test

7 years agoremove run.sh; use run.py instead
Jason Ish [Thu, 21 Dec 2017 00:16:56 +0000 (18:16 -0600)] 
remove run.sh; use run.py instead

7 years agoremove leftovers vars.sh files: not used anymore
Jason Ish [Thu, 21 Dec 2017 00:16:26 +0000 (18:16 -0600)] 
remove leftovers vars.sh files: not used anymore

7 years agotls test: based on tls tests in @regit suripcap branch
Jason Ish [Thu, 21 Dec 2017 00:09:04 +0000 (18:09 -0600)] 
tls test: based on tls tests in @regit suripcap branch

combines "TLS 1" and "TLS alert" into a single test