Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 77785de

Browse files
committed
hack/test-cmd.sh: change test image from "busybox" to "hyperhq/busybox"
Meet a issue that hyper::test::portmapping hang and it is a bug of busybox image "docker-library/busybox#44" (It is closed but actually it is not fixed). After discussion with @gnawux and @bergwolf, all of us think test with a image that under control is better than use normal busybox image. So @bergwolf add "hyperhq/busybox" image and let test use it. Signed-off-by: Hui Zhu <[email protected]>
1 parent eb4916e commit 77785de

14 files changed

+39
-39
lines changed

hack/lib/test.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ hyper::test::remove_image() {
2828

2929
hyper::test::exitcode() {
3030
echo "Pod exit code test"
31-
res=$(sudo hyperctl run --rm busybox sh -c "exit 17" > /dev/null 2>&1 ; echo $?)
31+
res=$(sudo hyperctl run --rm hyperhq/busybox sh -c "exit 17" > /dev/null 2>&1 ; echo $?)
3232
echo "should return 17, return: $res"
3333
test $res -eq 17
3434
}
3535

3636
hyper::test::exec() {
3737
echo "Pod exec and exit code test"
38-
id=$(sudo hyperctl run -d busybox /bin/sh | sed -ne "s/POD id is \(.*\)/\1/p")
38+
id=$(sudo hyperctl run -d hyperhq/busybox /bin/sh | sed -ne "s/POD id is \(.*\)/\1/p")
3939
echo "test pod ID is $id"
4040
res=$(sudo hyperctl exec $id sh -c "exit 37" > /dev/null 2>&1 ; echo $?)
4141
echo "should return 37, return: $res"
@@ -147,7 +147,7 @@ hyper::test::integration() {
147147

148148
hyper::test::execvm() {
149149
echo "Pod execvm echo test"
150-
id=$(sudo hyperctl run -d busybox /bin/sh | sed -ne "s/POD id is \(.*\)/\1/p")
150+
id=$(sudo hyperctl run -d hyperhq/busybox /bin/sh | sed -ne "s/POD id is \(.*\)/\1/p")
151151
echo "test pod ID is $id"
152152
res=$(sudo hyperctl exec -m $id /sbin/busybox sh -c "echo aaa")
153153
echo "should return aaa, actual: $res"
@@ -221,7 +221,7 @@ hyper::test::force_kill_container() {
221221
# regression test for #577
222222
hyper::test::container_logs_no_newline() {
223223
echo "Container logs without newlines"
224-
id=$(sudo hyperctl run -d busybox echo -n foobar | sed -ne "s/POD id is \(.*\)/\1/p")
224+
id=$(sudo hyperctl run -d hyperhq/busybox echo -n foobar | sed -ne "s/POD id is \(.*\)/\1/p")
225225
sleep 3 # sleep a bit to let logger kick in
226226
res=$(sudo hyperctl logs $id)
227227
sudo hyperctl rm $id
@@ -262,5 +262,5 @@ END
262262
else
263263
return 1
264264
fi
265-
done < <(sudo hyperctl run -t --rm --publish 3000:1300 busybox:latest sh -c 'echo "start" ; nc -l -p 1300')
265+
done < <(sudo hyperctl run -t --rm --publish 3000:1300 hyperhq/busybox:latest sh -c 'echo "start" ; nc -l -p 1300')
266266
}

hack/pods/busybox-tty.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "test-container-force-killing",
33
"containers" : [{
44
"name": "busybox-with-tty",
5-
"image": "busybox",
5+
"image": "hyperhq/busybox",
66
"command": ["/bin/sh"]
77
}],
88
"resource": {

hack/pods/file-mapping.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "test-file-mapping",
33
"containers" : [{
44
"name": "mapping",
5-
"image": "busybox",
5+
"image": "hyperhq/busybox",
66
"command": ["/bin/sh", "-c", "md5sum /root/resolv.conf"],
77
"volumes": [{
88
"volume": "resolv.conf",

hack/pods/hostname-err-char.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hostname": "/myname",
44
"containers" : [{
55
"name": "file-tester",
6-
"image": "busybox:latest",
6+
"image": "hyperhq/busybox:latest",
77
"workdir": "/",
88
"command": ["hostname"]
99
}],

hack/pods/hostname-err-long.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hostname": "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn",
44
"containers" : [{
55
"name": "file-tester",
6-
"image": "busybox:latest",
6+
"image": "hyperhq/busybox:latest",
77
"workdir": "/",
88
"command": ["hostname"]
99
}],

hack/pods/hostname.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"hostname": "myname",
44
"containers" : [{
55
"name": "file-tester",
6-
"image": "busybox:latest",
6+
"image": "hyperhq/busybox:latest",
77
"workdir": "/",
88
"command": ["hostname"]
99
}],

hack/pods/insert-file.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "test-inject-file",
33
"containers" : [{
44
"name": "file-tester",
5-
"image": "busybox:latest",
5+
"image": "hyperhq/busybox:latest",
66
"workdir": "/",
77
"command": ["/bin/sh", "-c", "cd /root/test/; md5sum resolv.conf logo.png t1 t2 t3"],
88
"files": [{

hack/pods/nfs-client.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"memory": 256
55
},
66
"containers": [{
7-
"image": "busybox",
7+
"image": "hyperhq/busybox",
88
"volumes": [{
99
"volume": "sharevolume",
1010
"path": "/export",

hack/pods/readonly-rootfs.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"containers" : [{
33
"name": "busybox-readonly",
4-
"image": "busybox",
4+
"image": "hyperhq/busybox",
55
"command": ["/bin/sh"],
66
"readonly": true,
77
"volumes": [{

hack/pods/service.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"containers": [
33
{
4-
"image": "busybox:latest",
4+
"image": "hyperhq/busybox:latest",
55
"name": "service",
66
"command": ["/bin/sh", "-c", "ps aux"]
77
}

hack/pods/simple-volume.pod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "test-remove-container-with-volume",
33
"containers" : [{
44
"name": "container-with-volume",
5-
"image": "busybox",
5+
"image": "hyperhq/busybox",
66
"volumes": [{
77
"volume": "tmp",
88
"path": "/mnt",

hack/pods/with-volume.pod

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "test-container-volume",
33
"containers" : [{
44
"name": "c1",
5-
"image": "busybox",
5+
"image": "hyperhq/busybox",
66
"command": ["/bin/sh", "-c", "grep -q 'hello, world' /mnt/with-volume-test-1 && df | grep -q '/var/log' && echo 'container 1 OK' ; sleep 5"],
77
"volumes": [{
88
"volume": "log",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"name": "c2",
19-
"image": "busybox",
19+
"image": "hyperhq/busybox",
2020
"workdir": "/",
2121
"command": ["/bin/sh", "-c", "echo 'container-2 OK' > /mnt/with-volume-test-2"],
2222
"volumes": [{

hack/test-cmd.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ __EOF__
160160
# Image management #
161161
######################
162162

163-
hyper::test::check_image busybox || hyper::test::pull_image busybox
164-
hyper::test::check_image busybox
163+
hyper::test::check_image "hyperhq/busybox" || hyper::test::pull_image "hyperhq/busybox"
164+
hyper::test::check_image "hyperhq/busybox"
165165

166-
hyper::test::remove_image busybox
167-
! hyper::test::check_image busybox
166+
hyper::test::remove_image "hyperhq/busybox"
167+
! hyper::test::check_image "hyperhq/busybox"
168168

169-
hyper::test::pull_image busybox
170-
hyper::test::check_image busybox
169+
hyper::test::pull_image "hyperhq/busybox"
170+
hyper::test::check_image "hyperhq/busybox"
171171

172172
hyper::test::pull_image "haproxy:1.5"
173173
hyper::test::check_image "haproxy" "1.5"

integration/hyper_test.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ func (s *TestSuite) TestGetContainerLogs(c *C) {
8484
}
8585

8686
func (s *TestSuite) TestPostAttach(c *C) {
87-
err := s.client.PullImage("busybox", "latest", nil)
87+
err := s.client.PullImage("hyperhq/busybox", "latest", nil)
8888
c.Assert(err, IsNil)
8989

9090
spec := types.UserPod{
9191
Containers: []*types.UserContainer{
9292
{
93-
Image: "busybox",
93+
Image: "hyperhq/busybox",
9494
},
9595
},
9696
}
@@ -132,7 +132,7 @@ func (s *TestSuite) TestCreateAndStartPod(c *C) {
132132
Id: "busybox",
133133
Containers: []*types.UserContainer{
134134
{
135-
Image: "busybox",
135+
Image: "hyperhq/busybox",
136136
},
137137
},
138138
}
@@ -168,7 +168,7 @@ func (s *TestSuite) TestCreateAndStartPod(c *C) {
168168
}
169169

170170
func (s *TestSuite) TestCreateContainer(c *C) {
171-
err := s.client.PullImage("busybox", "latest", nil)
171+
err := s.client.PullImage("hyperhq/busybox", "latest", nil)
172172
c.Assert(err, IsNil)
173173

174174
spec := types.UserPod{}
@@ -177,7 +177,7 @@ func (s *TestSuite) TestCreateContainer(c *C) {
177177
c.Logf("Pod created: %s", pod)
178178

179179
container, err := s.client.CreateContainer(pod, &types.UserContainer{
180-
Image: "busybox",
180+
Image: "hyperhq/busybox",
181181
})
182182
c.Assert(err, IsNil)
183183
c.Logf("Container created: %s", container)
@@ -191,7 +191,7 @@ func (s *TestSuite) TestCreateContainer(c *C) {
191191
}
192192

193193
func (s *TestSuite) TestRenameContainer(c *C) {
194-
err := s.client.PullImage("busybox", "latest", nil)
194+
err := s.client.PullImage("hyperhq/busybox", "latest", nil)
195195
c.Assert(err, IsNil)
196196

197197
spec := types.UserPod{}
@@ -200,7 +200,7 @@ func (s *TestSuite) TestRenameContainer(c *C) {
200200
c.Logf("Pod created: %s", pod)
201201

202202
container, err := s.client.CreateContainer(pod, &types.UserContainer{
203-
Image: "busybox",
203+
Image: "hyperhq/busybox",
204204
})
205205
c.Assert(err, IsNil)
206206
c.Logf("Container created: %s", container)
@@ -259,11 +259,11 @@ func (s *TestSuite) TestAddListDeleteService(c *C) {
259259
spec := types.UserPod{
260260
Containers: []*types.UserContainer{
261261
{
262-
Image: "busybox",
262+
Image: "hyperhq/busybox",
263263
Command: []string{"sleep", "10000"},
264264
},
265265
{
266-
Image: "busybox",
266+
Image: "hyperhq/busybox",
267267
Command: []string{"sleep", "10000"},
268268
},
269269
},
@@ -358,7 +358,7 @@ func (s *TestSuite) TestStartAndStopPod(c *C) {
358358
Id: "busybox",
359359
Containers: []*types.UserContainer{
360360
{
361-
Image: "busybox",
361+
Image: "hyperhq/busybox",
362362
},
363363
},
364364
}
@@ -391,7 +391,7 @@ func (s *TestSuite) TestSetPodLabels(c *C) {
391391
Id: "busybox",
392392
Containers: []*types.UserContainer{
393393
{
394-
Image: "busybox",
394+
Image: "hyperhq/busybox",
395395
},
396396
},
397397
}
@@ -419,7 +419,7 @@ func (s *TestSuite) TestPauseAndUnpausePod(c *C) {
419419
Id: "busybox",
420420
Containers: []*types.UserContainer{
421421
{
422-
Image: "busybox",
422+
Image: "hyperhq/busybox",
423423
},
424424
},
425425
}
@@ -466,7 +466,7 @@ func (s *TestSuite) TestGetPodStats(c *C) {
466466
Id: "busybox",
467467
Containers: []*types.UserContainer{
468468
{
469-
Image: "busybox",
469+
Image: "hyperhq/busybox",
470470
},
471471
},
472472
}
@@ -509,7 +509,7 @@ func (s *TestSuite) TestSendContainerSignal(c *C) {
509509
c.Assert(err, IsNil)
510510
}()
511511

512-
container, err := s.client.CreateContainer(pod, &types.UserContainer{Image: "busybox"})
512+
container, err := s.client.CreateContainer(pod, &types.UserContainer{Image: "hyperhq/busybox"})
513513
c.Assert(err, IsNil)
514514
c.Logf("Container created: %s", container)
515515

@@ -540,7 +540,7 @@ func (s *TestSuite) TestSendExecSignal(c *C) {
540540
Containers: []*types.UserContainer{
541541
{
542542
Name: cName,
543-
Image: "busybox",
543+
Image: "hyperhq/busybox",
544544
},
545545
},
546546
}
@@ -600,7 +600,7 @@ func (s *TestSuite) TestTTYResize(c *C) {
600600
Containers: []*types.UserContainer{
601601
{
602602
Name: cName,
603-
Image: "busybox",
603+
Image: "hyperhq/busybox",
604604
Tty: true,
605605
},
606606
},

0 commit comments

Comments
 (0)