Add in memswap_limit run option
By allowing the memswap_limit option to be defined we also need to check that mem_limit is set, you can't have swap without a limit. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
20218394b9
commit
fc26982132
4 changed files with 39 additions and 1 deletions
|
|
@ -155,6 +155,13 @@ class ServiceTest(unittest.TestCase):
|
|||
self.assertEqual(opts['hostname'], 'name', 'hostname')
|
||||
self.assertFalse('domainname' in opts, 'domainname')
|
||||
|
||||
def test_memory_swap_limit(self):
|
||||
service = Service(name='foo', image='foo', hostname='name', client=self.mock_client, mem_limit=1000000000, memswap_limit=2000000000)
|
||||
self.mock_client.containers.return_value = []
|
||||
opts = service._get_container_create_options({'some': 'overrides'}, 1)
|
||||
self.assertEqual(opts['memswap_limit'], 2000000000)
|
||||
self.assertEqual(opts['mem_limit'], 1000000000)
|
||||
|
||||
def test_split_domainname_fqdn(self):
|
||||
service = Service(
|
||||
'foo',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue