Files
nginx-unit/test/test_go_isolation_rootfs.py
Andrei Zeliankou c183bd8749 Tests: get rid of classes in test files.
Class usage came from the unittest framework and it was always redundant
after migration to the pytest.  This commit removes classes from files
containing tests to make them more readable and understandable.
2023-06-14 18:20:09 +01:00

20 lines
532 B
Python

from unit.applications.lang.go import ApplicationGo
prerequisites = {
'modules': {'go': 'all'},
'features': {'isolation': True},
'privileged_user': True,
}
client = ApplicationGo()
def test_go_isolation_rootfs_chroot(temp_dir):
client.load('ns_inspect', isolation={'rootfs': temp_dir})
obj = client.getjson(url='/?file=/go/app')['body']
assert obj['FileExists'], 'app relative to rootfs'
obj = client.getjson(url='/?file=/bin/sh')['body']
assert not obj['FileExists'], 'file should not exists'