tests/shell: Improve fix in sets/0036add_set_element_expiration_0
Phil Sutter
reviewerPATCH 1/1 tests/shell: Improve fix in sets/0036add_set_element_expiration_0
Explicitly eliminate the newgen message from output instead of just the last line to make sure no other output is dropped by accident. This also allows the test to pass in unpatched kernels which do not emit the newgen message despite NLM_F_ECHO if no netlink listeners are present.
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 | grep -v '# new generation') if [ "$test_output" != "$RULESET" ] ; then $DIFF -u <(echo "$test_output") <(echo "$RULESET")
Signature · 1 line
2.28.0