Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
shtouff committed Nov 26, 2024
1 parent 9a96273 commit 79e445a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
const (
hostPathVolumeType = "hostPath"
localVolumeType = "local"
normalDataPath = "/data"
subPathDataPath = "/nginx"
normalDataPath = "/data"
subPathDataPath = "/nginx"
)

type PodTestSuite struct {
Expand Down Expand Up @@ -210,7 +210,6 @@ func runTest(p *PodTestSuite, images []string, waitCondition, volumeType string)
}
}


func runPersistenceTest(p *PodTestSuite, images []string, dataPath string) {
kustomizeDir := testdataFile(p.kustomizeDir)

Expand All @@ -223,9 +222,9 @@ func runPersistenceTest(p *PodTestSuite, images []string, dataPath string) {

cmds = append(
cmds,
fmt.Sprintf("kubectl exec volume-test -- sh -c 'echo foo > %s/bar'", dataPath),
"kubectl delete pod/volume-test",
"kubectl wait --for=delete pod/volume-test --timeout=120s",
fmt.Sprintf("kubectl exec volume-test -- sh -c 'echo foo > %s/bar'", dataPath),
"kubectl delete pod/volume-test",
"kubectl wait --for=delete pod/volume-test --timeout=120s",
"kustomize build | kubectl apply -f -",
"kubectl wait pod volume-test --for condition=ready --timeout=120s",
)
Expand All @@ -248,7 +247,7 @@ func runPersistenceTest(p *PodTestSuite, images []string, dataPath string) {
c := createCmd(p.T(), catDataCmd, kustomizeDir, p.config.envs(), nil)
catDataOutput, err := c.CombinedOutput()
if err != nil {
p.FailNow("", "failed to cat 'bar' from %s: %v", dataPath, err)
p.FailNow("", "failed to cat 'bar' from %s: %v", dataPath, err)
}

if len(catDataOutput) == 0 || !strings.Contains(string(catDataOutput), "foo") {
Expand Down

0 comments on commit 79e445a

Please sign in to comment.