mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
cc362a70e4
Signed-off-by: magic_rb <magic_rb@redalder.org>
22 lines
693 B
Python
22 lines
693 B
Python
from test_driver.machine import Machine, StartCommand, NixStartScript
|
|
from test_driver.logger import TerminalLogger
|
|
from pathlib import Path
|
|
import os
|
|
|
|
|
|
def make_machine(out_dir: Path, tmp_dir: Path) -> Machine:
|
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
tmp_dir.mkdir(parents=True, exist_ok=True)
|
|
return Machine(
|
|
out_dir = out_dir.absolute(),
|
|
tmp_dir = tmp_dir.absolute(),
|
|
start_command = NixStartScript(os.getenv("ROUTER_CMD") + "/bin/run-nixos-vm"),
|
|
logger = TerminalLogger(),
|
|
name = "router",
|
|
)
|
|
|
|
router = make_machine(Path("router/out"), Path("router/tmp"))
|
|
router.start()
|
|
router.wait_for_unit("multi-user.target")
|
|
router.shutdown()
|