コード例 #1
0
    def test_connection_success(self):
        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
        wd = IWD(True)

        try:
            self.validate_connection(wd)
        finally:
            auth.stop()
コード例 #2
0
ファイル: connection_test.py プロジェクト: ernestsora/iwd
    def setUpClass(cls):
        if not ctx.is_process_running('ofonod'):
            cls.skipTest(cls, "ofono not running")

        IWD.copy_to_storage('ssidEAP-AKA.8021x')

        cls.auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
コード例 #3
0
    def test_connection_success(self):
        hostapd = None

        for hostapd_if in list(hostapd_map.values()):
            hpd = HostapdCLI(hostapd_if)
            if hpd.get_config_value('ssid') == 'ssidEAP-AKA':
                hostapd = hpd
                break

        self.assertIsNotNone(hostapd)

        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')

        wd = IWD()

        devices = wd.list_devices(1)
        device = devices[0]

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        device.scan()

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        ordered_networks = device.get_ordered_networks()
        ordered_network = ordered_networks[0]

        self.assertEqual(ordered_network.name, "ssidEAP-AKA")
        self.assertEqual(ordered_network.type, NetworkType.eap)

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        try:
            ordered_network.network_object.connect()
        except:
            auth.stop()
            raise

        condition = 'obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        hostapd.eapol_reauth(device.address)

        wd.wait(10)

        condition = 'obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        device.disconnect()

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        auth.stop()
コード例 #4
0
    def test_connection_success(self):
        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
        wd = IWD(True)

        try:
            self.validate_connection(wd)
        except:
            del wd
            auth.stop()
            raise

        del wd
        auth.stop()
コード例 #5
0
    def test_connection_success(self):
        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')

        ofono = Ofono()
        ofono.enable_modem('/phonesim')
        ofono.wait_for_sim_auth()

        wd = IWD()

        devices = wd.list_devices()
        self.assertIsNotNone(devices)
        device = devices[0]

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        device.scan()

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        ordered_networks = device.get_ordered_networks()
        ordered_network = ordered_networks[0]

        self.assertEqual(ordered_network.name, "ssidEAP-AKA")
        self.assertEqual(ordered_network.type, NetworkType.eap)

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        try:
            ordered_network.network_object.connect()
        except:
            auth.stop()
            raise

        condition = 'obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        device.disconnect()

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        auth.stop()
コード例 #6
0
    def test_connection_success(self):
        auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')

        wd = IWD()

        devices = wd.list_devices(1)
        device = devices[0]

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        device.scan()

        condition = 'not obj.scanning'
        wd.wait_for_object_condition(device, condition)

        ordered_network = device.get_ordered_network('ssidEAP-AKA')

        self.assertEqual(ordered_network.type, NetworkType.eap)

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        try:
            ordered_network.network_object.connect()
        except:
            auth.stop()
            raise

        condition = 'obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        device.disconnect()

        condition = 'not obj.connected'
        wd.wait_for_object_condition(ordered_network.network_object, condition)

        auth.stop()
コード例 #7
0
    def setUpClass(cls):
        cls.auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')

        IWD.copy_to_storage('ssidEAP-PEAP-SIM.8021x')