883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
24 lines
990 B
Python
24 lines
990 B
Python
#!/usr/bin/env python3
|
|
"""Explicit local endpoints must not broaden existing profile policies."""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'ops'))
|
|
from source_local_profile import endpoints
|
|
|
|
local = endpoints(5, '10.1.2.3', 3725, '192.168.22.7', 8111)
|
|
assert local == {'auth_host':'10.1.2.3', 'auth_port':3725, 'realm_host':'192.168.22.7', 'realm_port':8111}
|
|
assert endpoints(4) is None
|
|
for args in ((5, '8.8.8.8', 3724, '192.168.22.7', 8111),
|
|
(5, '10.1.2.3', 3724, '8.8.8.8', 8111),
|
|
(5, 'server.local', 3724, '192.168.22.7', 8111),
|
|
(5, '10.1.2.3', 3724, '192.168.22.7', 0),
|
|
(4, '127.0.0.1', 3724, '127.0.0.1', 8090),
|
|
(5, '10.1.2.3', 3724, None, 8111)):
|
|
try:
|
|
endpoints(*args)
|
|
except ValueError:
|
|
continue
|
|
raise AssertionError(f'Accepted invalid explicit local endpoints: {args!r}')
|
|
print('PASS explicit local source endpoint configuration')
|