Skip to content

Commit

Permalink
test_docker_compose.py: Test the volume mount feature
Browse files Browse the repository at this point in the history
Extend docker_compose_test() to expose /bin on the host to the container
through a volume mount and verify that /bin/busybox can be downloaded and
contains the right data.

Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
jacmet committed May 14, 2021
1 parent 4915b69 commit aa31d10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion support/testing/conf/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: '3'
services:
busybox:
image: "busybox:latest"
command: httpd -f -h /etc/
command: httpd -f -h /www/
ports:
- "80:80"
volumes:
- "/bin:/www"
3 changes: 2 additions & 1 deletion support/testing/tests/package/test_docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def docker_compose_test(self):
self.assertRunOk('docker-compose up -d', 120)
# container may take some time to start
self.assertRunOk('while ! docker inspect root_busybox_1 2>&1 >/dev/null; do sleep 1; done', 120)
self.assertRunOk('wget http://127.0.0.1/resolv.conf', 120)
self.assertRunOk('wget -O /tmp/busybox http://127.0.0.1/busybox', 120)
self.assertRunOk('cmp /bin/busybox /tmp/busybox', 120)

def test_run(self):
kernel = os.path.join(self.builddir, "images", "bzImage")
Expand Down

0 comments on commit aa31d10

Please sign in to comment.