From 36c480f64382ee6bbe02e0372d0d7f9de3e78a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Fri, 20 Jan 2023 20:06:08 +0100 Subject: [PATCH] Don't affect $XDG_RUNTIME_DIR of Podman starting the registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise $XDG_RUNTIME_DIR/netns gets created and mounted, breaking (rm -rf). Signed-off-by: Miloslav Trmač --- systemtest/040-local-registry-auth.bats | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/systemtest/040-local-registry-auth.bats b/systemtest/040-local-registry-auth.bats index 670697de..29c65597 100644 --- a/systemtest/040-local-registry-auth.bats +++ b/systemtest/040-local-registry-auth.bats @@ -8,17 +8,19 @@ load helpers function setup() { standard_setup - # Remove old/stale cred file - _cred_dir=$TESTDIR/credentials - export XDG_RUNTIME_DIR=$_cred_dir - mkdir -p $_cred_dir/containers - rm -f $_cred_dir/containers/auth.json - # Start authenticated registry with random password testuser=testuser testpassword=$(random_string 15) start_registry --testuser=$testuser --testpassword=$testpassword --enable-delete=true reg + + _cred_dir=$TESTDIR/credentials + # It is important to change XDG_RUNTIME_DIR only after we start the registry, otherwise it affects the path of $XDG_RUNTIME_DIR/netns maintained by Podman, + # making it imposible to clean up after ourselves. + export XDG_RUNTIME_DIR=$_cred_dir + mkdir -p $_cred_dir/containers + # Remove old/stale cred file + rm -f $_cred_dir/containers/auth.json } @test "auth: credentials on command line" {