Skip to content

Conversation

@haesbaert
Copy link
Collaborator

Basically our tests fork and exec itself with a -N (nop) option, we then look at process events and check if it's what we wanted.

This all worked great before as we used to figure out who we were by readlink(/proc/self/exe), but then I introduced the valgrind tests, where /proc/self/exe is some valgrind binary, not "us" (documented in bbf265b), so I changed the way we figure "us" by doing realpath(argv0), which is also bad.

The problem with realpath(argv0) is that it's not sufficient if quark-test was executed via some PATH directory, just copy quark-test into $HOME/bin, and then cd /tmp && quark-test and it will fail, as binpath() won't find it.

So stop this madness, use /bin/true for nop, instead of execing ourselves, which involves us also adding a /bin/true to the initramfs, so one is provided.

Basically our tests fork and exec itself with a -N (nop) option, we then look at
process events and check if it's what we wanted.

This all worked great before as we used to figure out who we were by
readlink(/proc/self/exe), but then I introduced the valgrind tests, where
/proc/self/exe is some valgrind binary, not "us" (documented in
bbf265b), so I changed the way we figure "us"
by doing realpath(argv0), which is also bad.

The problem with realpath(argv0) is that it's not sufficient if quark-test was
executed via some PATH directory, just copy quark-test into $HOME/bin, and then
cd /tmp && quark-test and it will fail, as binpath() won't find it.

So stop this madness, use /bin/true for nop, instead of execing ourselves, which
involves us also adding a /bin/true to the initramfs, so one is provided.
@haesbaert haesbaert requested a review from a team as a code owner July 27, 2025 14:59
@haesbaert haesbaert merged commit 04494c9 into main Jul 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants