Add owned OpenAI endpoint and coordinated native model switching
This commit is contained in:
+8
-1
@@ -13,11 +13,13 @@ class InstallTests(unittest.TestCase):
|
||||
with patch.object(installer,'inspect',return_value={'Config':{'Labels':{}}}):
|
||||
with self.assertRaises(RuntimeError):installer.owned('athena-deck-test',Path('/opt/test'))
|
||||
def test_launch_is_loopback_and_unprivileged(self):
|
||||
config=dict(base='/opt/athena-deck-test',name='athena-deck-test',port=8119,image='test:only',gpu_telemetry=False)
|
||||
config=dict(base='/opt/athena-deck-test',name='athena-deck-test',port=8119,api_ports=[8120,8121],image='test:only',gpu_telemetry=False)
|
||||
with patch.object(installer,'run') as run:
|
||||
installer.launch(config)
|
||||
args=run.call_args.args
|
||||
self.assertIn('127.0.0.1:8119:8108',args)
|
||||
self.assertIn('127.0.0.1:8120:8120',args)
|
||||
self.assertIn('DECK_API_PORTS=8120,8121',args)
|
||||
self.assertIn('--read-only',args)
|
||||
self.assertEqual(args[args.index('--cap-drop')+1],'ALL')
|
||||
for forbidden in ('--privileged','--gpus','--cap-add','host','/var/run/docker.sock'):
|
||||
@@ -44,6 +46,11 @@ class InstallTests(unittest.TestCase):
|
||||
def test_requires_preprovisioned_credentials(self):
|
||||
with tempfile.TemporaryDirectory() as directory,patch.dict(os.environ,{'DECK_REQUIRE_SETUP':'1'}):
|
||||
with self.assertRaises(RuntimeError):Server(0,state_dir=directory)
|
||||
def test_api_port_range_is_bounded(self):
|
||||
self.assertEqual(installer.parse_api_ports('8120-8124'),list(range(8120,8125)))
|
||||
for value in ('80','1-65535','8124-8120','8120,8121','8000-8100'):
|
||||
with self.assertRaises(RuntimeError):installer.parse_api_ports(value)
|
||||
|
||||
def test_source_allowlist_exists(self):
|
||||
for name in installer.FILES:self.assertTrue((installer.ROOT/name).is_file())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user