Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters