test: fixed various flaky tests (#1009)

- Removed test cases which required access to `/root` from the
  `pkg/util` package.

- Fixed flaky `PodDisruptionBudget` test.

- Fixed a typo in `PersistentVolumeClaim` test.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
This commit is contained in:
Vaibhav Malik
2024-03-12 12:55:03 +05:30
committed by GitHub
parent adf4f17085
commit 3475e2de0c
3 changed files with 5 additions and 28 deletions

View File

@@ -423,11 +423,6 @@ func TestFileExists(t *testing.T) {
filePath: "./util.go",
isPresent: true,
},
{
filePath: "/root/temp.go",
isPresent: false,
err: "permission denied",
},
}
for _, tt := range tests {
tt := tt
@@ -455,10 +450,6 @@ func TestEnsureDirExists(t *testing.T) {
{
dir: "./",
},
{
dir: "/root/tmp/",
err: "permission denied",
},
}
for _, tt := range tests {
tt := tt