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.
This commit is contained in:
Tiago Natel de Moura
2021-01-07 16:51:27 +00:00
parent d65a66f9d8
commit 13a06497de

View File

@@ -342,14 +342,6 @@ class TestGoIsolation(TestApplicationGo):
'pid': True
}
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 /'
isolation['automount'] = {
'tmpfs': False
}
@@ -361,3 +353,15 @@ class TestGoIsolation(TestApplicationGo):
assert (
"/ /tmp" not in obj['Mounts'] and "tmpfs" not in obj['Mounts']
), 'app has no /tmp mounted'
isolation['automount'] = {
'tmpfs': True
}
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 /'