def build(self, device, config):
        if not isinstance(device, DesktopDevice):
            raise ComponentNotSupported(
                "Can't create firewall tool for : {}".format(device.os_name()))

        if device.os_name() == 'macos':
            return MacOSFirewall(device, config)
        elif device.os_name() == 'windows':
            return WindowsFirewall(device, config)
        elif device.os_name() == 'linux':
            L.warning("Firewall not implemented for linux yet")
            raise ComponentNotSupported(
                "Firewall not implemented for linux yet")
    def _check_connector_is_local(self):
        if isinstance(self._device.connector(), LocalShellConnector):
            return

        raise ComponentNotSupported(
            "Component {} can only be used directly on device. It will not work remotely"
            .format(self.__class__.__name__))
Beispiel #3
0
    def build(self, device, config):
        if device.os_name() not in ['macos', 'linux', 'windows']:
            raise ComponentNotSupported(
                "packet_capturer is not currently supported on {}".format(
                    device.os_name()))

        return PacketCapturer(device, config)
    def build(self, device, config):
        if device.os_name() != 'linux':
            raise ComponentNotSupported(
                "Can't create open_wrt tools for : {}".format(
                    device.os_name()))

        return OpenWRT(device, config)
 def build(self, device, config):
     if device.os_name() == 'android':
         return AndroidSettings(device, config)
     elif device.os_name() == 'ios':
         return IOSSettings(device, config)
     raise ComponentNotSupported(
         "settings is not currently supported on {}".format(
             device.os_name()))
 def build(self, device, config):
     if device.os_name() == 'linux':
         return LinuxRoute(device, config)
     elif device.os_name() == 'macos':
         return MacOSRoute(device, config)
     elif device.os_name() == 'windows':
         return WindowsRoute(device, config)
     raise ComponentNotSupported(
         "Can't build a route component on {}".format(device.os_name()))
Beispiel #7
0
 def build(self, device, config):
     if device.os_name() == 'linux':
         return XVDriverLinux(device, config)
     elif device.os_name() == 'macos':
         return XVDriverMacOS(device, config)
     elif device.os_name() == 'windows':
         return XVDriverWindows(device, config)
     raise ComponentNotSupported("Can't build a webdriver on {}".format(
         device.os_name()))
Beispiel #8
0
 def build(self, device, config):
     if device.os_name() == 'linux':
         return LinuxRoute(device, config)
     elif device.os_name() == 'macos':
         return MacOSRoute(device, config)
     elif device.os_name() == 'windows':
         from xv_leak_tools.test_components.route.windows.windows_route import WindowsRoute
         return WindowsRoute(device, config)
     raise ComponentNotSupported("Can't build a route component on {}".format(device.os_name()))
 def build(self, device, config):
     if device.os_name() in ['macos', 'windows', 'linux']:
         return IPToolCurl(device, config)
     raise ComponentNotSupported("ip_tool is not currently supported on {}".format(
         device.os_name()))