diff mbox series

[nft,1/3] tests/shell: add "bogons/nft-f/zero_length_devicename2_assert"

Message ID 20231023170058.919275-1-thaller@redhat.com
State Accepted
Headers show
Series [nft,1/3] tests/shell: add "bogons/nft-f/zero_length_devicename2_assert" | expand

Commit Message

Thomas Haller Oct. 23, 2023, 5 p.m. UTC
This is copied from "bogons/nft-f/zero_length_devicename_assert" and
adjusted.

- `device""lo"` looks odd. In this file use `device ""` to only check
  against empty strings, without oddity.

- "ip" type has no hook ingress in filter. If the device name would be
  valid, the file would still be rejected. Use "netdev".

The purpose is to add a test for a file that would otherwise pass,
except having an empty device name. Without oddities.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 .../testcases/bogons/nft-f/zero_length_devicename2_assert    | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 tests/shell/testcases/bogons/nft-f/zero_length_devicename2_assert

Comments

Pablo Neira Ayuso Oct. 24, 2023, 9:57 a.m. UTC | #1
Series aplied, thanks.

After all these updates I see this failure:

W: [FAILED]     1/1 testcases/sets/elem_opts_compat_0

I: results: [OK] 0 [SKIPPED] 0 [FAILED] 1 [TOTAL] 1

when running tests.
Thomas Haller Oct. 24, 2023, 10:15 a.m. UTC | #2
On Tue, 2023-10-24 at 11:57 +0200, Pablo Neira Ayuso wrote:
> Series aplied, thanks.

Thank you.

> 
> After all these updates I see this failure:
> 
> W: [FAILED]     1/1 testcases/sets/elem_opts_compat_0
> 
> I: results: [OK] 0 [SKIPPED] 0 [FAILED] 1 [TOTAL] 1
> 
> when running tests.
> 

Hm. I don't get such failure (Kernel 6.5.6-200.fc38.x86_64).
But regardless of that, I don't think that my patches had anything to
do with that test, do they?


Can you provide more information? Can you bisect the failure?

Could you share:

  make && ./tests/shell/run-tests.sh ./tests/shell/testcases/sets/elem_opts_compat_0 -x -k
  grep -R ^ /tmp/nft-test.latest.*/


Thomas
Pablo Neira Ayuso Oct. 24, 2023, 10:24 a.m. UTC | #3
On Tue, Oct 24, 2023 at 12:15:22PM +0200, Thomas Haller wrote:
> On Tue, 2023-10-24 at 11:57 +0200, Pablo Neira Ayuso wrote:
> > Series aplied, thanks.
> 
> Thank you.
> 
> > 
> > After all these updates I see this failure:
> > 
> > W: [FAILED]     1/1 testcases/sets/elem_opts_compat_0
> > 
> > I: results: [OK] 0 [SKIPPED] 0 [FAILED] 1 [TOTAL] 1
> > 
> > when running tests.
> > 
> 
> Hm. I don't get such failure (Kernel 6.5.6-200.fc38.x86_64).
> But regardless of that, I don't think that my patches had anything to
> do with that test, do they?
> 
> 
> Can you provide more information? Can you bisect the failure?
> 
> Could you share:
> 
>   make && ./tests/shell/run-tests.sh ./tests/shell/testcases/sets/elem_opts_compat_0 -x -k
>   grep -R ^ /tmp/nft-test.latest.*/

/tmp/nft-test.latest.root/times:2.3
/tmp/nft-test.latest.root/times:3067.20
/tmp/nft-test.latest.root/times:3069.50
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/times:0.12
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/times:3069.38
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/times:3069.50
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:table ip t {
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:       set s {
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:               type inet_service
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:               counter
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:               timeout 30s
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:       }
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/ruleset-after:}
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/rc-failed:2
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/name:testcases/sets/elem_opts_compat_0
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/testout.log:Command: testcases/sets/elem_opts_compat_0 
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/testout.log:testcases/sets/elem_opts_compat_0: 20: Syntax error: redirection unexpected
/tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/rc-failed-exit:2
Florian Westphal Oct. 24, 2023, 10:29 a.m. UTC | #4
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/testout.log:testcases/sets/elem_opts_compat_0: 20: Syntax error: redirection unexpected
> /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/rc-failed-exit:2

The test case is broken, it uses /bin/sh but needs /bin/bash.
Pablo Neira Ayuso Oct. 24, 2023, 10:43 a.m. UTC | #5
On Tue, Oct 24, 2023 at 12:29:03PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/testout.log:testcases/sets/elem_opts_compat_0: 20: Syntax error: redirection unexpected
> > /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/rc-failed-exit:2
> 
> The test case is broken, it uses /bin/sh but needs /bin/bash.

Nice, it works now :)

http://git.netfilter.org/nftables/commit/?id=d3e941668be1d3922832fd70788fb248fd11f6c7
Phil Sutter Oct. 24, 2023, 11:50 a.m. UTC | #6
On Tue, Oct 24, 2023 at 12:29:03PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/testout.log:testcases/sets/elem_opts_compat_0: 20: Syntax error: redirection unexpected
> > /tmp/nft-test.latest.root/test-testcases-sets-elem_opts_compat_0.1/rc-failed-exit:2
> 
> The test case is broken, it uses /bin/sh but needs /bin/bash.

Gna, I keep forgetting that here-strings are a Bashism, sorry for the
mess.

Cheers, Phil
diff mbox series

Patch

diff --git a/tests/shell/testcases/bogons/nft-f/zero_length_devicename2_assert b/tests/shell/testcases/bogons/nft-f/zero_length_devicename2_assert
new file mode 100644
index 000000000000..fe416f8536e9
--- /dev/null
+++ b/tests/shell/testcases/bogons/nft-f/zero_length_devicename2_assert
@@ -0,0 +1,5 @@ 
+table netdev x {
+        chain Main_Ingress1 {
+                type filter hook ingress device "" priority -1
+	}
+}