diff options
author | James Falcon <james.falcon@canonical.com> | 2022-01-15 11:55:23 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 10:55:23 -0700 |
commit | b306633fd17e5ba0173ad3c41add59cb11884757 (patch) | |
tree | 51e97864d4ab610ac527b33a13fbca753664690b /tests/unittests/sources | |
parent | 73b1bb1f7665216053494717de27d7daf445d751 (diff) | |
download | vyos-cloud-init-b306633fd17e5ba0173ad3c41add59cb11884757.tar.gz vyos-cloud-init-b306633fd17e5ba0173ad3c41add59cb11884757.zip |
Ensure system_cfg read before ds net config on Oracle (SC-720) (#1174)
In 2c52e6e88b19f5db8d55eb7280ee27703e05d75f, the order of
reading network config was changed for Oracle due to initramfs
needing to take lower precedence than the datasource. However,
this also bumped system_cfg to a lower precedence than ds, which
means that any network configuration specified in /etc/cloud will not
be applied. system_cfg should instead be moved above ds so network
configuration in /etc/cloud takes precedence.
LP: #1956788
Diffstat (limited to 'tests/unittests/sources')
-rw-r--r-- | tests/unittests/sources/test_oracle.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/unittests/sources/test_oracle.py b/tests/unittests/sources/test_oracle.py index 356b3738..b3e6f10c 100644 --- a/tests/unittests/sources/test_oracle.py +++ b/tests/unittests/sources/test_oracle.py @@ -920,12 +920,14 @@ class TestNetworkConfig: assert network_config == m_read_initramfs_config.return_value assert "Failed to parse secondary network configuration" in caplog.text - def test_ds_network_cfg_preferred_over_initramfs(self, _m): - """Ensure that DS net config is preferred over initramfs config""" + def test_ds_network_cfg_order(self, _m): + """Ensure that DS net config is preferred over initramfs config + but less than system config.""" config_sources = oracle.DataSourceOracle.network_config_sources + system_idx = config_sources.index(NetworkConfigSource.system_cfg) ds_idx = config_sources.index(NetworkConfigSource.ds) initramfs_idx = config_sources.index(NetworkConfigSource.initramfs) - assert ds_idx < initramfs_idx + assert system_idx < ds_idx < initramfs_idx # vi: ts=4 expandtab |