Merge pull request #2647 from shin-/preexisting_volume_detection_rb1
Support for external volumes
This commit is contained in:
commit
153185eadb
7 changed files with 188 additions and 17 deletions
|
|
@ -775,6 +775,37 @@ class ConfigTest(unittest.TestCase):
|
|||
'extends': {'service': 'foo'}
|
||||
}
|
||||
|
||||
def test_external_volume_config(self):
|
||||
config_details = build_config_details({
|
||||
'version': 2,
|
||||
'services': {
|
||||
'bogus': {'image': 'busybox'}
|
||||
},
|
||||
'volumes': {
|
||||
'ext': {'external': True},
|
||||
'ext2': {'external': {'name': 'aliased'}}
|
||||
}
|
||||
})
|
||||
config_result = config.load(config_details)
|
||||
volumes = config_result.volumes
|
||||
assert 'ext' in volumes
|
||||
assert volumes['ext']['external'] is True
|
||||
assert 'ext2' in volumes
|
||||
assert volumes['ext2']['external']['name'] == 'aliased'
|
||||
|
||||
def test_external_volume_invalid_config(self):
|
||||
config_details = build_config_details({
|
||||
'version': 2,
|
||||
'services': {
|
||||
'bogus': {'image': 'busybox'}
|
||||
},
|
||||
'volumes': {
|
||||
'ext': {'external': True, 'driver': 'foo'}
|
||||
}
|
||||
})
|
||||
with self.assertRaises(ConfigurationError):
|
||||
config.load(config_details)
|
||||
|
||||
|
||||
class PortsTest(unittest.TestCase):
|
||||
INVALID_PORTS_TYPES = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue