If VM params define a new NIC that didn't previously exist, then when
make_qemu_command() is called in order to see if the VM should be restarted,
it attempts to get the MAC address of the new (nonexistent) NIC, and an
exception is raised.  This exception is expected and should be caught.

Signed-off-by: Michael Goldish <mgold...@redhat.com>
---
 client/tests/kvm/kvm_vm.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 969558b..d852784 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -638,7 +638,10 @@ class VM:
             except IndexError:
                 netdev_id = None
             # Handle the '-net nic' part
-            mac = vm.get_mac_address(vlan)
+            try:
+                mac = vm.get_mac_address(vlan)
+            except VMAddressError:
+                mac = None
             qemu_cmd += add_nic(help, vlan, nic_params.get("nic_model"), mac,
                                 netdev_id, nic_params.get("nic_extra_params"))
             # Handle the '-net tap' or '-net user' part
-- 
1.7.3.4

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to