summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2021-01-07 16:51:27 +0000
committerTiago Natel de Moura <t.nateldemoura@f5.com>2021-01-07 16:51:27 +0000
commit13a06497def68d8157dfe2b6e0a7f7edcc2ef477 (patch)
tree72846c915f9c157d1af40fa4ca1b85cc465605e3 /test
parentd65a66f9d813294917822554311281c5e1a7126b (diff)
downloadunit-13a06497def68d8157dfe2b6e0a7f7edcc2ef477.tar.gz
unit-13a06497def68d8157dfe2b6e0a7f7edcc2ef477.tar.bz2
Tests: reordered asserts to avoid a test race.
The mount points are unmounted in the main process after it detects the app process died. By testing the `tmpfs: true` first, it happens that main could start the `tmpfs: false` test case before main cleans the old process mount points.
Diffstat (limited to '')
-rw-r--r--test/test_go_isolation.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/test_go_isolation.py b/test/test_go_isolation.py
index 48c1b80c..0cd83056 100644
--- a/test/test_go_isolation.py
+++ b/test/test_go_isolation.py
@@ -342,16 +342,20 @@ class TestGoIsolation(TestApplicationGo):
'pid': True
}
+ isolation['automount'] = {
+ 'tmpfs': False
+ }
+
self.load('ns_inspect', isolation=isolation)
obj = self.getjson(url='/?mounts=true')['body']
assert (
- "/ /tmp" in obj['Mounts'] and "tmpfs" in obj['Mounts']
- ), 'app has /tmp mounted on /'
+ "/ /tmp" not in obj['Mounts'] and "tmpfs" not in obj['Mounts']
+ ), 'app has no /tmp mounted'
isolation['automount'] = {
- 'tmpfs': False
+ 'tmpfs': True
}
self.load('ns_inspect', isolation=isolation)
@@ -359,5 +363,5 @@ class TestGoIsolation(TestApplicationGo):
obj = self.getjson(url='/?mounts=true')['body']
assert (
- "/ /tmp" not in obj['Mounts'] and "tmpfs" not in obj['Mounts']
- ), 'app has no /tmp mounted'
+ "/ /tmp" in obj['Mounts'] and "tmpfs" in obj['Mounts']
+ ), 'app has /tmp mounted on /'