Skip to content

Commit 066606a

Browse files
committed
Check for leftover files in the container
1 parent f65d468 commit 066606a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_all.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,3 +748,21 @@ def test_container_suseconnect_adds_repos(container_per_test: ContainerData):
748748
container_per_test.connection.check_output("zypper -n ref")
749749
repos = get_repos_from_connection(container_per_test.connection)
750750
assert len(repos) > 3
751+
752+
753+
def test_no_leftover_files(auto_container):
754+
"""Ensure that there are no leftover backup files in /var/tmp and other locations."""
755+
756+
auto_container.connection.check_output("ls -1 /var/tmp").strip() == ""
757+
assert not auto_container.connection.file("/etc/shadow-").exists, (
758+
"backup file of /etc/shadow found"
759+
)
760+
761+
762+
@pytest.mark.parametrize("container", CONTAINERS_WITHOUT_ZYPPER, indirect=True)
763+
def test_no_zypper_leftover_files(
764+
container: ContainerData,
765+
) -> None:
766+
"""Ensure that there are no leftover files that only zypper needs."""
767+
768+
assert not container.connection.file("/var/lib/zypp/AutoInstalled").exists

0 commit comments

Comments
 (0)