diff options
author | Scott Moser <smoser@ubuntu.com> | 2018-09-26 21:29:27 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2018-09-26 21:29:27 +0000 |
commit | facb92c5b55f4d27ee971eaf49c580fbf92ac2c3 (patch) | |
tree | 0dbb6503066167ec4b50b2c58b687c8bde8aec88 /tests/unittests | |
parent | fd873fa83fb5ca9c6d5f22a7bec6a308448c77ff (diff) | |
download | vyos-cloud-init-facb92c5b55f4d27ee971eaf49c580fbf92ac2c3.tar.gz vyos-cloud-init-facb92c5b55f4d27ee971eaf49c580fbf92ac2c3.zip |
lxd: adjust to snap installed lxd.
Relax expectation on path to lxc and lxd. The deb path still does
install them in /usr/bin/ but that is overly pedantic.
Add a 'lxd waitready' (present since lxd 0.5) to wait until lxd
is ready before operating on it.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_handler/test_handler_lxd.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/unittests/test_handler/test_handler_lxd.py b/tests/unittests/test_handler/test_handler_lxd.py index 4dd7e09f..2478ebc4 100644 --- a/tests/unittests/test_handler/test_handler_lxd.py +++ b/tests/unittests/test_handler/test_handler_lxd.py @@ -43,12 +43,12 @@ class TestLxd(t_help.CiTestCase): self.assertTrue(mock_util.which.called) # no bridge config, so maybe_cleanup should not be called. self.assertFalse(m_maybe_clean.called) - init_call = mock_util.subp.call_args_list[0][0][0] - self.assertEqual(init_call, - ['lxd', 'init', '--auto', - '--network-address=0.0.0.0', - '--storage-backend=zfs', - '--storage-pool=poolname']) + self.assertEqual( + [mock.call(['lxd', 'waitready', '--timeout=300']), + mock.call( + ['lxd', 'init', '--auto', '--network-address=0.0.0.0', + '--storage-backend=zfs', '--storage-pool=poolname'])], + mock_util.subp.call_args_list) @mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default") @mock.patch("cloudinit.config.cc_lxd.util") |