Skip to content

Commit

Permalink
avocado-virt-tests: Update use of the params.get() API
Browse files Browse the repository at this point in the history
We now have to explicitly pass default, otherwise avocado
will take the default value for the path, rendering the
value returned invalid (None). Let's fix that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
  • Loading branch information
lmr committed May 18, 2015
1 parent 0f9c155 commit 99234ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions qemu/migration/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MigrationTest(test.VirtTest):

def test_migrate(self):
self.vm.power_on()
migration_mode = self.params.get('migration_mode', 'tcp')
for _ in xrange(self.params.get('migration_iterations', 4)):
migration_mode = self.params.get('migration_mode', default='tcp')
for _ in xrange(self.params.get('migration_iterations', default=4)):
self.vm.migrate(migration_mode)
self.vm.login_remote()

Expand Down
8 changes: 4 additions & 4 deletions qemu/usb_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def setUp(self):
Add a USB device to a QEMU VM
"""
super(USBBootTest, self).setUp()
self.device_name = self.params.get('virt.tests.usb_boot.device_name', 'QEMU USB Tablet')
self.device_name = self.params.get('virt.tests.usb_boot.device_name', default='QEMU USB Tablet')
usb_bus_cmdline = self.params.get('virt.tests.usb_boot.usb_bus_cmdline',
'-device piix3-usb-uhci,id=usbtest,bus=pci.0,addr=05')
default='-device piix3-usb-uhci,id=usbtest,bus=pci.0,addr=05')
self.vm.devices.add_cmdline(usb_bus_cmdline)
usb_device_cmdline = self.params.get('virt.tests.usb_boot.usb_device_cmdline',
'-device usb-tablet,id=usb-tablet,bus=usbtest.0,port=1')
default='-device usb-tablet,id=usb-tablet,bus=usbtest.0,port=1')
self.vm.devices.add_cmdline(usb_device_cmdline)
self.vm.power_on()
self.vm.login_remote()
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_shows_guest_os(self):
"""
Verify that the device shows up in the guest OS.
"""
check_cmd = self.params.get('virt.tests.usb_boot.check_cmd', 'lsusb -v')
check_cmd = self.params.get('virt.tests.usb_boot.check_cmd', default='lsusb -v')
result_check = self.vm.remote.run(check_cmd)
device_found = False
for line in result_check.stdout.splitlines():
Expand Down

0 comments on commit 99234ab

Please sign in to comment.