示例#1
0
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
示例#2
0
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
示例#3
0
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
示例#4
0
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()
示例#5
0
 def setUp(self):
     self.q = qfwupd.QubesFwupdmgr()
     self.maxDiff = 2000
     self.captured_output = io.StringIO()
     sys.stdout = self.captured_output