From a52f7d2400ad5f03ea65f8ced35953c5614a38d1 Mon Sep 17 00:00:00 2001 From: Mayank Pal Date: Sat, 18 May 2024 09:39:44 +0530 Subject: [PATCH] ci: Use temporary directory for unit tests This commit implements the use of a temporary directory for unit tests in order to ensure a clean and isolated environment for testing purposes. Signed-off-by: Mayank --- internal/rbd/nodeserver_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rbd/nodeserver_test.go b/internal/rbd/nodeserver_test.go index 9e6782ac8810..f6d9bdf15f32 100644 --- a/internal/rbd/nodeserver_test.go +++ b/internal/rbd/nodeserver_test.go @@ -243,7 +243,7 @@ func TestReadAffinity_GetReadAffinityMapOptions(t *testing.T) { if err != nil { t.Errorf("failed to marshal csi config info %v", err) } - tmpConfPath := util.CsiConfigFile + tmpConfPath := t.TempDir() + "/ceph-csi.json" err = os.Mkdir("/etc/ceph-csi-config", 0o600) if err != nil { t.Errorf("failed to create directory %s: %v", "/etc/ceph-csi-config", err)