From 0c981eec58e3b2013771f8fe61c8f22d645c73e4 Mon Sep 17 00:00:00 2001 From: taoky Date: Mon, 1 Jul 2024 13:41:38 +0800 Subject: [PATCH] tests: Add test for DeviceDisk.paths_in_use_by --- tests/test_disk.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_disk.py b/tests/test_disk.py index 9127371ba..d2512484f 100644 --- a/tests/test_disk.py +++ b/tests/test_disk.py @@ -114,6 +114,14 @@ def test_disk_path_in_use_kernel(): assert vms == ["test-arm-kernel"] +def test_disk_paths_in_use(): + conn = utils.URIs.open_kvm() + + vms = virtinst.DeviceDisk.paths_in_use_by( + conn, ["/pool-dir/test-arm-kernel", "/pool-dir/test-arm-initrd"]) + assert vms == [["test-arm-kernel"], ["test-arm-kernel"]] + + def test_disk_diskbackend_misc(): # Test get_size() with vol_install conn = utils.URIs.open_testdefault_cached()