feat: run smolmachines sidecar as vm
This commit is contained in:
@@ -106,6 +106,22 @@ class TestArgvShapes(unittest.TestCase):
|
||||
self.assertIn("--name", argv)
|
||||
self.assertIn("agent-xyz", argv)
|
||||
|
||||
def test_machine_create_with_net_ports_and_volumes(self):
|
||||
with self._patch_run() as m:
|
||||
machine_create(
|
||||
"sidecar-xyz",
|
||||
from_path=Path("/stage/sidecar.smolmachine"),
|
||||
net=True,
|
||||
ports=((55000, 9099),),
|
||||
volumes=(("/host/routes", "/etc/egress", True),),
|
||||
)
|
||||
argv = m.call_args.args[0]
|
||||
self.assertIn("--net", argv)
|
||||
self.assertIn("-p", argv)
|
||||
self.assertIn("55000:9099", argv)
|
||||
self.assertIn("-v", argv)
|
||||
self.assertIn("/host/routes:/etc/egress:ro", argv)
|
||||
|
||||
def test_machine_create_omits_net_when_no_allow_cidrs(self):
|
||||
with self._patch_run() as m:
|
||||
machine_create("agent-xyz", from_path=Path("/x.smolmachine"))
|
||||
|
||||
Reference in New Issue
Block a user