Ejemplo n.º 1
0
    def test_CardSupportedModesProperty(self):
        """Test for Card.SupportedModes property"""
        modes = self.device.Get(CRD_INTFACE, 'SupportedModes',
                                dbus_interface=dbus.PROPERTIES_IFACE)
        if not modes:
            raise unittest.SkipTest("Cannot be tested")

        self.failIfIn(MM_NETWORK_MODE_ANY, get_network_modes(modes))
Ejemplo n.º 2
0
    def test_NetworkSetNetworkMode(self):
        """Test for Network.SetNetworkMode"""
        modes = self.device.Get(CRD_INTFACE, 'SupportedModes',
                                dbus_interface=dbus.PROPERTIES_IFACE)
        if not modes:
            raise unittest.SkipTest("Cannot be tested")

        for mode in get_network_modes(modes):
            self.device.SetNetworkMode(mode)
            _mode = self.device.GetNetworkMode()
            self.assertEqual(mode, _mode)

        # leave it in MODE_ANY and give it some seconds to settle
        self.device.SetNetworkMode(MM_NETWORK_MODE_ANY)
        time.sleep(5)
Ejemplo n.º 3
0
    def test_NetworkSetAllowedMode(self):
        modes = self.device.Get(CRD_INTFACE, 'SupportedModes',
                                dbus_interface=dbus.PROPERTIES_IFACE)
        if not modes:
            raise unittest.SkipTest("Cannot be tested")

        for net_mode in get_network_modes(modes):
            mode = convert_network_mode_to_allowed_mode(net_mode)
            if mode is None:
                # could not convert it to allowed_mode
                continue

            self.device.SetAllowedMode(mode)
            allowed_mode = self.device.Get(NET_INTFACE, 'AllowedMode',
                                        dbus_interface=dbus.PROPERTIES_IFACE)
            self.assertEqual(mode, allowed_mode)

        # leave it in MODE_ANY and give it some seconds to settle
        self.device.SetAllowedMode(MM_ALLOWED_MODE_ANY)
        time.sleep(5)