Skip to content

Commit 3732f72

Browse files
author
Juhani Puurula
committed
Nanostack mac tester: document testcase steps in testcases
1 parent a513751 commit 3732f72

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed

TEST_APPS/testcases/nanostack_mac_tester/ED_scan.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def case(self):
7575
self.lock_th = threading.Lock()
7676
self.payload = "01234567890123456789012345678901234567890123456789"
7777

78+
# Start PAN coordinator
7879
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
80+
# Start PAN beacon
7981
self.command("Second", "start --pan_coordinator false --logical_channel {}".format(self.channel))
8082
self.command("Third", "start --pan_coordinator false --logical_channel {}".format(self.channel))
8183

@@ -90,12 +92,17 @@ def case(self):
9092
channels = range(11,27)
9193
for i in range(0, 3):
9294
self.lock_th.acquire()
95+
# Reset MAC settings
9396
self.command("First", "mlme-reset")
97+
# Start PAN coordinator
9498
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
9599
self.command("Third", "mlme-reset")
100+
# Start PAN beacon
96101
self.command("Third", "start --pan_coordinator false --logical_channel {}".format(self.channel))
97102
self.lock_th.release()
103+
# Scan all channels
98104
self.command("Second", "scan --scan_type 0 --scan_duration 7 --channel_mask {}".format(self.mask_from_channel_list(channels)))
105+
# Energy detection analysis
99106
self.command("Second", "analyze-ed --channel {} --above 100".format(self.channel))
100107

101108
def tearDown(self):

TEST_APPS/testcases/nanostack_mac_tester/address_read_and_write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def case(self):
5656
self.command("First", "addr")
5757
self.command("First", "addr --64-bit 01:02:03:00:00:00:00:01")
5858
self.command("First", "addr --16-bit 0xABCD")
59-
#macPANId
59+
# Set MAC PAN ID
6060
self.command("First", "mlme-set --attr 0x50 --value_bytes CD:CD --value_size 2")
6161
self.command("First", "addr")
6262
self.verify_trace(1, "MAC64: 01:02:03:00:00:00:00:01")

TEST_APPS/testcases/nanostack_mac_tester/create_and_join_PAN.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ def setUp(self):
6161
self.channel = 11
6262

6363
def case(self):
64-
#Beacon payload & length
64+
# Beacon payload
6565
self.command("First", "mlme-set --attr 0x45 --value_ascii mac-tester --value_size 10")
66+
# Beacon payload length
6667
self.command("First", "mlme-set --attr 0x46 --value_uint8 10 --value_size 1")
67-
68+
6869
self.command("Second", "mlme-set --attr 0x45 --value_ascii second-mac-tester --value_size 17")
6970
self.command("Second", "mlme-set --attr 0x46 --value_uint8 17 --value_size 1")
7071

72+
# Start PAN coordinator
7173
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
7274
self.command("Second", "start --pan_coordinator true --logical_channel {}".format(int(self.channel)+1))
7375
self.delay(3)

TEST_APPS/testcases/nanostack_mac_tester/send_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ def setUp(self):
5656
self.command("Second", "addr --64-bit 01:02:03:00:00:00:00:02")
5757

5858
def case(self):
59+
# Start PAN coordinator
5960
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
61+
# Start PAN beacon
6062
self.command("Second", "start --pan_coordinator false --logical_channel {}".format(self.channel))
6163

64+
# Send data
6265
self.command("First", "data --dst_addr 01:02:03:00:00:00:00:02 --msdu_length 5 --msdu abcde")
6366
self.command("Second", "data --dst_addr 01:02:03:00:00:00:00:01 --msdu_length 5 --msdu 12345")
6467

TEST_APPS/testcases/nanostack_mac_tester/send_data_indirect.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,52 @@ def setUp(self):
5858
self.command("Third", "addr --64-bit 01:02:03:00:00:00:00:03")
5959

6060
def case(self):
61+
# Start PAN coordinator
6162
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
63+
# Start PAN beacon
6264
self.command("Second", "start --pan_coordinator false --logical_channel {}".format(self.channel))
6365
self.command("Third", "start --pan_coordinator false --logical_channel {}".format(self.channel))
6466

65-
#macRxOnWhenIdle
67+
# Set MAC RX on-while-idle off
6668
self.command("Second", "mlme-set --attr 0x52 --value_uint8 0 --value_size 1")
6769
self.command("Third", "mlme-set --attr 0x52 --value_uint8 0 --value_size 1")
6870

71+
# Add neighbours
6972
self.command("First", "add-neigh --frame_ctr 0 --mac16 0xFFFF --mac64 01:02:03:00:00:00:00:02 --pan_id 0x1234 --index 0")
7073
self.command("First", "add-neigh --frame_ctr 0 --mac16 0xFFFF --mac64 01:02:03:00:00:00:00:03 --pan_id 0x1234 --index 1")
7174
self.command("Second", "add-neigh --frame_ctr 0 --mac16 0xFFFF --mac64 01:02:03:00:00:00:00:01 --pan_id 0x1234 --index 0")
7275
self.command("Third", "add-neigh --frame_ctr 0 --mac16 0xFFFF --mac64 01:02:03:00:00:00:00:01 --pan_id 0x1234 --index 0")
7376

77+
# Configure indirect data
7478
self.command("Second", "config-status --data_ind abcde")
7579
self.command("Third", "config-status --data_ind 12345")
7680

77-
#Runs into timing issues if extensive printing is enabled
81+
# Runs into timing issues if extensive printing is enabled
7882
self.command("*", "silent-mode on")
83+
84+
# Send data indirectly to DUT2
7985
self.command("First", "data --dst_addr 01:02:03:00:00:00:00:02 --msdu_length 5 --msdu abcde --indirect_tx true --wait_for_confirm false")
86+
# Poll DUT1 for data
8087
self.command("Second", "poll --coord_address 01:02:03:00:00:00:00:01")
8188

89+
# Send more data
8290
self.command("First", "data")
8391
self.command("First", "data")
92+
# Poll more data
8493
self.command("Second", "poll")
8594
self.command("Second", "poll")
95+
# Set expected poll return status to 0xEB(no data after poll)
8696
self.command("Second", "config-status --poll 235")
97+
# No data should remain to be polled for
8798
self.command("Second", "poll")
8899

100+
# Set expected poll return status to 0xEB(no data after poll)
89101
self.command("Second", "config-status --poll 235")
102+
# Send data to DUT3
90103
self.command("First", "data --dst_addr 01:02:03:00:00:00:00:03 --msdu 12345")
104+
# Poll(expected failure)
91105
self.command("Second", "poll")
106+
# Poll DUT1 for data(expected success)
92107
self.command("Third", "poll --coord_address 01:02:03:00:00:00:00:01")
93108
self.command("*", "silent-mode off")
94109

TEST_APPS/testcases/nanostack_mac_tester/send_large_payloads.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,25 @@ def setUp(self):
5858
def case(self):
5959
#104 characters, headers are 2+1+2+8+8+2=23 bytes, resulting in a packet size of 127 (max)
6060
large_payload = "0123456789abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZZZZZZZZZ0123456789012345678901234567891234"
61+
# Start PAN coordinator
6162
self.command("First", "start --pan_coordinator true --logical_channel {}".format(self.channel))
63+
# Start PAN beacon
6264
self.command("Second", "start --pan_coordinator false --logical_channel {}".format(self.channel))
6365

66+
# Set indirect data
6467
self.command("First", "config-status --data_ind {}".format(large_payload))
6568
self.command("Second", "config-status --data_ind {}".format(large_payload))
6669

70+
# Send data to DUT2
6771
self.command("First", "data --dst_addr 01:02:03:00:00:00:00:02 --msdu_length {} --msdu {}".format(len(large_payload), large_payload))
72+
# Wait for transmission to finish
6873
self.command("Second", "wait --timeout 500")
6974

75+
# Send data to DUT1
7076
self.command("Second", "data --dst_addr 01:02:03:00:00:00:00:01 --msdu_length {} --msdu {}".format(len(large_payload), large_payload))
77+
# Wait for transmission to finish
7178
self.command("First", "wait --timeout 500")
79+
# Loop with previous settings
7280
for i in range(0, 25):
7381
self.command("First", "data")
7482
self.command("Second", "wait")

0 commit comments

Comments
 (0)