xref: /unit/test/unit/check/unix_abstract.py (revision 2182:55860ad40a93)
1import json
2
3from unit.http import TestHTTP
4from unit.option import option
5
6http = TestHTTP()
7
8
9def check_unix_abstract():
10    available = option.available
11
12    resp = http.put(
13        url='/config',
14        sock_type='unix',
15        addr=option.temp_dir + '/control.unit.sock',
16        body=json.dumps(
17            {
18                "listeners": {"unix:@sock": {"pass": "routes"}},
19                "routes": [],
20            }
21        ),
22    )
23
24    if 'success' in resp['body']:
25        available['features']['unix_abstract'] = True
26