summaryrefslogtreecommitdiff
path: root/tests/integration_tests/modules/test_seed_random_data.py
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-12-25 17:52:03 +0200
committerzsdc <taras@vyos.io>2020-12-25 17:52:03 +0200
commit526c2760b85ff625a10f4a1c9ba83759d8de1441 (patch)
treec7a87d78a7944dd6a9d02544d1605f3a7d77e313 /tests/integration_tests/modules/test_seed_random_data.py
parent66dc53b1b3f8786f3bbb25e914c1dc8161af0494 (diff)
parent47f4229ebcef9f83df8b549bb869a2dbf6dff17c (diff)
downloadvyos-cloud-init-526c2760b85ff625a10f4a1c9ba83759d8de1441.tar.gz
vyos-cloud-init-526c2760b85ff625a10f4a1c9ba83759d8de1441.zip
T2117: Cloud-init updated to 20.4
Merged with 20.4 tag from the upstream Cloud-init repository
Diffstat (limited to 'tests/integration_tests/modules/test_seed_random_data.py')
-rw-r--r--tests/integration_tests/modules/test_seed_random_data.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/integration_tests/modules/test_seed_random_data.py b/tests/integration_tests/modules/test_seed_random_data.py
new file mode 100644
index 00000000..b365fa98
--- /dev/null
+++ b/tests/integration_tests/modules/test_seed_random_data.py
@@ -0,0 +1,28 @@
+"""Integration test for the random seed module.
+
+This test specifies a command to be executed by the ``seed_random`` module, by
+providing a different data to be used as seed data. We will then check
+if that seed data was actually used.
+
+(This is ported from
+``tests/cloud_tests/testcases/modules/seed_random_data.yaml``.)"""
+
+import pytest
+
+
+USER_DATA = """\
+#cloud-config
+random_seed:
+ data: 'MYUb34023nD:LFDK10913jk;dfnk:Df'
+ encoding: raw
+ file: /root/seed
+"""
+
+
+@pytest.mark.ci
+class TestSeedRandomData:
+
+ @pytest.mark.user_data(USER_DATA)
+ def test_seed_random_data(self, client):
+ seed_output = client.read_from_file("/root/seed")
+ assert seed_output.strip() == "MYUb34023nD:LFDK10913jk;dfnk:Df"