From a19981e60d074ad2b4f74ba819b91a2263e99a62 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 ensure a clean and isolated environment for testing purposes. Signed-off-by: Mayank Pal --- 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)