Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ integration-test-py3: build-py3
docker run -v `$(HOST_TMPDIR)`:/tmp -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test -rxs tests/integration_test.py

integration-dind: build build-py3
docker build -t dpy-tests -f ./tests/Dockerfile .
docker run -d --name dpy-dind -v /tmp --privileged dockerswarm/dind:1.8.1 docker -d -H tcp://0.0.0.0:2375
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being done as part of the jenkins config? Maybe just change this to a comment so that users can run it locally ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just unneeded, and I forgot to remove it - we already have Dockerfiles for building docker-py at the root.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, so should the integration-dind target depend on build and build-py3 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! Already does!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, right!

docker run --volumes-from dpy-dind --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py py.test -rxs tests/integration_test.py
docker run --volumes-from dpy-dind --env="DOCKER_HOST=tcp://docker:2375" --link=dpy-dind:docker docker-py3 py.test -rxs tests/integration_test.py
Expand Down
28 changes: 12 additions & 16 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def setUp(self):
if six.PY2:
self.assertRegex = self.assertRegexpMatches
self.assertCountEqual = self.assertItemsEqual
self.client = docker_client(timeout=5)
self.client = docker_client(timeout=60)
self.tmp_imgs = []
self.tmp_containers = []
self.tmp_folders = []
Expand Down Expand Up @@ -1115,38 +1115,36 @@ def runTest(self):

class TestPull(BaseTestCase):
def runTest(self):
self.client.close()
self.client = docker_client(timeout=10)
try:
self.client.remove_image('busybox')
self.client.remove_image('hello-world')
except docker.errors.APIError:
pass
res = self.client.pull('busybox')
res = self.client.pull('hello-world')
self.tmp_imgs.append('hello-world')
self.assertEqual(type(res), six.text_type)
self.assertGreaterEqual(
len(self.client.images('busybox')), 1
len(self.client.images('hello-world')), 1
)
img_info = self.client.inspect_image('busybox')
img_info = self.client.inspect_image('hello-world')
self.assertIn('Id', img_info)


class TestPullStream(BaseTestCase):
def runTest(self):
self.client.close()
self.client = docker_client(timeout=10)
try:
self.client.remove_image('busybox')
self.client.remove_image('hello-world')
except docker.errors.APIError:
pass
stream = self.client.pull('busybox', stream=True)
stream = self.client.pull('hello-world', stream=True)
self.tmp_imgs.append('hello-world')
for chunk in stream:
if six.PY3:
chunk = chunk.decode('utf-8')
json.loads(chunk) # ensure chunk is a single, valid JSON blob
self.assertGreaterEqual(
len(self.client.images('busybox')), 1
len(self.client.images('hello-world')), 1
)
img_info = self.client.inspect_image('busybox')
img_info = self.client.inspect_image('hello-world')
self.assertIn('Id', img_info)


Expand Down Expand Up @@ -1195,9 +1193,7 @@ def runTest(self):
class ImportTestCase(BaseTestCase):
'''Base class for `docker import` test cases.'''

# Use a large file size to increase the chance of triggering any
# MemoryError exceptions we might hit.
TAR_SIZE = 512 * 1024 * 1024
TAR_SIZE = 512 * 1024

def write_dummy_tar_content(self, n_bytes, tar_fd):
def extend_file(f, n_bytes):
Expand Down