From 47c5a5b225d9ced1ee40594b1a8ea850508d26a3 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 7 Jan 2022 14:54:36 +0200 Subject: [PATCH] tests: add test for deprecated rule option Signed-off-by: Stijn Tintel Reviewed-by: Jo-Philipp Wich --- tests/01_configuration/01_ruleset | 2 ++ tests/mocks/uci/firewall.json | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/tests/01_configuration/01_ruleset b/tests/01_configuration/01_ruleset index 9f18af4..79a1461 100644 --- a/tests/01_configuration/01_ruleset +++ b/tests/01_configuration/01_ruleset @@ -82,6 +82,7 @@ table inet fw4 { oifname "lo" accept comment "!fw4: Accept traffic towards loopback" ct state established,related accept comment "!fw4: Allow outbound established and related flows" + meta l4proto tcp counter comment "!fw4: Test-Deprecated-Rule-Option" oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic" oifname "wan" jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic" } @@ -285,6 +286,7 @@ table inet fw4 { [call] fs.stat path [call] fs.stat path [!] Section @defaults[0] specifies unknown option 'unknown_defaults_option' +[!] Section @rule[9] (Test-Deprecated-Rule-Option) option '_name' is deprecated by fw4 [call] fs.open path mode [call] fs.open path mode -- End -- diff --git a/tests/mocks/uci/firewall.json b/tests/mocks/uci/firewall.json index aa066c7..2d97796 100644 --- a/tests/mocks/uci/firewall.json +++ b/tests/mocks/uci/firewall.json @@ -114,6 +114,11 @@ "dest": "lan", "dest_port": "500", "target": "ACCEPT" + }, + { + "name": "Test-Deprecated-Rule-Option", + "_name": "Test-Deprecated-Rule-Option", + "proto": "tcp" } ] } -- 2.30.2