summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRyan Belgrave <Ryan.Belgrave@target.com>2016-10-17 15:26:45 -0500
committerRyan Belgrave <Ryan.Belgrave@target.com>2016-11-08 09:45:32 -0600
commit98e2e1fcd629c161c09be9abd67dd0f4194feb38 (patch)
treedb6a5f529f6ff366fe93c75db2ceac4e3d3373bd /tests
parentbd10874bc95e673ed262e9c7d3df474e8eaf2d9c (diff)
downloaddocker-py-98e2e1fcd629c161c09be9abd67dd0f4194feb38.tar.gz
Add labels and shmsize arguments to the image build
Signed-off-by: Ryan Belgrave <Ryan.Belgrave@target.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/build_test.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/integration/build_test.py b/tests/integration/build_test.py
index 699345f..2695b92 100644
--- a/tests/integration/build_test.py
+++ b/tests/integration/build_test.py
@@ -118,6 +118,44 @@ class BuildTest(BaseIntegrationTest):
info = self.client.inspect_image('buildargs')
self.assertEqual(info['Config']['User'], 'OK')
+ @requires_api_version('1.22')
+ def test_build_shmsize(self):
+ script = io.BytesIO('\n'.join([
+ 'FROM scratch',
+ 'CMD sh -c "echo \'Hello, World!\'"',
+ ]).encode('ascii'))
+
+ tag = 'shmsize'
+ shmsize = 134217728
+
+ stream = self.client.build(
+ fileobj=script, tag=tag, shmsize=shmsize
+ )
+ self.tmp_imgs.append(tag)
+ for chunk in stream:
+ pass
+
+ # There is currently no way to get the shmsize
+ # that was used to build the image
+
+ @requires_api_version('1.23')
+ def test_build_labels(self):
+ script = io.BytesIO('\n'.join([
+ 'FROM scratch',
+ ]).encode('ascii'))
+
+ labels = {'test': 'OK'}
+
+ stream = self.client.build(
+ fileobj=script, tag='labels', labels=labels
+ )
+ self.tmp_imgs.append('labels')
+ for chunk in stream:
+ pass
+
+ info = self.client.inspect_image('labels')
+ self.assertEqual(info['Config']['Labels'], labels)
+
def test_build_stderr_data(self):
control_chars = ['\x1b[91m', '\x1b[0m']
snippet = 'Ancient Temple (Mystic Oriental Dream ~ Ancient Temple)'