From 3a342fb25d3bc82a56ad66c2f4f8f58529a9394c Mon Sep 17 00:00:00 2001 From: d11wtq Date: Wed, 11 Jun 2014 10:25:50 +0000 Subject: [PATCH] Use busybox in fixtures, instead of ubuntu Signed-off-by: d11wtq --- .../fixtures/longer-filename-figfile/fig.yaml | 2 +- tests/fixtures/multiple-figfiles/fig.yml | 4 +-- tests/fixtures/multiple-figfiles/fig2.yml | 2 +- tests/fixtures/simple-dockerfile/Dockerfile | 2 +- tests/fixtures/simple-figfile/fig.yml | 4 +-- tests/integration/testcases.py | 4 +-- tests/unit/container_test.py | 10 +++---- tests/unit/project_test.py | 26 +++++++++---------- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/fixtures/longer-filename-figfile/fig.yaml b/tests/fixtures/longer-filename-figfile/fig.yaml index 81efaa2a8..315289402 100644 --- a/tests/fixtures/longer-filename-figfile/fig.yaml +++ b/tests/fixtures/longer-filename-figfile/fig.yaml @@ -1,3 +1,3 @@ definedinyamlnotyml: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 \ No newline at end of file diff --git a/tests/fixtures/multiple-figfiles/fig.yml b/tests/fixtures/multiple-figfiles/fig.yml index 225323755..3538ab097 100644 --- a/tests/fixtures/multiple-figfiles/fig.yml +++ b/tests/fixtures/multiple-figfiles/fig.yml @@ -1,6 +1,6 @@ simple: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 another: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 diff --git a/tests/fixtures/multiple-figfiles/fig2.yml b/tests/fixtures/multiple-figfiles/fig2.yml index 330ed771d..523becac2 100644 --- a/tests/fixtures/multiple-figfiles/fig2.yml +++ b/tests/fixtures/multiple-figfiles/fig2.yml @@ -1,3 +1,3 @@ yetanother: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 diff --git a/tests/fixtures/simple-dockerfile/Dockerfile b/tests/fixtures/simple-dockerfile/Dockerfile index b7fd870f0..d1ceac6b7 100644 --- a/tests/fixtures/simple-dockerfile/Dockerfile +++ b/tests/fixtures/simple-dockerfile/Dockerfile @@ -1,2 +1,2 @@ -FROM ubuntu +FROM busybox:latest CMD echo "success" diff --git a/tests/fixtures/simple-figfile/fig.yml b/tests/fixtures/simple-figfile/fig.yml index 225323755..3538ab097 100644 --- a/tests/fixtures/simple-figfile/fig.yml +++ b/tests/fixtures/simple-figfile/fig.yml @@ -1,6 +1,6 @@ simple: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 another: - image: ubuntu + image: busybox:latest command: /bin/sleep 300 diff --git a/tests/integration/testcases.py b/tests/integration/testcases.py index f913b7c3e..ba6bb3008 100644 --- a/tests/integration/testcases.py +++ b/tests/integration/testcases.py @@ -10,7 +10,7 @@ class DockerClientTestCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.client = Client(docker_url()) - cls.client.pull('ubuntu', tag='latest') + cls.client.pull('busybox', tag='latest') def setUp(self): for c in self.client.containers(all=True): @@ -28,7 +28,7 @@ class DockerClientTestCase(unittest.TestCase): project='figtest', name=name, client=self.client, - image="ubuntu", + image="busybox:latest", **kwargs ) diff --git a/tests/unit/container_test.py b/tests/unit/container_test.py index 445892418..cb6053e46 100644 --- a/tests/unit/container_test.py +++ b/tests/unit/container_test.py @@ -6,7 +6,7 @@ class ContainerTest(unittest.TestCase): def test_from_ps(self): container = Container.from_ps(None, { "Id":"abc", - "Image":"ubuntu:12.04", + "Image":"busybox:latest", "Command":"sleep 300", "Created":1387384730, "Status":"Up 8 seconds", @@ -17,7 +17,7 @@ class ContainerTest(unittest.TestCase): }, has_been_inspected=True) self.assertEqual(container.dictionary, { "ID": "abc", - "Image":"ubuntu:12.04", + "Image":"busybox:latest", "Name": "/figtest_db_1", }) @@ -39,7 +39,7 @@ class ContainerTest(unittest.TestCase): def test_number(self): container = Container.from_ps(None, { "Id":"abc", - "Image":"ubuntu:12.04", + "Image":"busybox:latest", "Command":"sleep 300", "Created":1387384730, "Status":"Up 8 seconds", @@ -53,7 +53,7 @@ class ContainerTest(unittest.TestCase): def test_name(self): container = Container.from_ps(None, { "Id":"abc", - "Image":"ubuntu:12.04", + "Image":"busybox:latest", "Command":"sleep 300", "Names":["/figtest_db_1"] }, has_been_inspected=True) @@ -62,7 +62,7 @@ class ContainerTest(unittest.TestCase): def test_name_without_project(self): container = Container.from_ps(None, { "Id":"abc", - "Image":"ubuntu:12.04", + "Image":"busybox:latest", "Command":"sleep 300", "Names":["/figtest_db_1"] }, has_been_inspected=True) diff --git a/tests/unit/project_test.py b/tests/unit/project_test.py index 4a2ad1422..bba2e1f51 100644 --- a/tests/unit/project_test.py +++ b/tests/unit/project_test.py @@ -8,29 +8,29 @@ class ProjectTest(unittest.TestCase): project = Project.from_dicts('figtest', [ { 'name': 'web', - 'image': 'ubuntu' + 'image': 'busybox:latest' }, { 'name': 'db', - 'image': 'ubuntu' - } + 'image': 'busybox:latest' + }, ], None) self.assertEqual(len(project.services), 2) self.assertEqual(project.get_service('web').name, 'web') - self.assertEqual(project.get_service('web').options['image'], 'ubuntu') + self.assertEqual(project.get_service('web').options['image'], 'busybox:latest') self.assertEqual(project.get_service('db').name, 'db') - self.assertEqual(project.get_service('db').options['image'], 'ubuntu') + self.assertEqual(project.get_service('db').options['image'], 'busybox:latest') def test_from_dict_sorts_in_dependency_order(self): project = Project.from_dicts('figtest', [ { 'name': 'web', - 'image': 'ubuntu', + 'image': 'busybox:latest', 'links': ['db'], }, { 'name': 'db', - 'image': 'ubuntu' + 'image': 'busybox:latest' } ], None) @@ -40,22 +40,22 @@ class ProjectTest(unittest.TestCase): def test_from_config(self): project = Project.from_config('figtest', { 'web': { - 'image': 'ubuntu', + 'image': 'busybox:latest', }, 'db': { - 'image': 'ubuntu', + 'image': 'busybox:latest', }, }, None) self.assertEqual(len(project.services), 2) self.assertEqual(project.get_service('web').name, 'web') - self.assertEqual(project.get_service('web').options['image'], 'ubuntu') + self.assertEqual(project.get_service('web').options['image'], 'busybox:latest') self.assertEqual(project.get_service('db').name, 'db') - self.assertEqual(project.get_service('db').options['image'], 'ubuntu') + self.assertEqual(project.get_service('db').options['image'], 'busybox:latest') def test_from_config_throws_error_when_not_dict(self): with self.assertRaises(ConfigurationError): project = Project.from_config('figtest', { - 'web': 'ubuntu', + 'web': 'busybox:latest', }, None) def test_get_service(self): @@ -63,7 +63,7 @@ class ProjectTest(unittest.TestCase): project='figtest', name='web', client=None, - image="ubuntu", + image="busybox:latest", ) project = Project('test', [web], None) self.assertEqual(project.get_service('web'), web)