diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-30 22:03:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-30 22:09:46 +0900 |
| commit | 297b444dfb6adb71d5d1e61ea1b5aff16683896e (patch) | |
| tree | 61136bffe95aae67baa436b20ce60b7b9074d126 /test/test.py | |
| parent | 89a05909a4fb393864a8aa752f6979dd9aaa2898 (diff) | |
test: separate app and sandbox
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/test/test.py b/test/test.py index baf074e2..0ab8970c 100644 --- a/test/test.py +++ b/test/test.py @@ -99,39 +99,14 @@ print(denyOutputVerbose) # Fail direct fsu call: print(machine.fail("sudo -u alice -i fsu")) -# Check seccomp outcome: -swaymsg("exec fortify run cat") -pid = int(machine.wait_until_succeeds("pgrep -U 1000000 -x cat", timeout=5)) -print(machine.succeed(f"fortify-test filter {pid} c698b081ff957afe17a6d94374537d37f2a63f6f9dd75da7546542407a9e32476ebda3312ba7785d7f618542bcfaf27ca27dcc2dddba852069d28bcfe8cad39a &>/dev/stdout", timeout=5)) -machine.succeed(f"kill -TERM {pid}") - -# Verify capabilities/securebits in user namespace: -print(machine.succeed("sudo -u alice -i fortify run capsh --print")) -print(machine.succeed("sudo -u alice -i fortify run capsh --has-no-new-privs")) -print(machine.fail("sudo -u alice -i fortify run capsh --has-a=CAP_SYS_ADMIN")) -print(machine.fail("sudo -u alice -i fortify run capsh --has-b=CAP_SYS_ADMIN")) -print(machine.fail("sudo -u alice -i fortify run capsh --has-i=CAP_SYS_ADMIN")) -print(machine.fail("sudo -u alice -i fortify run capsh --has-p=CAP_SYS_ADMIN")) -print(machine.fail("sudo -u alice -i fortify run umount -R /dev")) - # Verify PrintBaseError behaviour: if denyOutput != "fsu: uid 1001 is not in the fsurc file\n": raise Exception(f"unexpected deny output:\n{denyOutput}") if denyOutputVerbose != "fsu: uid 1001 is not in the fsurc file\nfortify: *cannot obtain uid from fsu: permission denied\n": raise Exception(f"unexpected deny verbose output:\n{denyOutputVerbose}") -# Check sandbox outcome: check_offset = 0 -def check_sandbox(name): - global check_offset - check_offset += 1 - swaymsg(f"exec script /dev/null -E always -qec check-sandbox-{name}") - machine.wait_for_file(f"/tmp/fortify.1000/tmpdir/{check_offset}/sandbox-ok", timeout=15) - -check_sandbox("preset") -check_sandbox("tty") -check_sandbox("mapuid") def aid(offset): return 1+check_offset+offset |
