Tests: prerequisites checking reworked.
Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
This commit is contained in:
@@ -7,26 +7,24 @@ http = TestHTTP()
|
||||
|
||||
|
||||
def check_chroot():
|
||||
available = option.available
|
||||
|
||||
resp = http.put(
|
||||
url='/config',
|
||||
sock_type='unix',
|
||||
addr=f'{option.temp_dir}/control.unit.sock',
|
||||
body=json.dumps(
|
||||
{
|
||||
"listeners": {"*:7080": {"pass": "routes"}},
|
||||
"routes": [
|
||||
{
|
||||
"action": {
|
||||
"share": option.temp_dir,
|
||||
"chroot": option.temp_dir,
|
||||
return (
|
||||
'success'
|
||||
in http.put(
|
||||
url='/config',
|
||||
sock_type='unix',
|
||||
addr=f'{option.temp_dir}/control.unit.sock',
|
||||
body=json.dumps(
|
||||
{
|
||||
"listeners": {"*:7080": {"pass": "routes"}},
|
||||
"routes": [
|
||||
{
|
||||
"action": {
|
||||
"share": option.temp_dir,
|
||||
"chroot": option.temp_dir,
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
),
|
||||
],
|
||||
}
|
||||
),
|
||||
)['body']
|
||||
)
|
||||
|
||||
if 'success' in resp['body']:
|
||||
available['features']['chroot'] = True
|
||||
|
||||
Reference in New Issue
Block a user