Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/integration_tests/modules/test_combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from tests.integration_tests.util import verify_ordered_items_in_text

USER_DATA = """\
## template: jinja
#cloud-config
apt:
primary:
Expand All @@ -31,6 +32,9 @@
locale_configfile: /etc/default/locale
ntp:
servers: ['ntp.ubuntu.com']
runcmd:
- echo {{ds.meta_data.local_hostname}} > /var/tmp/runcmd_output
- echo {{merged_cfg.def_log_file}} >> /var/tmp/runcmd_output
"""


Expand Down Expand Up @@ -92,6 +96,22 @@ def test_configured_locale(self, class_client: IntegrationInstance):
'en_US.UTF-8'
], locale_gen)

def test_runcmd_with_variable_substitution(
self, class_client: IntegrationInstance
):
"""Test runcmd, while including jinja substitution.

Ensure we can also substitue variables from instance-data-sensitive
LP: #1931392
"""
client = class_client
expected = [
client.execute('hostname').stdout.strip(),
'/var/log/cloud-init.log',
]
output = client.read_from_file('/var/tmp/runcmd_output')
verify_ordered_items_in_text(expected, output)

def test_no_problems(self, class_client: IntegrationInstance):
"""Test no errors, warnings, or tracebacks"""
client = class_client
Expand Down
25 changes: 0 additions & 25 deletions tests/integration_tests/modules/test_runcmd.py

This file was deleted.