add test for vm cli
All checks were successful
checks-impure / test (pull_request) Successful in 12s
checks / test (pull_request) Successful in 1m23s

This commit is contained in:
Jörg Thalheim 2023-10-03 17:18:36 +02:00
parent 361ad990ab
commit 2502422bc1

View File

@ -0,0 +1,22 @@
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"])