summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-11-20 14:12:54 -0500
committerGitHub <noreply@github.com>2020-11-20 14:12:54 -0500
commit5d4a9a4a50a496d27510f63217bcc0c25d9a8939 (patch)
treef08411a468543d002877a7a05be1e589889d48c6
parent12ef7541c2d0c6b2cd510f95fda53ca9c8333064 (diff)
downloadcloud-init-git-5d4a9a4a50a496d27510f63217bcc0c25d9a8939.tar.gz
add integration test for LP: #1900837 (#679)
As the first test of this SRU cycle, this also introduces the sru_2020_11 mark to allow us to easily identify the set of tests generated for this SRU.
-rw-r--r--tests/integration_tests/bugs/test_lp1900837.py28
-rw-r--r--tox.ini1
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/integration_tests/bugs/test_lp1900837.py b/tests/integration_tests/bugs/test_lp1900837.py
new file mode 100644
index 00000000..3fe7d0d0
--- /dev/null
+++ b/tests/integration_tests/bugs/test_lp1900837.py
@@ -0,0 +1,28 @@
+"""Integration test for LP: #1900836.
+
+This test mirrors the reproducing steps from the reported bug: it changes the
+permissions on cloud-init.log to 600 and confirms that they remain 600 after a
+reboot.
+"""
+import pytest
+
+
+def _get_log_perms(client):
+ return client.execute("stat -c %a /var/log/cloud-init.log")
+
+
+@pytest.mark.sru_2020_11
+class TestLogPermissionsNotResetOnReboot:
+ def test_permissions_unchanged(self, client):
+ # Confirm that the current permissions aren't 600
+ assert "644" == _get_log_perms(client)
+
+ # Set permissions to 600 and confirm our assertion passes pre-reboot
+ client.execute("chmod 600 /var/log/cloud-init.log")
+ assert "600" == _get_log_perms(client)
+
+ # Reboot
+ client.instance.restart()
+
+ # Check that permissions are not reset on reboot
+ assert "600" == _get_log_perms(client)
diff --git a/tox.ini b/tox.ini
index c86d38e9..066f923a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -169,3 +169,4 @@ markers =
lxd_container: test will only run in LXD container
user_data: the user data to be passed to the test instance
instance_name: the name to be used for the test instance
+ sru_2020_11: test is part of the 2020/11 SRU verification