blob: b627b515fc0adc3e0527ce718bd965fef2c67a13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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'
|