Skip to content

Conversation

@blackboxsw
Copy link
Collaborator

Fix 2 Jammy integration test run failures which are due to not sourcing the features settings that are installed on the system under test.

Integration tests should use get_feature_flag_value from the client instead of looking at the local repo's features.<FEATURE_NAME> value.

Proposed Commit Message

ci: feature values should be read from client under test

Additional Context

Github action faliure for jammy

Test Steps

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@blackboxsw blackboxsw force-pushed the ci-read-feature-flag-value-from-client branch from 0329ec7 to 3d56f96 Compare February 10, 2026 17:30
Copy link
Member

@holmanb holmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, besides the failing CI.


from cloudinit import features, lifecycle
from cloudinit.subp import subp
from cloudinit.util import is_true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being imported and used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason to use is_true, is because the value coming back from get_feature_flag_value will either be a string 'False' or 'True', we can wrap that in is_true() to align with the expected return value from network_wait_loggged() which parses the full log to ensure the expected 'wait' message was included. Alternatively, we could either:

  1. explicitly check for the return value of 'True' from get_feature_flag and then use that to be our assertion for the return of network_wait_logged(...).

Would you prefer one of these approaches instead?

  1. convert True/False strings to python boolean?
--- a/tests/integration_tests/datasources/test_nocloud.py
+++ b/tests/integration_tests/datasources/test_nocloud.py
@@ -7,7 +7,6 @@ from pycloudlib.lxd.instance import LXDInstance
 
 from cloudinit import features, lifecycle
 from cloudinit.subp import subp
-from cloudinit.util import is_true
 from tests.integration_tests.instances import IntegrationInstance
 from tests.integration_tests.integration_settings import PLATFORM
 from tests.integration_tests.releases import CURRENT_RELEASE, FOCAL
@@ -131,7 +130,7 @@ def test_nocloud_seedfrom_vendordata(client: IntegrationInstance):
     assert "seeded_vendordata_test_file" in client.execute("ls /var/tmp")
     assert network_wait_logged(
         client.execute("cat /var/log/cloud-init.log")
-    ) == is_true(get_feature_flag_value(client, "MANUAL_NETWORK_WAIT"))
+    ) is get_feature_flag_value(client, "MANUAL_NETWORK_WAIT")
 
 
 SMBIOS_USERDATA = """\
diff --git a/tests/integration_tests/util.py b/tests/integration_tests/util.py
index 6e86b6775..8ccbb85cd 100644
--- a/tests/integration_tests/util.py
+++ b/tests/integration_tests/util.py
@@ -603,6 +603,8 @@ def get_feature_flag_value(client: "IntegrationInstance", key):
     ).strip()
     if "NameError" in value:
         raise NameError(f"name '{key}' is not defined")
+    if value in ("True", "False"):
+        return value == "True"
     return value
 
 
  1. Perform the string check above call-site before our assertion
diff --git a/tests/integration_tests/datasources/test_nocloud.py b/tests/integration_tests/datasources/test_nocloud.py
index 0bfe29668..100cd9c93 100644
--- a/tests/integration_tests/datasources/test_nocloud.py
+++ b/tests/integration_tests/datasources/test_nocloud.py
@@ -7,7 +7,6 @@ from pycloudlib.lxd.instance import LXDInstance
 
 from cloudinit import features, lifecycle
 from cloudinit.subp import subp
-from cloudinit.util import is_true
 from tests.integration_tests.instances import IntegrationInstance
 from tests.integration_tests.integration_settings import PLATFORM
 from tests.integration_tests.releases import CURRENT_RELEASE, FOCAL
@@ -129,9 +128,11 @@ def test_nocloud_seedfrom_vendordata(client: IntegrationInstance):
     client.restart()
     assert client.execute("cloud-init status").ok
     assert "seeded_vendordata_test_file" in client.execute("ls /var/tmp")
-    assert network_wait_logged(
-        client.execute("cat /var/log/cloud-init.log")
-    ) == is_true(get_feature_flag_value(client, "MANUAL_NETWORK_WAIT"))
+    wait_log = "True" == get_feature_flag_value(client, "MANUAL_NETWORK_WAIT")
+    assert (
+        network_wait_logged(client.execute("cat /var/log/cloud-init.log"))
+        == wait_log
+    )

@blackboxsw blackboxsw force-pushed the ci-read-feature-flag-value-from-client branch from acfb107 to 0477029 Compare February 10, 2026 21:24
@blackboxsw blackboxsw requested a review from holmanb February 11, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants