Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add integration test for LP: #1900837 #679

Merged
merged 1 commit into from Nov 20, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions 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)
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -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