Skip to content

Commit

Permalink
Run busybox integration test in default namespace
Browse files Browse the repository at this point in the history
If we choose a random namespace, the test will fail since RBAC
permissions will not be set up correctly.

This also chooses a randomly generated name, so that if we are running
an integration test while another busybox pod is still cleaning up,
there are no errors
  • Loading branch information
r2d4 committed Sep 8, 2017
1 parent 941be53 commit c7484f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions test/integration/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ func TestPersistence(t *testing.T) {
kubectlRunner := util.NewKubectlRunner(t)
podPath, _ := filepath.Abs("testdata/busybox.yaml")

podNamespace := kubectlRunner.CreateRandomNamespace()
defer kubectlRunner.DeleteNamespace(podNamespace)

// Create a pod and wait for it to be running.
if _, err := kubectlRunner.RunCommand([]string{"create", "-f", podPath, "--namespace=" + podNamespace}); err != nil {
if _, err := kubectlRunner.RunCommand([]string{"create", "-f", podPath}); err != nil {
t.Fatalf("Error creating test pod: %s", err)
}

Expand All @@ -47,7 +44,7 @@ func TestPersistence(t *testing.T) {
t.Fatalf("waiting for dashboard to be up: %s", err)
}

if err := util.WaitForBusyboxRunning(t, podNamespace); err != nil {
if err := util.WaitForBusyboxRunning(t, "default"); err != nil {
t.Fatalf("waiting for busybox to be up: %s", err)
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/testdata/busybox.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox
generateName: busybox-
labels:
integration-test: busybox
spec:
Expand Down

0 comments on commit c7484f5

Please sign in to comment.