mirror of https://github.com/docker/compose.git
Merge pull request #249 from d11wtq/performance/busybox_fixtures
Use busybox in fixtures, instead of ubuntu
This commit is contained in:
commit
f1390b3cb6
|
@ -1,3 +1,3 @@
|
||||||
definedinyamlnotyml:
|
definedinyamlnotyml:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
|
@ -1,6 +1,6 @@
|
||||||
simple:
|
simple:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
||||||
another:
|
another:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
yetanother:
|
yetanother:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
FROM ubuntu
|
FROM busybox:latest
|
||||||
CMD echo "success"
|
CMD echo "success"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
simple:
|
simple:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
||||||
another:
|
another:
|
||||||
image: ubuntu
|
image: busybox:latest
|
||||||
command: /bin/sleep 300
|
command: /bin/sleep 300
|
||||||
|
|
|
@ -10,7 +10,7 @@ class DockerClientTestCase(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.client = Client(docker_url())
|
cls.client = Client(docker_url())
|
||||||
cls.client.pull('ubuntu', tag='latest')
|
cls.client.pull('busybox', tag='latest')
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
for c in self.client.containers(all=True):
|
for c in self.client.containers(all=True):
|
||||||
|
@ -28,7 +28,7 @@ class DockerClientTestCase(unittest.TestCase):
|
||||||
project='figtest',
|
project='figtest',
|
||||||
name=name,
|
name=name,
|
||||||
client=self.client,
|
client=self.client,
|
||||||
image="ubuntu",
|
image="busybox:latest",
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ContainerTest(unittest.TestCase):
|
||||||
def test_from_ps(self):
|
def test_from_ps(self):
|
||||||
container = Container.from_ps(None, {
|
container = Container.from_ps(None, {
|
||||||
"Id":"abc",
|
"Id":"abc",
|
||||||
"Image":"ubuntu:12.04",
|
"Image":"busybox:latest",
|
||||||
"Command":"sleep 300",
|
"Command":"sleep 300",
|
||||||
"Created":1387384730,
|
"Created":1387384730,
|
||||||
"Status":"Up 8 seconds",
|
"Status":"Up 8 seconds",
|
||||||
|
@ -17,7 +17,7 @@ class ContainerTest(unittest.TestCase):
|
||||||
}, has_been_inspected=True)
|
}, has_been_inspected=True)
|
||||||
self.assertEqual(container.dictionary, {
|
self.assertEqual(container.dictionary, {
|
||||||
"ID": "abc",
|
"ID": "abc",
|
||||||
"Image":"ubuntu:12.04",
|
"Image":"busybox:latest",
|
||||||
"Name": "/figtest_db_1",
|
"Name": "/figtest_db_1",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class ContainerTest(unittest.TestCase):
|
||||||
def test_number(self):
|
def test_number(self):
|
||||||
container = Container.from_ps(None, {
|
container = Container.from_ps(None, {
|
||||||
"Id":"abc",
|
"Id":"abc",
|
||||||
"Image":"ubuntu:12.04",
|
"Image":"busybox:latest",
|
||||||
"Command":"sleep 300",
|
"Command":"sleep 300",
|
||||||
"Created":1387384730,
|
"Created":1387384730,
|
||||||
"Status":"Up 8 seconds",
|
"Status":"Up 8 seconds",
|
||||||
|
@ -53,7 +53,7 @@ class ContainerTest(unittest.TestCase):
|
||||||
def test_name(self):
|
def test_name(self):
|
||||||
container = Container.from_ps(None, {
|
container = Container.from_ps(None, {
|
||||||
"Id":"abc",
|
"Id":"abc",
|
||||||
"Image":"ubuntu:12.04",
|
"Image":"busybox:latest",
|
||||||
"Command":"sleep 300",
|
"Command":"sleep 300",
|
||||||
"Names":["/figtest_db_1"]
|
"Names":["/figtest_db_1"]
|
||||||
}, has_been_inspected=True)
|
}, has_been_inspected=True)
|
||||||
|
@ -62,7 +62,7 @@ class ContainerTest(unittest.TestCase):
|
||||||
def test_name_without_project(self):
|
def test_name_without_project(self):
|
||||||
container = Container.from_ps(None, {
|
container = Container.from_ps(None, {
|
||||||
"Id":"abc",
|
"Id":"abc",
|
||||||
"Image":"ubuntu:12.04",
|
"Image":"busybox:latest",
|
||||||
"Command":"sleep 300",
|
"Command":"sleep 300",
|
||||||
"Names":["/figtest_db_1"]
|
"Names":["/figtest_db_1"]
|
||||||
}, has_been_inspected=True)
|
}, has_been_inspected=True)
|
||||||
|
|
|
@ -8,29 +8,29 @@ class ProjectTest(unittest.TestCase):
|
||||||
project = Project.from_dicts('figtest', [
|
project = Project.from_dicts('figtest', [
|
||||||
{
|
{
|
||||||
'name': 'web',
|
'name': 'web',
|
||||||
'image': 'ubuntu'
|
'image': 'busybox:latest'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'db',
|
'name': 'db',
|
||||||
'image': 'ubuntu'
|
'image': 'busybox:latest'
|
||||||
}
|
},
|
||||||
], None)
|
], None)
|
||||||
self.assertEqual(len(project.services), 2)
|
self.assertEqual(len(project.services), 2)
|
||||||
self.assertEqual(project.get_service('web').name, 'web')
|
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').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):
|
def test_from_dict_sorts_in_dependency_order(self):
|
||||||
project = Project.from_dicts('figtest', [
|
project = Project.from_dicts('figtest', [
|
||||||
{
|
{
|
||||||
'name': 'web',
|
'name': 'web',
|
||||||
'image': 'ubuntu',
|
'image': 'busybox:latest',
|
||||||
'links': ['db'],
|
'links': ['db'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'db',
|
'name': 'db',
|
||||||
'image': 'ubuntu'
|
'image': 'busybox:latest'
|
||||||
}
|
}
|
||||||
], None)
|
], None)
|
||||||
|
|
||||||
|
@ -40,22 +40,22 @@ class ProjectTest(unittest.TestCase):
|
||||||
def test_from_config(self):
|
def test_from_config(self):
|
||||||
project = Project.from_config('figtest', {
|
project = Project.from_config('figtest', {
|
||||||
'web': {
|
'web': {
|
||||||
'image': 'ubuntu',
|
'image': 'busybox:latest',
|
||||||
},
|
},
|
||||||
'db': {
|
'db': {
|
||||||
'image': 'ubuntu',
|
'image': 'busybox:latest',
|
||||||
},
|
},
|
||||||
}, None)
|
}, None)
|
||||||
self.assertEqual(len(project.services), 2)
|
self.assertEqual(len(project.services), 2)
|
||||||
self.assertEqual(project.get_service('web').name, 'web')
|
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').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):
|
def test_from_config_throws_error_when_not_dict(self):
|
||||||
with self.assertRaises(ConfigurationError):
|
with self.assertRaises(ConfigurationError):
|
||||||
project = Project.from_config('figtest', {
|
project = Project.from_config('figtest', {
|
||||||
'web': 'ubuntu',
|
'web': 'busybox:latest',
|
||||||
}, None)
|
}, None)
|
||||||
|
|
||||||
def test_get_service(self):
|
def test_get_service(self):
|
||||||
|
@ -63,7 +63,7 @@ class ProjectTest(unittest.TestCase):
|
||||||
project='figtest',
|
project='figtest',
|
||||||
name='web',
|
name='web',
|
||||||
client=None,
|
client=None,
|
||||||
image="ubuntu",
|
image="busybox:latest",
|
||||||
)
|
)
|
||||||
project = Project('test', [web], None)
|
project = Project('test', [web], None)
|
||||||
self.assertEqual(project.get_service('web'), web)
|
self.assertEqual(project.get_service('web'), web)
|
||||||
|
|
Loading…
Reference in New Issue