diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-03-01 00:19:55 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-03-01 00:19:55 -0500 |
commit | 14915526ca67bbf7842028d48170015b85f87469 (patch) | |
tree | b355f852bc8a585513eb7651f58ccbf54dd64460 /tests/unittests/test_handler/test_handler_lxd.py | |
parent | b7a6e92274bb0d146c4637a78128bc771f2612e9 (diff) | |
download | vyos-cloud-init-14915526ca67bbf7842028d48170015b85f87469.tar.gz vyos-cloud-init-14915526ca67bbf7842028d48170015b85f87469.zip |
lxd: general fix after testing
A few changes:
a.) change to using '--name=value' rather than '--name' 'value'
b.) make sure only strings are passed to command
(useful for storage_create_loop: which is likely an integer)
c.) document simple working example
d.) support installing zfs if not present and storage_backedn has it.
Diffstat (limited to 'tests/unittests/test_handler/test_handler_lxd.py')
-rw-r--r-- | tests/unittests/test_handler/test_handler_lxd.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/unittests/test_handler/test_handler_lxd.py b/tests/unittests/test_handler/test_handler_lxd.py index 4d858b8f..65794a41 100644 --- a/tests/unittests/test_handler/test_handler_lxd.py +++ b/tests/unittests/test_handler/test_handler_lxd.py @@ -43,9 +43,10 @@ class TestLxd(t_help.TestCase): self.assertTrue(mock_util.which.called) init_call = mock_util.subp.call_args_list[0][0][0] self.assertEquals(init_call, - ['lxd', 'init', '--auto', '--network-address', - '0.0.0.0', '--storage-backend', 'zfs', - '--storage-pool', 'poolname']) + ['lxd', 'init', '--auto', + '--network-address=0.0.0.0', + '--storage-backend=zfs', + '--storage-pool=poolname']) @mock.patch("cloudinit.config.cc_lxd.util") def test_lxd_install(self, mock_util): @@ -55,4 +56,4 @@ class TestLxd(t_help.TestCase): cc_lxd.handle('cc_lxd', self.lxd_cfg, cc, LOG, []) self.assertTrue(cc.distro.install_packages.called) install_pkg = cc.distro.install_packages.call_args_list[0][0][0] - self.assertEquals(install_pkg, ('lxd',)) + self.assertEquals(sorted(install_pkg), ['lxd', 'zfs']) |