def check_whonix_updatevm(): """Checks if the sys-whonix is running""" if 'qubes' not in platform.release(): return False q = qfwupd.QubesFwupdmgr() q.check_usbvm() return "sys-whonix" in q.output
def check_usbvm(): """Checks if sys-usb is running""" if 'qubes' not in platform.release(): return False q = qfwupd.QubesFwupdmgr() q.check_usbvm() return "sys-usb" in q.output
def device_connected_dom0(): """Checks if the testing device is connected in dom0""" if 'qubes' not in platform.release(): return False q = qfwupd.QubesFwupdmgr() q.check_fwupd_version() q._get_dom0_devices() return "ColorHug2" in q.dom0_devices_info
def device_connected_usbvm(): """Checks if the testing device is connected in usbvm""" if not check_usbvm(): return False q = qfwupd.QubesFwupdmgr() q.check_fwupd_version(usbvm=True) q._validate_usbvm_dirs() if not os.path.exists(FWUPD_DOM0_DIR): q.refresh_metadata() q._get_usbvm_devices() with open(FWUPD_USBVM_LOG) as usbvm_device_info: return "ColorHug2" in usbvm_device_info.read()
def setUp(self): self.q = qfwupd.QubesFwupdmgr() self.maxDiff = 2000 self.captured_output = io.StringIO() sys.stdout = self.captured_output