From bc7a50c3f08407417093e90f502f6a918605daec Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 1 Oct 2025 21:26:15 -0600 Subject: [PATCH] test: add regex to cope with stat link output double/single quotes --- tests/integration_tests/modules/test_combined.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/integration_tests/modules/test_combined.py b/tests/integration_tests/modules/test_combined.py index 9d216a2a555..97d21008197 100644 --- a/tests/integration_tests/modules/test_combined.py +++ b/tests/integration_tests/modules/test_combined.py @@ -326,12 +326,13 @@ def test_correct_datasource_detected( def test_cloud_id_file_symlink(self, class_client: IntegrationInstance): cloud_id = class_client.execute("cloud-id").stdout - expected_link_output = ( - "'/run/cloud-init/cloud-id' -> " - f"'/run/cloud-init/cloud-id-{cloud_id}'" + expected_link_regex = ( + r"['\"]/run/cloud-init/cloud-id['\"] -> " + f"['\"]/run/cloud-init/cloud-id-{cloud_id}['\"]" ) - assert expected_link_output == str( - class_client.execute("stat -c %N /run/cloud-init/cloud-id") + assert re.match( + expected_link_regex, + class_client.execute("stat -c %N /run/cloud-init/cloud-id"), ) def test_run_frequency(self, class_client: IntegrationInstance):