コード例 #1
0
 def test_wpa2_psk_tkip_assoc(self):
     wtfconfig.aps[0].config = AP.APConfig(ssid="wtf-wpatest",
                                           security=AP.SECURITY_WPA2,
                                           auth=AP.AUTH_PSK,
                                           password="******",
                                           encrypt=AP.ENCRYPT_TKIP)
     self.startNodes()
     self.assocTest()
     self.pingTest()
コード例 #2
0
    def test_open_associate(self):
        wtfconfig.aps[0].config = AP.APConfig(ssid="wtf-assoctest", channel=6)

        self.startNodes()
        # give slow AP plenty of time to start
        time.sleep(5)
        self.assocTest()
        self.pingTest()
        self.throughput()
コード例 #3
0
 def test_15_connect_wifi_no_password(self):
     self.start_hostapd(ap.APConfig(ssid="wtf-arduino-ap"))
     self.setup_run(os.getcwd() +
                    '/platform/arduino/SimpleWiFi/SimpleWiFi.ino')
     # set to 20 incase connection takes longer than 10 seconds
     time.sleep(20)
     self.ffd.expect(re.escape("You're connected to the network"))
     # [1-9] first so we don't match 0.0.0.0 with d+.d+.d+.d+
     self.ffd.expect(re.escape("the ip is ") + r'[1-9]\d+\.\d+\.\d+\.\d+')
     self.stop_hostapd()
コード例 #4
0
 def test_16_connect_wifi_with_password(self):
     self.start_hostapd(
         ap.APConfig(ssid="wtf-arduino-pass-ap",
                     security=ap.SECURITY_WPA2,
                     auth=ap.AUTH_PSK,
                     password="******",
                     encrypt=ap.ENCRYPT_CCMP))
     self.setup_run(os.getcwd() +
                    '/platform/arduino/SimpleWiFiPass/SimpleWiFiPass.ino')
     # set to 20 incase connection takes longer than 10 seconds
     time.sleep(20)
     self.ffd.expect(
         re.escape("You're connected to the password protected network"))
     # [1-9] first so we don't match 0.0.0.0 with d+.d+.d+.d+
     self.ffd.expect(re.escape("the ip is ") + r'[1-9]\d+\.\d+\.\d+\.\d+')
     self.stop_hostapd()
コード例 #5
0
    def test_scan(self):
        wtfconfig.aps[0].config = AP.APConfig(ssid="wtf-scantest", channel=11)
        wtfconfig.aps[0].start()
        wtfconfig.stas[0].start()
        # try a few times since not all BSSs are found each scan
        found = None
        for i in range(3):
            results = wtfconfig.stas[0].scan()
            for r in results:
                if r.ssid == "wtf-scantest":
                    found = r
                    break
            if found != None:
                break

        self.failIf(found == None, "Failed to find ssid wtf-scantest")
        self.failIf(r.channel != 11, "Expected wtf-scantest on channel 11")