From aed1c0564f4ce43707768158c8c5c8994f231237 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 13 Apr 2014 19:25:00 +0300 Subject: [PATCH] tests: NFC_GET_HANDOVER_REQ/SEL Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ctrl.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index 562177a99..a04b8bf0a 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -638,6 +638,30 @@ def test_wpas_ctrl_nfc_tag_read(dev): if "FAIL" not in dev[0].request("WPS_NFC_TAG_READ " + v): raise Exception("Unexpected WPS_NFC_TAG_READ success for " + v) +def test_wpas_ctrl_nfc_get_handover(dev): + """wpa_supplicant ctrl_iface NFC_GET_HANDOVER""" + vals = [ "FOO", "FOO BAR", "WPS WPS", "WPS WPS-CR", "WPS FOO", "NDEF P2P" ] + for v in vals: + if "FAIL" not in dev[0].request("NFC_GET_HANDOVER_REQ " + v): + raise Exception("Unexpected NFC_GET_HANDOVER_REQ success for " + v) + + vals = [ "NDEF WPS", "NDEF P2P-CR", "WPS P2P-CR" ] + for v in vals: + if "FAIL" in dev[0].request("NFC_GET_HANDOVER_REQ " + v): + raise Exception("Unexpected NFC_GET_HANDOVER_REQ failure for " + v) + + vals = [ "FOO", "FOO BAR", "WPS WPS", "WPS WPS-CR", "WPS FOO", "NDEF P2P", + "NDEF WPS", "NDEF WPS uuid" ] + for v in vals: + if "FAIL" not in dev[0].request("NFC_GET_HANDOVER_SEL " + v): + raise Exception("Unexpected NFC_GET_HANDOVER_SEL success for " + v) + + vals = [ "NDEF P2P-CR", "WPS P2P-CR", "NDEF P2P-CR-TAG", + "WPS P2P-CR-TAG" ] + for v in vals: + if "FAIL" in dev[0].request("NFC_GET_HANDOVER_SEL " + v): + raise Exception("Unexpected NFC_GET_HANDOVER_SEL failure for " + v) + def get_blacklist(dev): return dev.request("BLACKLIST").splitlines()