From 7d93e2c2fbc77f05fd7acb63a2acf9874c9ad58f Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Wed, 7 Mar 2018 22:51:10 +0100 Subject: tests: shell: autogenerate dump verification Complete the automated shell tests with the verification of the test file dump, only for positive tests and if the test execution was successful. It's able to generate the dump file with the -g option. Example: # ./run-tests.sh -g testcases/chains/0001jumps_0 The dump files are generated in the same path in the folder named dumps/ with .nft extension. It has been avoided the dump verification code in every test file. Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft | 12 ++++++++++++ tests/shell/testcases/cache/dumps/0002_interval_0.nft | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft create mode 100644 tests/shell/testcases/cache/dumps/0002_interval_0.nft (limited to 'tests/shell/testcases/cache/dumps') diff --git a/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft b/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft new file mode 100644 index 00000000..f6dd6541 --- /dev/null +++ b/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft @@ -0,0 +1,12 @@ +table inet test { + set test { + type ipv4_addr + elements = { 1.1.1.1 } + } + + chain test { + ip daddr { 2.2.2.2 } counter packets 0 bytes 0 accept + ip saddr @test counter packets 0 bytes 0 accept + ip daddr { 2.2.2.2 } counter packets 0 bytes 0 accept + } +} diff --git a/tests/shell/testcases/cache/dumps/0002_interval_0.nft b/tests/shell/testcases/cache/dumps/0002_interval_0.nft new file mode 100644 index 00000000..6a081320 --- /dev/null +++ b/tests/shell/testcases/cache/dumps/0002_interval_0.nft @@ -0,0 +1,7 @@ +table inet t { + set s { + type ipv4_addr + flags interval + elements = { 192.168.0.0/24 } + } +} -- cgit v1.2.3