summaryrefslogtreecommitdiff
path: root/cloudinit/sources/tests/test_oracle.py
diff options
context:
space:
mode:
authorJames Falcon <therealfalcon@gmail.com>2021-09-17 13:04:07 -0500
committerGitHub <noreply@github.com>2021-09-17 13:04:07 -0500
commit612e39087aee3b1242765e7c4f463f54a6ebd723 (patch)
tree27112d8462d1f414c61717a7500dc264ab96c2ac /cloudinit/sources/tests/test_oracle.py
parentcb82a4508a4c56c3814fa633166d944762071bcf (diff)
downloadvyos-cloud-init-612e39087aee3b1242765e7c4f463f54a6ebd723.tar.gz
vyos-cloud-init-612e39087aee3b1242765e7c4f463f54a6ebd723.zip
Add connectivity_url to Oracle's EphemeralDHCPv4 (#988)
Add connectivity_url to Oracle's EphemeralDHCPv4 On bionic, when trying to bring up the EphemeralDHCPv4, it's possible that we already have a route defined, which will result in an error when trying to add the DHCP route. Use the connectivity_url to check if we can reach the metadata service, and if so, skip the EphemeralDHCPv4. The has_url_connectivity function has also been modified to take a dict of kwargs to send to readurl. LP: #1939603
Diffstat (limited to 'cloudinit/sources/tests/test_oracle.py')
-rw-r--r--cloudinit/sources/tests/test_oracle.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/cloudinit/sources/tests/test_oracle.py b/cloudinit/sources/tests/test_oracle.py
index dcf33b9b..5f608cbb 100644
--- a/cloudinit/sources/tests/test_oracle.py
+++ b/cloudinit/sources/tests/test_oracle.py
@@ -694,7 +694,15 @@ class TestNonIscsiRoot_GetDataBehaviour:
assert oracle_ds._get_data()
assert [
- mock.call(m_find_fallback_nic.return_value)
+ mock.call(
+ iface=m_find_fallback_nic.return_value,
+ connectivity_url_data={
+ 'headers': {
+ 'Authorization': 'Bearer Oracle'
+ },
+ 'url': 'http://169.254.169.254/opc/v2/instance/'
+ }
+ )
] == m_EphemeralDHCPv4.call_args_list