Skip to content

Commit

Permalink
refresh no-nocloud-network.patch for additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blackboxsw committed Sep 6, 2024
1 parent 6cd3267 commit 6d6f4b4
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions debian/patches/no-nocloud-network.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Last-Update: 2024-08-02

--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -190,7 +190,7 @@ class DataSourceNoCloud(sources.DataSour
@@ -190,7 +190,7 @@

# This could throw errors, but the user told us to do it
# so if errors are raised, let them raise
Expand All @@ -16,7 +16,7 @@ Last-Update: 2024-08-02
LOG.debug("Using seeded cache data from %s", seedfrom)

# Values in the command line override those from the seed
@@ -199,7 +199,6 @@ class DataSourceNoCloud(sources.DataSour
@@ -199,7 +199,6 @@
)
mydata["user-data"] = ud
mydata["vendor-data"] = vd
Expand All @@ -26,15 +26,15 @@ Last-Update: 2024-08-02
# Now that we have exhausted any other places merge in the defaults
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1059,7 +1059,6 @@ def read_seeded(base="", ext="", timeout
@@ -1059,7 +1059,6 @@
ud_url = base.replace("%s", "user-data" + ext)
vd_url = base.replace("%s", "vendor-data" + ext)
md_url = base.replace("%s", "meta-data" + ext)
- network_url = base.replace("%s", "network-config" + ext)
else:
if features.NOCLOUD_SEED_URL_APPEND_FORWARD_SLASH:
if base[-1] != "/" and parse.urlparse(base).query == "":
@@ -1068,17 +1067,7 @@ def read_seeded(base="", ext="", timeout
@@ -1068,17 +1067,7 @@
ud_url = "%s%s%s" % (base, "user-data", ext)
vd_url = "%s%s%s" % (base, "vendor-data", ext)
md_url = "%s%s%s" % (base, "meta-data", ext)
Expand All @@ -54,7 +54,16 @@ Last-Update: 2024-08-02
)
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -2536,7 +2536,7 @@ class TestReadSeeded:
@@ -2481,7 +2481,7 @@
{
"meta-data": {"md": "val"},
"user-data": b"ud",
- "network-config": {"net": "cfg"},
+ "network-config": None,
"vendor-data": None,
},
True,
@@ -2536,7 +2536,7 @@
assert found_md == {"key1": "val1"}
assert found_ud == ud
assert found_vd == vd
Expand All @@ -63,47 +72,47 @@ Last-Update: 2024-08-02

@pytest.mark.parametrize(
"base, feature_flag, req_urls",
@@ -2545,7 +2545,6 @@ class TestReadSeeded:
@@ -2545,7 +2545,6 @@
"http://10.0.0.1/%s?qs=1",
True,
[
- "http://10.0.0.1/network-config?qs=1",
"http://10.0.0.1/meta-data?qs=1",
"http://10.0.0.1/user-data?qs=1",
"http://10.0.0.1/vendor-data?qs=1",
@@ -2556,7 +2555,6 @@ class TestReadSeeded:
@@ -2556,7 +2555,6 @@
"https://10.0.0.1:8008/",
True,
[
- "https://10.0.0.1:8008/network-config",
"https://10.0.0.1:8008/meta-data",
"https://10.0.0.1:8008/user-data",
"https://10.0.0.1:8008/vendor-data",
@@ -2567,7 +2565,6 @@ class TestReadSeeded:
@@ -2567,7 +2565,6 @@
"https://10.0.0.1:8008",
True,
[
- "https://10.0.0.1:8008/network-config",
"https://10.0.0.1:8008/meta-data",
"https://10.0.0.1:8008/user-data",
"https://10.0.0.1:8008/vendor-data",
@@ -2578,7 +2575,6 @@ class TestReadSeeded:
@@ -2578,7 +2575,6 @@
"https://10.0.0.1:8008",
False,
[
- "https://10.0.0.1:8008network-config",
"https://10.0.0.1:8008meta-data",
"https://10.0.0.1:8008user-data",
"https://10.0.0.1:8008vendor-data",
@@ -2589,7 +2585,6 @@ class TestReadSeeded:
@@ -2589,7 +2585,6 @@
"https://10.0.0.1:8008?qs=",
True,
[
- "https://10.0.0.1:8008?qs=network-config",
"https://10.0.0.1:8008?qs=meta-data",
"https://10.0.0.1:8008?qs=user-data",
"https://10.0.0.1:8008?qs=vendor-data",
@@ -2628,7 +2623,7 @@ class TestReadSeeded:
@@ -2628,7 +2623,7 @@
# user-data, vendor-data read raw. It could be scripts or other format
assert found_ud == "/user-data: 1"
assert found_vd == "/vendor-data: 1"
Expand All @@ -112,7 +121,7 @@ Last-Update: 2024-08-02
assert [
mock.call(req_url, timeout=5, retries=10) for req_url in req_urls
] == m_read.call_args_list
@@ -2658,7 +2653,7 @@ class TestReadSeededWithoutVendorData(he
@@ -2658,7 +2653,7 @@
self.assertEqual(found_md, {"key1": "val1"})
self.assertEqual(found_ud, ud)
self.assertEqual(found_vd, vd)
Expand Down

0 comments on commit 6d6f4b4

Please sign in to comment.