summaryrefslogtreecommitdiff
path: root/tests/integration_tests/modules/test_jinja_templating.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration_tests/modules/test_jinja_templating.py')
-rw-r--r--tests/integration_tests/modules/test_jinja_templating.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/integration_tests/modules/test_jinja_templating.py b/tests/integration_tests/modules/test_jinja_templating.py
index 35b8ee2d..fe8eff1a 100644
--- a/tests/integration_tests/modules/test_jinja_templating.py
+++ b/tests/integration_tests/modules/test_jinja_templating.py
@@ -11,6 +11,7 @@ USER_DATA = """\
runcmd:
- echo {{v1.local_hostname}} > /var/tmp/runcmd_output
- echo {{merged_cfg._doc}} >> /var/tmp/runcmd_output
+ - echo {{v1['local-hostname']}} >> /var/tmp/runcmd_output
"""
@@ -18,13 +19,16 @@ runcmd:
def test_runcmd_with_variable_substitution(client: IntegrationInstance):
"""Test jinja substitution.
- Ensure we can also substitute variables from instance-data-sensitive
- LP: #1931392
+ Ensure underscore-delimited aliases exist for hyphenated key and
+ we can also substitute variables from instance-data-sensitive
+ LP: #1931392.
"""
+ hostname = client.execute('hostname').stdout.strip()
expected = [
- client.execute('hostname').stdout.strip(),
+ hostname,
('Merged cloud-init system config from /etc/cloud/cloud.cfg and '
- '/etc/cloud/cloud.cfg.d/')
+ '/etc/cloud/cloud.cfg.d/'),
+ hostname
]
output = client.read_from_file('/var/tmp/runcmd_output')
verify_ordered_items_in_text(expected, output)