tests: Give document string for each test case as a description

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-03-17 11:19:24 +02:00
parent 1a4d80b8d5
commit 47c34473f9
4 changed files with 13 additions and 0 deletions

View file

@ -61,6 +61,8 @@ def main():
for d in dev: for d in dev:
d.reset() d.reset()
print "START " + t.__name__ print "START " + t.__name__
if t.__doc__:
print "Test: " + t.__doc__
for d in dev: for d in dev:
d.request("NOTE TEST-START " + t.__name__) d.request("NOTE TEST-START " + t.__name__)
try: try:

View file

@ -27,6 +27,7 @@ def connect_cli(go, client):
hwsim_utils.test_connectivity_p2p(go, client) hwsim_utils.test_connectivity_p2p(go, client)
def test_autogo(dev): def test_autogo(dev):
"""P2P autonomous GO and client joining group"""
autogo(dev[0]) autogo(dev[0])
connect_cli(dev[0], dev[1]) connect_cli(dev[0], dev[1])
dev[0].remove_group() dev[0].remove_group()
@ -36,6 +37,7 @@ def test_autogo(dev):
pass pass
def test_autogo_2cli(dev): def test_autogo_2cli(dev):
"""P2P autonomous GO and two clients joining group"""
autogo(dev[0]) autogo(dev[0])
connect_cli(dev[0], dev[1]) connect_cli(dev[0], dev[1])
connect_cli(dev[0], dev[2]) connect_cli(dev[0], dev[2])
@ -57,6 +59,7 @@ def wlantest_tdls_clear(bssid, addr1, addr2):
"clear_tdls_counters", bssid, addr1, addr2]); "clear_tdls_counters", bssid, addr1, addr2]);
def test_autogo_tdls(dev): def test_autogo_tdls(dev):
"""P2P autonomous GO and two clients using TDLS"""
go = dev[0] go = dev[0]
logger.info("Start autonomous GO with fixed parameters " + go.ifname) logger.info("Start autonomous GO with fixed parameters " + go.ifname)
id = go.add_network() id = go.add_network()

View file

@ -10,6 +10,7 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def test_discovery(dev): def test_discovery(dev):
"""P2P device discovery and provision discovery"""
addr0 = dev[0].p2p_dev_addr() addr0 = dev[0].p2p_dev_addr()
addr1 = dev[1].p2p_dev_addr() addr1 = dev[1].p2p_dev_addr()
logger.info("Start device discovery") logger.info("Start device discovery")

View file

@ -109,6 +109,7 @@ def go_neg_pbc(i_dev, r_dev, i_intent=None, r_intent=None):
return [i_res, r_res] return [i_res, r_res]
def test_grpform(dev): def test_grpform(dev):
"""P2P group formation using PIN and authorized connection (init -> GO)"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0) go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
dev[0].remove_group() dev[0].remove_group()
try: try:
@ -117,6 +118,7 @@ def test_grpform(dev):
pass pass
def test_grpform2(dev): def test_grpform2(dev):
"""P2P group formation using PIN and authorized connection (resp -> GO)"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=0, r_dev=dev[1], r_intent=15) go_neg_pin_authorized(i_dev=dev[0], i_intent=0, r_dev=dev[1], r_intent=15)
dev[0].remove_group() dev[0].remove_group()
try: try:
@ -125,6 +127,7 @@ def test_grpform2(dev):
pass pass
def test_grpform3(dev): def test_grpform3(dev):
"""P2P group formation using PIN and re-init GO Negotiation"""
go_neg_pin(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0) go_neg_pin(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
dev[0].remove_group() dev[0].remove_group()
try: try:
@ -133,6 +136,7 @@ def test_grpform3(dev):
pass pass
def test_grpform_pbc(dev): def test_grpform_pbc(dev):
"""P2P group formation using PBC and re-init GO Negotiation"""
[i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0) [i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=0)
check_grpform_results(i_res, r_res) check_grpform_results(i_res, r_res)
if i_res['role'] != 'GO' or r_res['role'] != 'client': if i_res['role'] != 'GO' or r_res['role'] != 'client':
@ -144,12 +148,15 @@ def test_grpform_pbc(dev):
pass pass
def test_both_go_intent_15(dev): def test_both_go_intent_15(dev):
"""P2P GO Negotiation with both devices using GO intent 15"""
go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=15, expect_failure=True, i_go_neg_status=9) go_neg_pin_authorized(i_dev=dev[0], i_intent=15, r_dev=dev[1], r_intent=15, expect_failure=True, i_go_neg_status=9)
def test_both_go_neg_display(dev): def test_both_go_neg_display(dev):
"""P2P GO Negotiation with both devices trying to display PIN"""
go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='display', r_method='display') go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='display', r_method='display')
def test_both_go_neg_enter(dev): def test_both_go_neg_enter(dev):
"""P2P GO Negotiation with both devices trying to enter PIN"""
go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='enter', r_method='enter') go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='enter', r_method='enter')
def add_tests(tests): def add_tests(tests):