clan-core/pkgs/clan-cli/tests/test_vms_cli.py
Jörg Thalheim 2502422bc1
All checks were successful
checks-impure / test (pull_request) Successful in 12s
checks / test (pull_request) Successful in 1m23s
add test for vm cli
2023-10-03 17:24:08 +02:00

23 lines
533 B
Python

import os
from pathlib import Path
import pytest
from cli import Cli
no_kvm = not os.path.exists("/dev/kvm")
@pytest.mark.impure
def test_inspect(test_flake_with_core: Path, capsys: pytest.CaptureFixture) -> None:
cli = Cli()
cli.run(["vms", "inspect", "vm1"])
out = capsys.readouterr() # empty the buffer
assert "Cores" in out.out
@pytest.mark.skipif(no_kvm, reason="Requires KVM")
@pytest.mark.impure
def test_create(test_flake_with_core: Path) -> None:
cli = Cli()
cli.run(["vms", "create", "vm1"])