]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/commands: Ensure sync can be found regardless of PATH
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 20 Dec 2020 15:58:47 +0000 (15:58 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Dec 2020 22:29:08 +0000 (22:29 +0000)
Avoid command not found errors shown in selftest logs due to changes to PATH
settings which also risks intermittent problems due to IO load.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/commands.py

index 6c1535ddfbf08a301b08bd582a5e11d6b06ba42b..a71c16ab1494c8a862c0f6b10a8f2466e38289c7 100644 (file)
@@ -188,7 +188,10 @@ def runCmd(command, ignore_status=False, timeout=None, assert_error=True, sync=T
     # call sync around the tests to ensure the IO queue doesn't get too large, taking any IO
     # hit here rather than in bitbake shutdown.
     if sync:
+        p = os.environ['PATH']
+        os.environ['PATH'] = "/usr/bin:/bin:/usr/sbin:/sbin:" + p
         os.system("sync")
+        os.environ['PATH'] = p
 
     result.command = command
     result.status = cmd.status