diff options
| author | Ryan Belgrave <Ryan.Belgrave@target.com> | 2016-10-17 15:26:45 -0500 |
|---|---|---|
| committer | Ryan Belgrave <Ryan.Belgrave@target.com> | 2016-11-08 09:45:32 -0600 |
| commit | 98e2e1fcd629c161c09be9abd67dd0f4194feb38 (patch) | |
| tree | db6a5f529f6ff366fe93c75db2ceac4e3d3373bd /tests | |
| parent | bd10874bc95e673ed262e9c7d3df474e8eaf2d9c (diff) | |
| download | docker-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.py | 38 |
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)' |
