summaryrefslogtreecommitdiffhomepage
path: root/runsc/test/image
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-08-02 12:40:29 -0700
committerShentubot <shentubot@google.com>2018-08-02 12:42:07 -0700
commit4c1167de4ee2aa7b71729ff8b1c742b4183168d1 (patch)
tree13cedfb93a66e617fafd0cc1f6feaac764fb764b /runsc/test/image
parent57d0fcbdbf7e9d2d573ce8d4ca2f72b82f778d63 (diff)
Isolate image pulling time from container startup
mysql image test is timing out sporadically and it's hard to tell where the slow down in coming from. PiperOrigin-RevId: 207147237 Change-Id: I05a4d2c116292695d63cf861f3b89cd1c54b6106
Diffstat (limited to 'runsc/test/image')
-rw-r--r--runsc/test/image/image_test.go9
-rw-r--r--runsc/test/image/python_test.go3
-rw-r--r--runsc/test/image/tomcat_test.go3
3 files changed, 15 insertions, 0 deletions
diff --git a/runsc/test/image/image_test.go b/runsc/test/image/image_test.go
index 04c334d92..248934484 100644
--- a/runsc/test/image/image_test.go
+++ b/runsc/test/image/image_test.go
@@ -82,6 +82,9 @@ 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)
+ }
d := testutil.MakeDocker("http-test")
dir, err := testutil.PrepareFiles("latin10k.txt")
@@ -112,6 +115,9 @@ 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)
+ }
d := testutil.MakeDocker("net-test")
dir, err := testutil.PrepareFiles("latin10k.txt")
@@ -142,6 +148,9 @@ 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)
+ }
d := testutil.MakeDocker("mysql-test")
// Start the container.
diff --git a/runsc/test/image/python_test.go b/runsc/test/image/python_test.go
index e7324e83e..b77a6ec87 100644
--- a/runsc/test/image/python_test.go
+++ b/runsc/test/image/python_test.go
@@ -24,6 +24,9 @@ import (
)
func TestPythonHello(t *testing.T) {
+ if out, err := testutil.Pull("google/python-hello"); err != nil {
+ t.Fatalf("docker pull failed: %v\nout: %s", err, out)
+ }
d := testutil.MakeDocker("python-hello-test")
if out, err := d.Run("-p", "8080", "google/python-hello"); err != nil {
t.Fatalf("docker run failed: %v\nout: %s", err, out)
diff --git a/runsc/test/image/tomcat_test.go b/runsc/test/image/tomcat_test.go
index 578385ca7..dd47ab6da 100644
--- a/runsc/test/image/tomcat_test.go
+++ b/runsc/test/image/tomcat_test.go
@@ -24,6 +24,9 @@ import (
)
func TestTomcat(t *testing.T) {
+ if out, err := testutil.Pull("tomcat:8.0"); err != nil {
+ t.Fatalf("docker pull failed: %v\nout: %s", err, out)
+ }
d := testutil.MakeDocker("tomcat-test")
if out, err := d.Run("-p", "8080", "tomcat:8.0"); err != nil {
t.Fatalf("docker run failed: %v\nout: %s", err, out)