support/testing: set $USER in rust tests
authorEric Le Bihan <eric.le.bihan.dev@free.fr>
Sat, 28 Apr 2018 22:14:13 +0000 (00:14 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 29 Apr 2018 07:57:32 +0000 (09:57 +0200)
When the run-time tests to build rust and rust-bin packages are run via Docker,
the $USER environment variable is not set, which makes cargo fail when
initializing the test project.

So add it to make cargo happy.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/testing/tests/package/test_rust.py

index e6c0de22145dce054202edf14ca6522d043cb99d..2dc814f99d271b336de5e34923438cf3cbbd5a79 100644 (file)
@@ -21,6 +21,7 @@ class TestRustBase(infra.basetest.BRTest):
     def build_test_prog(self):
         hostdir = os.path.join(self.builddir, 'host')
         env = os.environ.copy()
+        env["USER"] = "br-user"
         env["PATH"] = "{}:".format(os.path.join(hostdir, 'bin')) + env["PATH"]
         env["CARGO_HOME"] = os.path.join(hostdir, 'usr', 'share', 'cargo')
         env["RUST_TARGET_PATH"] = os.path.join(hostdir, 'etc', 'rustc')