@@ -100,14 +100,21 @@ def exec_command_and_wait_for_pattern(test, command,
class Test(avocado.Test):
+ def _get_unique_tag_val(self, tag_name):
+ """
+ Gets a tag value, if unique for a key
+ """
+ vals = self.tags.get(tag_name, [])
+ if len(vals) == 1:
+ return vals.pop()
+ return None
+
def setUp(self):
self._vms = {}
- arches = self.tags.get('arch', [])
- if len(arches) == 1:
- arch = arches.pop()
- else:
- arch = None
- self.arch = self.params.get('arch', default=arch)
+
+ self.arch = self.params.get('arch',
+ default=self._get_unique_tag_val('arch'))
+
default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
self.qemu_bin = self.params.get('qemu_bin',
default=default_qemu_bin)