Tests: default tmpfs in rootfs.
This commit is contained in:
@@ -327,6 +327,26 @@ class TestGoIsolation(TestApplicationGo):
|
||||
obj = self.getjson(url='/?file=/bin/sh')['body']
|
||||
self.assertEqual(obj['FileExists'], False, 'file should not exists')
|
||||
|
||||
def test_go_isolation_rootfs_default_tmpfs(self):
|
||||
if not self.isolation_key('unprivileged_userns_clone'):
|
||||
print('unprivileged clone is not available')
|
||||
raise unittest.SkipTest()
|
||||
|
||||
if not self.isolation_key('mnt'):
|
||||
print('mnt namespace is not supported')
|
||||
raise unittest.SkipTest()
|
||||
|
||||
isolation = {
|
||||
'namespaces': {'mount': True, 'credential': True},
|
||||
'rootfs': self.testdir,
|
||||
}
|
||||
|
||||
self.load('ns_inspect', isolation=isolation)
|
||||
|
||||
obj = self.getjson(url='/?file=/tmp')['body']
|
||||
|
||||
self.assertEqual(obj['FileExists'], True, 'app has /tmp')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
TestGoIsolation.main()
|
||||
|
||||
Reference in New Issue
Block a user