Skip to content

Commit

Permalink
Added test for file permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lueschem committed Apr 20, 2024
1 parent 99ca13f commit 8867ff8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pytest


@pytest.mark.parametrize("path, user, group, mode", [
("/etc/hosts", "root", "root", 0o644),
("/etc/gshadow", "root", "shadow", 0o640),
("/etc/hostname", "root", "root", 0o644),
("/usr/bin", "root", "root", 0o755),
("/dev/null", "root", "root", 0o666),
])
def test_permissions(host, path, user, group, mode):
test_file = host.file(path)
assert test_file.user == user
assert test_file.group == group
assert test_file.mode == mode

0 comments on commit 8867ff8

Please sign in to comment.