]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: sets/reset_command_0: Fix drop_seconds()
authorPhil Sutter <phil@nwl.cc>
Fri, 29 Sep 2023 17:59:12 +0000 (19:59 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 29 Sep 2023 18:06:41 +0000 (20:06 +0200)
The function print_times() skips any time elements which are zero, so
output may lack the ms part. Adjust the sed call dropping anything but
the minutes value to not fail in that case.

Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Fixes: 255ec36a11525 ("tests: shell: Stabilize sets/reset_command_0 test")
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/shell/testcases/sets/reset_command_0

index 5e769fe66d684a27a81e3440fcff7694ee2bf873..e663dac831f8c919322a46a8a9c413bbd870845e 100755 (executable)
@@ -32,7 +32,7 @@ $NFT -f - <<< "$RULESET"
 echo OK
 
 drop_seconds() {
-       sed 's/m[0-9]*s[0-9]*ms/m/g'
+       sed 's/[0-9]\+m\?s//g'
 }
 expires_minutes() {
        sed -n 's/.*expires \([0-9]*\)m.*/\1/p'