* [nft PATCH] tests: shell: sets/reset_command_0: Fix drop_seconds()
@ 2023-09-29 18:03 Phil Sutter
2023-09-29 18:07 ` Phil Sutter
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2023-09-29 18:03 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/shell/testcases/sets/reset_command_0 b/tests/shell/testcases/sets/reset_command_0
index 5e769fe66d684..e663dac831f8c 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'
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nft PATCH] tests: shell: sets/reset_command_0: Fix drop_seconds()
2023-09-29 18:03 [nft PATCH] tests: shell: sets/reset_command_0: Fix drop_seconds() Phil Sutter
@ 2023-09-29 18:07 ` Phil Sutter
0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2023-09-29 18:07 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel
On Fri, Sep 29, 2023 at 08:03:44PM +0200, Phil Sutter wrote:
> 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>
Patch applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-29 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-29 18:03 [nft PATCH] tests: shell: sets/reset_command_0: Fix drop_seconds() Phil Sutter
2023-09-29 18:07 ` Phil Sutter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).