From d68c09c21c884713fe33266b0099dd39c397bda9 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 3 Apr 2018 18:37:07 +0200 Subject: [PATCH] pts/sm_test: all tests run --- test/pts/sm_test.c | 2 +- test/pts/sm_test.csv | 38 +++++++++++++++----------------------- test/pts/sm_test.py | 19 +++++++++++++------ 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/test/pts/sm_test.c b/test/pts/sm_test.c index 3bbc534df..d5316a6db 100644 --- a/test/pts/sm_test.c +++ b/test/pts/sm_test.c @@ -322,7 +322,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t * case SM_EVENT_AUTHORIZATION_REQUEST: break; case SM_EVENT_PAIRING_COMPLETE: - printf("PAIRING_COMPLETE: %u,%u\n", sm_event_pairing_complete_get_status(packet), sm_event_pairing_complete_get_reason(packet)); + printf("\nPAIRING_COMPLETE: %u,%u\n", sm_event_pairing_complete_get_status(packet), sm_event_pairing_complete_get_reason(packet)); if (sm_event_pairing_complete_get_status(packet)) break; if (we_are_central){ printf("Search for LE Counter service.\n"); diff --git a/test/pts/sm_test.csv b/test/pts/sm_test.csv index 61e2f799e..b80fece78 100644 --- a/test/pts/sm_test.csv +++ b/test/pts/sm_test.csv @@ -92,37 +92,35 @@ SM/MAS/SCPK/BI-01-C/04,0,0,8,8,0,0,9 SM/MAS/SCPK/BI-01-C/05,0,2,8,12,0,0,1 -SM/MAS/SCPK/BI-02-C,0,3,8,8,0,0,4 +SM/MAS/SCPK/BI-02-C,0,2,8,12,0,0,4 -SM/SLA/SCPK/BI-03-C,0,3,8,8,0,0,4 +SM/SLA/SCPK/BI-03-C,0,2,8,12,0,0,4 -SM/SLA/SCPK/BI-04-C/01,0,0,8,8,0,0,3 -SM/SLA/SCPK/BI-04-C/02,0,0,8,8,0,0,8 -SM/SLA/SCPK/BI-04-C/03,0,0,8,8,0,0,5 -SM/SLA/SCPK/BI-04-C/04,0,0,8,8,0,0,9 -SM/SLA/SCPK/BI-04-C/05,0,2,8,12,0,0,1 +SM/SLA/SCPK/BI-04-C/01,2,0,12,8,0,0,3 +SM/SLA/SCPK/BI-04-C/02,2,0,12,8,0,0,8 +SM/SLA/SCPK/BI-04-C/03,2,0,12,8,0,0,5 +SM/SLA/SCPK/BI-04-C/04,2,0,12,8,0,0,9 +SM/SLA/SCPK/BI-04-C/05,2,0,12,8,0,0,1 # -- Out-of-Band (SCOB) -# TODO: OOB not selected if at least one has OOB, OOB checked before MITM SM/MAS/SCOB/BV-01-C/01,0,0,12,12,0,1,0 SM/MAS/SCOB/BV-01-C/02,0,0,12,12,1,0,0 SM/MAS/SCOB/BV-01-C/03,0,0,12,12,1,1,0 -# TODO: OOB not selected if at least one has OOB, OOB checked before MITM SM/SLA/SCOB/BV-02-C/01,0,0,12,12,0,1,0 SM/SLA/SCOB/BV-02-C/02,0,0,12,12,1,0,0 SM/SLA/SCOB/BV-02-C/03,0,0,12,12,1,1,0 # RFU -SM/SLA/SCOB/BV-03-C/01,0,0,12,12,76,1,0 -SM/SLA/SCOB/BV-03-C/02,0,0,12,12,140,1,0 -SM/SLA/SCOB/BV-03-C/03,0,0,12,12,204,1,0 +SM/SLA/SCOB/BV-03-C/01,0,0,12,76,1,1,0 +SM/SLA/SCOB/BV-03-C/02,0,0,12,140,1,1,0 +SM/SLA/SCOB/BV-03-C/03,0,0,12,204,1,1,0 # RFU -SM/MAS/SCOB/BV-04-C/01,0,0,12,12,76,1,0 -SM/MAS/SCOB/BV-04-C/02,0,0,12,12,140,1,0 -SM/MAS/SCOB/BV-04-C/03,0,0,12,12,204,1,0 +SM/MAS/SCOB/BV-04-C/01,0,0,12,76,1,1,0 +SM/MAS/SCOB/BV-04-C/02,0,0,12,140,1,1,0 +SM/MAS/SCOB/BV-04-C/03,0,0,12,204,1,1,0 # failures SM/MAS/SCOB/BI-01-C/01,0,0,12,12,1,1,3 @@ -138,11 +136,5 @@ SM/SLA/SCOB/BI-02-C/03,0,0,12,12,1,1,5 SM/SLA/SCOB/BI-02-C/04,0,0,12,12,1,1,9 SM/SLA/SCOB/BI-02-C/05,0,0,12,12,1,1,2 -# TODO: tester responds with pairing failure during phase 2 -SM/SLA/SCOB/BI-03-C,0,3,8,8,0,0,4 - -# TODO: we enter incorrect Passkey, and get DHKey Check error instead of passkey entry failed -SM/MAS/SCOB/BI-04-C,0,2,8,12,0,0,1 - - - +SM/SLA/SCOB/BI-03-C,0,3,12,12,1,1,4 +SM/MAS/SCOB/BI-04-C,0,2,12,12,1,1,4 diff --git a/test/pts/sm_test.py b/test/pts/sm_test.py index f2e00f6ea..f3833021a 100755 --- a/test/pts/sm_test.py +++ b/test/pts/sm_test.py @@ -238,6 +238,9 @@ def run(test_descriptor, nodes): passkey = line.split(': ')[1] print('%s passkey display %s' % (node.get_name(), passkey)) test_descriptor['passkey'] = passkey + if node.get_name() == 'tester' and test_descriptor['tester_failure'] == '1': + print('Decline bonding') + node.write('d') if state == 'W4_PAIRING': state = 'W4_PASSKEY_INPUT' else: @@ -324,6 +327,8 @@ def write_config(fout, test_descriptor): iut = test_descriptor['passkey'] tester = test_descriptor['passkey'] elif attribute == 'method': + if not 'method' in test_descriptor: + continue iut = test_descriptor['method'] tester = test_descriptor['method'] elif attribute == 'failure': @@ -406,12 +411,14 @@ def run_test(test_descriptor): test_ok &= test_descriptor['iut_pairing_complete_status'] == '0' # check pairing method - if 'SCJW' in test_name and ( test_descriptor['method'] != 'Just Works' and test_descriptor['method' != 'Numeric Comparison']): - test_ok = False - if 'SCPK' in test_name and test_descriptor['method'] != 'Passkey Entry': - test_ok = False - if 'SCOB' in test_name and test_descriptor['method'] != 'OOB': - test_ok = False + if 'method' in test_descriptor: + method = test_descriptor['method'] + if 'SCJW' in test_name and (method != 'Just Works' and method != 'Numeric Comparison'): + test_ok = False + if 'SCPK' in test_name and method != 'Passkey Entry': + test_ok = False + if 'SCOB' in test_name and method != 'OOB': + test_ok = False # rename folder if test not ok if not test_ok: