diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-08-07 13:47:16 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-07 13:48:35 -0700 |
commit | cb23232c37c092b60d7e3ee91cb8dd8bed855028 (patch) | |
tree | f0390f71cea833c3ac7214d5ec30c1862a4e6a95 /runsc/test/image/image_test.go | |
parent | c036da5dffdf6cad912abe2723e69c04b59430b7 (diff) |
Fix build break in test
integration_test runs manually and breakage wasn't detected. Added test to
kokoro to ensure breakages are detected in the future.
PiperOrigin-RevId: 207772835
Change-Id: Iada81b579b558477d4db3516b38366ef6a2e933d
Diffstat (limited to 'runsc/test/image/image_test.go')
-rw-r--r-- | runsc/test/image/image_test.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/runsc/test/image/image_test.go b/runsc/test/image/image_test.go index 248934484..962c31b24 100644 --- a/runsc/test/image/image_test.go +++ b/runsc/test/image/image_test.go @@ -39,8 +39,8 @@ import ( func TestHelloWorld(t *testing.T) { d := testutil.MakeDocker("hello-test") - if out, err := d.Run("hello-world"); err != nil { - t.Fatalf("docker run failed: %v\nout: %s", err, out) + if _, err := d.Run("hello-world"); err != nil { + t.Fatalf("docker run failed: %v", err) } defer d.CleanUp() @@ -82,8 +82,8 @@ func testHTTPServer(port int) error { } func TestHttpd(t *testing.T) { - if out, err := testutil.Pull("httpd"); err != nil { - t.Fatalf("docker pull failed: %v\nout: %s", err, out) + if err := testutil.Pull("httpd"); err != nil { + t.Fatalf("docker pull failed: %v", err) } d := testutil.MakeDocker("http-test") @@ -93,8 +93,8 @@ func TestHttpd(t *testing.T) { } // Start the container. - if out, err := d.Run("-p", "80", "-v", testutil.MountArg(dir, "/usr/local/apache2/htdocs:ro"), "httpd"); err != nil { - t.Fatalf("docker run failed: %v\nout: %s", err, out) + if _, err := d.Run("-p", "80", "-v", testutil.MountArg(dir, "/usr/local/apache2/htdocs:ro"), "httpd"); err != nil { + t.Fatalf("docker run failed: %v", err) } defer d.CleanUp() @@ -105,8 +105,8 @@ func TestHttpd(t *testing.T) { } // Wait until it's up and running. - if err := d.WaitForHTTP(port, 5*time.Second); err != nil { - t.Fatalf("docker.WaitForHTTP() timeout: %v", err) + if err := testutil.WaitForHTTP(port, 5*time.Second); err != nil { + t.Fatalf("WaitForHTTP() timeout: %v", err) } if err := testHTTPServer(port); err != nil { @@ -115,8 +115,8 @@ func TestHttpd(t *testing.T) { } func TestNginx(t *testing.T) { - if out, err := testutil.Pull("nginx"); err != nil { - t.Fatalf("docker pull failed: %v\nout: %s", err, out) + if err := testutil.Pull("nginx"); err != nil { + t.Fatalf("docker pull failed: %v", err) } d := testutil.MakeDocker("net-test") @@ -126,8 +126,8 @@ func TestNginx(t *testing.T) { } // Start the container. - if out, err := d.Run("-p", "80", "-v", testutil.MountArg(dir, "/usr/share/nginx/html:ro"), "nginx"); err != nil { - t.Fatalf("docker run failed: %v\nout: %s", err, out) + if _, err := d.Run("-p", "80", "-v", testutil.MountArg(dir, "/usr/share/nginx/html:ro"), "nginx"); err != nil { + t.Fatalf("docker run failed: %v", err) } defer d.CleanUp() @@ -138,8 +138,8 @@ func TestNginx(t *testing.T) { } // Wait until it's up and running. - if err := d.WaitForHTTP(port, 5*time.Second); err != nil { - t.Fatalf("docker.WaitForHTTP() timeout: %v", err) + if err := testutil.WaitForHTTP(port, 5*time.Second); err != nil { + t.Fatalf("WaitForHTTP() timeout: %v", err) } if err := testHTTPServer(port); err != nil { @@ -148,14 +148,14 @@ func TestNginx(t *testing.T) { } func TestMysql(t *testing.T) { - if out, err := testutil.Pull("mysql"); err != nil { - t.Fatalf("docker pull failed: %v\nout: %s", err, out) + if err := testutil.Pull("mysql"); err != nil { + t.Fatalf("docker pull failed: %v", err) } d := testutil.MakeDocker("mysql-test") // Start the container. - if out, err := d.Run("-e", "MYSQL_ROOT_PASSWORD=foobar123", "mysql"); err != nil { - t.Fatalf("docker run failed: %v\nout: %s", err, out) + if _, err := d.Run("-e", "MYSQL_ROOT_PASSWORD=foobar123", "mysql"); err != nil { + t.Fatalf("docker run failed: %v", err) } defer d.CleanUp() @@ -178,8 +178,8 @@ func TestMysql(t *testing.T) { "mysql", "mysql", "-hmysql", "-uroot", "-pfoobar123", "-v", "-e", "source /sql/mysql.sql", } - if out, err := client.Run(args...); err != nil { - t.Fatalf("docker run failed: %v\nout: %s", err, out) + if _, err := client.Run(args...); err != nil { + t.Fatalf("docker run failed: %v", err) } defer client.CleanUp() |