Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
from unit.applications.lang.ruby import ApplicationRuby
|
|
|
|
prerequisites = {'modules': {'ruby': 'any'}, 'features': {'isolation': True}}
|
|
|
|
client = ApplicationRuby()
|
|
|
|
|
|
def test_ruby_isolation_rootfs(is_su, require, temp_dir):
|
|
isolation = {'rootfs': temp_dir}
|
|
|
|
if not is_su:
|
|
require(
|
|
{
|
|
'features': {
|
|
'isolation': [
|
|
'unprivileged_userns_clone',
|
|
'user',
|
|
'mnt',
|
|
'pid',
|
|
]
|
|
}
|
|
}
|
|
)
|
|
|
|
isolation['namespaces'] = {
|
|
'mount': True,
|
|
'credential': True,
|
|
'pid': True,
|
|
}
|
|
|
|
client.load('status_int', isolation=isolation)
|
|
|
|
assert 'success' in client.conf(
|
|
'"/ruby/status_int/config.ru"',
|
|
'applications/status_int/script',
|
|
)
|
|
|
|
assert 'success' in client.conf(
|
|
'"/ruby/status_int"',
|
|
'applications/status_int/working_directory',
|
|
)
|
|
|
|
assert client.get()['status'] == 200, 'status int'
|