From: Phil Sutter Date: Fri, 29 Sep 2023 17:59:12 +0000 (+0200) Subject: tests: shell: sets/reset_command_0: Fix drop_seconds() X-Git-Tag: v1.0.9~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a3dcbb44389edc5aba8dbc9317e8c6293263a66;p=thirdparty%2Fnftables.git tests: shell: sets/reset_command_0: Fix drop_seconds() 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 Fixes: 255ec36a11525 ("tests: shell: Stabilize sets/reset_command_0 test") Signed-off-by: Phil Sutter --- diff --git a/tests/shell/testcases/sets/reset_command_0 b/tests/shell/testcases/sets/reset_command_0 index 5e769fe6..e663dac8 100755 --- a/tests/shell/testcases/sets/reset_command_0 +++ b/tests/shell/testcases/sets/reset_command_0 @@ -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'