* [PATCH] test: Fix the escaping issue in memory/passt test
@ 2025-10-15 8:04 Yumei Huang
2025-10-16 1:05 ` David Gibson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yumei Huang @ 2025-10-15 8:04 UTC (permalink / raw)
To: passt-dev, sbrivio; +Cc: david, yuhuang
Test memory/passt failed with error "objsize: No such file or
directory" because of an escaping issue. Fix it.
Link: https://bugs.passt.top/show_bug.cgi?id=155
Signed-off-by: Yumei Huang <yuhuang@redhat.com>
---
test/memory/passt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/memory/passt b/test/memory/passt
index 7e45724..c5142ea 100644
--- a/test/memory/passt
+++ b/test/memory/passt
@@ -51,7 +51,7 @@ guest sed /proc/slabinfo -ne 's/^\([^ ]* *[^ ]* *[^ ]* *[^ ]*\).*/\\\1/p' > /tmp
guest kill \$(cat /tmp/pid)
guest diff -y --suppress-common-lines /tmp/meminfo.before /tmp/meminfo.after || :
guest nm -td -Sr --size-sort -P /bin/passt.avx2 | head -30 | tee /tmp/nm.size
-guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
+guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\\\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
endef
def summary
--
2.47.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: Fix the escaping issue in memory/passt test
2025-10-15 8:04 [PATCH] test: Fix the escaping issue in memory/passt test Yumei Huang
@ 2025-10-16 1:05 ` David Gibson
2025-10-21 21:51 ` Stefano Brivio
2025-10-28 0:09 ` Stefano Brivio
2 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2025-10-16 1:05 UTC (permalink / raw)
To: Yumei Huang; +Cc: passt-dev, sbrivio
[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]
On Wed, Oct 15, 2025 at 04:04:02PM +0800, Yumei Huang wrote:
> Test memory/passt failed with error "objsize: No such file or
> directory" because of an escaping issue. Fix it.
It would be useful for the commit message to spell out in more detail
what exactly is going wrong. How is the missing escape resulting in
the error we see.
What is the extra escape for, specifically? '\1' is what we want to
give to sed, the '' should escape it for the shell. I'm assuming
something else in the test scripts is removing one of these escapes,
but it's not obvious to me what exactly.
>
> Link: https://bugs.passt.top/show_bug.cgi?id=155
> Signed-off-by: Yumei Huang <yuhuang@redhat.com>
> ---
> test/memory/passt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/memory/passt b/test/memory/passt
> index 7e45724..c5142ea 100644
> --- a/test/memory/passt
> +++ b/test/memory/passt
> @@ -51,7 +51,7 @@ guest sed /proc/slabinfo -ne 's/^\([^ ]* *[^ ]* *[^ ]* *[^ ]*\).*/\\\1/p' > /tmp
> guest kill \$(cat /tmp/pid)
> guest diff -y --suppress-common-lines /tmp/meminfo.before /tmp/meminfo.after || :
> guest nm -td -Sr --size-sort -P /bin/passt.avx2 | head -30 | tee /tmp/nm.size
> -guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
> +guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\\\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
> endef
>
> def summary
> --
> 2.47.0
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: Fix the escaping issue in memory/passt test
2025-10-15 8:04 [PATCH] test: Fix the escaping issue in memory/passt test Yumei Huang
2025-10-16 1:05 ` David Gibson
@ 2025-10-21 21:51 ` Stefano Brivio
2025-10-22 3:37 ` Yumei Huang
2025-10-28 0:09 ` Stefano Brivio
2 siblings, 1 reply; 5+ messages in thread
From: Stefano Brivio @ 2025-10-21 21:51 UTC (permalink / raw)
To: Yumei Huang; +Cc: passt-dev, david
On Wed, 15 Oct 2025 16:04:02 +0800
Yumei Huang <yuhuang@redhat.com> wrote:
> Test memory/passt failed with error "objsize: No such file or
> directory" because of an escaping issue. Fix it.
Sorry for the delay.
I tested the patch and it works for me, it simply adds a \ at the
beginning of the line, and that print simply shows results in the test
log. The output is not used in any automated way.
But I never ran into the issue, so I was looking for an explanation for
this:
> Link: https://bugs.passt.top/show_bug.cgi?id=155
> Signed-off-by: Yumei Huang <yuhuang@redhat.com>
> ---
> test/memory/passt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/memory/passt b/test/memory/passt
> index 7e45724..c5142ea 100644
> --- a/test/memory/passt
> +++ b/test/memory/passt
> @@ -51,7 +51,7 @@ guest sed /proc/slabinfo -ne 's/^\([^ ]* *[^ ]* *[^ ]* *[^ ]*\).*/\\\1/p' > /tmp
> guest kill \$(cat /tmp/pid)
> guest diff -y --suppress-common-lines /tmp/meminfo.before /tmp/meminfo.after || :
> guest nm -td -Sr --size-sort -P /bin/passt.avx2 | head -30 | tee /tmp/nm.size
> -guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
> +guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\\\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
Without the \ at the beginning, we have this line:
# name <active_objs> <num_objs> <objsize>
and... maybe you have a file in the directory where you run the tests
that's called num_objs, or objsize, created as a result of a previous
failure (and some other issue), and '<objsize' is not escaped somewhere
so it's taken as a redirection?
Perhaps a \# at the beginning, instead of #, makes Bash ignore the
whole line, and for some reason it's not ignored otherwise?
It shouldn't have anything to do with the guest image because that's
read-only.
Could you have a look if you see any "strange" file name in your test
directory?
Otherwise I would be tempted to just go ahead and apply this because
it's harmless and it's not *that* important that we find a solution to
this. We're going to rewrite this test eventually.
--
Stefano
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: Fix the escaping issue in memory/passt test
2025-10-21 21:51 ` Stefano Brivio
@ 2025-10-22 3:37 ` Yumei Huang
0 siblings, 0 replies; 5+ messages in thread
From: Yumei Huang @ 2025-10-22 3:37 UTC (permalink / raw)
To: Stefano Brivio; +Cc: passt-dev, david
On Wed, Oct 22, 2025 at 5:51 AM Stefano Brivio <sbrivio@redhat.com> wrote:
>
> On Wed, 15 Oct 2025 16:04:02 +0800
> Yumei Huang <yuhuang@redhat.com> wrote:
>
> > Test memory/passt failed with error "objsize: No such file or
> > directory" because of an escaping issue. Fix it.
>
> Sorry for the delay.
>
> I tested the patch and it works for me, it simply adds a \ at the
> beginning of the line, and that print simply shows results in the test
> log. The output is not used in any automated way.
>
> But I never ran into the issue, so I was looking for an explanation for
> this:
>
> > Link: https://bugs.passt.top/show_bug.cgi?id=155
> > Signed-off-by: Yumei Huang <yuhuang@redhat.com>
> > ---
> > test/memory/passt | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/memory/passt b/test/memory/passt
> > index 7e45724..c5142ea 100644
> > --- a/test/memory/passt
> > +++ b/test/memory/passt
> > @@ -51,7 +51,7 @@ guest sed /proc/slabinfo -ne 's/^\([^ ]* *[^ ]* *[^ ]* *[^ ]*\).*/\\\1/p' > /tmp
> > guest kill \$(cat /tmp/pid)
> > guest diff -y --suppress-common-lines /tmp/meminfo.before /tmp/meminfo.after || :
> > guest nm -td -Sr --size-sort -P /bin/passt.avx2 | head -30 | tee /tmp/nm.size
> > -guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
> > +guest sed /proc/slabinfo -ne 's/\(.*<objsize>\).*$/\\\1/p' | tail -1; (diff -y --suppress-common-lines /tmp/slabinfo.before /tmp/slabinfo.after | sort -grk8)
>
> Without the \ at the beginning, we have this line:
>
> # name <active_objs> <num_objs> <objsize>
>
> and... maybe you have a file in the directory where you run the tests
> that's called num_objs, or objsize, created as a result of a previous
> failure (and some other issue), and '<objsize' is not escaped somewhere
> so it's taken as a redirection?
>
> Perhaps a \# at the beginning, instead of #, makes Bash ignore the
> whole line, and for some reason it's not ignored otherwise?
>
> It shouldn't have anything to do with the guest image because that's
> read-only.
>
> Could you have a look if you see any "strange" file name in your test
> directory?
I don't see any strange file either num_objs or objsize in my test
directory. The cmd is supposed to run inside the guest, and the error
appears in pane_guest.log. I guess it's not related to the files on
the host?
>
> Otherwise I would be tempted to just go ahead and apply this because
> it's harmless and it's not *that* important that we find a solution to
> this. We're going to rewrite this test eventually.
>
> --
> Stefano
>
--
Thanks,
Yumei Huang
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] test: Fix the escaping issue in memory/passt test
2025-10-15 8:04 [PATCH] test: Fix the escaping issue in memory/passt test Yumei Huang
2025-10-16 1:05 ` David Gibson
2025-10-21 21:51 ` Stefano Brivio
@ 2025-10-28 0:09 ` Stefano Brivio
2 siblings, 0 replies; 5+ messages in thread
From: Stefano Brivio @ 2025-10-28 0:09 UTC (permalink / raw)
To: Yumei Huang; +Cc: passt-dev, david
On Wed, 15 Oct 2025 16:04:02 +0800
Yumei Huang <yuhuang@redhat.com> wrote:
> Test memory/passt failed with error "objsize: No such file or
> directory" because of an escaping issue. Fix it.
>
> Link: https://bugs.passt.top/show_bug.cgi?id=155
> Signed-off-by: Yumei Huang <yuhuang@redhat.com>
Applied.
I tried to actually un-escape more stuff from the sed pattern (for
example just 'sed s/\(.*...)/.../p') and sure I get problems with Bash
but not the 'objsize' thing you're hitting, so I don't have another
explanation.
I'm fairly sure that one of those < > around objsize is taken as
redirection by Bash, but I have no idea why.
Whatever, as long as it's harmless, these test scripts are definitely
not very clean/elegant...
--
Stefano
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-28 0:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15 8:04 [PATCH] test: Fix the escaping issue in memory/passt test Yumei Huang
2025-10-16 1:05 ` David Gibson
2025-10-21 21:51 ` Stefano Brivio
2025-10-22 3:37 ` Yumei Huang
2025-10-28 0:09 ` Stefano Brivio
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).