summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2020-08-20 15:53:20 +0100
committerTiago Natel de Moura <t.nateldemoura@f5.com>2020-08-20 15:53:20 +0100
commit10738c3fe22d2c46669630e55e465c5c8a84c77c (patch)
tree35a9944f47049a01356612ce5e64aff2dc6ba6d0 /test
parent4ad8c5b8989d2772a2f68f9386bf31036e39ccdd (diff)
downloadunit-10738c3fe22d2c46669630e55e465c5c8a84c77c.tar.gz
unit-10738c3fe22d2c46669630e55e465c5c8a84c77c.tar.bz2
Tests: default tmpfs in rootfs.
Diffstat (limited to '')
-rw-r--r--test/test_go_isolation.py20
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()