Skip to contentSkip to conversation

nondeterministic -c testimage (python3 from hosttools vs recipe-sysroot-native)

DISCUSSION André Draszik 1 participant 2 messages Feb 4, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

I have some OEQA image tests where external python3 scripts are invoked by the OEQA test case.

Those external scripts use #!/usr/bin/env python3 as shebang.

Now it appears that if rm-work is enabled, those are run using python3 from the tmp/hosttools/python3 symlink and without rm-work, they run using python3 from the recipe-sysroot-native (which all makes sense).

But the whole testing becomes a bit nondeterministic... In particular, those external python3 script import modules that
are not available in the recipe-sysroot-native (but
they are in the host's python3 installation).

What is the correct solution here - considering that
a) OEQA test cases themselves are run using hosttools' python3, and also considering
b) that additional hosttools symlinks are added if testimage is enabled (via bitbake.conf)

1) Should testimage remove the recipe-sysroot-native from PATH (for the duration of the test) so that everything runs in the same environment? Or
2) should my image update TESTIMAGEDEPENDS and depend on python3-native and all the extra python3 native module recipes from OE.

I'm inclined to send a patch to update PATH for the testimage run, but wanted to gauge opinions first?

What is the correct approach here?

Cheers,
Andre'

#1 lore raw

Answering my own question here...

Quoted 8 lines · André Draszik

1) Should testimage remove the recipe-sysroot-native from PATH (for the duration of the test) so that everything runs in the same environment? Or
2) should my image update TESTIMAGEDEPENDS and depend on python3-native and all the extra python3 native module recipes from OE.

I'm inclined to send a patch to update PATH for the testimage run, but wanted to gauge opinions first?

Option 1) probably won't work, as things like native apt/opkg/rpm etc. are being added to recipe-sysroot-native via TESTIMAGEDEPENDS, so PATH can not be changed.

I'll have to use option 2).

Cheers,
Andre'