Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/src/cloud-init/tests/integration_tests/bugs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/src/cloud-init/tests/integration_tests/bugs/test_lp1900837.py
"""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.
"""


def _get_log_perms(client):
    return client.execute("stat -c %a /var/log/cloud-init.log")


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.restart()
        assert client.execute("cloud-init status").ok

        # Check that permissions are not reset on reboot
        assert "600" == _get_log_perms(client)

haha - 2025