diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2019-09-27 14:48:52 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-09-27 14:48:52 +0000 |
commit | 762f230cb37bdceaed3fb264e9cede48c2749d3f (patch) | |
tree | f56af9a8741d3f9b6c140f2cf53ef72fbfd5d0a6 /tests/unittests | |
parent | f80f7f0d82eaf05e68419c7ac87bf5d4c934b796 (diff) | |
download | vyos-cloud-init-762f230cb37bdceaed3fb264e9cede48c2749d3f.tar.gz vyos-cloud-init-762f230cb37bdceaed3fb264e9cede48c2749d3f.zip |
ovf: do not generate random instance-id for IMC customization path
Cloud-init will not operate properly if the instance-id value changes
on each boot. This is the source of a number of behavioral bugs filed
against cloud-init with OVF datasource. Instead, use a static instance-id
value, iid-vmware-imc, similar to iid-dsovf.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_vmware_config_file.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unittests/test_vmware_config_file.py b/tests/unittests/test_vmware_config_file.py index f47335ea..16343ed2 100644 --- a/tests/unittests/test_vmware_config_file.py +++ b/tests/unittests/test_vmware_config_file.py @@ -62,13 +62,13 @@ class TestVmwareConfigFile(CiTestCase): (md1, _, _) = read_vmware_imc(conf) self.assertIn(instance_id_prefix, md1["instance-id"]) - self.assertEqual(len(md1["instance-id"]), len(instance_id_prefix) + 8) + self.assertEqual(md1["instance-id"], 'iid-vmware-imc') (md2, _, _) = read_vmware_imc(conf) self.assertIn(instance_id_prefix, md2["instance-id"]) - self.assertEqual(len(md2["instance-id"]), len(instance_id_prefix) + 8) + self.assertEqual(md2["instance-id"], 'iid-vmware-imc') - self.assertNotEqual(md1["instance-id"], md2["instance-id"]) + self.assertEqual(md2["instance-id"], md1["instance-id"]) def test_configfile_static_2nics(self): """Tests Config class for a configuration with two static NICs.""" |