Skip to contentSkip to conversation

support/testing: set $USER in rust tests

PATCH New Eric Le Bihan 3 participants 3 messages Apr 28, 2018 – May 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/testing: set $USER in rust tests

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.

---
 support/testing/tests/package/test_rust.py | 1 +
 1 file changed, 1 insertion(+)
support/testing/tests/package/test_rust.py +1 -0
index e6c0de2214..2dc814f99d 100644
@@ -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')
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 support/testing: set $USER in rust tests

Hello,

Quoted 10 lines · Eric Le Bihan

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.

---
 support/testing/tests/package/test_rust.py | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 support/testing: set $USER in rust tests

In reply to Eric Le Bihan
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Eric" == Eric Le Bihan <[email protected]> writes:

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.

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard