diff options
Diffstat (limited to 'test/test_go_isolation.py')
-rw-r--r-- | test/test_go_isolation.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_go_isolation.py b/test/test_go_isolation.py index 61d39617..76434f62 100644 --- a/test/test_go_isolation.py +++ b/test/test_go_isolation.py @@ -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() |