tests/shell: Restore testcases/sets/0036add_set_element_expiration_0
Phil Sutter
reviewerPATCH 1/1 tests/shell: Restore testcases/sets/0036add_set_element_expiration_0
This reverts both commits 46b54fdcf266d3d631ffb6102067825d7672db46 and 0e258556f7f3da35deeb6d5cfdec51eafc7db80d.
With both applied, the test succeeded *only* if 'nft monitor' was running in background, which is equivalent to the original problem (where the test succeeded only if *no* 'nft monitor' was running).
The test merely exposed a kernel bug, so in fact it is correct.
--- tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/sets/0036add_set_element_expiration_0 +1 -1
@@ -6,7 +6,7 @@ RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } add element ip x y { 1.1.1.1 timeout 30s expires 15s }" -test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1) +test_output=$($NFT -e -f - <<< "$RULESET" 2>&1) if [ "$test_output" != "$RULESET" ] ; then $DIFF -u <(echo "$test_output") <(echo "$RULESET")
Signature · 1 line
2.28.0
Pablo Neira Ayuso
maintainerHi Phil,
Quoted 8 lines · Phil Sutter
This reverts both commits
46b54fdcf266d3d631ffb6102067825d7672db46and0e258556f7f3da35deeb6d5cfdec51eafc7db80d.With both applied, the test succeeded *only* if 'nft monitor' was running in background, which is equivalent to the original problem (where the test succeeded only if *no* 'nft monitor' was running).
The test merely exposed a kernel bug, so in fact it is correct.
Please, do not revert this.
This kernel patch needs this fix:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
Thanks.
Quoted 22 lines
Fixes 46b54fdcf266d ("Revert "monitor: do not print generation ID with --echo"")Signed-off-by Phil Sutter <[email protected]>--- tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/shell/testcases/sets/0036add_set_element_expiration_0 +1
-1@@ -6,7 +6,7 @@ RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } add element ip x y { 1.1.1.1 timeout 30s expires 15s }" -test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1) +test_output=$($NFT -e -f - <<< "$RULESET" 2>&1) if [ "$test_output" != "$RULESET" ] ; then $DIFF -u <(echo "$test_output") <(echo "$RULESET")Signature · 1 line
2.28.0
Pablo Neira Ayuso
maintainerQuoted 10 lines · Pablo Neira Ayuso
Hi Phil,
Quoted 7 lines · Phil Sutter
This reverts both commits
46b54fdcf266d3d631ffb6102067825d7672db46and0e258556f7f3da35deeb6d5cfdec51eafc7db80d.With both applied, the test succeeded *only* if 'nft monitor' was running in background, which is equivalent to the original problem (where the test succeeded only if *no* 'nft monitor' was running).
Quoted 7 lines
Quoted 1 line
The test merely exposed a kernel bug, so in fact it is correct.
Please, do not revert this.
This kernel patch needs this fix:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
With the kernel patch above, this test does not break anymore.
ie. --echo is not printing the generation ID because kernel bug.
Quoted 22 lines
Quoted 22 lines
Fixes 46b54fdcf266d ("Revert "monitor: do not print generation ID with --echo"")Signed-off-by Phil Sutter <[email protected]>--- tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/shell/testcases/sets/0036add_set_element_expiration_0 +1
-1@@ -6,7 +6,7 @@ RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } add element ip x y { 1.1.1.1 timeout 30s expires 15s }" -test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1) +test_output=$($NFT -e -f - <<< "$RULESET" 2>&1) if [ "$test_output" != "$RULESET" ] ; then $DIFF -u <(echo "$test_output") <(echo "$RULESET")Signature · 1 line
2.28.0
Phil Sutter
reviewerHi Pablo,
Quoted 15 lines · Pablo Neira Ayuso
Quoted 14 lines · Pablo Neira Ayuso
Hi Phil,
Quoted 8 lines · Phil Sutter
This reverts both commits
46b54fdcf266d3d631ffb6102067825d7672db46and0e258556f7f3da35deeb6d5cfdec51eafc7db80d.With both applied, the test succeeded *only* if 'nft monitor' was running in background, which is equivalent to the original problem (where the test succeeded only if *no* 'nft monitor' was running).
The test merely exposed a kernel bug, so in fact it is correct.
Please, do not revert this.
Quoted 7 lines
Quoted 3 lines
This kernel patch needs this fix:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
With the kernel patch above, this test does not break anymore.
ie. --echo is not printing the generation ID because kernel bug.
Oh, I mis-read the kernel patch, sorry for the mess. I would suggest to change your test case fix into this though:
| -test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1) | +test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation')
This makes it clear what is to be omitted and also makes the test work with unpatched kernels as well. Fine with you?
Thanks, Phil
Pablo Neira Ayuso
maintainerQuoted 26 lines · Phil Sutter
Hi Pablo,
Quoted 15 lines · Pablo Neira Ayuso
Quoted 14 lines · Pablo Neira Ayuso
Hi Phil,
Quoted 8 lines · Phil Sutter
This reverts both commits
46b54fdcf266d3d631ffb6102067825d7672db46and0e258556f7f3da35deeb6d5cfdec51eafc7db80d.With both applied, the test succeeded *only* if 'nft monitor' was running in background, which is equivalent to the original problem (where the test succeeded only if *no* 'nft monitor' was running).
The test merely exposed a kernel bug, so in fact it is correct.
Please, do not revert this.
Quoted 7 lines
Quoted 3 lines
This kernel patch needs this fix:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
With the kernel patch above, this test does not break anymore.
ie. --echo is not printing the generation ID because kernel bug.
Quoted 8 lines
Oh, I mis-read the kernel patch, sorry for the mess. I would suggest to change your test case fix into this though:
| -test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | head -n -1) | +test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation')This makes it clear what is to be omitted and also makes the test work with unpatched kernels as well. Fine with you?
That's fine indeed and more readable indeed.