tests: Use random WPS PIN
authorJouni Malinen <j@w1.fi>
Sun, 6 Apr 2014 13:31:44 +0000 (16:31 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 6 Apr 2014 21:56:04 +0000 (00:56 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/wpasupplicant.py

index cb3d7cf..e65bf0c 100644 (file)
@@ -332,8 +332,9 @@ class WpaSupplicant:
         return self.global_request("P2P_STOP_FIND")
 
     def wps_read_pin(self):
-        #TODO: make this random
-        self.pin = "12345670"
+        self.pin = self.request("WPS_PIN get").rstrip("\n")
+        if "FAIL" in self.pin:
+            raise Exception("Could not generate PIN")
         return self.pin
 
     def peer_known(self, peer, full=True):