diff options
| author | zdc <zdc@users.noreply.github.com> | 2020-12-25 18:57:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-25 18:57:19 +0200 |
| commit | 27c317f83d8e393254b6766b34fdf8d29148ea8f (patch) | |
| tree | ea824de28fa639ba6ba8b212efaf53b5df2e90d9 /tests/integration_tests/modules/test_runcmd.py | |
| parent | 66dc53b1b3f8786f3bbb25e914c1dc8161af0494 (diff) | |
| parent | c6bcb8df28daa234686a563549681082eb3283a1 (diff) | |
| download | vyos-cloud-init-27c317f83d8e393254b6766b34fdf8d29148ea8f.tar.gz vyos-cloud-init-27c317f83d8e393254b6766b34fdf8d29148ea8f.zip | |
Merge pull request #28 from zdc/T2117-equuleus-20.4
T2117: Cloud-init updated to 20.4
Diffstat (limited to 'tests/integration_tests/modules/test_runcmd.py')
| -rw-r--r-- | tests/integration_tests/modules/test_runcmd.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration_tests/modules/test_runcmd.py b/tests/integration_tests/modules/test_runcmd.py new file mode 100644 index 00000000..50d1851e --- /dev/null +++ b/tests/integration_tests/modules/test_runcmd.py @@ -0,0 +1,25 @@ +"""Integration test for the runcmd module. + +This test specifies a command to be executed by the ``runcmd`` module +and then checks if that command was executed during boot. + +(This is ported from +``tests/cloud_tests/testcases/modules/runcmd.yaml``.)""" + +import pytest + + +USER_DATA = """\ +#cloud-config +runcmd: + - echo cloud-init run cmd test > /var/tmp/run_cmd +""" + + +@pytest.mark.ci +class TestRuncmd: + + @pytest.mark.user_data(USER_DATA) + def test_runcmd(self, client): + runcmd_output = client.read_from_file("/var/tmp/run_cmd") + assert runcmd_output.strip() == "cloud-init run cmd test" |
