From 273411f5326f54a09133663d61dc4903ed56193a Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 8 Aug 2024 12:25:32 +0200 Subject: tests: shell: resolve check-tree.sh errors It prints a few errors like this: ERR: "tests/shell/testcases/chains/jump_to_base_chain" has no "tests/shell/testcases/chains/dumps/jump_to_base_chain.{nft,nodump}" file For all of those, add the relevant .nft dump file. Add a 'nodump' file in case the test doesn't print anything (e.g. because the test checks that invalid ruleset fails validation). Some tests have a .nft but not .json-nft, this is because json lacks some features, in particular "typeof" and anonymous/implicit chains. ERR: "tests/shell/testcases/maps/delete_element_catchall" has no "tests/shell/testcases/maps/dumps/delete_element_catchall.{nft,nodump}" file ERR: "tests/shell/testcases/maps/dumps/delete_elem_catchall.nft" has no test "tests/shell/testcases/maps/delete_elem_catchall" these two are related, rename the dump file to match the script name. Signed-off-by: Florian Westphal --- .../chains/dumps/jump_to_base_chain.nodump | 0 .../dumps/netdev_chain_dormant_autoremove.json-nft | 32 ++++++++++++++++++++++ .../dumps/netdev_chain_dormant_autoremove.nft | 7 +++++ 3 files changed, 39 insertions(+) create mode 100644 tests/shell/testcases/chains/dumps/jump_to_base_chain.nodump create mode 100644 tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.json-nft create mode 100644 tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.nft (limited to 'tests/shell/testcases/chains') diff --git a/tests/shell/testcases/chains/dumps/jump_to_base_chain.nodump b/tests/shell/testcases/chains/dumps/jump_to_base_chain.nodump new file mode 100644 index 00000000..e69de29b diff --git a/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.json-nft b/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.json-nft new file mode 100644 index 00000000..9151d42f --- /dev/null +++ b/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.json-nft @@ -0,0 +1,32 @@ +{ + "nftables": [ + { + "metainfo": { + "version": "VERSION", + "release_name": "RELEASE_NAME", + "json_schema_version": 1 + } + }, + { + "table": { + "family": "netdev", + "name": "test", + "handle": 0, + "flags": "dormant" + } + }, + { + "chain": { + "family": "netdev", + "table": "test", + "name": "ingress", + "handle": 0, + "dev": "dummy1", + "type": "filter", + "hook": "ingress", + "prio": 0, + "policy": "drop" + } + } + ] +} diff --git a/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.nft b/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.nft new file mode 100644 index 00000000..aad7cb63 --- /dev/null +++ b/tests/shell/testcases/chains/dumps/netdev_chain_dormant_autoremove.nft @@ -0,0 +1,7 @@ +table netdev test { + flags dormant + + chain ingress { + type filter hook ingress device "dummy1" priority filter; policy drop; + } +} -- cgit v1.2.3