From f773041121d6d0d112fa9cb003fd791eacd6e43d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Oct 2023 19:00:46 +0200 Subject: tests/shell: cover long interface name in "0042chain_variable_0" test IFNAMSIZ is 16. Adjust "0042chain_variable_0" to use an interface name with the maximum allowed bytes length. Instead of adding an entirely different test, adjust an existing one to use another interface name. The aspect for testing for a long interface name is not special enough, to warrant a separate test. We can cover it by extending an existing test. Note that the length check in "parser_bison.y" is wrong. The test checks still for the wrong behavior and that "d23456789012345x" is accepted. Signed-off-by: Thomas Haller Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/chains/0042chain_variable_0 | 36 +++++++++++++++++++--- .../chains/dumps/0042chain_variable_0.nft | 4 +-- 2 files changed, 34 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/shell/testcases/chains/0042chain_variable_0 b/tests/shell/testcases/chains/0042chain_variable_0 index 1ea44e85..739dc05a 100755 --- a/tests/shell/testcases/chains/0042chain_variable_0 +++ b/tests/shell/testcases/chains/0042chain_variable_0 @@ -2,7 +2,8 @@ set -e -ip link add name dummy0 type dummy +ip link add name d23456789012345 type dummy + EXPECTED="define if_main = \"lo\" @@ -14,22 +15,50 @@ table netdev filter1 { $NFT -f - <<< $EXPECTED + +EXPECTED="define if_main = \"lo\" + +table netdev filter2 { + chain Main_Ingress2 { + type filter hook ingress devices = { \$if_main, d23456789012345x } priority -500; policy accept; + } +}" + +rc=0 +$NFT -f - <<< $EXPECTED || rc=$? +test "$rc" = 0 +cat <