diff --git a/e2e/basic/build_from_git_test.go b/e2e/basic/build_from_git_test.go index 753b90b..bf3f7a2 100644 --- a/e2e/basic/build_from_git_test.go +++ b/e2e/basic/build_from_git_test.go @@ -52,7 +52,6 @@ func TestBuildFromGit(t *testing.T) { }) // Test logic - require.NoError(t, instance.Start(), "Error starting instance") data, err := instance.GetFileBytes("/home/hello.txt") diff --git a/e2e/basic/external_file_test.go b/e2e/basic/external_file_test.go index feeb2e5..844563a 100644 --- a/e2e/basic/external_file_test.go +++ b/e2e/basic/external_file_test.go @@ -20,16 +20,16 @@ func TestExternalFile(t *testing.T) { t.Fatalf("Error creating executor: %v", err) } - web, err := knuu.NewInstance("web") + server, err := knuu.NewInstance("server") if err != nil { t.Fatalf("Error creating instance '%v':", err) } - err = web.SetImage("docker.io/nginx:latest") + err = server.SetImage("docker.io/nginx:latest") if err != nil { t.Fatalf("Error setting image '%v':", err) } - web.AddPortTCP(80) - _, err = web.ExecuteCommand("mkdir", "-p", "/usr/share/nginx/html") + server.AddPortTCP(80) + _, err = server.ExecuteCommand("mkdir", "-p", "/usr/share/nginx/html") if err != nil { t.Fatalf("Error executing command '%v':", err) } @@ -59,36 +59,36 @@ func TestExternalFile(t *testing.T) { t.Fatalf("Error syncing data to disk '%v':", err) } - err = web.AddFile("/tmp/index.html", "/usr/share/nginx/html/index.html", "0:0") + err = server.AddFile("/tmp/index.html", "/usr/share/nginx/html/index.html", "0:0") if err != nil { t.Fatalf("Error adding file '%v':", err) } - err = web.Commit() + err = server.Commit() if err != nil { t.Fatalf("Error committing instance: %v", err) } t.Cleanup(func() { - require.NoError(t, knuu.BatchDestroy(executor.Instance, web)) + require.NoError(t, knuu.BatchDestroy(executor.Instance, server)) }) // Test logic - webIP, err := web.GetIP() + serverIP, err := server.GetIP() if err != nil { t.Fatalf("Error getting IP '%v':", err) } - err = web.Start() + err = server.Start() if err != nil { t.Fatalf("Error starting instance: %v", err) } - err = web.WaitInstanceIsRunning() + err = server.WaitInstanceIsRunning() if err != nil { t.Fatalf("Error waiting for instance to be running: %v", err) } - wget, err := executor.ExecuteCommand("wget", "-q", "-O", "-", webIP) + wget, err := executor.ExecuteCommand("wget", "-q", "-O", "-", serverIP) if err != nil { t.Fatalf("Error executing command '%v':", err) } diff --git a/e2e/basic/file_test.go b/e2e/basic/file_test.go index e35f398..e54c6aa 100644 --- a/e2e/basic/file_test.go +++ b/e2e/basic/file_test.go @@ -26,53 +26,53 @@ func TestFile(t *testing.T) { t.Fatalf("Error creating executor: %v", err) } - web, err := knuu.NewInstance("web") + serverfile, err := knuu.NewInstance("serverfile") if err != nil { t.Fatalf("Error creating instance '%v':", err) } - err = web.SetImage("docker.io/nginx:latest") + err = serverfile.SetImage("docker.io/nginx:latest") if err != nil { t.Fatalf("Error setting image '%v':", err) } - web.AddPortTCP(80) - _, err = web.ExecuteCommand("mkdir", "-p", "/usr/share/nginx/html") + serverfile.AddPortTCP(80) + _, err = serverfile.ExecuteCommand("mkdir", "-p", "/usr/share/nginx/html") if err != nil { t.Fatalf("Error executing command '%v':", err) } - err = web.AddFile("resources/html/index.html", "/usr/share/nginx/html/index.html", "0:0") + err = serverfile.AddFile("resources/html/index.html", "/usr/share/nginx/html/index.html", "0:0") if err != nil { t.Fatalf("Error adding file '%v':", err) } - err = web.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0) + err = serverfile.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0) if err != nil { t.Fatalf("Error adding volume: %v", err) } - err = web.Commit() + err = serverfile.Commit() if err != nil { t.Fatalf("Error committing instance: %v", err) } t.Cleanup(func() { - require.NoError(t, knuu.BatchDestroy(executor.Instance, web)) + require.NoError(t, knuu.BatchDestroy(executor.Instance, serverfile)) }) // Test logic - webIP, err := web.GetIP() + serverfileIP, err := serverfile.GetIP() if err != nil { t.Fatalf("Error getting IP '%v':", err) } - err = web.Start() + err = serverfile.Start() if err != nil { t.Fatalf("Error starting instance: %v", err) } - err = web.WaitInstanceIsRunning() + err = serverfile.WaitInstanceIsRunning() if err != nil { t.Fatalf("Error waiting for instance to be running: %v", err) } - wget, err := executor.ExecuteCommand("wget", "-q", "-O", "-", webIP) + wget, err := executor.ExecuteCommand("wget", "-q", "-O", "-", serverfileIP) if err != nil { t.Fatalf("Error executing command '%v':", err) } diff --git a/e2e/basic/files_to_volumes_cm_test.go b/e2e/basic/files_to_volumes_cm_test.go index 61924e5..77eb384 100644 --- a/e2e/basic/files_to_volumes_cm_test.go +++ b/e2e/basic/files_to_volumes_cm_test.go @@ -173,6 +173,10 @@ func TestNoVolumesOneFile(t *testing.T) { if err != nil { t.Fatalf("Error executing command for '%v': %v", instanceName, err) } + err = instance.AddVolumeWithOwner("/usr/share/nginx/html", "1Gi", 0) + if err != nil { + t.Fatalf("Error adding volume: %v", err) + } err = instance.Commit() if err != nil { t.Fatalf("Error committing instance '%v': %v", instanceName, err)