Skip to content

Commit

Permalink
ci: Use temporary directory for unit tests
Browse files Browse the repository at this point in the history
ensure a clean and isolated environment for testing purposes.

Signed-off-by: Mayank Pal <mayankpal9654@gmail.com>

ci: Use temporary directory for unit tests

remove err = os.Mkdir('/etc/ceph-csi-config', 0o600)

Signed-off-by: Mayank Pal <mayankpal9654@gmail.com>

ci: Use temporary directory for unit tests

remove err = os.Mkdir('/etc/ceph-csi-config', 0o600)

Signed-off-by: Mayank Pal <mayankpal9654@gmail.com>

ci: Use temporary directory for unit tests

remove if err

Signed-off-by: Mayank Pal <mayankpal9654@gmail.com>
  • Loading branch information
mayankpall authored and mergify[bot] committed May 27, 2024
1 parent a8e9d66 commit 822794c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/rbd/nodeserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,8 @@ func TestReadAffinity_GetReadAffinityMapOptions(t *testing.T) {
if err != nil {
t.Errorf("failed to marshal csi config info %v", err)
}
tmpConfPath := util.CsiConfigFile
err = os.Mkdir("/etc/ceph-csi-config", 0o600)
if err != nil {
t.Errorf("failed to create directory %s: %v", "/etc/ceph-csi-config", err)
}
tmpConfPath := t.TempDir() + "/ceph-csi.json"

err = os.WriteFile(tmpConfPath, csiConfigFileContent, 0o600)
if err != nil {
t.Errorf("failed to write %s file content: %v", util.CsiConfigFile, err)
Expand Down

0 comments on commit 822794c

Please sign in to comment.