From 4060b771577356c6966d9af6b92dc5c85c20b84a Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 26 Aug 2020 11:39:51 -0600 Subject: BATS: fix corner case in --userns=keep-id test The test that does 'adduser' in a keep-id container had a really dumb bug: if the user running the test has UID 1000, then podman itself (via keep-id) will add the "1000" passwd entry, and the in-container "adduser" will allocate 1001, making our test fail. This triggered in f31/f32 podman gating tests, but (?!?) never in rawhide gating tests. Solution: explicitly feed a UID to adduser. Make sure that it's not the same as the UID of the current user. Also (unrelated): fix a ridiculous "run mkdir || die". At the time I wrote that I probably had no idea how BATS works. Signed-off-by: Ed Santiago --- test/system/070-build.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/system/070-build.bats') diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 0e6e97d40..997699ecb 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -12,7 +12,7 @@ load helpers rand_content=$(random_string 50) tmpdir=$PODMAN_TMPDIR/build-test - run mkdir -p $tmpdir || die "Could not mkdir $tmpdir" + mkdir -p $tmpdir dockerfile=$tmpdir/Dockerfile cat >$dockerfile <