Skip to contentSkip to conversation

Determinism issue for swapon/swapoff tests

LTP Richard Purdie 2 participants 2 messages Mar 2, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

I've been ensuring the ltp binaries/packages used by Yocto Project are reproducible. I've sent two patches which address most of the issues, the remaining one was with the swapon/swapoff tests.

The challenge there is they share libswapon.o. There is a race over building it depending on whether swapon or swapoff is built first. The issue is that in one case "../swapon/libswapon.c" is referenced in libswapon.o and in the other, "libswapon.c" is referenced. This means the build isn't deterministic/reproducible.

I've worked around this in Yocto Project by executing:

"make -C XXX/testcases/kernel/syscalls/swapon/"

before running the main compile. That ensures we're deterministic but I wanted to mention the issue in case you had a better solution to fix the Makefiles?

Cheers,

Richard

#1 lore raw

Hi!

Quoted 10 lines

I've been ensuring the ltp binaries/packages used by Yocto Project are reproducible. I've sent two patches which address most of the issues, the remaining one was with the swapon/swapoff tests.

The challenge there is they share libswapon.o. There is a race over building it depending on whether swapon or swapoff is built first. The issue is that in one case "../swapon/libswapon.c" is referenced in libswapon.o and in the other, "libswapon.c" is referenced. This means the build isn't deterministic/reproducible.

Quoted 7 lines

I've worked around this in Yocto Project by executing:

"make -C XXX/testcases/kernel/syscalls/swapon/"

before running the main compile. That ensures we're deterministic but I wanted to mention the issue in case you had a better solution to fix the Makefiles?

Actually we recently introduced top level libs directory for code shared between multiple tests, so the best course of action would be to move the libswapon.c there.

Signature · 2 lines
Cyril Hrubis
[email protected]