summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Falcon <TheRealFalcon@users.noreply.github.com>2021-02-16 13:15:16 -0500
committerGitHub <noreply@github.com>2021-02-16 11:15:16 -0700
commit84e56f84d24e8f18b73c559e219b70527b9347af (patch)
tree23edd7252ecdfbbe9139b4ff74958fe85b36ac97
parent09193e5141ca45b822617399047204abd701047e (diff)
downloadcloud-init-git-84e56f84d24e8f18b73c559e219b70527b9347af.tar.gz
Fix attempting to decode binary data in test_seed_random_data test (#806)
`test_seed_random_data.py` was failing on openstack as openstack provides additional binary seed data to the end of the specified file. The test has been changed to only read the ascii porition of seed file.
-rw-r--r--tests/integration_tests/modules/test_seed_random_data.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/integration_tests/modules/test_seed_random_data.py b/tests/integration_tests/modules/test_seed_random_data.py
index f6a67c19..94e982e0 100644
--- a/tests/integration_tests/modules/test_seed_random_data.py
+++ b/tests/integration_tests/modules/test_seed_random_data.py
@@ -24,5 +24,7 @@ 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.startswith("MYUb34023nD:LFDK10913jk;dfnk:Df")
+ # Only read the first 31 characters, because the rest could be
+ # binary data
+ result = client.execute("head -c 31 < /root/seed")
+ assert result.startswith("MYUb34023nD:LFDK10913jk;dfnk:Df")