test: update ci test case

This commit is contained in:
huchaoru 2017-12-18 19:24:09 +08:00 committed by bot
parent e184a2fc0b
commit f409a33653
57 changed files with 20174 additions and 21019 deletions

View File

@ -296,6 +296,7 @@ test_report:
only:
- master
- triggers
- schedules
- /^release\/v/
- /^v\d+\.\d+(\.\d+)?($|-)/
variables:
@ -514,6 +515,7 @@ assign_test:
- /^release\/v/
- /^v\d+\.\d+(\.\d+)?($|-)/
- triggers
- schedules
# gitlab ci do not support match job with RegEx or wildcard now in dependencies.
# we have a lot build example jobs and the binaries them exceed the limitation of artifacts.
# we can't artifact them in one job. For example test jobs, download all artifacts from previous stages.
@ -553,6 +555,7 @@ assign_test:
- /^release\/v/
- /^v\d+\.\d+(\.\d+)?($|-)/
- triggers
- schedules
allow_failure: true
dependencies:
- assign_test
@ -970,6 +973,48 @@ IT_003_07:
- ESP32_IDF
- SSC_T2_1
IT_003_08:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_09:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_10:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_11:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_12:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_13:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_14:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_004_01:
<<: *test_template
tags:
@ -982,30 +1027,18 @@ IT_005_01:
- ESP32_IDF
- SSC_T1_WEP
IT_006_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T3_PhyMode
IT_007_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_PhyMode
IT_008_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_PhyMode
IT_009_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T1_3
IT_010_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T5_1
IT_501_01:
<<: *test_template
tags:

File diff suppressed because it is too large Load Diff

View File

@ -1,302 +0,0 @@
test cases:
- ID: BTSTK_COEXIST_0101
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE advertise co-exist with WIFI
summary: BLE advertise co-exist with wifi scan
steps: '1. DUT2 BLE do advertise in range (0x20 - 0x40)
2. DUT2 do wifi scan and DUT1 do BLE scan
3. DUT2 BLE do advertise in range (0x400 - 0x800)
4. DUT2 do wifi scan and DUT1 do BLE scan'
expected result: '1. succeed
2. external AP in wifi scan result, and DUT2 in BLE scan result
3. succeed
4. external AP in wifi scan result, and DUT2 in BLE scan result'
initial condition: BLE_INIT2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC2 bleadv -D -z stop"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -L -c 0 -t 3"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0 -i 0x20-0x40"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 op -S -o 1"
- ["R SSC2 C +MODE:OK"]
- - "SSC SSC1 blescan -L -c 0"
- ["R SSC1 C +BLESCAN:SetScanParam,OK"]
- - "SSC SSC1 blescan -D -z start -t 2"
- [""]
- - "SSC SSC2 sta -S"
- ["P SSC2 P <ap_ssid>", "P SSC1 P <dut2_bt_mac> C Complete"]
- - "SSC SSC2 bleadv -D -z stop"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0 -i 0x400-0x800"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC1 blescan -D -z start -t 2"
- [""]
- - "SSC SSC2 sta -S"
- ["P SSC2 P <ap_ssid>", "P SSC1 P <dut2_bt_mac>"]
- ID: BTSTK_COEXIST_0102
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE advertise co-exist with WIFI
summary: BLE advertise co-exist with wifi join AP
steps: '1. DUT2 BLE do advertise in range (0x20 - 0x40)
2. DUT2 do wifi JAP and DUT1 do BLE scan
3. DUT2 BLE do advertise in range (0x400 - 0x800)
4. DUT2 do wifi JAP and DUT1 do BLE scan'
expected result: '1. succeed
2. JAP succeed, and DUT2 in BLE scan result
3. succeed
4. JAP succeed, and DUT2 in BLE scan result'
initial condition: BLE_INIT2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC2 bleadv -L -c 0 -t 3"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 op -S -o 1"
- ["R SSC2 C +MODE:OK"]
- - "SSC SSC1 blescan -L -c 0"
- ["R SSC1 C +BLESCAN:SetScanParam,OK"]
- - "SSC SSC2 sta -C -s <ap_ssid> -p <ap_password>"
- [""]
- - "SSC SSC1 blescan -D -z start -t 5"
- ["P SSC2 C +JAP:CONNECTED", "P SSC1 P <dut2_bt_mac> C Complete"]
- - "SSC SSC2 bleadv -D -z stop"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0 -i 0x400-0x800"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 sta -C -s <ap_ssid> -p <ap_password>"
- [""]
- - "SSC SSC1 blescan -D -z start -t 5"
- ["P SSC2 C +JAP:CONNECTED", "P SSC1 P <dut2_bt_mac> C Complete"]
- ID: BTSTK_COEXIST_0103
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE advertise co-exist with WIFI
summary: BLE advertise co-exist with wifi connected with AP
steps: '1. DUT2 BLE do advertise in range (0x20 - 0x40)
2. DUT2 do wifi JAP
3. DUT1 do BLE scan
4. DUT2 BLE do advertise in range (0x400 - 0x800)
5. DUT2 do wifi JAP
6. DUT1 do BLE scan'
expected result: '1. succeed
2. JAP succeed
3. STA not disconnected with AP and DUT2 in BLE scan result
4. succeed
5. JAP succeed
6. STA not disconnected with AP and DUT2 in BLE scan result'
initial condition: BLE_INIT2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC2 bleadv -L -c 0 -t 3"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 op -S -o 1"
- ["R SSC2 C +MODE:OK"]
- - "SSC SSC1 blescan -L -c 0"
- ["R SSC1 C +BLESCAN:SetScanParam,OK"]
- - "SSC SSC2 sta -C -s <ap_ssid> -p <ap_password>"
- ["P SSC2 C +JAP:CONNECTED"]
- - "SSC SSC1 blescan -D -z start -t 10"
- ["P SSC2 NC DISCONNECT", "P SSC1 P <dut2_bt_mac> C Complete"]
- - "SSC SSC2 bleadv -D -z stop"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 bleadv -D -z start -c 0 -i 0x400-0x800"
- ["R SSC2 C +BLEADV:OK"]
- - "SSC SSC2 sta -C -s <ap_ssid> -p <ap_password>"
- ["P SSC2 C +JAP:CONNECTED"]
- - "SSC SSC1 blescan -D -z start -t 10"
- ["P SSC2 NC DISCONNECT", "P SSC1 P <dut2_bt_mac> C Complete"]
- ID: BTSTK_COEXIST_0201
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE send recv co-exist with WIFI
summary: BLE send recv co-exist with wifi scan
steps: '1. DUT1 BLE read long with interval 50 ms
2. DUT1 do wifi scan
3. DUT1 BLE read long with interval 5 ms
4. DUT1 do wifi scan'
expected result: '1. succeed
2. external AP in wifi scan result, read succeed
3. succeed
4. external AP in wifi scan result, read succeed'
initial condition: BLE_CONN2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 gattc -D -z primaryService -p 0x10"
- ["R SSC1 C +GATTC:Discover,OK"]
- - "SSC SSC1 op -S -o 1"
- ["R SSC1 C +MODE:OK"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20 -j 50"
- ["P SSC1 C +GATTC:OK"]
- - "SSC SSC1 sta -S"
- ["P SSC1 P <ap_ssid>", "P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20 -j 5"
- ["P SSC1 C +GATTC:OK"]
- - "SSC SSC1 sta -S"
- ["P SSC1 P <ap_ssid>", "P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- ID: BTSTK_COEXIST_0202
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE send recv co-exist with WIFI
summary: BLE send recv co-exist with wifi join AP
steps: '1. DUT1 BLE read long with interval 50 ms
2. DUT1 do wifi JAP
3. DUT1 BLE read long with interval 5 ms
4. DUT1 do wifi JAP'
expected result: '1. succeed
2. JAP succeed, read succeed
3. succeed
4. JAP succeed, read succeed'
initial condition: BLE_CONN2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 gattc -D -z primaryService -p 0x10"
- ["R SSC1 C +GATTC:Discover,OK"]
- - "SSC SSC1 op -S -o 1"
- ["R SSC1 C +MODE:OK"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20"
- ["P SSC1 C +GATTC:OK"]
- - "SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>"
- ["P SSC1 C +JAP:CONNECTED", "P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20"
- ["P SSC1 C +GATTC:OK"]
- - "SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>"
- ["P SSC1 C +JAP:CONNECTED", "P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- ID: BTSTK_COEXIST_0203
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE send recv co-exist with WIFI
summary: BLE send recv co-exist with wifi join AP
steps: '1. DUT1 do wifi JAP
2. DUT1 BLE read long with interval 50 ms
3. DUT1 do wifi JAP
4. DUT1 BLE read long with interval 5 ms'
expected result: '1. succeed
2. JAP succeed, read succeed
3. succeed
4. JAP succeed, read succeed'
initial condition: BLE_CONN2
test environment: SSC_T2_1
execution time: 0
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 gattc -D -z primaryService -p 0x10"
- ["R SSC1 C +GATTC:Discover,OK"]
- - "SSC SSC1 op -S -o 1"
- ["R SSC1 C +MODE:OK"]
- - "SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>"
- ["P SSC1 C +JAP:CONNECTED", ""]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20"
- ["P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20"
- ["P SSC1 C +GATTC:Read,OK,0010,A000,C101"]
- ID: BTSTK_COEXIST_0301
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: BLE co-exist with WIFI on all channels
summary: BLE co-exist with wifi when join AP on different channels
steps: '1. DUT1 set to AP mode, DUT2 set to STA mode, config AP on a specific channel
2. DUT1 starts read long char
3. DUT2 join DUT1 soft AP
4. Loop step 1-3 for all 13 channels'
expected result: '1. succeed
2. succeed
3. succeed
4. succeed'
initial condition: BLE_CONN2
test environment: SSC_T2_1
execution time: 0.3
module: BT Stack
sub module: Coexist
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 gattc -D -z primaryService -p 0x10"
- ["R SSC1 C +GATTC:Discover,OK"]
- - "SSC SSC[1-2] op -S -o [2,1]"
- ["P SSC[1-2] C +MODE:OK"]
- - 'LOOP 13 3 "range(1,14)"'
- [""]
- - "SSC SSC1 ap -S -s <target_ssid> -p <target_password> -n {%d}"
- ["P SSC1 C +SAP:OK"]
- - "SSC SSC1 gattc -R -z char -p 0x10 -s 0xA000 -c 0xC101 -n 20"
- [""]
- - "SSC SSC2 sta -C -s <target_ssid> -c <target_password>"
- ["P SSC1 C +GATTC:Read,OK,0010,A000,C101", "P SSC2 C +JAP:CONNECTED"]

File diff suppressed because it is too large Load Diff

View File

@ -1,138 +0,0 @@
test cases:
- ID: BTSTK_MISC_0101
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: bt init and enable
summary: correct init and deinit flow
steps: '1. disable and deinit bt
2. init bt
3. deinit bt
4. init and enable bt
5. disable and deinit bt'
expected result: '1. succeed
2. succeed
3. succeed
4. succeed
5. succeed'
initial condition: BLE_DEINIT1
test environment: SSC_T1_1
execution time: 0
module: BT Stack
sub module: Misc
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z start"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT:OK"]
- ID: BTSTK_MISC_0102
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: bt init and enable
summary: incorrect deinit disable flow
steps: '1. disable and deinit bt
2. init and enable bt
3. deinit bt
4. disable bt
5. disable bt
6. deinit bt
7. deinit bt
8. disable bt'
expected result: '1. succeed
2. succeed
3. fail
4. succeed
5. fail
6. succeed
7. fail
8. fail'
initial condition: BLE_DEINIT1
test environment: SSC_T1_1
execution time: 0
module: BT Stack
sub module: Misc
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z start"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0103
SDK: ESP32_IDF
Test App: SSC_BLE
auto test: 'Yes'
category: Function
test point 1: basic function
test point 2: bt init and enable
summary: incorrect init enable flow
steps: '1. disable and deinit bt
2. enable bt
3. init bt
4. init bt
5. enable bt
6. enable bt
7. init bt'
expected result: '1. succeed
2. fail
3. succeed
4. fail
5. succeed
6. fail
7. fail'
initial condition: BLE_DEINIT1
test environment: SSC_T1_1
execution time: 0
module: BT Stack
sub module: Misc
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:ERROR"]

File diff suppressed because it is too large Load Diff

View File

@ -5,62 +5,21 @@
TCPIP_ICMP_0101
TCPIP_ICMP_0101_01
# don't support PHY mode command
WIFI_SCAN_0201
WIFI_SCAN_0302
WIFI_PHY_0401
WIFI_PHY_0402
WIFI_PHY_0403
WIFI_PHY_0404
WIFI_PHY_0405
WIFI_PHY_0407
WIFI_PHY_0406
WIFI_PHY_0408
WIFI_PHY_0501
WIFI_PHY_0502
WIFI_PHY_0503
WIFI_PHY_0504
WIFI_PHY_0505
WIFI_PHY_0506
# Bug or not stable cases
# BUG
# Wifi
# auth change event
WIFI_CONN_0801
WIFI_CONN_0801_01
# Wifi heap size issue
WIFI_CONN_1101
# disconnect reason
WIFI_CONN_0901
WIFI_CONN_0901_01
WIFI_CONN_0904
WIFI_CONN_0904_01
WIFI_CONN_0902_01
WIFI_CONN_0902
# Wifi connect issue
# Wifi scan issue
WIFI_SCAN_0303
WIFI_SCAN_0303_01
WIFI_CONN_0101
WIFI_CONN_0101_01
WIFI_CONN_0102
WIFI_CONN_0102_01
WIFI_CONN_0103
WIFI_CONN_0103_01
WIFI_CONN_0104
WIFI_CONN_0104_01
WIFI_CONN_0201
WIFI_CONN_0201_01
WIFI_CONN_0401
WIFI_CONN_0401_01
WIFI_CONN_0601
WIFI_CONN_0601_01
WIFI_ADDR_0102
WIFI_ADDR_0102_01
WIFI_CONN_0502
WIFI_CONN_0502_01
WIFI_CONN_0501
WIFI_CONN_0501_01
WIFI_CONN_0903_01
# Wifi scan issue
WIFI_SCAN_0101
WIFI_SCAN_0101_01
WIFI_SCAN_0102
@ -69,231 +28,59 @@ WIFI_SCAN_0103
WIFI_SCAN_0103_01
WIFI_SCAN_0104
WIFI_SCAN_0104_01
WIFI_SCAN_0105
WIFI_SCAN_0105_01
WIFI_SCAN_0201_01
WIFI_SCAN_0303
WIFI_SCAN_0303_01
WIFI_SCAN_0304
WIFI_SCAN_0304_01
WIFI_MODE_0101
WIFI_MODE_0102
WIFI_MODE_0103
WIFI_ADDR_0102
WIFI_ADDR_0102_01
# IGMP cases are supported but as UDP is not stable, exclude them first
TCPIP_IGMP_0101
TCPIP_IGMP_0102
TCPIP_IGMP_0103
TCPIP_IGMP_0104
# IGMP
TCPIP_IGMP_0201
TCPIP_IGMP_0202
TCPIP_IGMP_0203
TCPIP_IGMP_0204
TCPIP_IGMP_0101_01
TCPIP_IGMP_0102_01
TCPIP_IGMP_0103_01
TCPIP_IGMP_0104_01
TCPIP_IGMP_0201_01
TCPIP_IGMP_0202
TCPIP_IGMP_0202_01
TCPIP_IGMP_0203_01
TCPIP_IGMP_0204
TCPIP_IGMP_0204_01
# DHCP issues
TCPIP_DHCP_0101
TCPIP_DHCP_0101_01
TCPIP_DHCP_0202
TCPIP_DHCP_0202_01
TCPIP_DHCP_0204
TCPIP_DHCP_0204_01
TCPIP_DHCP_0205
TCPIP_DHCP_0205_01
TCPIP_DHCP_0206
TCPIP_DHCP_0206_01
TCPIP_DHCP_0207
TCPIP_DHCP_0207_01
TCPIP_DHCP_0208
TCPIP_DHCP_0208_01
TCPIP_DHCP_0209
TCPIP_DHCP_0209_01
TCPIP_DHCP_0210
TCPIP_DHCP_0210_01
TCPIP_DHCP_0211
TCPIP_DHCP_0211_01
TCPIP_DHCP_0301
TCPIP_DHCP_0301_01
TCPIP_DHCP_0302
TCPIP_DHCP_0302_01
# TCP issue
TCPIP_TCP_0101
TCPIP_TCP_0101_01
TCPIP_TCP_0102
TCPIP_TCP_0102_01
TCPIP_TCP_0103
TCPIP_TCP_0103_01
TCPIP_TCP_0104
TCPIP_TCP_0104_01
TCPIP_TCP_0105
TCPIP_TCP_0105_01
TCPIP_TCP_0106
TCPIP_TCP_0106_01
TCPIP_TCP_0107
TCPIP_TCP_0107_01
TCPIP_TCP_0112
TCPIP_TCP_0112_01
TCPIP_TCP_0201
TCPIP_TCP_0201_01
TCPIP_TCP_0202
TCPIP_TCP_0202_01
TCPIP_TCP_0203
TCPIP_TCP_0203_01
TCPIP_TCP_0204
TCPIP_TCP_0204_01
TCPIP_TCP_0206
TCPIP_TCP_0206_01
TCPIP_TCP_0208
TCPIP_TCP_0208_01
TCPIP_TCP_0210
TCPIP_TCP_0210_01
TCPIP_TCP_0401
TCPIP_TCP_0401_01
TCPIP_TCP_0402
TCPIP_TCP_0402_01
TCPIP_TCP_0403
TCPIP_TCP_0403_01
TCPIP_TCP_0404
TCPIP_TCP_0404_01
TCPIP_TCP_0406
TCPIP_TCP_0406_01
TCPIP_TCP_0407
TCPIP_TCP_0407_01
TCPIP_TCP_0408
TCPIP_TCP_0408_01
TCPIP_TCP_0412
TCPIP_TCP_0412_01
TCPIP_TCP_0411
TCPIP_TCP_0411_01
# UDP issue
TCPIP_UDP_0102
TCPIP_UDP_0102_01
# UDP
TCPIP_UDP_0103
TCPIP_UDP_0103_01
TCPIP_UDP_0104
TCPIP_UDP_0104_01
TCPIP_UDP_0108
TCPIP_UDP_0108_01
TCPIP_UDP_0110
TCPIP_UDP_0110_01
TCPIP_UDP_0111
TCPIP_UDP_0111_01
TCPIP_UDP_0112
TCPIP_UDP_0112_01
TCPIP_UDP_0301
TCPIP_UDP_0301_01
TCPIP_UDP_0302
TCPIP_UDP_0302_01
TCPIP_UDP_0303
TCPIP_UDP_0303_01
TCPIP_UDP_0304
TCPIP_UDP_0304_01
TCPIP_UDP_0305
TCPIP_UDP_0305_01
TCPIP_UDP_0306
TCPIP_UDP_0306_01
TCPIP_UDP_0307
TCPIP_UDP_0307_01
#DNS
TCPIP_DNS_0101
TCPIP_DNS_0101_01
TCPIP_DNS_0102
TCPIP_DNS_0102_01
TCPIP_DNS_0103
TCPIP_DNS_0103_01
# BLE
# BT heap size issue
BTSTK_MISC_0301
# SMP
BTSTK_SMP_05001
BTSTK_SMP_05002
BTSTK_SMP_05003
BTSTK_SMP_06004
# BT Stack
# GAP
BTSTK_GAP_07003
BTSTK_GAP_06003
# GATT
BTSTK_GATT_21005
BTSTK_GATT_25013
BTSTK_GATT_25001
BTSTK_GATT_25002
BTSTK_GATT_25003
BTSTK_GATT_25004
BTSTK_GATT_25005
BTSTK_GATT_25006
BTSTK_GATT_25007
BTSTK_GATT_25008
BTSTK_GATT_25009
BTSTK_GATT_25010
BTSTK_GATT_25011
BTSTK_GATT_25012
BTSTK_GATT_25013
BTSTK_GATT_25014
# BT cases that might fail
BTSTK_GAP_01003
BTSTK_GAP_03005
BTSTK_GAP_04002
BTSTK_GAP_05001
BTSTK_GAP_06001
BTSTK_GAP_06002
BTSTK_GAP_06004
BTSTK_GAP_06005
BTSTK_GAP_03002
BTSTK_GAP_03004
BTSTK_GAP_09003
BTSTK_GAP_09002
BTSTK_GATT_21002
BTSTK_GATT_21006
BTSTK_GATT_21007
BTSTK_GATT_21008
BTSTK_GATT_21011
BTSTK_GATT_21013
BTSTK_GATT_21014
BTSTK_GATT_22003
BTSTK_GATT_22004
BTSTK_GATT_22008
BTSTK_GATT_22009
BTSTK_GATT_22010
BTSTK_GATT_22023
BTSTK_GATT_25006
BTSTK_GATT_23010
BTSTK_GATT_23003
BTSTK_GATT_25005
BTSTK_GATT_25007
BTSTK_GATT_25014
BTSTK_GATT_20001
BTSTK_GATT_20002
BTSTK_GATT_23007
BTSTK_GATT_24003
BTSTK_GATT_26006
BTSTK_COEXIST_0101
BTSTK_COEXIST_0102
BTSTK_COEXIST_0103
BTSTK_COEXIST_0201
BTSTK_COEXIST_0202
BTSTK_COEXIST_0203
BTSTK_COEXIST_0301
# new failed caused by GATTC can't get correct attribute handle
BTSTK_GATT_22001
BTSTK_GATT_22002
BTSTK_GATT_22014
BTSTK_GATT_22013
BTSTK_GATT_22012
BTSTK_GATT_22011
BTSTK_GATT_22017
BTSTK_GATT_22016
BTSTK_GATT_22015
BTSTK_GATT_22019
BTSTK_GATT_22018
# GAP multi connect
BTSTK_GAP_10001
BTSTK_GAP_10002
BTSTK_GAP_10003
BTSTK_GAP_10004
BTSTK_GAP_11001
BTSTK_GAP_11002
BTSTK_GAP_12001
BTSTK_GAP_12002
BTSTK_GATT_30001
BTSTK_GATT_30002
BTSTK_GATT_30003
BTSTK_GATT_31001
BTSTK_GATT_31002
BTSTK_GATT_31003
BTSTK_GATT_32001
BTSTK_GATT_32002
BTSTK_GATT_32003
BTSTK_GATT_32004
BTSTK_GATT_33001
BTSTK_GATT_33002
BTSTK_GATT_33003
BTSTK_GATT_34001
BTSTK_GATT_34002
BTSTK_GATT_34003

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,529 @@
.MISC_CASE: &MISC_CASE
SDK: ESP32_IDF
Test App: SSC_BLE_WIFI
auto test: 'Yes'
category: Function
test point 1: basic function
initial condition: BLE_DEINIT1
test environment: SSC_T1_1
execution time: 0
module: BT Stack
sub module: Misc
version: v1 (2016-12-31)
CI ready: 'Yes'
level: Integration
allow fail: ''
test cases:
- ID: BTSTK_MISC_0101
<<: *MISC_CASE
test point 2: bt init and enable
summary: correct init and deinit flow
steps: |
1. disable and deinit bt
2. init bt
3. deinit bt
4. init and enable bt
5. disable and deinit bt
expected result: |
1. succeed
2. succeed
3. succeed
4. succeed
5. succeed
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z start"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT:OK"]
- ID: BTSTK_MISC_0102
<<: *MISC_CASE
test point 2: bt init and enable
summary: incorrect deinit disable flow
steps: |
1. disable and deinit bt
2. init and enable bt
3. deinit bt
4. disable bt
5. disable bt
6. deinit bt
7. deinit bt
8. disable bt
expected result: |
1. succeed
2. succeed
3. fail
4. succeed
5. fail
6. succeed
7. fail
8. fail
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z start"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0103
<<: *MISC_CASE
test point 2: bt init and enable
summary: incorrect init enable flow
steps: |
1. disable and deinit bt
2. enable bt
3. init bt
4. init bt
5. enable bt
6. enable bt
7. init bt
expected result: |
1. succeed
2. fail
3. succeed
4. fail
5. succeed
6. fail
7. fail
cmd set:
- ""
- - "SSC SSC1 bt -D -z stop"
- ["R SSC1 C +BT"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0201
<<: *MISC_CASE
test point 2: bt controller init test
summary: bt controller init test
steps: |
1. bt controller init
expected result: |
1. OK
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- ID: BTSTK_MISC_0202
<<: *MISC_CASE
test point 2: bt controller deinit test
summary: bt controller deinit test
steps: |
1. bt controller init
2. bt controller deinit
expected result: |
1. OK
2. OK
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z deinit"
- ["R SSC1 C +BTC:OK"]
- ID: BTSTK_MISC_0203
<<: *MISC_CASE
test point 2: bt host init test
summary: bt host init test
steps: |
1. bt controller init
2. bt controller enable
3. bt host init
expected result: |
1. +BTC:OK
2. +BTC:OK
3. +BT:OK
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- ID: BTSTK_MISC_0204
<<: *MISC_CASE
test point 2: bt host deinit test
summary: bt host deinit test
steps: |
1. bt controller init
2. bt controller enable
3. bt host init
4. bt host deinit
expected result: |
1. OK
2. OK
3. OK
4. OK
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- ID: BTSTK_MISC_0301
<<: *MISC_CASE
test point 2: heap size unchanged after bt controller stop
summary: heap size unchanged after bt controller stop
steps: |
1.get current heap size
2.bt controller init
3.enable bt controller
4.bt host init
5.enable bt host
6.disable bt host
7.bt host deinit
8.disable bt controller
9.bt controller deinit
10.check current heap size
expected result: |
1. +FREEHEAP
2.OK
3.OK
4.OK
5.OK
6.OK
7.OK
8.OK
9.OK
10.heap size unchanged
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 ram -Q"
- ['R SSC1 A <heapsize>:\+FREEHEAP:(\d+)\r\n']
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z disable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z deinit"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 btc -D -z disable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z deinit"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 ram -Q"
- ['R SSC1 P <heapsize>']
- ID: BTSTK_MISC_0401
<<: *MISC_CASE
test point 2: bt controller init and enable
summary: incorrect init enable flow
steps: |
1. disable and deinit btc
2. enable btc
3. init btc
4. init btc
5. enable btc
6. enable btc
7. init btc
expected result: |
1. succeed
2. fail
3. succeed
4. fail
5. succeed
6. fail
7. fail
initial condition: WIFIBTSTOP
cmd set:
- ""
- - "SSC SSC1 btc -D -z stop"
- ["R SSC1 C +BTC"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:ERROR"]
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:ERROR"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:ERROR"]
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:ERROR"]
- ID: BTSTK_MISC_0402
<<: *MISC_CASE
test point 2: bt controller init and enable
summary: correct init and deinit flow
steps: |
1. disable and deinit btc
2. init btc
3. deinit btc
4. init and enable btc
5. disable and deinit btc
expected result: |
1. succeed
2. succeed
3. succeed
4. succeed
5. succeed
cmd set:
- ""
- - "SSC SSC1 btc -D -z stop"
- ["R SSC1 C +BTC"]
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z deinit"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z start"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z stop"
- ["R SSC1 C +BTC:OK"]
- ID: BTSTK_MISC_0403
<<: *MISC_CASE
test point 2: bt controller init and enable
summary: incorrect deinit disable flow
steps: |
1. disable and deinit btc
2. init and enable btc
3. deinit btc
4. disable btc
5. disable btc
expected result: |
1. succeed
2. succeed
3. fail
4. succeed
5. fail
cmd set:
- ""
- - "SSC SSC1 btc -D -z stop"
- ["R SSC1 C +BTC"]
- - "SSC SSC1 btc -D -z start"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z deinit"
- ["R SSC1 C +BTC:ERROR"]
- - "SSC SSC1 btc -D -z disable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z disable"
- ["R SSC1 C +BTC:ERROR"]
- ID: BTSTK_MISC_0501
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT memory
steps: |
1. DUT1 release BT mem
2. DUT1 init and enable btc
expected result: |
1. succeed
2. fail
initial condition: BTC_DEINIT1
cmd set:
- ""
- - "SSC SSC1 bt -R -m 1"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 btc -D -z start -m 2"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z start -m 1"
- ["R SSC1 C +BTC:ERROR"]
- ID: BTSTK_MISC_0502
<<: *MISC_CASE
test point 2: bt mem release
summary: release BLE memory
steps: |
1. DUT1 release BT mem
2. DUT1 init and enable btc
expected result: |
1. succeed
2. fail
initial condition: BTC_DEINIT1
cmd set:
- ""
- - "SSC SSC1 bt -R -m 2"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 btc -D -z start -m 1"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z start -m 2"
- ["R SSC1 C +BTC:ERROR"]
- ID: BTSTK_MISC_0503
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT and BLE memory
steps: |
1. DUT1 release BT mem
2. DUT1 init and enable btc
expected result: |
1. succeed
2. fail
initial condition: BTC_DEINIT1
cmd set:
- ""
- - "SSC SSC1 bt -R -m 3"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 btc -D -z start -m 3"
- ["R SSC1 C +BTC:ERROR"]
- ID: BTSTK_MISC_0504
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT memory after bt controller init
initial condition: BTC_DEINIT1
steps: |
1. DUT1 init bt controller
2. DUT1 release BT memory
3. DUT1 release BLE memory
4. DUT1 release BT and BLE memory
expected result: |
1. succeed
2. fail
3. fail
4. fail
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 bt -R -m 1"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 2"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 3"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0505
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT memory after bt controller enable and bluedriod disable
initial condition: BTC_DEINIT1
steps: |
1. DUT1 init and enable bt controller
2. DUT1 release BT memory
3. DUT1 release BLE memory
4. DUT1 release BT and BLE memory
expected result: |
1. succeed
2. fail
3. fail
4. fail
cmd set:
- ""
- - "SSC SSC1 btc -D -z init"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 btc -D -z enable"
- ["R SSC1 C +BTC:OK"]
- - "SSC SSC1 bt -R -m 1"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 2"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 3"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0506
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT memory after bt controller enable and bluedriod init
steps: |
1. DUT1 init bluedriod
2. DUT1 release BT memory
3. DUT1 release BLE memory
4. DUT1 release BT and BLE memory
expected result: |
1. succeed
2. fail
3. fail
4. fail
cmd set:
- ""
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -R -m 1"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 2"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 3"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_0507
<<: *MISC_CASE
test point 2: bt mem release
summary: release BT memory after bt controller enable and bluedriod enable
steps: |
1. DUT1 init and enable bluedriod
2. DUT1 release BT memory
3. DUT1 release BLE memory
4. DUT1 release BT and BLE memory
expected result: |
1. succeed
2. fail
3. fail
4. fail
cmd set:
- ""
- - "SSC SSC1 bt -D -z init"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -D -z enable"
- ["R SSC1 C +BT:OK"]
- - "SSC SSC1 bt -R -m 1"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 2"
- ["R SSC1 C +BT:ERROR"]
- - "SSC SSC1 bt -R -m 3"
- ["R SSC1 C +BT:ERROR"]
- ID: BTSTK_MISC_5001
<<: *MISC_CASE
category: Performance
test point 1: performance + stress
test point 2: BT Controller Performance test
summary: bt controller init and deinit Performance test
execution time: 6
steps: |
1.get current heap size
2.bt controller init
3.enable bt controller
4.bt host init
5.enable bt host
6.disable bt host
7.bt host deinit
8.disable bt controller
9.bt controller deinit
10.loop step1 to step 9
expected result: |
1. +FREEHEAP
2.OK
3.OK
4.OK
5.OK
6.OK
7.OK
8.OK
9.OK
10.heap size unchanged
cmd set:
- "BLEStress/BLEInitDeinitPerformance"
- - "test_time = 420"
- ""

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
test cases:
- CI ready: 'Yes'
ID: SYS_MISC_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 reboot
- - R SSC1 C !!!ready!!!
execution time: 0.0
expected result: 重启成功
initial condition: None
level: Integration
module: System
steps: 系统重启
sub module: Misc
summary: test reboot function
test environment: SSC_T1_1
test point 1: basic function
test point 2: sw reboot
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: SYS_MISC_0201
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ram -H
- - R SSC1 RE FREEHEAP:\d+\r\n
execution time: 0.0
expected result: |2
可以查询到一个数值
initial condition: None
level: Integration
module: System
steps: 查询空闲ram
sub module: Misc
summary: get heap size test
test environment: SSC_T1_1
test point 1: basic function
test point 2: 'get heap size '
version: v1 (2016-8-15)
- CI ready: 'No'
ID: SYS_MISC_5001
SDK: |-
8266_NonOS
8266_RTOS
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set: ''
execution time: 12.0
expected result: 4.target1正常运行无异常
initial condition: None
level: Integration
module: System
steps: |-
1.target1、target2通过UART与PC相连接
2.target1的晶振为40MHz晶振烧录SDK的时候选择26MHz晶振
3.target2的GPIO PIN脚通过排线与target1的电源相连接target1与target2 GND通过排线连接
4.PC发送命令控制target2使GPIO不停的拉高拉低
sub module: Misc
summary: random reboot to confirm default init data bin will not overwrite user
config
test environment: SSC_T1_InitData
test point 1: stress
test point 2: reboot when using user defined init data bin
version: v1 (2016-8-15)

View File

@ -0,0 +1,57 @@
test cases:
- CI ready: SpecialJob
ID: SYS_NVS_01001
SDK: ESP32_IDF
Test App: SSC_BLE_WIFI
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- NVSTest/NVSCompatibleWiFi
- - nvs_path = "nvs_bin_folder"
- - ''
execution time: 0
expected result: |
1. succeed
2. succeed
3. succeed
4. succeed
initial condition: None
level: Integration
module: System
steps: |
1. get NVS data from earlier released branches and last master
2. download each NVS data to target
3. check if auto connected to the same AP
4. check if SoftAP config is correct
sub module: NVS
summary: use old NVS data WIFI function test
test environment: SSC_T1_1
test point 1: compatiable test
test point 2: test if latest SDK work with pervious version of NVS data
version: v1 (2017-06-01)
- CI ready: 'No'
ID: SYS_NVS_5001
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: Reboot
auto test: 'Yes'
category: Stress
cmd set: ''
execution time: 12.0
expected result: 3.无异常发生
initial condition: None
level: Integration
module: System
steps: |-
1.target1、target2通过UART与PC相连接
2.target2的GPIO PIN脚通过排线与target1的电源相连接target1与target2 GND通过排线连接
3.PC发送命令控制target2使GPIO不停的拉高拉低
sub module: NVS
summary: random reboot when access NVS
test environment: NVS_T1_1
test point 1: stress
test point 2: reboot when accessing NVS
version: v1 (2016-8-15)

View File

@ -0,0 +1,993 @@
test cases:
- CI ready: 'Yes'
ID: TCPIP_DHCP_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -E -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 ip -S -i 0.0.0.0
- - R SSC1 C +IP
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - ''
- - DELAY 20
- - P PC_COM C +DELAYDONE
- P SSC1 NC +JAP:CONNECTED
- - SSC SSC1 dhcp -S -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 ip -Q
- - R SSC1 C +STAIP:0.0.0.0
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 C +JAP:CONNECTED
- - SSC SSC1 ip -Q
- - R SSC1 RE "\+STAIP:%%s"%%(<target_ip>)
execution time: 0.0
expected result: "1.target1 关闭DHCP OK\n2.target1 设置ip add OK\n3.target1 连接AP fail\n4.target1
打开DHCP OK\n5.查询到sta ip \n6.target1 连接AP ok\n7.查询到sta ip 为target_ip"
initial condition: STAM1
level: Integration
module: TCPIP
steps: "1.target1 关闭DHCP OK\n2.target1 设置ip add OK\n3.target1 连接AP fail\n4.target1
打开DHCP OK\n5.查询到sta ip \n6.target1 连接AP ok\n7.查询到sta ip 为target_ip"
sub module: DHCP
summary: dhcp client function test
test environment: SSC_T1_1
test point 1: basic function
test point 2: DHCP client function test
version: v2 (2016-10-19)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0103
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 op -S -o 3
- - R SSC1 C +MODE:OK
- - SSC SSC1 dhcp -S -o 3
- - R SSC1 C +DHCP:AP,OK C +DHCP:STA,OK
- - SSC SSC1 dhcp -Q -o 3
- - R SSC1 C +DHCP:STA,STARTED C +DHCP:AP,STARTED
- - SSC SSC1 dhcp -Q -o 1
- - R SSC1 C +DHCP:STA,STARTED NC +DHCP:AP,STARTED
- - SSC SSC1 dhcp -Q -o 2
- - R SSC1 NC +DHCP:STA,STARTED C +DHCP:AP,STARTED
- - SSC SSC1 dhcp -E -o 3
- - R SSC1 C +DHCP:AP,OK C +DHCP:STA,OK
- - SSC SSC1 dhcp -Q -o 3
- - R SSC1 C +DHCP:STA,STOPPED C +DHCP:AP,STOPPED
execution time: 0.0
expected result: |-
1.OK
2.OK
3.STA&AP STARTED
4.STA STARTED
5.AP STARTED
6.OK
7.STA&AP STOPPED
initial condition: STAM1
level: Integration
module: TCPIP
steps: |-
1.target1 设置mode 为sta+softAP mode
2.target1 打开DHCP 3
3.target1 查询DHCP 状态
4.target1 查询sta DHCP 状态
5.target1 查询softAP DHCP 状态
6.target1 关闭 DHCP 3
7.target1 查询 DHCP 状态
sub module: DHCP
summary: dhcp status query
test environment: SSC_T1_1
test point 1: basic function
test point 2: DHCP client function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0201
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 ip -S -o 2 -i <target_ap_ip>
- - R SSC1 C +IP:OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -L -s 192.168.4.1 -e 192.168.4.10
- - R SSC1 C +DHCP:LEASE,ERROR
- - SSC SSC1 dhcp -L -s 192.168.4.5 -e 192.168.4.2
- - R SSC1 C +DHCP:LEASE,ERROR
- - SSC SSC1 dhcp -L -s 192.168.2.2 -e 192.168.2.5
- - R SSC1 C +DHCP:LEASE,ERROR
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
execution time: 0.0
expected result: |-
1.target1 关闭DHCP 2 OK
2.target1 设置ip 成功
3.设置dhcp 地址池 OK
4.ERROR
5.ERROR
6.ERROR
7.target1 打开DHCP ok
initial condition: APM1
level: Integration
module: TCPIP
steps: "1.target1 关闭DHCP 2 \n2.target1 设置ip \n3.设置dhcp 地址池\n4.设置dhcp错误的参数\n5.设置dhcp错误的参数\n6.设置dhcp错误的参数\n7.target1
打开DHCP ok"
sub module: DHCP
summary: server dhcp lease test
test environment: SSC_T1_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0202
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - LOOP 3 4 "['01','02','03']" "[2,3,4]"
- - ''
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:{%s}
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.{%s}
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3,4: get IP from dhcp pool with correct sequence
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. config DHCP Server on Target1
3. target change mac, connect to Target1
4. Loop step3
sub module: DHCP
summary: dhcp server ip pool
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0203
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.3
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - LOOP 2 4 "['01','02']" "[2,3]"
- - ''
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:{%s}
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.{%s}
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:66
- - R SSC2 C +MAC:STA,OK
- - DELAY 20
- - ''
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:0.0.0.0
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4.1 succeed
4.2 failed
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. config DHCP Server on Target1(.4.2 - .4.3)
3. target change mac, connect to Target1
4. Loop step3 twice
sub module: DHCP
summary: dhcp server ip pool empty
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0204
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.3 -t 1
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.2
- - DELAY 90
- - ''
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.2
- - SSC SSC2 sta -D
- - R SSC2 C +JAP:DISCONNECTED
- - DELAY 60
- - ''
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:66
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.2
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. get IP 192.168.4.2
5. succeed
6. succeed
8. get IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. config DHCP timeout as 1 minute
3. target2 connect to target1
4. wait 90 seconds
5. check if target2 IP is same
6. target2 disconnect
7. wait 60s
8. target2 change mac and connect to target1
sub module: DHCP
summary: dhcp server timeout test
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0205
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.3 -t 1
- - P SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - P SSC1 C +DHCP:AP,OK
- P SSC2 C +JAP:DISCONNECTED
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. target2 wifi disconnected
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1
3. disable DHCP server, do config and enable
sub module: DHCP
summary: disconnect STA if config dhcp server
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0206
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - LOOP 4 4 "['01','02','03','01']" "[2,3,4,2]"
- - ''
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:{%s}
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.{%s}
execution time: 0.0
expected result: |-
1. succeed
2. succeed
4. get IP 192.168.4.2 - 192.168.4.4
5. get IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. disable DHCP server, do config and enable
3. target2 change mac, connect to softap, disconnect
4. Loop step3 twice
5. change to first mac, connect to softap
sub module: DHCP
summary: dhcp server assign same IP to same MAC when it's not released
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0207
SDK: |-
8266_NonOS
8266_RTOS
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - WIFI <pc_wifi_nic> DISCONN2
- - R PC_COM NC ERROR C +WIFIDISCONN:OK
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:66
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.2
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. get IP 192.168.4.2
4. succeed
5. succeed
6. get IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. disable DHCP server, do config and enable
3. PC WIFI NIC connect to target1 softap
4. target2 connect to target1 softap and disnnect
5. PC release IP and disconnected
6. target2 change mac and connect to target1
sub module: DHCP
summary: dhcp server prefer assign released IP to new client
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0207
SDK: ESP32_IDF
Test App: SSC
allow fail: '1/2'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - WIFI <pc_wifi_nic> DISCONN2
- - R PC_COM NC ERROR C +WIFIDISCONN:OK
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC2 mac -S -o 1 -m 10:22:33:44:55:66
- - R SSC2 C +MAC:STA,OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC2 ip -Q -o 1
- - R SSC2 C +STAIP:192.168.4.2
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. get IP 192.168.4.2
4. succeed
5. succeed
6. succeed
7. get IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. disable DHCP server, do config and enable
3. PC WIFI NIC connect to target1 softap
4. target2 connect to target1 softap and disnnect
5. PC release IP and disconnected
6. disable DHCP server and enable
7. target2 change mac and connect to target1
sub module: DHCP
summary: dhcp server prefer assign released IP to new client
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0208
SDK: |-
8266_NonOS
8266_RTOS
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - P SSC1 C +DHCP:AP,OK
- P SSC2 C +JAP:DISCONNECTED
- - SSC SSC2 sta -D
- - R SSC2 C +JAP:DISCONNECTED
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC1 ap -L
- - R SSC1 C 192.168.4.2 P <pc_wifi_nic_mac>
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. get IP 192.168.4.2
5. can only find target2 with IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1 softap
3. disable DHCP server, do config and enable
4. PC NIC connect to target1 softap
5. softap list connected station
sub module: DHCP
summary: dhcp server reconfig and new client able to get first IP in pool
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0208
SDK: ESP32_IDF
Test App: SSC
allow fail: '2/3'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - P SSC1 C +DHCP:AP,OK
- P SSC2 C +JAP:DISCONNECTED
- - SSC SSC2 sta -D
- - R SSC2 C +JAP:DISCONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC1 ap -L
- - R SSC1 C 192.168.4.2 P <pc_wifi_nic_mac>
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. succeed
5. succeed
6. succeed
7. can only find target2 with IP 192.168.4.2
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1 softap
3. disable DHCP server, do config and enable
4. target2 disconnect
5. disable DHCP server and enable
6. PC NIC connect to target1 softap
7. softap list connected station
sub module: DHCP
summary: dhcp server reconfig and new client able to get first IP in pool
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0209
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: '2/3'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - DELAY 20
- - ''
- - SSC SSC1 ap -L
- - R SSC1 C 192.168.4.2 C 192.168.4.3 P <pc_wifi_nic_mac> P <target2_mac>
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. succeed
5. find target2 and PC
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1 softap
3. disable DHCP server, do config and enable
4. PC NIC connect to target1 softap
5. softap list connected station
sub module: DHCP
summary: dhcp server reconfig, old client and new client able to get IP
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0210
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: '1/2'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - WIFI <pc_wifi_nic> CONN2 <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC1 ap -L
- - R SSC1 C 192.168.4.2 C 192.168.4.3 P <pc_wifi_nic_mac> P <target2_mac>
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. succeed
5. find target2 and PC
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1 softap
3. disable DHCP server, do config and enable
4. PC NIC connect to target1 softap try to renew IP 192.168.4.2
5. softap list connected station
sub module: DHCP
summary: dhcp server reconfig, old client able to get IP (discover with requested
IP)
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0211
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: '1/2'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <random_string> -p <random_string> -t 4
- - R SSC1 C +SAP:OK
- - WIFI <pc_wifi_nic> CONN <random_string> <random_string> 192.168.4.2
- - R PC_COM NC ERROR C +WIFICONN:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.100
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <random_string> -p <random_string>
- - R SSC2 C +JAP:CONNECTED
- - DELAY 30
- - ''
- - SSC SSC1 ap -L
- - R SSC1 C 192.168.4.2 C 192.168.4.3 P <pc_wifi_nic_mac> P <target2_mac>
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. succeed
5. find target2 and PC
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. config softap to a random ssid
2. target2 connect to target1 softap
3. disable DHCP server, do config and enable
4. PC NIC connect to target1 softap try to renew IP 192.168.4.2
5. softap list connected station
sub module: DHCP
summary: dhcp server reconfig, old client able to renew IP (direct send request)
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0212
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - ''
- - DELAY 20
- - P PC_COM C +DELAYDONE
- P SSC2 NC +JAP:CONNECTED
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - R SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: "1.target1 set AP OK \n2.target1 关闭DHCP OK\n3.target2 jap target
1,FAIL \n4.target1 打开DHCP OK\n5.target2 jap target 1,ok"
initial condition: T2_1
level: Integration
module: TCPIP
steps: "1.target1 set AP OK \n2.target1 关闭DHCP OK\n3.target2 jap target 1,FAIL \n4.target1
打开DHCP OK\n5.target2 jap target 1,ok"
sub module: DHCP
summary: dhcp server function test
test environment: SSC_T2_1
test point 1: basic function
test point 2: DHCP server function test
version: v2 (2016-10-19)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0301
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -E -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 ip -S -i 192.168.123.123 -o 1
- - R SSC1 C +IP:OK
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 C +JAP:CONNECTED
- - SSC SSC1 ip -S -i 0.0.0.0 -o 1
- - R SSC1 C +IP
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - ''
- - DELAY 10
- - P PC_COM C +DELAYDONE
- P SSC1 NC +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.OK
2.OK
3.JAP CONNETED
4.OK
5.等待10sJAP fail
initial condition: STAM1
level: Integration
module: TCPIP
steps: |-
1.target1 关闭DHCP 1
2.target1 设置sta ip 192.168.123.123
4.target1 jap AP
5.target1 设置sta ip 0.0.0.0
6.target1 jap AP
sub module: DHCP
summary: sta dhcp static ip interaction
test environment: SSC_T1_1
test point 1: interaction
test point 2: static IP and DHCP interaction test
version: v2 (2016-10-19)
- CI ready: 'Yes'
ID: TCPIP_DHCP_0302
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 ip -S -i 192.168.123.123 -o 2
- - R SSC1 C +IP:ERROR
- - SSC SSC1 dhcp -L -s 192.168.2.2 -e 192.168.2.10
- - R SSC1 C +DHCP:LEASE,ERROR
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 ip -S -i 192.168.4.1 -o 2
- - R SSC1 C +IP:OK
- - SSC SSC1 dhcp -L -s 192.168.4.2 -e 192.168.4.10
- - R SSC1 C +DHCP:LEASE,OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - ''
- - DELAY 10
- - P PC_COM C +DELAYDONE
- P SSC2 NC +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.target 1 OK
2.target1 ERROR
3.target1 ERROR
4.target2 jap target1 OK
5.target1 OK
6.target1 OK
7.target1 OK
8.target2 jap target1 OK
initial condition: T2_1
level: Integration
module: TCPIP
steps: "1.target1 打开DHCP 2\n2.target1 设置softAP ip 192.168.123.123\n3.target1 设置地址池\n4.target1下设置ssid
和pwd 加密方式\n5.target2 连接target1 \n6.target1 关闭DHCP 2\n7.target1 设置softAP ip \n8.target1
设置正确的地址池\n9.target2 连接target1 "
sub module: DHCP
summary: ap dhcp static ip interaction
test environment: SSC_T2_1
test point 1: interaction
test point 2: static IP and DHCP interaction test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: TCPIP_DHCP_5001
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/SoftAPNSTA
- - sta_num = 4
- - dummy
- - max_sta = 3
- - ''
- - test_time = 300
- - ''
- - delay1 = [5, 60]
- - ''
- - delay2 = [1, 10]
- - ''
- - change_mac = False
- - ''
- - channel = 11
- - ''
execution time: 5.0
expected result: "1. succeed\n2. succeed\n3. JAP succeed except: \nsoftap reach
max connected AP \nor all address in dhcp pool not available"
initial condition: None
level: Integration
module: TCPIP
steps: |-
1. 1 target set to softap mode and rest set to sta mode
2. set a short dhcp server lease time
2. all sta set random mac, random join and disconnect from softap
Loop step 2
sub module: DHCP
summary: max sta connect to SotfAP and disconnect, sta number more than sta allowed
test environment: SSC_T5_1
test point 1: stress
test point 2: DHCP server stress test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: TCPIP_DHCP_5101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
auto test: 'No'
category: IOT
cmd set: ''
execution time: 0.1
expected result: |-
2. 成功
3. 成功
4. 断开连接并开始重连
5. WIFI连上但无法获取 IP等大概1分钟后发生 DHCP TIMEOUT断开连接并重连成功获取到 IP
initial condition: STAM1
level: Integration
module: TCPIP
steps: |-
1. 使用小米路由器青春版进行测试
2. 设置DHCP timeoutdhcp -T -n 6
3. target 连上 AP
4. 路由器断电
5. 路由器上电
sub module: DHCP
summary: DHCP timeout test on sepcial router
test environment: SSC_T1_IOT1
test point 1: interoperability
test point 2: DHCP timeout test
version: v1 (2016-8-15)

View File

@ -0,0 +1,149 @@
test cases:
- CI ready: 'Yes'
ID: TCPIP_DNS_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: 1/2
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 soc -H -d gbot.espressif.cn
- - R SSC1 C +HOSTIP:OK,118.31.185.120
execution time: 0.0
expected result: 1.OK
initial condition: STAM2
level: Integration
module: TCPIP
steps: 1. get host name "espressif.cn"
sub module: DNS
summary: get host by name test
test environment: SSC_T1_2
test point 1: basic function
test point 2: DNS function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_DNS_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: 1/2
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 soc -H -d gbot.espressif.cn
- - R SSC1 A <ip_addr>:\+HOSTIP:OK,(.+)\r\n
- - SSC SSC1 soc -B -t TCP
- - R SSC1 A <sock1>:\+BIND:(\d+),OK
- - SSC SSC1 soc -C -s <sock1> -i <ip_addr> -p 9001
- - R SSC1 RE \+CONNECT:\d+,OK
- - SSC SSC1 soc -S -s <sock1> -l 10
- - P SSC1 RE \+SEND:\d+,OK
- P SSC1 SL <sock1>+10
execution time: 0.0
expected result: |-
1.OK
2.OK
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. get host name "espressif.cn"
2. connect, send, recv
sub module: DNS
summary: TCP connect to gbot.espressif.cn
test environment: SSC_T1_2
test point 1: basic function
test point 2: DNS function test
version: v2 (2016-10-19)
- CI ready: 'Yes'
ID: TCPIP_DNS_0103
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: 1/2
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 soc -H -d gbot.espressif.cn
- - R SSC1 A <ip_addr>:\+HOSTIP:OK,(.+)\r\n
- - SSC SSC1 soc -B -t UDP
- - R SSC1 A <sock1>:\+BIND:(\d+),OK
- - SSC SSC1 soc -S -s <sock1> -i <ip_addr> -p 9003 -l 10 -n 3 -j 1000
- - P SSC1 RE \+SEND:\d+,OK
- P SSC1 SL <sock1>+10
execution time: 0.0
expected result: |-
1.OK
2.send OK and recv at least one echo
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. get host name "espressif.cn"
2. sendto echo server 3 times
sub module: DNS
summary: UDP send to gbot.espressif.cn
test environment: SSC_T1_2
test point 1: basic function
test point 2: DNS function test
version: v2 (2016-10-19)
- CI ready: 'No'
ID: TCPIP_DNS_0201
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'No'
category: Function
cmd set: ''
execution time: 0.1
expected result: 2. failed
initial condition: None
level: Integration
module: TCPIP
steps: |-
1.AP的主、备用DNS server均设置为错误
2.target连接上AP 并访问正确的域名
sub module: DNS
summary: get host name with error DNS server
test environment: SSC_T1_2
test point 1: abnormal/special use
test point 2: use special DNS server config
version: v1 (2016-8-15)
- CI ready: 'No'
ID: TCPIP_DNS_0202
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'No'
category: Function
cmd set: ''
execution time: 0.1
expected result: 2. succeed
initial condition: None
level: Integration
module: TCPIP
steps: |-
1.AP的主DNS server设置为错误备用DNS server设置为正确
2.target连接上AP 并访问正确的域名
sub module: DNS
summary: get host name with error main DNS server and correct backup DNS server
test environment: SSC_T1_2
test point 1: abnormal/special use
test point 2: use special DNS server config
version: v1 (2016-8-15)

View File

@ -0,0 +1,68 @@
test cases:
- CI ready: 'Yes'
ID: TCPIP_ICMP_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: 1/5
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ping -i <pc_ip>
- - R SSC1 C +PING:OK
- - SSC SSC1 ping -i <pc_ip> -c 2
- - R SSC1 C +PING:OK
execution time: 0.0
expected result: |-
1.ok
2.ok
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1.ping -i <pc_ip>
2.ping -i <pc_ip> -c 2
sub module: ICMP
summary: ping function test
test environment: SSC_T1_1
test point 1: basic function
test point 2: ping function test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: TCPIP_ICMP_5001
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- TCPIPStress/PingStress
- - test_time = 300
- - dummy
- - test_freq = 0.2
- - ''
- - ping_len = 64
- - ''
- - target_mode = "STA"
- - ''
execution time: 5.0
expected result: |-
1. send succeed
2. recv ping reply
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. PC send ping request to target
2. PC check if received ping reply
sub module: ICMP
summary: ping target and check for ping reply
test environment: SSC_T1_1
test point 1: stress
test point 2: ICMP ping stress test
version: v1 (2016-11-15)

View File

@ -0,0 +1,347 @@
test cases:
- CI ready: 'Yes'
ID: TCPIP_IGMP_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -L -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -J -h <target_ip> -m 223.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h <target_ip> -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h 192.168.237.77 -m 224.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h 192.168.237.77 -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
execution time: 0.0
expected result: |-
1. success
2. failed
3. failed
4. failed
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. join group with correct host addr and multicast addr
2. join group with correct host addr and wrong multicast addr
3. join group with wrong host addr and correct multicast addr
4. join group with wrong host addr and wrong multicast addr
sub module: IGMP
summary: station IGMP join group address check
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP API parameter check
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -L -h <target_ip> -m 224.1.1.2
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h 192.168.237.77 -m 224.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h 192.168.237.77 -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. success
2. failed
3. failed
4. failed
5. succeed
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. join group with correct host addr and multicast addr
2. leave group with correct host addr and wrong multicast addr
3. leave group with wrong host addr and correct multicast addr
4. leave group with wrong host addr and wrong multicast addr
5. leave group with correct host addr and correct multicast addr
sub module: IGMP
summary: station IGMP leave group address check
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP API parameter check
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0103
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -L -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 223.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h 192.168.237.77 -m 224.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -J -h 192.168.237.77 -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
execution time: 0.0
expected result: |-
1. success
2. failed
3. failed
4. failed
initial condition: APM2
level: Integration
module: TCPIP
steps: |-
1. join group with correct host addr and multicast addr
2. join group with correct host addr and wrong multicast addr
3. join group with wrong host addr and correct multicast addr
4. join group with wrong host addr and wrong multicast addr
sub module: IGMP
summary: softAP IGMP join group address check
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP API parameter check
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0104
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 igmp -L -h <target_ap_ip> -m 224.1.1.2
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h 192.168.237.77 -m 224.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h 192.168.237.77 -m 240.1.1.1
- - R SSC1 C +IGMP:ERROR
- - SSC SSC1 igmp -L -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. success
2. failed
3. failed
4. failed
5. succeed
initial condition: APM2
level: Integration
module: TCPIP
steps: |-
1. join group with correct host addr and multicast addr
2. leave group with correct host addr and wrong multicast addr
3. leave group with wrong host addr and correct multicast addr
4. leave group with wrong host addr and wrong multicast addr
5. leave group with correct host addr and correct multicast addr
sub module: IGMP
summary: softAP IGMP leave group address check
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP API parameter check
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0201
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: '1/2'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 soc -B -t UDP -i 224.1.1.1 -p <test_udp_port1>
- - R SSC1 A <sock1>:\+BIND:(\d+),OK
- - SOC SOC1 BIND <test_udp_port1>
- - R SOC_COM L OK
- - SOC SOC1 SENDTO 1 <test_udp_port1> 224.1.1.1
- - R SSC1 SL <sock1>+1
- - SSC SSC1 igmp -L -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. able to recv packet
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. join group
2. create UDP socket using multicast addr
3. PC send UDP packet to multicast addr
sub module: IGMP
summary: station IGMP recv packets
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP send/recv test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0202
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: '1/2'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC2 op -S -o 1
- - R SSC2 C +MODE:OK
- - SSC SSC2 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 igmp -J -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 soc -B -t UDP -i 224.1.1.1 -p <test_udp_port1>
- - R SSC1 A <sock1>:\+BIND:(\d+),OK
- - SSC SSC2 soc -B -t UDP -p <random_port>
- - R SSC2 A <sock2>:\+BIND:(\d+),OK
- - SSC SSC2 soc -S -s <sock2> -i 224.1.1.1 -p <test_udp_port1> -l 10
- - R SSC1 SL <sock1>+1
- - SSC SSC1 igmp -L -h <target_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. target1 recv multicast packet
initial condition: STAM2
level: Integration
module: TCPIP
steps: |-
1. target2 set to sta mode and join AP
2. target1 join group and create UDP socket using multicast addr
3. target2 create UDP socket
4. target2 send to multicast addr
sub module: IGMP
summary: station send multicast packets
test environment: SSC_T2_1
test point 1: basic function
test point 2: IGMP send/recv test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0203
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 soc -B -t UDP -i 224.1.1.1 -p <test_udp_port1>
- - R SSC1 A <sock1>:BIND:(\d+),OK
- - SOC SOC1 BIND <test_udp_port1> <pc_ip_wifi>
- - R SOC_COM L OK
- - SOC SOC1 SENDTO 1 <test_udp_port1> 224.1.1.1
- - R SSC1 SL <sock1>+1
- - SSC SSC1 igmp -L -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. able to recv packet
initial condition: APM2
level: Integration
module: TCPIP
steps: |-
1. join group
2. create UDP socket using multicast addr
3. PC send UDP packet to multicast addr
sub module: IGMP
summary: softAP IGMP recv packets
test environment: SSC_T1_1
test point 1: basic function
test point 2: IGMP send/recv test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IGMP_0204
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - R SSC2 C +JAP:CONNECTED
- - SSC SSC1 igmp -J -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
- - SSC SSC1 soc -B -t UDP -i 224.1.1.1 -p <test_udp_port1>
- - R SSC1 A <sock1>:\+BIND:(\d+),OK
- - SSC SSC2 soc -B -t UDP -p <test_udp_port1>
- - R SSC2 A <sock2>:\+BIND:(\d+),OK
- - SSC SSC2 soc -S -s <sock2> -i 224.1.1.1 -p <test_udp_port1> -l 10
- - R SSC1 SL <sock1>+1
- - SSC SSC1 igmp -L -h <target_ap_ip> -m 224.1.1.1
- - R SSC1 C +IGMP:OK
execution time: 0.0
expected result: |-
1. succeed
2. succeed
3. succeed
4. target1 recv multicast packet
initial condition: T2_1
level: Integration
module: TCPIP
steps: |-
1. target2 join SoftAP
2. target1 join group and create UDP socket using multicast addr
3. target2 create UDP socket
4. target2 send to multicast addr
sub module: IGMP
summary: softAP send multicast packets
test environment: SSC_T2_1
test point 1: basic function
test point 2: IGMP send/recv test
version: v1 (2016-8-15)

View File

@ -0,0 +1,85 @@
test cases:
- CI ready: 'Yes'
ID: TCPIP_IP_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -S -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 ip -S -o 1 -i 192.168.123.123
- - R SSC1 C +IP:ERROR
- - SSC SSC1 dhcp -E -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 ip -S -o 1 -i 192.168.123.123
- - R SSC1 C +IP:OK
- - SSC SSC1 ip -Q -o 1
- - R SSC1 C +STAIP:192.168.123.123
execution time: 0.0
expected result: |-
1.OK
2.ERROR
3.OK
4.OK
5.STAIP:192.168.123.123
initial condition: STAM1
level: Integration
module: TCPIP
steps: "1.target1 打开DHCP 1\n2.target1 设置sta ip 192.168.123.123\n4.target1 关闭DHCP
1\n5.target1 设置sta ip 192.168.123.123\n6.target1 查询 当前sta ip "
sub module: IP
summary: sta set and query static ip test
test environment: SSC_T1_1
test point 1: basic function
test point 2: set and query static IP
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: TCPIP_IP_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 dhcp -S -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 ip -S -o 2 -i 192.168.123.123
- - R SSC1 C +IP:ERROR
- - SSC SSC1 dhcp -E -o 2
- - R SSC1 C +DHCP:AP,OK
- - SSC SSC1 ip -S -o 2 -i 192.168.123.123
- - R SSC1 C +IP:OK
- - SSC SSC1 ip -Q -o 2
- - R SSC1 C +APIP:192.168.123.123
- - SSC SSC1 ip -S -o 2 -i <target_ap_ip>
- - R SSC1 C +IP:OK
execution time: 0.0
expected result: |-
1.OK
2.ERROR
3.OK
4.OK
5.APIP:192.168.123.123
6.OK
initial condition: APM1
level: Integration
module: TCPIP
steps: "1.target1 打开DHCP 2\n2.target1 设置softAP ip 192.168.123.123\n4.target1 关闭DHCP
2\n5.target1 设置softAP ip 192.168.123.123\n6.target1 查询 当前sta ip \n7.target1 设置softAP
ip 为target_ap_ip"
sub module: IP
summary: ap set and query static ip test
test environment: SSC_T1_1
test point 1: basic function
test point 2: set and query static IP
version: v1 (2016-8-15)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
test cases:
- CI ready: 'Yes'
ID: WIFI_ADDR_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 op -S -o 3
- - R SSC1 C +MODE:OK
- - SSC SSC1 mac -S -o 1 -m 44:55:66:77:88:99
- - R SSC1 C +MAC:STA,OK
- - SSC SSC1 mac -S -o 2 -m 22:33:44:55:66:77
- - R SSC1 C +MAC:AP,OK
- - SSC SSC1 mac -Q -o 3
- - R SSC1 C +STAMAC:44:55:66:77:88:99 C +APMAC:22:33:44:55:66:77
- - SSC SSC1 mac -S -o 1 -m <target_mac>
- - R SSC1 C +MAC:STA,OK
- - SSC SSC1 mac -S -o 2 -m <target_ap_mac>
- - R SSC1 C +MAC:AP,OK
execution time: 0.0
expected result: |-
1.OK
2.ok
3.ok
4.ok
5.ok
6.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: "1.target1 设置mode 为sta+softAP mode\n2.target1 设置sta mode 下的mac \n3.target1
设置softAP mode 下的mac\n4.target1 查询softAP+sta 下的mac\n5.target1 设置sta mode 下的mac
为target1_mac\n6.target1 设置softAP mode 下的mac 为target1_ap_mac\n"
sub module: MAC Address
summary: set mac, query mac
test environment: SSC_T2_1
test point 1: basic function
test point 2: mac address function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_ADDR_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 mac -S -o 2 -m 44:55:66:77:88:99
- - R SSC1 C +MAC:AP,OK
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - ''
- - SSC SSC2 sta -S -b 44:55:66:77:88:99
- - R SSC2 RE \+SCAN:.+,44:55:66:77:88:99,
- - SSC SSC1 mac -S -o 2 -m <target_ap_mac>
- - R SSC1 C +MAC:AP,OK
- - SSC SSC2 mac -Q -o 1
- - R SSC2 A <target2_mac_tmp>:\+STAMAC:(.+)\r\n
- - SSC SSC2 mac -S -o 1 -m 22:33:44:55:66:77
- - R SSC2 C +MAC:STA,OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC1 ap -L
- - R SSC1 C +LSTA:22:33:44:55:66:77
- - SSC SSC2 mac -S -o 1 -m <target2_mac>
- - R SSC2 C +MAC:STA,OK
execution time: 0.0
expected result: |-
1.OK
2.ok
3.ok
4.ok
5.ok
6.ok
7.ok
8.ok
9.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: "1.target1 设置sta mode下的mac 44:55:66:77:88:99\n2.target1下设置ssid 和pwd 加密方式\n3.target2
查询mac为44:55:66:77:88:99的ssid\n4.target1 设置sta mode下的mac target_ap_mac\n5.target2
查询sta mode 下的mac 为target2_mac_tmp\n6.target2 设置sta mode 下的mac 为22:33:44:55:66:77\n7.target2
jap target1\n8.target1 查询连接到的sta \n9.target2 设置sta mode 下的mac 为 target2_mac\n"
sub module: MAC Address
summary: set mac and do scan/JAP/SAP
test environment: SSC_T2_1
test point 1: basic function
test point 2: mac address function test
version: v1 (2016-8-15)

View File

@ -0,0 +1,29 @@
test cases:
- CI ready: 'Yes'
ID: WIFI_AMSDU_5001
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- TCPStress/TCPAMSDUsendrecv
- - delay_config = [0, 0.01, 0.1, 0.5, 1]
- - dummy
- - send_count = 1000
- - ''
- - test_time = 300
- - ''
execution time: 12.0
expected result: 1. do not disconnect
initial condition: STAM2
level: Integration
module: WIFI MAC
steps: |-
1. PC and SSC1 connected to 天猫魔盒,do TCP pkts send/recv for a long time.
2.Loop executing step 1
sub module: A-MSDU
summary: test AMSDU send/rev
test environment: SSC_T1_AMSDU
test point 1: function + stress
test point 2: AMSDU send recv
version: v2 (2016-11-15)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
test cases:
- CI ready: 'Yes'
ID: WIFI_MODE_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC1 op -S -o 1
- - R SSC1 C +MODE:OK
- - SSC SSC1 dhcp -S -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 RE "\+JAP:CONNECTED,%%s"%%(<ap_ssid>)
- - SSC SSC2 sta -S
- - R SSC2 NP <target_ssid> C +SCANDONE
- - SSC SSC1 sta -D
- - R SSC1 C +QAP:OK
execution time: 0.0
expected result: |-
1.target1下设置ssid 和pwd 、加密方式成功
2.修改target 1的mode 为sta mode
3.target1的dhcp打开
4.target1成功连接上AP
5.target2上不能查询到target_ssid
6.target1断开AP
initial condition: T2O_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.修改target1的mode 为sta mode
3.target1的dhcp打开
4.target1连接AP
5.target2查询target_ssid
6.target1断开AP
sub module: WIFI Mode
summary: mode switch test (sta mode)
test environment: SSC_T2_1
test point 1: basic function
test point 2: wifi mode fucntion
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_MODE_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -S
- - R SSC2 P <target_ssid>
- R SSC2 C +SCANDONE
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 C +JAP:ERROR
- - SSC SSC1 sta -D
- - R SSC1 C +QAP:ERROR
execution time: 0.0
expected result: |-
1. target1 set AP
2.target 2 上查询到target_ssid
3. target1 can't join AP
4. target1 can't QAP
initial condition: T2O_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.target 2 上查询target_ssid
3.target1 join AP
4.target1 DISCONN AP
sub module: WIFI Mode
summary: mode switch test (AP mode)
test environment: SSC_T2_1
test point 1: basic function
test point 2: wifi mode fucntion
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_MODE_0103
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 op -S -o 3
- - R SSC1 C +MODE:OK
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC1 dhcp -S -o 1
- - R SSC1 C +DHCP:STA,OK
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 RE "\+JAP:CONNECTED,%%s"%%(<ap_ssid>)
- - SSC SSC2 sta -S
- - R SSC2 P <target_ssid>
- R SSC2 C +SCANDONE
execution time: 0.0
expected result: |-
1.target1 change to AP mode
2.target1 set AP
3.target 1 的dhcp 打开
4.target 1 成功连接上AP
5.target 2 上查询到target_ssid
initial condition: T2O_1
level: Integration
module: WIFI MAC
steps: |-
1.target1 change to AP mode
2.target1下设置ssid 和pwd 加密方式
3.target1 的dhcp 打开
4.target1 连接AP
5.target2 上查询target_ssid
sub module: WIFI Mode
summary: mode switch test (STA+AP mode)
test environment: SSC_T2_1
test point 1: basic function
test point 2: wifi mode fucntion
version: v1 (2016-8-15)

View File

@ -0,0 +1,848 @@
test cases:
- CI ready: 'Yes'
ID: WIFI_SCAN_0101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC2 sta -S -s .,juhg123
- - 'R SSC2 NC +SCAN: C +SCANDONE'
- - SSC SSC1 ap -S -s <target_tmp_ssid> -p 123456789 -t 3
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -S -s <target_tmp_ssid>
- - 'R SSC2 C +SCAN:'
- R SSC2 P <target_tmp_ssid>
- 'R SSC2 NC +SCAN: C +SCANDONE'
execution time: 0.0
expected result: |-
1.target 2上不能scan .,juhg123
2.target1 set AP
3.target2上查询到<target_tmp_ssid>
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target 2 scan .,juhg123
2.target1下设置ssid 和pwd 加密方式
3.target2 scan <target_tmp_ssid>
sub module: WIFI Scan
summary: scan with scan config ssid
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan with different config
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0102
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC2 sta -S -b ff:ff:ff:ff:ff:11
- - 'R SSC2 NC +SCAN: C +SCANDONE'
- - SSC SSC2 sta -S -b <target_ap_mac>
- - R SSC2 RE "\+SCAN:.+,%%s"%%(<target_ap_mac>)
- 'R SSC2 NC +SCAN: C +SCANDONE'
execution time: 0.0
expected result: |-
1.target2 上不能查询到此mac
2.target2上查询到<target_ap_mac>
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target2 上查询此macff:ff:ff:ff:ff:11
2.target2上查询<target_ap_mac>
sub module: WIFI Scan
summary: scan with scan config bssid
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan with different config
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0103
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 sta -D
- - 'R SSC1 C +QAP:'
- - SSC SSC1 ap -S -s <target_tmp_ssid> -p 123456789 -t 3 -n 6
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -S -n 5
- - R SSC2 NP <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -n 6
- - 'R SSC2 C +SCAN:'
- R SSC2 P <target_tmp_ssid>
execution time: 0.0
expected result: |-
1.target1 QAP
2. target1 set AP,set channel 6
3.target2 上scan不到 channel 5
4.target2 上查询channel 6的<target_tmp_ssid>
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1 断开连接AP
2.target1下设置ssid 和pwd 加密方式,set channel 6
3.target2 上scan channel 5
4.target2 上查询channel 6的<target_tmp_ssid>
sub module: WIFI Scan
summary: scan with scan config channel
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan with different config
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0104
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_tmp_ssid> -p 123456789 -t 3 -h 0
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -D
- - R SSC2 C OK
- - SSC SSC2 sta -S -h 0
- - R SSC2 P <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -h 1
- - R SSC2 P <target_tmp_ssid> C +SCANDONE
- - SSC SSC1 ap -S -s <target_tmp_ssid> -p 123456789 -h 1
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -S -h 0
- - R SSC2 NP <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -h 1
- - R SSC2 P <target_ap_mac> C +SCANDONE
execution time: 0.0
expected result: |-
1.target1 set AP,set ssid broad cast
2.target 2上scan <target_tmp_ssid>
3.target 2上scan <target_tmp_ssid>
4.target1 set AP,set ssid hidden,
5.target 2上不能查询到 <target_tmp_ssid>
6.target 2上查询到<target_ap_mac>
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式,set ssid broad cast
2.target 2上scan <target_tmp_ssid>
3.target 2上scan <target_tmp_ssid>
4.target1下设置ssid 和pwd 加密方式,set ssid hidden,
5.target 2上查询 <target_tmp_ssid>
6.target 2上查询<target_ap_mac>
sub module: WIFI Scan
summary: scan with scan config show hidden
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan with different config
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0105
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 sta -D
- - 'R SSC1 C +QAP:'
- - SSC SSC1 ap -S -s <target_tmp_ssid> -p 123456789 -t 3 -h 0 -n 11
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -S -s <target_tmp_ssid> -b <target_ap_mac> -n 11
- - R SSC2 P <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -s <target_ssid> -b <target_ap_mac> -n 11
- - R SSC2 NP <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -s <target_tmp_ssid> -b ff:ff:ff:ff:ff:11 -n 11
- - R SSC2 P <target_tmp_ssid>
- R SSC2 NP <target_tmp_ssid> C +SCANDONE
- - SSC SSC2 sta -S -s <target_tmp_ssid> -b <target_ap_mac> -n 10
- - R SSC2 P <target_tmp_ssid>
- R SSC2 NP <target_tmp_ssid> C +SCANDONE
execution time: 0.0
expected result: |-
1.target1 QAP
2. target1 set AP,set ssid broad cast,set channel 11
3.target2 上查询到<target_tmp_ssid>
4.target2 上查询不到<target_tmp_ssid>
5.target2 上查询不到<target_tmp_ssid>
6.target2 上查询不到<target_tmp_ssid>
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1 QAP
2. target1 set AP,set ssid broad cast,set channel 11
3.target2 上查询到<target_tmp_ssid>
4.target2 上查询不到<target_tmp_ssid>
5.target2 上查询不到<target_tmp_ssid>
6.target2 上查询不到<target_tmp_ssid>
sub module: WIFI Scan
summary: scan with several configs
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan with different config
version: v1 (2016-8-15)
- CI ready: 'No'
ID: WIFI_SCAN_0202
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -d 0 -b <target1_ap_mac>
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -d 1 -b <target1_ap_mac>
- - P SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.OK
2.ok
3.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.target2 jap
3.target2 conn target1 by bssid
sub module: WIFI Scan
summary: do scan/JAP/SAP
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan function test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: WIFI_SCAN_0203
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t 3
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -j 0
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -j 1
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -j 2
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -j 3
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -j 5
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -j 1
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -j 2
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -j 3
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -j 0
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -j 4
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 3 -j 0
- - P SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.OK 2.ok
3.ok
4.ok
5.ok
7.ok
8.ok
9.ok
10.ok
12.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.target2 fast scan and jap target1
3.target2 jap target1 except open encrypt
4.target2 jap target1 except open and wep encrypt
5.target2 jap target1 only wpa2 encrypt can be connect
6.target2 scan all channel jap target1 except open encrypt
7.target2 scan all channel jap target1 except open encrypt
8.target2 scan all channel jap target1 except open and wep encrypt
9.target2 scan all channel jap target1 only wpa2 encrypt can be connected
10.target2 scan all channel jap target1
11.target2 scan all channel jap target1
12.target2 jap target1
sub module: WIFI Scan
summary: do scan/JAP/SAP
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan function test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: WIFI_SCAN_0204
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t 2
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -q 0
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -q 128
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 0 -q 80
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -q 128
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -q 0
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -q 80
- - P SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.OK
2.no exception
3.no exception
4.ok
5.no exception
6.no exception
7.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.target2 fast scan and jap target1 rssi>-1
3.target2 fast scan and jap rssi>-127
4.target2 scan all channel and jap target1 rssi>-80
5.target2 scan all channel and jap rssi > -127
6.target2 scan all channel and jap rssi > -1
7.target2 scan all channel and jap target1 rssi > -80
sub module: WIFI Scan
summary: do scan/JAP/SAP
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan function test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: WIFI_SCAN_0205
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t 3
- - R SSC1 C +SAP:OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -x 0
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -x 1
- - P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password> -f 1 -x 2
- - P SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
1.OK
2.ok
3.ok
4.ok
initial condition: T2_1
level: Integration
module: WIFI MAC
steps: |-
1.target1下设置ssid 和pwd 加密方式
2.target2 scan ap all channel and jap target1 by rssi sort
3.target2 scan ap all channel and jap target1 by auth
4.target2 scan ap all channel jap target1 by auth
sub module: WIFI Scan
summary: do scan/JAP/SAP
test environment: SSC_T2_1
test point 1: basic function
test point 2: scan function test
version: v1 (2016-8-15)
- CI ready: 'No'
ID: WIFI_SCAN_0206
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 op -S -o 1
- - P SSC1 C +MODE:OK
- - SSC SSC1 op -Q
- - P SSC1 C +CURMODE:1
- - SSC SSC1 sta -S -t 0 -l 0 -m 0
- - 'R SSC1 C +SCAN: C +SCANDONE'
- - SSC SSC1 sta -S -t 0 -l 1000 -m 100
- - 'R SSC1 C +SCAN: C +SCANDONE'
- - SSC SSC1 sta -S -t 1 -k 0
- - 'R SSC1 C +SCAN: C +SCANDONE'
- - SSC SSC1 sta -S -t 1 -k 2000
- - 'R SSC1 C +SCAN: C +SCANDONE'
- - SSC SSC1 sta -S -t 5 -k 100
- - 'R SSC1 C +SCAN: C +SCANDONE'
execution time: 0.0
expected result: |-
1.OK
2.ok
3.scan ok
4.scan ok
5.scan ok
6.scan ok
7.scan ok
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1.target set as sta
2.check target1 work mode
3.target1 active scan max and min time set to 0ms
4.target1 active scan max time 1000ms min time 100ms
5.target1 passive scan scan time 0ms
6.target passive scan scan time 10000ms
7.target1 scan type set to 5
sub module: WIFI Scan
summary: do active/passive scan
test environment: SSC_T1_1
test point 1: basic function
test point 2: scan function test
version: v1 (2016-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0301
SDK: ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 sta -S
- - ''
- - SSC SSC1 sta -S
- - P SSC1 C +SCANFAIL
- 'P SSC1 C +SCAN:'
- R SSC1 C +SCANDONE
execution time: 0.0
expected result: |-
1. second scan failed
2. first scan succeed
initial condition: STAM1
level: Integration
module: WIFI MAC
steps: |-
1. do all channel scan
2. do scan before scan finished
sub module: WIFI Scan
summary: reject scan request before scan finished
test environment: SSC_T1_1
test point 1: interaction
test point 2: Scan interact with other WiFi operation
version: v1 (2015-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0302
SDK: ESP32_IDF
Test App: SSC
allow fail: '2/3'
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 C +JAP:CONNECTED
- - SSC SSC1 soc -B -t UDP -p <test_udp_port1>
- - R SSC1 A <sock1>:BIND:(\d+),OK
- - SSC SSC1 soc -S -s <sock1> -i <pc_ip> -p <test_udp_port1> -n 1000000 -j 5
- - ''
- - SSC SSC2 phy -S -o 1 -m b
- - R SSC2 C +SPHY:protocol
- - SSC SSC2 sta -S -n <ap_channel>
- - R SSC2 P <ap_ssid>
- - SSC SSC2 phy -S -o 1 -m g
- - R SSC2 C +SPHY:protocol
- - SSC SSC2 sta -S -n <ap_channel>
- - R SSC2 P <ap_ssid>
- - SSC SSC2 phy -S -o 1 -m n -b 20
- - R SSC2 C +SPHY:protocol
- - SSC SSC2 sta -S -n <ap_channel>
- - R SSC2 P <ap_ssid>
- - SSC SSC2 phy -S -o 1 -m n -b 40
- - R SSC2 C +SPHY:protocol
- - SSC SSC2 sta -S -n <ap_channel>
- - R SSC2 P <ap_ssid>
execution time: 0.0
expected result: 3. target 2 able to scan AP
initial condition: T2_2
level: Integration
module: WIFI MAC
steps: |-
1. target 1 connect to AP
2. target 1 start sending UDP packets
3. target 2 scan in AP channel in 11b.g,n,ht40 mode
sub module: WIFI Scan
summary: scan in congest channel
test environment: SSC_T2_1
test point 1: interaction
test point 2: Scan interact with other WiFi operation
version: v1 (2015-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0303
SDK: ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - R SSC1 C +JAP:OK
- - SSC SSC1 sta -S
- - P SSC1 C +SCANDONE
- P SSC1 C +JAP:CONNECTED
- - SSC SSC1 sta -D
- - R SSC1 C +QAP:OK
- - SSC SSC1 sta -S
- - ''
- - SSC SSC1 sta -C -s <ap_ssid> -p <ap_password>
- - P SSC1 C +SCANDONE
- P SSC1 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
2. scan succeed, JAP succeed
5. JAP succeed, scan succeed
initial condition: STAM1
level: Integration
module: WIFI MAC
steps: |-
1. target 1 STA join AP
2. target 1 STA scan before JAP succeed
3. target 1 quite AP
4. target 1 scan
5. target 1 JAP before scan succeed
sub module: WIFI Scan
summary: scan during JAP
test environment: SSC_T1_1
test point 1: interaction
test point 2: Scan interact with other WiFi operation
version: v1 (2015-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_0304
SDK: ESP32_IDF
Test App: SSC
allow fail: ''
auto test: 'Yes'
category: Function
cmd set:
- ''
- - SSC SSC1 ap -S -s <target_ssid> -p <target_password> -t <target_auth_enum>
- - R SSC1 C +SAP:OK
- - SSC SSC1 sta -D
- - R SSC1 C OK
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - R SSC2 C +JAP:OK
- - SSC SSC1 sta -S
- - P SSC1 C +SCANDONE
- P SSC2 C +JAP:CONNECTED
- - SSC SSC2 sta -D
- - R SSC2 C +QAP:OK
- - SSC SSC1 sta -S
- - ''
- - SSC SSC2 sta -C -s <target_ssid> -p <target_password>
- - P SSC1 C +SCANDONE
- P SSC2 C +JAP:CONNECTED
execution time: 0.0
expected result: |-
2. scan succeed, JAP succeed
5. JAP succeed, scan succeed
initial condition: T2_2
level: Integration
module: WIFI MAC
steps: |-
1. target 2 STA join target 1 SoftAP
2. target 1 STA scan before target 2 JAP succeed
3. target 2 STA QAP
4. target 1 STA scan
5. target 2 STA JAP before target 1 STA scan succeed
sub module: WIFI Scan
summary: scan during ext STA join SoftAP
test environment: SSC_T2_1
test point 1: interaction
test point 2: Scan interact with other WiFi operation
version: v1 (2015-8-15)
- CI ready: 'Yes'
ID: WIFI_SCAN_5101
SDK: |-
8266_NonOS
8266_RTOS
ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiSCANTime
- - test_time = 300
- - ''
- - active_scan_max_time = 120
- - ''
- - active_scan_min_time = 20
- - ''
- - passive_scan_max_time = 100
- - ''
- - scan_mode_list = ["active_scan","passive_scan"]
- - ''
execution time: 5.0
expected result: "1. succeed\n3. scan time less than 1.15 test time "
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 target set to sta mode
2. set scan mode
3. start scan ap and check scan time
sub module: WIFI Scan
summary: test differnt scan mode scan time
test environment: SSC_T1_1
test point 1: stress
test point 2: Sta active/passive scan stress test
version: v2 (2017-05-10)
- CI ready: 'No'
ID: WIFI_SCAN_5201
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "conn_by_bssid"
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. SSC target connect ap by bssid
sub module: WIFI Scan
summary: connect specify ap test
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: connect ap by bssid
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5202
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "conn_max_rssi_ap"
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. SSC connect max rssi ap.
sub module: WIFI Scan
summary: connect max rssi ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: connect max rssi ap
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5203
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "conn_most_security_ap"
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. SSC connect max rssi ap
sub module: WIFI Scan
summary: connect most security ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: connect most security ap
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5204
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "conn_setting_ap"
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. SSC connect setting ap
sub module: WIFI Scan
summary: connect setting ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: connect setting ap
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5205
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "reconn_same_ssid_ap"
- - ''
- - apc_num_list = [1,3]
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. ap1 power on by apc
3. SSC connect ap
4. ap1 power off and ap2 power on
5. SSC auto connect ap2.
sub module: WIFI Scan
summary: reconnect same ssid ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: reconnect same ssid ap
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5206
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
- - test_mode = "quick_conn_ap"
- - ''
- - rssi_threshold = 60
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. SSC1 connect ap
sub module: WIFI Scan
summary: quick connect ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function + stress
test point 2: quick connect ap
version: v2 (2016-11-15)
- CI ready: 'No'
ID: WIFI_SCAN_5207
SDK: ESP32_IDF
Test App: SSC
auto test: 'Yes'
category: Stress
cmd set:
- WiFiStress/WifiScanOptimize
- - test_times = 10
- - ''
execution time: 5.0
expected result: 2. connect success
initial condition: None
level: Integration
module: WIFI MAC
steps: |-
1. 1 SSC target connect PC by Uart.
2. make menuconfig
3. write ap ssid
4. connect ap auto
sub module: WIFI Scan
summary: connect open security ap
test environment: SSC_T1_SCANSPECIFIED
test point 1: function
test point 2: connect open security mode ap
version: v2 (2016-11-15)

View File

@ -0,0 +1,240 @@
.TEST_ENV: &TEST_ENV
PC OS: ''
Special: N
test script: EnvBase
test environment:
- tag: SSC_T1_1
<<: *TEST_ENV
Target Count: 1
test environment detail: |-
PC has 2 wired NIC connected to AP.
PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.
- tag: SSC_T1_2
<<: *TEST_ENV
Target Count: 1
test environment detail: |-
Able to access WAN after connect to AP.
1 SSC target connect with PC by UART.
- tag: SSC_T1_3
<<: *TEST_ENV
Target Count: 1
test environment detail: PC has one BT adapter (dongle). 1 SSC target connect with
PC by UART.
- tag: SSC_T1_8089
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP.
1 8089 tablet able to run iperf test placed near SSC1.
1 SSC target connect with PC by UART.
- tag: SSC_T1_ADC
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP.
Analog input connect to SSC1 TOUT.
Multimeter connect to input, able to measure input voltage.
1 SSC target connect with PC by UART.
- tag: SSC_T1_AMSDU
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
1 SSC target connect PC by UART.
PC 无线网卡和 SSC target 均连接到天猫魔盒AP.
- tag: SSC_T1_APC
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP.
PC has 1 wired NIC connected to APC (static IP within the same subnet with APC).
APC control AP power supply.
PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.
- tag: SSC_T1_Enterprise
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: "AP use WPA2-Etherprise is placed near SSC1. \n1 SSC target
connect with PC by UART."
- tag: SSC_T1_IOT1
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.
AP todo IOT test are placed near SSC1.
- tag: SSC_T1_InitData
<<: *TEST_ENV
Special: Y
Target Count: 2
test environment detail: |-
2 SSC target connect with PC by UART.
SSC1 use 40M crystal oscillator.
SSC2 use normal 26M crystal oscillator.
SSC2 GPIO connect to SSC1 power control pin.
- tag: SSC_T1_SCANSPECIFIED
<<: *TEST_ENV
Special: N
Target Count: 1
test environment detail: 1 SSC target connect with PC by UART. All APs power on.
- tag: SSC_T1_ShieldBox
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
refer to figure.
All APs and APC should be set to the same IP subnet.
PC wired NIC should set static IP address within the same subnet with AP.
Must use onboard wired NIC.
- tag: SSC_T1_Sleep1
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
AP support DTIM placed with AT target.
SSC target connect with Raspberry Pi by UART.
Multimeter connect with Raspberry Pi via GPIB.
Series multimeter between GND and VCC of SSC1.
SSC1's light sleep wakeup pin and wakeup indication connect with Raspberry Pi's GPIO.
SSC1's XPD connect with RSTB.
- tag: SSC_T1_Sleep2
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
AP support DTIM placed with AT target.
SSC target connect with Raspberry Pi by UART.
Multimeter connect with Raspberry Pi via GPIB.
Series multimeter between GND and VCC of SSC1.
SSC1's RSTB pin connect with Raspberry Pi's GPIO.
- tag: SSC_T1_Sleep3
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
AP support DTIM placed with AT target.
SSC target connect with Raspberry Pi by UART.
Multimeter connect with Raspberry Pi via GPIB.
Series multimeter between GND and VCC of SSC1.
- tag: SSC_T1_Sniffer
<<: *TEST_ENV
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP. PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.
- tag: SSC_T1_TempBox
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
1 SSC target connect with PC by UART.
Put SSC target to temperature box.
- tag: SSC_T1_VDD33
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |-
1 SSC target connect with PC by UART.
Multimeter connect to VDD33, able to measure voltage.
- tag: SSC_T1_WEP
<<: *TEST_ENV
Target Count: 1
test environment detail: |-
1 SSC target connect with PC by UART.
One WEP share key AP placed near SSC1.
- tag: SSC_T2_1
<<: *TEST_ENV
Target Count: 2
test environment detail: |-
PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
2 SSC target connect with PC by UART.
- tag: SSC_T2_JAP
<<: *TEST_ENV
Target Count: 2
test environment detail: |-
PC has 1 wired NIC connected to APC.
APC control the power supply of multiple APs.
2 SSC target connect with PC by UART.
- tag: SSC_T2_PhyMode
<<: *TEST_ENV
PC OS: 'linux'
Target Count: 2
test environment detail: |-
2 SSC target connect with PC by UART.
PC has one WiFi NIC support capture wlan packet using libpcap.
Set 4 AP with phy mode 11b, 11g, 11n HT20, 11n HT40.
Put 4 APs near SSC targets.
- tag: SSC_T2_ShieldBox
<<: *TEST_ENV
Special: Y
Target Count: 2
test environment detail: |-
2 SSC target connect with PC by UART.
Put them to Shield box.
- tag: SSC_T2_ShieldBox2
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |
refer to figure.
2 SSC target connect with PC by UART. Put target board to different Shield boxes.
2 shield boxes are connected with programmable attenuator.
- tag: SSC_T2_Sniffer
<<: *TEST_ENV
PC OS: 'linux'
Special: N
Target Count: 2
test environment detail: |-
PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
2 SSC target connect with PC by UART.
- tag: SSC_T2_TempBox
<<: *TEST_ENV
Special: Y
Target Count: 1
test environment detail: |
refer to figure.
2 SSC target connect with PC by UART. Put 1 target board to temperature box.
- tag: SSC_T3_1
<<: *TEST_ENV
Special: N
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
3 SSC target connect with PC by UART.
- tag: SSC_T3_PhyMode
<<: *TEST_ENV
PC OS: 'linux'
Target Count: 3
test environment detail: |-
3 SSC target connect with PC by UART.
PC has one WiFi NIC support capture wlan packet using libpcap.
Set 4 AP with (HT20, channel1), (HT20, channel2), (HT40, channel1), (HT40, channel2).
Put 4 APs near SSC targets.
- tag: SSC_T5_1
<<: *TEST_ENV
Target Count: 5
test environment detail: 5 SSC target connect with PC by UART.
- tag: SSC_T5_IOT1
<<: *TEST_ENV
Special: Y
Target Count: 5
test environment detail: |-
5 SSC targets connect with PC by UART.
some Android smart phone are placed near SSC targets.
- tag: SSC_T6_1
<<: *TEST_ENV
Target Count: 1
test environment detail: |-
PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
6 SSC target connect with PC by UART.

File diff suppressed because it is too large Load Diff

View File

@ -1,125 +0,0 @@
import re
import subprocess
import time
from TCAction import PerformanceTCBase
from TCAction import TCActionBase
from NativeLog import NativeLog
from comm.NIC import Adapter
MIN_PACKETS_TO_CHECK = 10
class TestCase(PerformanceTCBase.PerformanceTCBase):
INTERVAL_PATTERN = re.compile("(0x[0-9A-Fa-f]+)-(0x[0-9A-Fa-f]+)")
def __init__(self, test_case, test_env, timeout, log_path):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout, log_path)
self.interval_list = []
self.deviation = 0
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def process_packets(self, packets, interval):
def convert_ts(ts):
return float("%s.%s" % (ts["second"], ts["microsecond"]))
def filter_packets():
_filtered_packets = []
mac_address = self.get_parameter("dut1_bt_mac")
for _packet in packets:
packet_str = str(_packet)
if "[le_sub_event_code]: LEAdvReport" in packet_str \
and "[address_0]: %s" % mac_address in packet_str:
_filtered_packets.append(_packet)
# sort by time
_filtered_packets.sort(key=lambda x: convert_ts(x.ts))
return _filtered_packets
filtered_packets = filter_packets()
# add captured packets to log
for packet in filtered_packets:
self.result_check("BLENIC", str(packet))
# flush data cache to free memory
self.flush_data("BLENIC")
# scan will switch channel, therefore need to check if there're successive fails
succeed_packets = 0
# process packets
# unit: ms; allow deviation for interval
allowed_range = [float(interval[0] * (1 - self.deviation) * 0.625) / 1000,
float(interval[1] * (1 + self.deviation) * 0.625) / 1000]
NativeLog.add_trace_info("[BLE][AdvInterval] allowed_interval_range is %s" % allowed_range)
for i in range(len(filtered_packets) - 1):
_p1 = filtered_packets[i]
_p2 = filtered_packets[i+1]
interval = convert_ts(_p2.ts) - convert_ts(_p1.ts)
if allowed_range[0] < interval < allowed_range[1]:
succeed_packets += 1
else:
pass
result = True if succeed_packets >= MIN_PACKETS_TO_CHECK else False
return result
def execute(self):
TCActionBase.TCActionBase.execute(self)
test_result = "Succeed"
# open capture device
adapter = Adapter.Adapter(self.get_parameter("bt_capture_nic"), "capture", capture_type="bluetooth")
ret = adapter.start_capture()
if ret != "LIBPCAP_SUCCEED":
NativeLog.add_trace_critical("Can't start capture packets: %s" % ret)
return
def run_test_once(interval):
# flush all packets
adapter.get_packets()
# config ble adv data
self.serial_write_line("SSC1", "bleadv -D -z stop")
self.check_response("SSC1", "+BLEADV")
self.serial_write_line("SSC1", "bleadv -L -c 0 -t 3")
self.check_response("SSC1", "+BLEADV")
# set adv param and start adv
self.serial_write_line("SSC1", "bleadv -D -z start -i 0x%04X-0x%04X -h 1" % (interval[0], interval[1]))
self.check_response("SSC1", "+BLEADV:OK")
# set scan window = scan interval = 2s, scan for 6s, each channel scan 2 second.
subprocess.check_output("hcitool cmd 0x08 0x000b 0x00 0x80 0x0c 0x80 0x0c 0x00 0x00\n", shell=True)
subprocess.check_output("hcitool cmd 0x08 0x000c 0x01 0x00\n", shell=True)
time.sleep(6)
subprocess.check_output("hcitool cmd 0x08 0x000c 0x00 0x00\n", shell=True)
packets = adapter.get_packets()
return self.process_packets(packets, interval)
for _interval in self.interval_list:
match = self.INTERVAL_PATTERN.search(_interval)
if match is not None:
if run_test_once([int(match.group(1), base=16), int(match.group(2), base=16)]) is False:
NativeLog.add_trace_critical("Test fail for interval: %s." % _interval)
test_result = "Fail"
else:
NativeLog.add_trace_critical("interval string format not correct: %s." % _interval)
test_result = "Fail"
pass
self.set_result(test_result)
def main():
pass
if __name__ == '__main__':
pass

View File

@ -1,98 +0,0 @@
import os
import time
from TCAction import TCActionBase
from TCAction import PerformanceTCBase
from NativeLog import NativeLog
SOFTAP_SSID = "SoftAPSSID4NVSCompatibleTest"
SOFTAP_PASSWORD = "SoftAPPassword4NVSCompatibleTest"
NVS_FILE_NAME = "nvs_wifi.bin"
class TestCase(PerformanceTCBase.PerformanceTCBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.nvs_path = ""
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
def get_nvs_bins(self):
if os.path.exists(self.nvs_path) is False:
NativeLog.add_trace_critical("NVS path is not correct")
files = []
else:
files = [os.path.join(self.nvs_path, x) for x in os.listdir(self.nvs_path)]
return filter(lambda f: NVS_FILE_NAME in f, files)
def check_nvs(self, nvs_bin):
branch_name = os.path.basename(nvs_bin)
branch_name.replace("___", "/")
result = True
ssc1_port = self.test_env.get_port_by_name("SSC1")
ap_ssid = self.get_parameter("ap_ssid")
self.flush_data("SSC1")
# first download
ssc1_port.flash_nvs(nvs_bin)
self.check_response("SSC1", "ready!!!")
# set to sta mode and join ap
if self.check_response("SSC1", "+JAP:CONNECTED,%s" % ap_ssid, timeout=15) is False:
NativeLog.add_trace_critical("Failed to join AP on: " + branch_name)
result = False
self.serial_write_line("SSC1", "op -Q")
if self.check_response("SSC1", "+CURMODE:3") is False:
NativeLog.add_trace_critical("Failed on verifying WIFI mode on: " + branch_name)
result = False
self.serial_write_line("SSC1", "ap -Q")
if self.check_response("SSC1", "+APCONFIG:%s,%s" % (SOFTAP_SSID, SOFTAP_PASSWORD)) is False:
NativeLog.add_trace_critical("Failed on verifying SoftAP config on: " + branch_name)
result = False
return result
def dump_nvs(self):
ssc1_port = self.test_env.get_port_by_name("SSC1")
ap_ssid = self.get_parameter("ap_ssid")
ap_password = self.get_parameter("ap_password")
# first erase NVS
ssc1_port.flash_nvs(None)
self.check_response("SSC1", "ready!!!")
self.serial_write_line("SSC1", "op -S -o 3")
self.check_response("SSC1", "+MODE:OK")
self.serial_write_line("SSC1", "sta -C -s %s -p %s" % (ap_ssid, ap_password))
self.check_response("SSC1", "+JAP:CONNECTED,%s" % ap_ssid, timeout=20)
self.serial_write_line("SSC1", "ap -S -s %s -p %s -t 3" % (SOFTAP_SSID, SOFTAP_PASSWORD))
self.check_response("SSC1", "+SAP:OK")
time.sleep(1)
idf_path = os.getenv("IDF_PATH")
ssc1_port.dump_nvs(os.path.join(idf_path, NVS_FILE_NAME))
def cleanup(self):
# make sure dump nvs will be executed
self.dump_nvs()
def process(self):
result = True
nvs_bins = self.get_nvs_bins()
for nvs_bin in nvs_bins:
result = result and self.check_nvs(nvs_bin)
if result is True:
self.set_result("Succeed")

View File

@ -1,223 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 500
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.send_len = 1460
self.server_echo = True
self.sta_number = 4
self.test_time = 12 * 60
self.send_delay = 50
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def cleanup(self):
checker_stings = []
test_action_strings = []
for i in range(self.sta_number + 1):
checker_stings.append("R SSC%s C +RECVPRINT:1" % (i+1))
test_action_strings.append("SSC SSC%s soc -R -o 1" % (i+1))
fail_string = "Fail, Fail to turn on recv print"
self.load_and_exe_one_step(checker_stings, test_action_strings, fail_string)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
server_echo = self.server_echo
sta_number = self.sta_number
test_time = self.test_time * 60
send_delay = self.send_delay
ap_ip = self.get_parameter("target_ap_ip")
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
checker_stings = []
test_action_string = []
for i in range(sta_number+1):
checker_stings.append("P SSC%d C !!!ready!!!" % (i+1))
test_action_string.append("SSCC SSC%d reboot" % (i+1))
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# switch off recv print
checker_stings = []
test_action_strings = []
for i in range(self.sta_number + 1):
checker_stings.append("R SSC%s C +RECVPRINT:0" % (i+1))
test_action_strings.append("SSC SSC%s soc -R -o 0" % (i+1))
fail_string = "Fail, Fail to turn off recv print"
self.load_and_exe_one_step(checker_stings, test_action_strings, fail_string)
# step1 set ap on SSC1, create server
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail set mode"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
tcp_port = random.randint(10000, 20000)
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -t 3 -m 8" % (ssid, password)]
fail_string = "Fail, Fail set ap"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -B -t TCP -p %s" % tcp_port]
fail_string = "Fail, Fail create server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -L -s <server_sock>"]
fail_string = "Fail, Fail create server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step 2, 8 SSC target(SSC2 - SSC9) join SSC1 soft AP
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d C +MODE:OK" % (i+2))
test_action_string.append("SSCC SSC%d op -S -o 1" % (i+2))
fail_string = "Fail, Fail set mode"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d C +JAP:CONNECTED,%s" % (i+2, ssid))
test_action_string.append("SSCC SSC%d ap -C -s %s -p %s" % (i+2, ssid, password))
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step 3, create client on SSC2 - SSC9
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d A <client_sock%d>:BIND:(\d+),OK" % (i+2, i+2))
test_action_string.append("SSCC SSC%d soc -B -t TCP" % (i+2))
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["P SSC%d RE CONNECT:(\d+),OK" % (i+2),
"P SSC1 A <accept_sock%d>:ACCEPT:(\d+),.+" % (i+2)]
test_action_string = ["SSCC SSC%d soc -C -s <client_sock%d> -i %s -p %s" %
(i+2, i+2, ap_ip, tcp_port)]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step 4, do send/recv
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d RE \+SEND:\d+,OK NC CLOSED" % (i+2))
test_action_string.append("SSC SSC%d soc -S -s <client_sock%d> -l %d -n %d -j %d" %
(i+2, i+2, send_len, TEST_COUNT_ONE_ROUND, send_delay))
if server_echo is True:
test_action_string.append("SSC SSC1 soc -S -s <accept_sock%d> -l %d -n %d -j %d" %
(i+2, send_len, TEST_COUNT_ONE_ROUND, send_delay))
checker_stings.append("P SSC1 RE \"\+SEND:%%%%s,OK\"%%%%(<accept_sock%d>) NC CLOSED)" %
(i+2))
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=300) is False:
break
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# TODO: create a function to create TCP connections. reuse not copy paste code
checker_stings = []
test_action_string = []
for i in range(sta_number + 1):
checker_stings.append("P SSC%d C CLOSEALL" % (i + 1))
test_action_string.append("SSCC SSC%d soc -T" % (i + 1))
fail_string = "Fail, Fail to close socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
server_port = random.randint(20000, 30000)
checker_stings = ["R SSC1 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -B -t TCP -p %s" % server_port]
fail_string = "Fail, Fail to bind socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to listen"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d A <client_sock%d>:BIND:(\d+),OK" % (i + 2, i + 2))
test_action_string.append("SSCC SSC%d soc -B -t TCP" % (i + 2))
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["P SSC%d RE CONNECT:(\d+),OK" % (i + 2),
"P SSC1 A <accept_sock%d>:ACCEPT:(\d+),.+" % (i + 2)]
test_action_string = ["SSCC SSC%d soc -C -s <client_sock%d> -i %s -p %s" %
(i + 2, i + 2, ap_ip, server_port)]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,335 +0,0 @@
import random
import re
import socket
import threading
import time
import TCPConnectionUtility
from NativeLog import NativeLog
from TCAction import PerformanceTCBase
DELAY_RANGE = [10, 3000]
CONNECTION_STRUCTURE = ("Connection handler", "PC socket", "Target socket id",
"Target port", "PC port", "PC state", "Target state")
# max fail count for one connection during test
MAX_FAIL_COUNT = 10
class CheckerBase(threading.Thread):
CHECK_ITEM = ("CONDITION", "NOTIFIER", "ID", "DATA")
SLEEP_TIME = 0.1 # sleep 100ms between each check action
def __init__(self):
threading.Thread.__init__(self)
self.setDaemon(True)
self.exit_event = threading.Event()
self.sync_lock = threading.Lock()
self.check_item_list = []
self.check_item_id = 0
def run(self):
while self.exit_event.isSet() is False:
self.process()
pass
def process(self):
pass
def add_check_item(self, condition, notifier):
with self.sync_lock:
check_item_id = self.check_item_id
self.check_item_id += 1
self.check_item_list.append(dict(zip(self.CHECK_ITEM, (condition, notifier, check_item_id, str()))))
return check_item_id
def remove_check_item(self, check_item_id):
ret = None
with self.sync_lock:
check_items = filter(lambda x: x["ID"] == check_item_id, self.check_item_list)
if len(check_items) > 0:
self.check_item_list.remove(check_items[0])
ret = check_items[0]["DATA"]
return ret
def exit(self):
self.exit_event.set()
pass
# check on serial port
class SerialPortChecker(CheckerBase):
def __init__(self, serial_reader):
CheckerBase.__init__(self)
self.serial_reader = serial_reader
pass
# check condition for serial is compiled regular expression pattern
@staticmethod
def do_check(check_item, data):
match = check_item["CONDITION"].search(data)
if match is not None:
pos = data.find(match.group()) + len(match.group())
# notify user
check_item["NOTIFIER"]("serial", match)
else:
pos = -1
return pos
def process(self):
# do check
with self.sync_lock:
# read data
new_data = self.serial_reader()
# NativeLog.add_trace_info("[debug][read data] %s" % new_data)
# do check each item
for check_item in self.check_item_list:
# NativeLog.add_trace_info("[debug][read data][ID][%s]" % check_item["ID"])
check_item["DATA"] += new_data
self.do_check(check_item, check_item["DATA"])
time.sleep(self.SLEEP_TIME)
# handle PC TCP server accept and notify user
class TCPServerChecker(CheckerBase):
def __init__(self, server_sock):
CheckerBase.__init__(self)
self.server_sock = server_sock
server_sock.settimeout(self.SLEEP_TIME)
self.accepted_socket_list = []
# check condition for tcp accepted sock is tcp source port
@staticmethod
def do_check(check_item, data):
for sock_addr_pair in data:
addr = sock_addr_pair[1]
if addr[1] == check_item["CONDITION"]:
# same port, so this is the socket that matched, notify and remove it from list
check_item["NOTIFIER"]("tcp", sock_addr_pair[0])
data.remove(sock_addr_pair)
def process(self):
# do accept
try:
client_sock, addr = self.server_sock.accept()
self.accepted_socket_list.append((client_sock, addr))
except socket.error:
pass
# do check
with self.sync_lock:
check_item_list = self.check_item_list
for check_item in check_item_list:
self.do_check(check_item, self.accepted_socket_list)
pass
# this thread handles one tcp connection.
class ConnectionHandler(threading.Thread):
CHECK_FREQ = CheckerBase.SLEEP_TIME/2
def __init__(self, utility, serial_checker, tcp_checker, connect_method, disconnect_method, test_case):
threading.Thread.__init__(self)
self.setDaemon(True)
self.utility = utility
self.connect_method = connect_method
self.disconnect_method = disconnect_method
self.exit_event = threading.Event()
# following members are used in communication with checker threads
self.serial_checker = serial_checker
self.tcp_checker = tcp_checker
self.serial_notify_event = threading.Event()
self.tcp_notify_event = threading.Event()
self.serial_result = None
self.tcp_result = None
self.serial_check_item_id = None
self.tcp_check_item_id = None
self.data_cache = None
self.fail_count = 0
self.test_case = test_case
pass
def log_error(self):
self.fail_count += 1
if self.fail_count > MAX_FAIL_COUNT:
self.test_case.error_detected()
def new_connection_structure(self):
connection = dict.fromkeys(CONNECTION_STRUCTURE, None)
connection["Connection handler"] = self
return connection
def run(self):
while self.exit_event.isSet() is False:
connection = self.new_connection_structure()
# do connect
connect_method_choice = random.choice(self.connect_method)
if self.utility.execute_tcp_method(connect_method_choice, connection) is False:
self.log_error()
# check if established
if self.utility.is_established_state(connection) is True:
time.sleep(float(random.randint(DELAY_RANGE[0], DELAY_RANGE[1]))/1000)
# do disconnect if established
disconnect_method_choice = random.choice(self.disconnect_method)
if self.utility.execute_tcp_method(disconnect_method_choice, connection) is False:
self.log_error()
# make sure target socket closed
self.utility.close_connection(connection)
time.sleep(float(random.randint(DELAY_RANGE[0], DELAY_RANGE[1]))/1000)
pass
# serial_condition: re string
# tcp_condition: target local port
def add_checkers(self, serial_condition=None, tcp_condition=None):
# cleanup
self.serial_result = None
self.tcp_result = None
self.serial_notify_event.clear()
self.tcp_notify_event.clear()
# serial_checker
if serial_condition is not None:
pattern = re.compile(serial_condition)
self.serial_check_item_id = self.serial_checker.add_check_item(pattern, self.notifier)
else:
# set event so that serial check always pass
self.serial_notify_event.set()
if tcp_condition is not None:
self.tcp_check_item_id = self.tcp_checker.add_check_item(tcp_condition, self.notifier)
else:
# set event so that tcp check always pass
self.tcp_notify_event.set()
# NativeLog.add_trace_info("[Debug] add check item %s, connection is %s" % (self.serial_check_item_id, self))
pass
def get_checker_results(self, timeout=5):
time1 = time.time()
while time.time() - time1 < timeout:
# if one type of checker is not set, its event will be set in add_checkers
if self.serial_notify_event.isSet() is True and self.tcp_notify_event.isSet() is True:
break
time.sleep(self.CHECK_FREQ)
# do cleanup
# NativeLog.add_trace_info("[Debug] remove check item %s, connection is %s" % (self.serial_check_item_id, self))
self.data_cache = self.serial_checker.remove_check_item(self.serial_check_item_id)
self.tcp_checker.remove_check_item(self.tcp_check_item_id)
# self.serial_check_item_id = None
# self.tcp_check_item_id = None
return self.serial_result, self.tcp_result
def notifier(self, typ, result):
if typ == "serial":
self.serial_notify_event.set()
self.serial_result = result
elif typ == "tcp":
self.tcp_notify_event.set()
self.tcp_result = result
def exit(self):
self.exit_event.set()
pass
class TestCase(PerformanceTCBase.PerformanceTCBase):
def __init__(self, test_case, test_env, timeout=120, log_path=None):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env,
timeout=timeout, log_path=log_path)
self.max_connection = 5
self.execute_time = 120 # execute time default 120 minutes
self.pc_ip = "pc_ip"
self.target_ip = "target_ip"
self.connect_method = ["C_01"]
self.disconnect_method = ["D_05"]
cmd_set = test_case["cmd set"]
# load param from excel
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.error_event = threading.Event()
self.serial_lock = threading.Lock()
pass
def serial_reader(self):
return self.serial_read_data("SSC1")
def send_ssc_command(self, data):
with self.serial_lock:
time.sleep(0.05)
self.serial_write_line("SSC1", data)
def error_detected(self):
self.error_event.set()
def process(self):
# parameters
max_connection = self.max_connection
execute_time = self.execute_time * 60
pc_ip = self.get_parameter(self.pc_ip)
target_ip = self.get_parameter(self.target_ip)
connect_method = self.connect_method
disconnect_method = self.disconnect_method
server_port = random.randint(30000, 50000)
# step 1, create TCP server on target and PC
# create TCP server on target
self.serial_write_line("SSC1", "soc -B -t TCP -p %s" % server_port)
match = self.check_regular_expression("SSC1", re.compile("BIND:(\d+),OK"))
if match is None:
NativeLog.add_prompt_trace("Failed to create TCP server on target")
return
target_sock_id = match.group(1)
self.serial_write_line("SSC1", "soc -L -s %s" % target_sock_id)
if self.check_response("SSC1", "+LISTEN:%s,OK" % target_sock_id) is False:
NativeLog.add_prompt_trace("Failed to create TCP server on target")
return
# create TCP server on PC
try:
server_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
server_sock.bind((pc_ip, server_port))
server_sock.listen(5)
except StandardError:
NativeLog.add_prompt_trace("Failed to create TCP server on PC")
return
# step 2, create checker
serial_port_checker = SerialPortChecker(self.serial_reader)
tcp_server_checker = TCPServerChecker(server_sock)
serial_port_checker.start()
tcp_server_checker.start()
# step 3, create 5 thread and do connection
utility = TCPConnectionUtility.Utility(self, server_port, server_port, pc_ip, target_ip)
work_thread = []
for i in range(max_connection):
t = ConnectionHandler(utility, serial_port_checker, tcp_server_checker,
connect_method, disconnect_method, self)
work_thread.append(t)
t.start()
# step 4, wait and exit
self.error_event.wait(execute_time)
# close all threads
for t in work_thread:
t.exit()
t.join()
serial_port_checker.exit()
tcp_server_checker.exit()
serial_port_checker.join()
tcp_server_checker.join()
if self.error_event.isSet() is False:
# no error detected
self.set_result("Succeed")
pass
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,251 +0,0 @@
import random
import socket
import threading
from NativeLog import NativeLog
# from NativeLog import NativeLog
# make sure target do not listen on this port
ERROR_PORT = 62685
class Utility(object):
METHOD_RESULT = {"C_01": ("ESTABLISHED", "ESTABLISHED"), # target TCP peer state, PC TCP peer state
"C_02": ("SYNC_SENT", "CLOSED"),
"C_03": ("CLOSED", "CLOSED"),
"C_04": ("SYN_RCVD", "ESTABLISHED"),
"C_05": ("ESTABLISHED", "ESTABLISHED"),
"C_06": ("CLOSED", "CLOSED"),
"C_07": ("CLOSED", "CLOSED"),
"C_08": ("CLOSED", "CLOSED"),
"D_01": ("TIME_WAIT", "CLOSED"),
"D_02": ("TIME_WAIT", "TIME_WAIT"),
"D_03": ("FIN_WAIT_2", "CLOSE_WAIT"),
"D_04": ("FIN_WAIT_1", "CLOSE_WAIT"),
"D_05": ("CLOSED", "TIME_WAIT"),
"D_06": ("CLOSED", "CLOSED"),
"D_07": ("CLOSE_WAIT", "FIN_WAIT2"),
"D_08": ("TIME_WAIT", "CLOSED"), }
SOC_CLOSED_STATE = ("FIN_WAIT_1", "FIN_WAIT_2", "CLOSING", "TIME_WAIT", "LAST_ACK", "CLOSED")
SOC_CREATED_STATE = ("SYNC_RCVD", "ESTABLISHED")
SOC_SEND_DATA_STATE = ("ESTABLISHED", "CLOSE_WAIT")
SOC_ESTABLISHED_STATE = ("ESTABLISHED", )
def __init__(self, tc_action, pc_server_port, target_server_port, pc_ip, target_ip):
self.tc_action = tc_action
self.pc_server_port = pc_server_port
self.target_server_port = target_server_port
self.pc_ip = pc_ip
self.target_ip = target_ip
self.pc_close_wait_socket_list = []
self.sync_lock = threading.Lock()
pass
# create a tcp socket, return True or False
def __create_tcp_socket(self, connection):
connection_handler = connection["Connection handler"]
connection["Target port"] = random.randint(10000, 60000)
connection_handler.add_checkers("BIND:(\d+),OK,%s,%s"
% (self.target_ip, connection["Target port"]))
self.tc_action.send_ssc_command("soc -B -t TCP -i %s -p %s" % (self.target_ip, connection["Target port"]))
serial_result, tcp_result = connection_handler.get_checker_results()
if serial_result is not None:
connection["Target socket id"] = serial_result.group(1)
return True
else:
return False
# target do connect, return True or False
def __target_do_connect(self, connection, dest_ip, dest_port, timeout=20):
connection_handler = connection["Connection handler"]
connection_handler.add_checkers("CONNECT:%s,OK" % connection["Target socket id"],
connection["Target port"])
self.tc_action.send_ssc_command("soc -C -s %s -i %s -p %s"
% (connection["Target socket id"], dest_ip, dest_port))
serial_result, tcp_result = connection_handler.get_checker_results(timeout)
if serial_result is not None and tcp_result is not None:
connection["PC socket"] = tcp_result
return True
else:
return False
pass
# pc do connect, return True or False
def __pc_do_connect(self, connection, dest_ip, dest_port, timeout=20):
connection_handler = connection["Connection handler"]
sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
while True:
connection["PC port"] = random.randint(10000, 60000)
try:
sock.bind((self.pc_ip, connection["PC port"]))
break
except socket.error, e:
if e.errno == 10048: # socket port reuse
continue
sock.settimeout(timeout)
connection["PC socket"] = sock
connection_handler.add_checkers("ACCEPT:(\d+),\d+,%s,%s"
% (self.pc_ip, connection["PC port"]))
try:
sock.connect((dest_ip, dest_port))
except socket.error:
pass
serial_result, tcp_result = connection_handler.get_checker_results()
if serial_result is not None:
connection["Target socket id"] = serial_result.group(1)
return True
else:
return False
pass
def connect_c_01(self, connection):
if self.__create_tcp_socket(connection) is True:
return self.__target_do_connect(connection, self.pc_ip, self.pc_server_port)
else:
return False
def connect_c_02(self, connection):
if self.__create_tcp_socket(connection) is True:
return not self.__target_do_connect(connection, self.pc_ip, ERROR_PORT, timeout=5)
else:
return False
def connect_c_03(self, connection):
return False
def connect_c_04(self, connection):
return False
def connect_c_05(self, connection):
return self.__pc_do_connect(connection, self.target_ip, self.target_server_port)
def connect_c_06(self, connection):
return False
def connect_c_07(self, connection):
return not self.__pc_do_connect(connection, self.target_ip, ERROR_PORT)
def connect_c_08(self, connection):
return False
def __target_socket_close(self, connection):
connection_handler = connection["Connection handler"]
if connection["Target socket id"] is not None:
connection_handler.add_checkers("CLOSE:%s" % connection["Target socket id"])
self.tc_action.send_ssc_command("soc -T -s %s" % connection["Target socket id"])
serial_result, tcp_result = connection_handler.get_checker_results()
connection["Target socket id"] = None
else:
serial_result = None
return True if serial_result is not None else False
@staticmethod
def __pc_socket_close(connection):
connection_handler = connection["Connection handler"]
if connection["PC socket"] is not None:
connection_handler.add_checkers("CLOSED:%s" % connection["Target socket id"])
connection["PC socket"].close()
serial_result, tcp_result = connection_handler.get_checker_results()
connection["PC socket"] = None
else:
serial_result = None
return True if serial_result is not None else False
def close_d_01(self, connection):
connection["PC socket"] = None
return self.__target_socket_close(connection)
def close_d_02(self, connection):
pass
def close_d_03(self, connection):
with self.sync_lock:
self.pc_close_wait_socket_list.append(connection["PC socket"])
return self.__target_socket_close(connection)
pass
def close_d_04(self, connection):
pass
def close_d_05(self, connection):
return self.__pc_socket_close(connection)
def close_d_06(self, connection):
# target send data to PC, PC don't recv and close socket
connection_handler = connection["Connection handler"]
connection_handler.add_checkers("SEND:%s,OK" % connection["Target socket id"])
self.tc_action.send_ssc_command("soc -S -s %s -l 100" % connection["Target socket id"])
serial_result, tcp_result = connection_handler.get_checker_results()
if serial_result is None:
return False
return self.__pc_socket_close(connection)
def close_d_07(self, connection):
# PC shutdown WR
result = False
try:
connection["PC socket"].shutdown(socket.SHUT_WR)
result = True
except StandardError:
pass
return result
def close_d_08(self, connection):
pass
def close_connection(self, connection):
self.__target_socket_close(connection)
pass
TCP_ACTION_DICT = {"C_01": connect_c_01,
"C_02": connect_c_02,
"C_03": connect_c_03,
"C_04": connect_c_04,
"C_05": connect_c_05,
"C_06": connect_c_06,
"C_07": connect_c_07,
"C_08": connect_c_08,
"D_01": close_d_01,
"D_02": close_d_02,
"D_03": close_d_03,
"D_04": close_d_04,
"D_05": close_d_05,
"D_06": close_d_06,
"D_07": close_d_07,
"D_08": close_d_08,
}
def get_method_destination_state(self, method):
return self.METHOD_RESULT[method]
def execute_tcp_method(self, method, connection):
if method in self.METHOD_RESULT:
result = self.TCP_ACTION_DICT[method](self, connection)
if result is True:
state = self.get_method_destination_state(method)
connection["Target state"] = state[0]
connection["PC state"] = state[1]
else:
NativeLog.add_prompt_trace("[TCPConnection] tcp method %s fail, connection is %s"
% (method, connection))
NativeLog.add_trace_info("[TCPConnection][data cache][check item %s] %s"
% (connection["Connection handler"].serial_check_item_id,
connection["Connection handler"].data_cache))
else:
raise StandardError("Not TCP connection method")
return result
def is_established_state(self, connection):
return True if connection["Target state"] in self.SOC_CREATED_STATE else False
def is_closed_state(self, connection):
return True if connection["Target state"] in self.SOC_CLOSED_STATE else False
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,243 +0,0 @@
import os
import random
import threading
import socket
import time
import re
from TCAction import TCActionBase
from TCAction import PerformanceTCBase
from NativeLog import NativeLog
def calc_hash(index):
return (index & 0xffffffff) % 83 + (index & 0xffffffff) % 167
def verify_data(data, start_index):
for i, c in enumerate(data):
if ord(c) != calc_hash(start_index + i):
NativeLog.add_trace_critical("[Data Validation Error] target sent data index %u is error."
" Sent data is %x, should be %x"
% (start_index + i, ord(c), calc_hash(start_index + i)))
return False
return True
def make_validation_data(length, start_index):
return bytes().join([chr(calc_hash(start_index + i)) for i in range(length)])
class SendThread(threading.Thread):
def __init__(self, sock, send_len):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.send_len = send_len
self.exit_event = threading.Event()
pass
def exit(self):
self.exit_event.set()
def run(self):
index = 0
while self.exit_event.isSet() is False:
data = make_validation_data(self.send_len, index)
try:
self.sock.send(data)
index += self.send_len
except StandardError:
# pass but not exit thread
time.sleep(1)
continue
pass
class RecvThread(threading.Thread):
def __init__(self, sock):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.exit_event = threading.Event()
def exit(self):
self.exit_event.set()
def run(self):
index = 0
while self.exit_event.isSet() is False:
if self.sock is not None:
try:
data = self.sock.recv(8*1024)
except StandardError, e:
NativeLog.add_exception_log(e)
NativeLog.add_trace_critical("recv error, connection closed")
break
if verify_data(data, index) is not True:
break
index += len(data)
else:
time.sleep(1)
pass
class ValidationThread(threading.Thread):
def __init__(self, tc_action):
threading.Thread.__init__(self)
self.setDaemon(True)
self.tc_action = tc_action
self.exit_event = threading.Event()
def exit(self):
self.exit_event.set()
def run(self):
while self.exit_event.isSet() is False:
if self.tc_action.check_response("SSC1", "DATA_ERROR", 5) is True:
NativeLog.add_trace_critical("[Data Validation Error] target recv data error")
break
pass
class TestCase(PerformanceTCBase.PerformanceTCBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.send_len = 0
self.tx_enable = None
self.rx_enable = None
self.conn_num = 0
self.test_time = 0
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
try:
# configurable params
send_len = self.send_len
tx_enable = self.tx_enable
rx_enable = self.rx_enable
conn_num = self.conn_num
test_time = self.test_time * 60 # convert minutes to seconds
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPThroughput script, error is %s" % e)
raise StandardError("Error configuration")
# init throughput result data
test_item = ""
if tx_enable is True:
test_item += "Tx"
if rx_enable is True:
test_item += "Rx"
if test_item == "":
raise StandardError("no throughput test item")
pc_ip = self.get_parameter("pc_ip")
tcp_port = random.randint(10000, 50000)
# disable recv print during throughput test
self.serial_write_line("SSC1", "soc -R -o 0")
if self.check_response("SSC1", "+RECVPRINT", 2) is False:
NativeLog.add_trace_critical("Fail, Fail to disable recv print")
# create server
server_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
server_sock.bind((pc_ip, tcp_port))
server_sock.settimeout(5)
server_sock.listen(5)
sock_id_list = []
send_thread_list = []
recv_thread_list = []
# step 4 create tcp connection
for i in range(conn_num):
self.serial_write_line("SSC1", "soc -B -t TCP")
match = self.check_regular_expression("SSC1", re.compile("\+BIND:(\d+),OK"), 2)
if match is None:
NativeLog.add_trace_critical("Fail, Fail to bind")
return
else:
sock_id_list.append(int(match.group(1)))
self.serial_write_line("SSC1", "soc -V -s %s -o 3" % sock_id_list[-1])
if self.check_regular_expression("SSC1", re.compile("\+DATA_VALIDATION:\d+,OK"), 2) is None:
NativeLog.add_trace_critical("Fail, Failed to enable validation")
return
self.serial_write_line("SSC1", "soc -C -s %s -i %s -p %s" % (sock_id_list[-1], pc_ip, tcp_port))
try:
sock, addr = server_sock.accept()
except socket.error, e:
NativeLog.add_trace_critical("%s" % e)
raise e
if self.check_regular_expression("SSC1", re.compile("\+CONNECT:\d+,OK"), 5) is None:
NativeLog.add_trace_critical("Fail, Failed to connect")
return
sock.settimeout(10)
send_thread_list.append(SendThread(sock if rx_enable is True else None, send_len))
recv_thread_list.append(RecvThread(sock if tx_enable is True else None))
recv_thread_list[-1].start()
# step 5 do test
validation_thread = ValidationThread(self)
validation_thread.start()
for send_thread in send_thread_list:
send_thread.start()
if tx_enable is True:
# do send from target
for sock_id in sock_id_list:
self.serial_write_line("SSC1", "soc -S -s %s -l %s -n 10000000" % (sock_id, send_len))
time1 = time.time()
exit_flag = False
while time.time() - time1 < test_time and exit_flag is False:
for i in sock_id_list:
send_thread_list[i].join(0.5)
recv_thread_list[i].join(0.5)
validation_thread.join(0.5)
if send_thread_list[i].isAlive() is False \
or recv_thread_list[i].isAlive() is False \
or validation_thread.isAlive() is False:
NativeLog.add_trace_critical("validation error found")
exit_flag = True
break
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - time1))
if time.time() - time1 >= test_time:
self.set_result("Succeed")
else:
self.set_result("Failed")
# exit all thread
for i in sock_id_list:
send_thread_list[i].exit()
recv_thread_list[i].exit()
send_thread_list[i].join()
send_thread_list[i].join()
validation_thread.exit()
validation_thread.join()
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,165 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 500
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
server_echo = self.server_echo
sta_number = self.sta_number
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C ready!!!" % (i + 1)]
test_action_string = ["SSCC SSC%d restore" % (i + 1)]
fail_string = "Fail, Fail to restore"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# turn off recv print
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C +RECVPRINT:0" % (i + 1)]
test_action_string = ["SSCC SSC%d soc -R -o 0" % (i + 1)]
fail_string = "Fail, Fail to turn off recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step1, set softap mode on SSC1
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail to set mode on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set STA mode on SSC2-SSCn
for i in range(sta_number):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 2)]
test_action_string = ["SSCC SSC%d op -S -o 1" % (i + 2)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
tcp_port = random.randint(40000, 50000)
# step3, set ssid/password on SSC1
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -n 10 -t 0 -m 10" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step4, SSC2-SSCn join SSC1(soft AP)
for i in range(sta_number):
checker_stings = ["P SSC%d C +JAP:CONNECTED,%s" % (i + 2, ssid)]
test_action_string = ["SSCC SSC%d ap -C -s %s -p %s" % (i + 2, ssid, password)]
fail_string = "Fail, SSC%d Fail to connect to SSC1" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step5, create server on SSC2
checker_stings = ["R SSC2 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -B -t TCP -p %s" % tcp_port]
fail_string = "Fail, Fail to create server on SSC2 while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to create server on SSC2 while listening"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step6, create client on SSC3-SSCn
for i in range(sta_number - 1):
checker_stings = ["P SSC%d A <client_sock%d>:BIND:(\d+),OK" % (i + 3, i + 3)]
test_action_string = ["SSCC SSC%d soc -B -t TCP" % (i + 3)]
fail_string = "Fail, SSC%d Fail to connect to TCP server while binding" % (i + 3)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number - 1):
checker_stings = ["P SSC%d RE CONNECT:(\d+),OK" % (i + 3), "P SSC2 A <accept_sock%d>:ACCEPT:(\d+),.+" % i]
test_action_string = [
"SSCC SSC%d soc -C -s <client_sock%d> -i 192.168.4.2 -p %s" % (i + 3, i + 3, tcp_port)]
fail_string = "Fail, SSC%d Fail to connect to TCP server while connecting" % (i + 3)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step7, do send/recv, SSC2<---->other STAs
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
# SSC2 send packets to SSC3-SSCn
if server_echo is True:
for i in range(sta_number - 1):
test_action_string.append("SSC SSC2 soc -S -s <accept_sock%d> -l %d -n 1000 -j %d" %
(i, send_len, send_delay))
checker_stings.append(
"P SSC2 RE \+SEND:%s,OK NC CLOSED NC ERROR" % self.get_parameter("accept_sock%d" % (i + 3)))
# SSC3-SSCn send packets to SSC2
for i in range(sta_number - 1):
checker_stings.append(
"P SSC%d RE \+SEND:%s,OK NC CLOSED NC ERROR" % (i + 3, self.get_parameter("client_sock%d" % i)))
test_action_string.append("SSC SSC%d soc -S -s <client_sock%d> -l %d -n 1000 -j %d" %
(i + 3, i + 3, send_len, send_delay))
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=900) is False:
break
# drop off the delay time if it's greater than 20ms
if send_delay > 20:
send_delay -= 10
NativeLog.add_trace_critical("Time escape: %d" % (time.time() - start_time))
if (time.time() - start_time) >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,109 +0,0 @@
import os
import time
import random
import threading
import socket
from TCAction import TCActionBase
from NativeLog import NativeLog
from NativeLog import ThroughputResult
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.send_len_config = range(1460)
self.delay_config = [0, 0.01, 0.1, 0.5, 1]
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len_config = self.send_len_config
delay_config = self.delay_config
send_count = self.send_count
test_time = self.test_time * 60
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPThroughput script, error is %s" % e)
raise StandardError("Error configuration")
# disable recv print during random send test
checker_stings = ["R SSC1 C +RECVPRINT"]
test_action_string = ["SSC SSC1 soc -R -o 0"]
fail_string = "Fail, Fail to disable recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
pc_ip = self.get_parameter("pc_ip")
tcp_port = random.randint(50000, 60000)
# step 0 create tcp connection
server_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
server_sock.bind((pc_ip, tcp_port))
server_sock.settimeout(1)
server_sock.listen(5)
checker_stings = ["R SSC1 A <client_sock>:\+BIND:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -B -t TCP"]
fail_string = "Fail, Fail bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["P SSC1 RE \+CONNECT:\d+,OK"]
test_action_string = ["SSC SSC1 soc -C -s <client_sock> -i %s -p %s" % (pc_ip, tcp_port)]
fail_string = "Fail, Fail to connect"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
sock, addr = server_sock.accept()
sock.settimeout(10)
# set no delay so that tcp segment will be send as soon as send called
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
# step 1 start send
start_time = time.time()
while time.time() - start_time < test_time:
for delay in delay_config:
for i in xrange(send_count):
send_len = random.choice(send_len_config)
data = "A" * (send_len+1)
try:
sock.send(data)
except socket.error, e:
NativeLog.add_exception_log(e)
NativeLog.add_trace_critical("Fail to send packets")
return
pass
time.sleep(delay)
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) > test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,159 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout, log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
server_echo = self.server_echo
conn_number = self.conn_number
sta_number = self.sta_number
test_time = self.test_time
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C !!!ready!!!" % (i + 1)]
test_action_string = ["SSCC SSC%d reboot" % (i + 1)]
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step1, set ap mode on SSC1, set STA mode on SSC2-SSC3
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail to set mode on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 2)]
test_action_string = ["SSCC SSC%d op -S -o 1" % (i + 2)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# turn off recv print
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C +RECVPRINT:0" % (i + 1)]
test_action_string = ["SSCC SSC%d soc -R -o 0" % (i + 1)]
fail_string = "Fail, Fail to turn off recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set ssid/password on SSC1
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
tcp_port = random.randint(10000, 20000)
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -t 3 -m 8" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step3, SSC2-SSC3 connect to SSC1
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d C +JAP:CONNECTED,%s" % (i + 2, ssid))
test_action_string.append("SSCC SSC%d ap -C -s %s -p %s" % (i + 2, ssid, password))
fail_string = "Fail, SSC%d Fail to connect to SoftAP" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step4, create tcp server on STA SSC2
checker_stings = ["R SSC2 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -B -t TCP -p %s" % tcp_port]
fail_string = "Fail, Fail to create server on SSC2 while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to create server on SSC2 while listening"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step5, create multi client on SSC3
for i in range(conn_number):
checker_stings = ["P SSC3 A <client_sock%d>:BIND:(\d+),OK" % i]
test_action_string = ["SSCC SSC3 soc -B -t TCP"]
fail_string = "Fail, Fail to create client on SSC3"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["P SSC3 RE CONNECT:(\d+),OK", "P SSC2 A <accept_sock%d>:ACCEPT:(\d+),.+" % i]
test_action_string = ["SSCC SSC3 soc -C -s <client_sock%d> -i %s -p %s" % (i, "192.168.4.2", tcp_port)]
fail_string = "Fail, Fail to connect to SSC2 server while connecting"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step6, do send/recv
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
# SSC2 send packets to SSC3
if server_echo is True:
for i in range(conn_number):
checker_stings.append("P SSC2 RE \+SEND:\d+,OK NC CLOSED NC ERROR")
test_action_string.append("SSC SSC2 soc -S -s <accept_sock%d> -l %d -n 1000 -j %d" %
(i, send_len, send_delay))
# SSC3 send packets to SSC2
for i in range(conn_number):
test_action_string.append("SSC SSC3 soc -S -s <client_sock%d> -l %d -n 1000 -j %d" %
(i, send_len, send_delay))
checker_stings.append("P SSC3 RE \+SEND:\d+,OK NC CLOSED NC ERROR")
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=600) is False:
break
if send_delay > 20:
send_delay -= 10
NativeLog.add_trace_critical("Time escape: %d" % (time.time() - start_time))
if (time.time() - start_time) > test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,167 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout, log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
server_echo = self.server_echo
conn_number = self.conn_number
sta_number = self.sta_number
test_time = self.test_time * 60
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C ready!!!" % (i + 1)]
test_action_string = ["SSCC SSC%d restore" % (i + 1)]
fail_string = "Fail, Fail to restore"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step1, set ap mode on SSC1, set STA mode on SSC2-SSC3
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail to set mode on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 2)]
test_action_string = ["SSCC SSC%d op -S -o 1" % (i + 2)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# turn off recv print
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C +RECVPRINT:0" % (i + 1)]
test_action_string = ["SSCC SSC%d soc -R -o 0" % (i + 1)]
fail_string = "Fail, Fail to turn off recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set ssid/password on SSC1
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
tcp_port = random.randint(10000, 20000)
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -n 10 -t 0 -m 10" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step3, SSC2-SSC3 connect to SSC1
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d C +JAP:CONNECTED,%s" % (i + 2, ssid))
test_action_string.append("SSCC SSC%d ap -C -s %s -p %s" % (i + 2, ssid, password))
fail_string = "Fail, SSC%d Fail to connect to SoftAP" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step4, create tcp server on STA SSC2
checker_stings = ["R SSC2 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -B -t TCP -p %s" % tcp_port]
fail_string = "Fail, Fail to create server on SSC2 while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to create server on SSC2 while listening"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step5, create multi client on SSC3
for i in range(conn_number):
checker_stings = ["P SSC3 A <client_sock%d>:BIND:(\d+),OK" % i]
test_action_string = ["SSCC SSC3 soc -B -t TCP"]
fail_string = "Fail, Fail to create client on SSC3"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["P SSC3 RE CONNECT:(\d+),OK", "P SSC2 A <accept_sock%d>:ACCEPT:(\d+),.+ NC ERROR" % i]
test_action_string = ["SSCC SSC3 soc -C -s <client_sock%d> -i %s -p %s" % (i, "192.168.4.2", tcp_port)]
fail_string = "Fail, Fail to connect to SSC2 server while connecting"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step6, do send/recv
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
# SSC2 send packets to SSC3
if server_echo is True:
for i in range(conn_number):
checker_stings.append(
"P SSC2 RE \+SEND:%s,OK NC CLOSED NC ERROR NC unexpected" % self.get_parameter(
"accept_sock%d" % i))
test_action_string.append("SSC SSC2 soc -S -s <accept_sock%d> -l %d -n 1000 -j %d" %
(i, send_len, send_delay))
# SSC3 send packets to SSC2
for i in range(conn_number):
test_action_string.append("SSC SSC3 soc -S -s <client_sock%d> -l %d -n 1000 -j %d" %
(i, send_len, send_delay))
checker_stings.append(
"P SSC3 RE \+SEND:%s,OK NC CLOSED NC ERROR" % self.get_parameter("client_sock%d" % i))
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=900) is False:
# checker_stings = ["R SSC1 C +LSTADONE"]
# test_action_string = ["SSCC SSC1 ap -L"]
# fail_string = ""
# if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
# pass
break
if send_delay > 20:
send_delay -= 10
NativeLog.add_trace_critical("Time escape: %d" % (time.time() - start_time))
if (time.time() - start_time) > test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,154 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 1000
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def cleanup(self):
# step 0 turn on recv print
checker_stings = ["P SSC1 C +RECVPRINT:1", "P SSC2 C +RECVPRINT:1"]
test_action_string = ["SSC SSC1 soc -R -o 1", "SSC SSC2 soc -R -o 1"]
fail_string = "Fail, Fail to turn on recv print"
self.load_and_exe_one_step(checker_stings, test_action_string, fail_string)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
duplex = self.duplex
conn_num = self.conn_num
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPSendRecv script, error is %s" % e)
raise StandardError("Error configuration")
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
tcp_port = random.randint(10000, 50000)
# step 0 set ap
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSC SSC1 ap -S -s %s -p %s -t 3" % (ssid, password)]
fail_string = "Fail, Fail to set ap"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
# step 1 connect to ap and turn off recv print
checker_stings = ["R SSC2 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC2 sta -C -s %s -p %s" % (ssid, password)]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=200) is False:
self.result_cntx.set_result("Fail")
return
checker_stings = ["P SSC1 C +RECVPRINT:0", "P SSC2 C +RECVPRINT:0"]
test_action_string = ["SSC SSC1 soc -R -o 0", "SSC SSC2 soc -R -o 0"]
fail_string = "Fail, Fail to turn off recv print"
self.load_and_exe_one_step(checker_stings, test_action_string, fail_string)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=200) is False:
self.result_cntx.set_result("Fail")
return
# step 2 create server on AP
checker_stings = ["R SSC1 A <server_sock>:\+BIND:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -B -t TCP -p %s" % tcp_port]
fail_string = "Fail, Fail to create server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
checker_stings = ["R SSC1 A <server_sock>:\+LISTEN:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to create server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
# step 3 create conn_num tcp connections
for i in range(conn_num):
checker_stings = ["R SSC2 A <client_sock%s>:\+BIND:(\d+),OK" % i]
test_action_string = ["SSC SSC2 soc -B -t TCP"]
fail_string = "Fail, Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
checker_stings = ["P SSC1 A <accept_sock%s>:\+ACCEPT:(\d+),\d+" % i,
"P SSC2 RE \+CONNECT:\d+,OK"]
test_action_string = ["SSC SSC2 soc -C -s <client_sock%s> -i <target_ap_ip> -p %s" % (i, tcp_port)]
fail_string = "Fail, Fail to connect"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
start_time = time.time()
# step 4, do send/recv
while time.time()-start_time < test_time:
checker_stings = ["P SSC1 NC ERROR NC CLOSE NC ERROR"]
for i in range(conn_num):
test_action_string = ["SSC SSC2 soc -S -s <client_sock%d> -l %d -n %d -j %d" %
(i, send_len, TEST_COUNT_ONE_ROUND, send_delay)]
checker_stings.append("P SSC2 RE \"\+SEND:%%%%s,OK\"%%%%(<client_sock%d>) NC ERROR NC CLOSE" % i)
if duplex is True:
checker_stings.append("P SSC1 RE \"\+SEND:%%%%s,OK\"%%%%(<accept_sock%d>)" % i)
test_action_string.append("SSC SSC1 soc -S -s <accept_sock%d> -l %d -n %d -j %d" %
(i, send_len, TEST_COUNT_ONE_ROUND, send_delay))
fail_string = "Fail, Failed on send command"
if self.load_and_exe_one_step([], test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
break
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, ["DELAY 0.1"], fail_string,
check_freq=1, check_time=300) is False:
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
self.result_cntx.set_result("Fail")
return
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,339 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 500
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env,
timeout=timeout, log_path=log_path)
self.send_len = 1460
self.server_port = random.randint(10000, 50000)
self.server_port_2 = random.randint(10000, 50000)
self.server_echo = True
self.test_time = 12 * 60
self.sta_number = 3
self.send_delay = 50
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def cleanup(self):
checker_stings = []
test_action_strings = []
for i in range(self.sta_number + 2):
checker_stings.append("R SSC%s C +RECVPRINT:1" % (i+1))
test_action_strings.append("SSC SSC%s soc -R -o 1" % (i+1))
fail_string = "Fail, Fail to turn on recv print"
self.load_and_exe_one_step(checker_stings, test_action_strings, fail_string)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
# server port
server_port = self.server_port
server_port_t = self.server_port_2
# ap ip
# ap_ip = self.ap_ip
# server echo
server_echo = self.server_echo
# station number
sta_number = self.sta_number
# send delay
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
checker_stings = []
test_action_string = []
for i in range(sta_number + 2):
checker_stings.append("P SSC%d C !!!ready!!!" % (i + 1))
test_action_string.append("SSCC SSC%d reboot" % (i + 1))
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# switch off recv print
checker_stings = []
test_action_strings = []
for i in range(self.sta_number + 2):
checker_stings.append("R SSC%s C +RECVPRINT:0" % (i+1))
test_action_strings.append("SSC SSC%s soc -R -o 0" % (i+1))
fail_string = "Fail, Fail to turn off recv print"
self.load_and_exe_one_step(checker_stings, test_action_strings, fail_string)
# step1, set ap/STA mode on all target
for i in range(sta_number + 2):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 1)]
test_action_string = ["SSCC SSC%d op -S -o 3" % (i + 1)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 1)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# set different getway for SSC1 softAP
checker_stings = ["R SSC1 C +DHCP:AP,OK"]
test_action_string = ["SSCC SSC1 dhcp -E -o 2"]
fail_string = "Fail, SSC1 Fail to disable DHCP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 C +IP:OK"]
test_action_string = ["SSCC SSC1 ip -S -o 2 -i 192.168.6.1"]
fail_string = "Fail, SSC1 Fail to set IP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 C +DHCP:AP,OK"]
test_action_string = ["SSCC SSC1 dhcp -S -o 2"]
fail_string = "Fail, SSC1 Fail to enable DHCP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# set different getway for SSC2 softAP
checker_stings = ["R SSC2 C +DHCP:AP,OK"]
test_action_string = ["SSCC SSC2 dhcp -E -o 2"]
fail_string = "Fail, SSC2 Fail to disable DHCP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 C +IP:OK"]
test_action_string = ["SSCC SSC2 ip -S -o 2 -i 192.168.5.1"]
fail_string = "Fail, SSC2 Fail to set IP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 C +DHCP:AP,OK"]
test_action_string = ["SSCC SSC2 dhcp -S -o 2"]
fail_string = "Fail, SSC2 Fail to enable DHCP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set ssid/password on SSC1
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -n 10 -t 0 -m 8" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step3, set ssid/password on SSC2
ssid_1 = "".join([random.choice(string.lowercase) for m in range(10)])
password_1 = "".join([random.choice(string.lowercase) for m in range(10)])
checker_stings = ["R SSC2 C +SAP:OK"]
test_action_string = ["SSCC SSC2 ap -S -s %s -p %s -n 10 -t 0 -m 8" % (ssid_1, password_1)]
fail_string = "Fail, Fail to set ap ssid/password on SSC2"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step4, SSC2 join SSC1(soft AP)
checker_stings = []
test_action_string = []
checker_stings.append("P SSC2 C +JAP:CONNECTED,%s" % ssid)
test_action_string.append("SSCC SSC2 ap -C -s %s -p %s" % (ssid, password))
fail_string = "Fail, Fail to connect to SSC1 SoftAP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step5, create server on SSC1
checker_stings = ["R SSC1 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -B -t TCP -p %s" % server_port]
fail_string = "Fail, Fail to create server on SSC1 while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to create server on SSC1 while listening"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step6, create client on SSC2
checker_stings = []
test_action_string = []
checker_stings.append("P SSC2 A <client_sock>:BIND:(\d+),OK")
test_action_string.append("SSCC SSC2 soc -B -t TCP")
fail_string = "Fail, SSC2 Fail to connect to server while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["P SSC2 RE CONNECT:(\d+),OK", "P SSC1 A <accept_sock>:ACCEPT:(\d+),.+"]
test_action_string = ["SSCC SSC2 soc -C -s <client_sock> -i %s -p %s" % ("192.168.6.1", server_port)]
fail_string = "Fail, SSC2 Fail to connect to server while connecting"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step7, SSC3 - SSC5 join SSC2
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d C +JAP:CONNECTED,%s" % (i + 3, ssid_1))
test_action_string.append("SSCC SSC%d ap -C -s %s -p %s" % (i + 3, ssid_1, password_1))
fail_string = "Fail, SSC%d Fail to connect to SSC2" % (i + 3)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step8, create server on SSC2
checker_stings = ["R SSC2 A <server_sock_t>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -B -t TCP -p %s -i 192.168.5.1" % server_port_t]
fail_string = "Fail, Fail to create server one SSC2 while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -L -s <server_sock_t>"]
fail_string = "Fail, Fail to create server one SSC2 while listening"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step9, create client on SSC3 - SSC5
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d A <client_sock%d>:BIND:(\d+),OK" % (i + 3, i + 3))
test_action_string.append("SSCC SSC%d soc -B -t TCP" % (i + 3))
fail_string = "Fail, Fail to connect to SSC2 server while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["P SSC%d RE CONNECT:(\d+),OK" % (i + 3),
"P SSC2 A <accept_sock%d>:ACCEPT:(\d+),.+" % (i + 3)]
test_action_string = ["SSCC SSC%d soc -C -s <client_sock%d> -i %s -p %s" %
(i + 3, i + 3, "192.168.5.1", server_port_t)]
fail_string = "Fail, Fail to connect to SSC2 server while connecting"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step 10, do send/recv
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
if server_echo is True:
test_action_string.append("SSC SSC1 soc -S -s <accept_sock> -l %d -n %d -j %d" %
(send_len, TEST_COUNT_ONE_ROUND, send_delay))
checker_stings.append("P SSC1 RE \+SEND:\d+,OK NC CLOSED")
test_action_string.append("SSC SSC2 soc -S -s <server_sock> -l %d -n %d -j %d" %
(send_len, TEST_COUNT_ONE_ROUND, send_delay))
checker_stings.append("P SSC2 RE \+SEND:\d+,OK NC CLOSED")
for i in range(sta_number):
checker_stings.append("P SSC%d RE \+SEND:\d+,OK NC CLOSED" % (i + 3))
test_action_string.append("SSC SSC%d soc -S -s <client_sock%d> -l %d -n %d -j %d" %
(i + 3, i + 3, send_len, TEST_COUNT_ONE_ROUND, send_delay))
for i in range(sta_number):
test_action_string.append("SSC SSC2 soc -S -s <accept_sock%d> -l %d -n %d -j %d" %
(i + 3, send_len, TEST_COUNT_ONE_ROUND, send_delay))
checker_stings.append("P SSC2 RE \+SEND:\d+,OK NC CLOSED")
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=300) is False:
break
pass
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) > test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
checker_stings = []
test_action_string = []
for i in range(sta_number + 2):
checker_stings.append("P SSC%d C CLOSEALL" % (i + 1))
test_action_string.append("SSCC SSC%d soc -T" % (i + 1))
fail_string = "Fail, Fail to close socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# re-set server on SSC1
server_port = random.randint(20000, 30000)
checker_stings = ["R SSC1 A <server_sock>:BIND:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -B -t TCP -p %s" % server_port]
fail_string = "Fail, Fail to bind socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC1 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC1 soc -L -s <server_sock>"]
fail_string = "Fail, Fail to listen"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# SSC2 connnect SSC1
checker_stings = []
test_action_string = []
checker_stings.append("P SSC2 A <client_sock>:BIND:(\d+),OK")
test_action_string.append("SSCC SSC2 soc -B -t TCP")
fail_string = "Fail, SSC2 Fail to bind sock"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["P SSC2 RE CONNECT:(\d+),OK", "P SSC1 A <accept_sock>:ACCEPT:(\d+),.+"]
test_action_string = ["SSCC SSC2 soc -C -s <client_sock> -i %s -p %s" % ("192.168.6.1", server_port)]
fail_string = "Fail, SSC2 Fail to connect to SSC1 server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# create server on SSC2
checker_stings = []
test_action_string = []
checker_stings.append("P SSC2 A <server_sock>:BIND:(\d+),OK")
test_action_string.append("SSCC SSC2 soc -B -t TCP -p %s -i 192.168.5.1" % server_port_t)
fail_string = "Fail, SSC2 Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC2 RE LISTEN:(\d+),OK"]
test_action_string = ["SSCC SSC2 soc -L -s <server_sock>"]
fail_string = "Fail, SSC2 Fail to listen"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# create client on SSC3-SSC5
checker_stings = []
test_action_string = []
for i in range(sta_number):
checker_stings.append("P SSC%d A <client_sock%d>:BIND:(\d+),OK" % (i + 3, i + 3))
test_action_string.append("SSCC SSC%d soc -B -t TCP" % (i + 3))
fail_string = "Fail, Fail to connect to SSC2 server while binding"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
for i in range(sta_number):
checker_stings = ["P SSC%d RE CONNECT:(\d+),OK" % (i + 3),
"P SSC2 A <accept_sock%d>:ACCEPT:(\d+),.+" % (i + 3)]
test_action_string = ["SSCC SSC%d soc -C -s <client_sock%d> -i %s -p %s" %
(i + 3, i + 3, "192.168.5.1", server_port_t)]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,325 +0,0 @@
import os
import time
import random
import threading
import socket
from TCAction import TCActionBase
from NativeLog import NativeLog
from NativeLog import ThroughputResult
from Utility import RSSICalibrator
LOG_FOLDER = os.path.join("Performance", "Throughput")
AP_PROP_KEY = ("ssid", "password", "apc")
class SendThread(threading.Thread):
def __init__(self, sock, send_len):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.send_len = send_len
self.exit_event = threading.Event()
self.calc_event = threading.Event()
self.bytes_sent = 0
pass
def start_calc(self):
self.calc_event.set()
def stop_calc(self):
self.calc_event.clear()
self.exit_event.set()
def run(self):
data = "A" * self.send_len
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
self.sock.send(data)
except StandardError:
break
if self.calc_event.isSet() is True:
self.bytes_sent += self.send_len
def get_bytes_sent(self):
return self.bytes_sent
pass
class RecvThread(threading.Thread):
def __init__(self, sock):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.exit_event = threading.Event()
self.calc_event = threading.Event()
self.bytes_recv = 0
def start_calc(self):
self.calc_event.set()
def stop_calc(self):
self.calc_event.clear()
self.exit_event.set()
def run(self):
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
data = self.sock.recv(8 * 1024)
except StandardError:
break
if self.calc_event.isSet() is True:
self.bytes_recv += len(data)
def get_bytes_recv(self):
return self.bytes_recv
pass
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.performance_folder_path = log_path
self.att_test_list = range(60)
cmd_set = test_case["cmd set"]
# load param from excel
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
ap_list = self.get_parameter("shield_box_ap_list")
pc_ip = self.get_parameter("pc_ip")
send_len = self.send_len
att_test_list = self.att_test_list
tx_enable = self.tx_enable
rx_enable = self.rx_enable
measure_period = self.measure_period
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPThroughput script, error is %s" % e)
raise StandardError("Error configuration")
tcp_port = random.randint(40000, 50000)
# init throughput result data
test_item = ""
if tx_enable is True:
test_item += "Tx"
if rx_enable is True:
test_item += "Rx"
if test_item == "":
raise StandardError("no throughput test item")
folder_path = os.path.join(self.performance_folder_path, LOG_FOLDER)
file_name = os.path.join(folder_path,
"TCPThroughput_%s_%s" % (test_item, time.strftime("%d%H%M%S", time.localtime())))
result = ThroughputResult.ThroughputResult(file_name, standard_required=True)
# restart before executing throughput
checker_stings = ["R SSC1 C !!!ready!!!"]
test_action_string = ["SSC SSC1 reboot"]
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
# disable recv print during throughput test
checker_stings = ["R SSC1 C +RECVPRINT"]
test_action_string = ["SSC SSC1 soc -R -o 0"]
fail_string = "Fail, Fail to disable recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
ret = True
for ap_prop in ap_list:
ssid = ap_prop[0]
password = ap_prop[1]
apc = ap_prop[2]
if ap_prop[1] == "":
# set a default string for open ap
password = "1"
# switch off all outlet, switch on AP outlet
outlet_config_dict = dict.fromkeys(range(1, 9), "OFF")
outlet_config_dict[apc] = "ON"
apc_cmd = "APC <APC1>"
for outlet in outlet_config_dict:
apc_cmd += " %s %s" % (outlet_config_dict[outlet], outlet)
checker_stings = ["P PC_COM L OK"]
fail_string = "Fail, Fail to switch apc"
if self.load_and_exe_one_step(checker_stings, [apc_cmd], fail_string) is False:
ret = False
break
# wait AP ready
time.sleep(20)
# create server
server_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
server_sock.bind((pc_ip, tcp_port))
server_sock.settimeout(5)
server_sock.listen(5)
if tx_enable is True:
result.add_test_item(ssid + "_tx")
if rx_enable is True:
result.add_test_item(ssid + "_rx")
# create RSSI Calibrator
calibrator = RSSICalibrator.Calibrator()
for att_value in att_test_list:
# step 0 set att value
checker_stings = ["R PC_COM L OK"]
test_action_string = ["ATT <att_port> %s" % att_value]
fail_string = "Fail, Fail to set att value"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
# step 1 get AP RSSI
checker_stings = ["R SSC1 A <rssi>:\+SCAN:%s,[:\d\w]+,\d+,\d+,([-\d]+)" % ssid]
test_action_string = ["SSC SSC1 sta -S -s %s" % ssid]
fail_string = "Fail, Fail to scan"
rssi = scan_count = 0
for i in range(3):
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
continue
rssi += int(self.test_env.get_variable_by_name("rssi")[1])
scan_count += 1
rssi = calibrator.calibrate_rssi(float(rssi) / scan_count if scan_count > 0 else 0, att_value)
# step 2 connect to AP
checker_stings = ["R SSC1 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC1 sta -C -s %s -p %s" % (ssid, password)]
fail_string = "Fail, Fail to JAP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=30) is False:
if rssi < -89:
continue
else:
ret = False
break
# step 3 close all connections
checker_stings = ["R SSC1 C +CLOSEALL"]
test_action_string = ["SSC SSC1 soc -T"]
fail_string = "Fail, Fail to close socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
# step 4 create tcp connection
checker_stings = ["R SSC1 A <client_sock>:\+BIND:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -B -t TCP"]
fail_string = "Fail, Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
checker_stings = ["P SSC1 RE \+CONNECT:\d+,OK"]
test_action_string = ["SSC SSC1 soc -C -s <client_sock> -i %s -p %s" % (pc_ip, tcp_port)]
fail_string = "Fail, Fail to connect socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
try:
sock, addr = server_sock.accept()
except socket.error, e:
NativeLog.add_trace_critical("%s" % e)
continue
sock.settimeout(measure_period)
# step 5 do throughput test
send_thread = SendThread(sock if rx_enable is True else None, send_len)
send_thread.start()
recv_thread = RecvThread(sock if tx_enable is True else None)
recv_thread.start()
if tx_enable is True:
# do send from target
test_action_string = ["SSC SSC1 soc -S -s <client_sock> -l %s -n 10000000" % send_len]
fail_string = "Fail, Fail to send"
if self.load_and_exe_one_step([], test_action_string, fail_string) is False:
pass
# start throughput calculate
send_thread.start_calc()
recv_thread.start_calc()
# sleep for measure period
time.sleep(measure_period)
# stop throughput calculate
send_thread.stop_calc()
recv_thread.stop_calc()
send_thread.join()
recv_thread.join()
sock.close()
# output throughput result
# in Mbps
if send_thread.get_bytes_sent() > 0:
result.log_throughput(ssid + "_rx", rssi, att_value,
float(send_thread.get_bytes_sent() * 8) / (measure_period * 1000000))
if recv_thread.get_bytes_recv() > 0:
result.log_throughput(ssid + "_tx", rssi, att_value,
float(recv_thread.get_bytes_recv() * 8) / (measure_period * 1000000))
result.output_to_file()
pass
server_sock.close()
if not ret:
NativeLog.add_trace_critical("Test SUC for %s" % ssid)
elif ret:
NativeLog.add_trace_critical("Test FAIL for %s!!!" % ssid)
if ret:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Fail")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1 +0,0 @@
__all__ = ["TCPConnUtility", "TCPConnSingleMode", "TCPConnMixedMode"]

View File

@ -1,342 +0,0 @@
import time
import random
import threading
import socket
import re
from TCAction import PerformanceTCBase
from NativeLog import NativeLog
from Utility import Encoding
class SendThread(threading.Thread):
def __init__(self, sock, send_len, target_addr, delay):
threading.Thread.__init__(self)
self.sock = sock
self.send_len = send_len
self.target_addr = target_addr
self.delay = delay
self.exit_event = threading.Event()
self.send_count = 0
pass
def exit(self):
self.exit_event.set()
def run(self):
data = "A" * self.send_len
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
self.sock.sendto(data, self.target_addr)
except StandardError:
break
self.send_count += 1
time.sleep(self.delay * 0.001)
pass
def get_send_count(self):
return self.send_count
class RecvThread(threading.Thread):
def __init__(self, sock):
threading.Thread.__init__(self)
self.sock = sock
self.exit_event = threading.Event()
self.calc_event = threading.Event()
self.bytes_recv = 0
self.Max = 0.0
def start_calc(self):
self.calc_event.set()
def stop_calc(self):
self.calc_event.clear()
self.exit_event.set()
def run(self):
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
data, addr = self.sock.recvfrom(2048)
except StandardError:
break
if self.calc_event.isSet() is True:
self.bytes_recv += len(data)
if len(data) == 0:
start = time.time()
while True:
try:
data, addr = self.sock.recvfrom(2048)
except StandardError:
break
if len(data) > 0:
if self.calc_event.isSet() is True:
self.bytes_recv += len(data)
end = time.time()
break
if end - start > self.Max:
self.Max = end - start
def get_bytes_recv(self):
return self.bytes_recv
pass
def get_Max_time(self):
return self.Max
pass
class device_check(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
self.Max = 0.0
self.port = port
self.recv_data_cache = ""
self.cache_lock = threading.Lock()
self.exit_event = threading.Event()
def data_recv_callback(self, data):
with self.cache_lock:
self.recv_data_cache += data
pass
def exit(self):
self.exit_event.set()
pass
def run(self):
while self.exit_event.isSet() is False:
while True:
if self.recv_data_cache:
match = re.search("\+RECVFROM:\d+,\d+,\d+\.\d+\.\d+\.\d+,\d+", self.recv_data_cache)
if match is not None:
self.recv_data_cache = self.recv_data_cache[len(match.group()):]
else:
start = time.time()
end = 0.0
while True:
res = re.search("\+RECVFROM:\d+,\d+,\d+\.\d+\.\d+\.\d+,\d+", self.recv_data_cache)
if res is not None:
self.recv_data_cache = self.recv_data_cache[len(res.group()):]
end = time.time()
break
if end - start > self.Max:
self.Max = end - start
pass
def get_max_time(self):
return self.Max
class TestCase(PerformanceTCBase.PerformanceTCBase):
def __init__(self, test_case, test_env, timeout, log_path):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout, log_path)
self.send_len = 0
self.pc_send = 0
self.target_send = 0
self.test_time = 0
self.delay = 0
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.recv_cb_lock = threading.Lock()
self.recv_cb = dict.fromkeys(["SSC1"])
pass
def register_recv_callback(self, port_name, callback):
with self.recv_cb_lock:
if self.recv_cb[port_name] is None:
self.recv_cb[port_name] = [callback]
else:
self.recv_cb[port_name].append(callback)
pass
def process(self):
try:
# configurable params
send_len = self.send_len
pc_send = self.pc_send
target_send = self.target_send
test_time = self.test_time
delay = self.delay
ap_ssid = self.get_parameter("ap_ssid")
ap_password = self.get_parameter("ap_password")
pc_ip = self.get_parameter("pc_ip")
target_ip = self.get_parameter("target_ip")
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for UDP script, error is %s" % e)
raise StandardError("Error configuration")
udp_port = random.randint(40000, 50000)
# reboot before executing
self.flush_data("SSC1")
self.serial_write_line("SSC1", "reboot")
if self.check_response("SSC1", "ready!!!", 5) is False:
NativeLog.add_trace_critical("Fail to reboot")
return
# set target as STA mode
self.flush_data("SSC1")
self.serial_write_line("SSC1", "op -S -o 1")
if self.check_response("SSC1", "+MODE:OK", 5) is False:
NativeLog.add_trace_critical("Fail to set mode")
return
# connect to AP
self.flush_data("SSC1")
self.serial_write_line("SSC1", "sta -C -s %s -p %s" % (ap_ssid, ap_password))
if self.check_response("SSC1", "+JAP:CONNECTED", 30) is False:
NativeLog.add_trace_critical("Fail to JAP")
return
# disable recv print on target
self.flush_data("SSC1")
self.serial_write_line("SSC1", "soc -R -o 0")
if self.check_response("SSC1", "+RECVPRINT", 5) is False:
NativeLog.add_trace_critical("Fail to disable recv print")
return
# get broadcast ip
res = re.search("(\d+\.\d+\.\d+\.)\d+", pc_ip)
if res is not None:
udp = res.group(1)
broadcast_ip = udp + "255"
else:
NativeLog.add_trace_critical("No ip addr found")
return
# close all connection on target
self.flush_data("SSC1")
self.serial_write_line("SSC1", "soc -T")
if self.check_response("SSC1", "+CLOSEALL", 5) is False:
NativeLog.add_trace_critical("Fail to close sock")
return
# create socket on pc
pc_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
pc_sock.bind((pc_ip, udp_port))
pc_sock.settimeout(1)
# create socket on target
self.flush_data("SSC1")
self.serial_write_line("SSC1", "soc -B -t UDP -i %s -p %s" % (target_ip, udp_port))
if self.check_response("SSC1", "+BIND:0,OK,", 5) is False:
NativeLog.add_trace_critical("Fail to bind")
return
thread_dict = dict.fromkeys(["SSC1"])
thread_dict["SSC1"] = dict(zip(["check"], [None]))
thread_dict["SSC1"]["check"] = device_check(self.test_env.get_port_by_name("SSC1"))
self.register_recv_callback("SSC1", thread_dict["SSC1"]["check"].data_recv_callback)
send_thread = SendThread(pc_sock if pc_send is True else None, send_len, (broadcast_ip, udp_port), delay)
send_thread.start()
recv_thread = RecvThread(pc_sock if target_send is True else None)
recv_thread.start()
# start calculate
recv_thread.start_calc()
thread_dict["SSC1"]["check"].start()
send_count = 0
if target_send is True:
# do send from target
start = time.time()
while time.time() - start < test_time * 60:
self.flush_data("SSC1")
self.serial_write_line("SSC1", "soc -S -s 0 -l %s -n 1000 -i %s -p %s -j %s" % (
send_len, broadcast_ip, udp_port, delay))
if self.check_response("SSC1", "+SEND:0,OK", 300) is False:
NativeLog.add_trace_critical("Fail to send")
return
send_count += 1000
else:
time.sleep(test_time * 60)
send_thread.exit()
send_thread.join()
# stop throughput calculate
while True:
if recv_thread.isAlive() is False:
recv_thread.stop_calc()
recv_thread.join()
break
Max = 0.0
recv_count = 0
if pc_send is True:
send_count = send_thread.get_send_count()
start = time.time()
rx_data_len = 0
suc_time = 0
while time.time() - start < 30:
self.flush_data("SSC1")
self.serial_write_line("SSC1", "soc -Q -s 0 -o 1")
time.sleep(0.05)
data = self.serial_read_data("SSC1")
if data is not None:
res = re.search("\+RECVLEN:(\d+)", data)
if res is not None:
if rx_data_len < int(res.group(1)):
rx_data_len = int(res.group(1))
time.sleep(0.5)
else:
suc_time += 1
if suc_time > 5:
break
if (rx_data_len * 8 % send_len) > 0:
recv_count = rx_data_len / send_len + 1
else:
recv_count = rx_data_len / send_len
if recv_thread.get_bytes_recv() > 0:
if (recv_thread.get_bytes_recv() % send_len) > 0:
recv_count = recv_thread.get_bytes_recv() / send_len + 1
else:
recv_count = recv_thread.get_bytes_recv() / send_len
Max = recv_thread.get_Max_time()
thread_dict["SSC1"]["check"].exit()
pc_sock.close()
self.set_result("Succeed")
NativeLog.add_trace_critical("send_count is %s, recv_count is %s" % (send_count, recv_count))
NativeLog.add_trace_critical(
"UDP Broadcast lose rate is %.2f%%" % (float(send_count - recv_count) / send_count * 100))
NativeLog.add_trace_critical("UDP Broadcast lose test MAX time is %.4f" % Max)
@Encoding.encode_utf8(3)
def result_check(self, port_name, data):
PerformanceTCBase.PerformanceTCBase.result_check(self, port_name, data)
if port_name in self.recv_cb:
with self.recv_cb_lock:
callback_list = self.recv_cb[port_name]
if callback_list is not None:
for callback in callback_list:
callback(data)
pass
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,156 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
server_echo = self.server_echo
sta_number = self.sta_number
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C ready!!!" % (i + 1)]
test_action_string = ["SSCC SSC%d restore" % (i + 1)]
fail_string = "Fail, Fail to restore"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# turn off recv print
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C +RECVPRINT:0" % (i + 1)]
test_action_string = ["SSCC SSC%d soc -R -o 0" % (i + 1)]
fail_string = "Fail, Fail to turn off recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step1, set softAP mode on SSC1
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail to set mode on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set STA mode on SSC2-SSCn
for i in range(sta_number):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 2)]
test_action_string = ["SSCC SSC%d op -S -o 1" % (i + 2)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step3, set ssid/password on SSC1
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
udp_port = random.randint(10000, 20000)
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -n 10 -t 0 -m 10" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step4, all STA join SSC1(soft AP)
for i in range(sta_number):
checker_stings = ["R SSC%d C +JAP:CONNECTED,%s" % (i + 2, ssid)]
test_action_string = ["SSCC SSC%d ap -C -s %s -p %s" % (i + 2, ssid, password)]
fail_string = "Fail, Fail to connect to SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step5, get all the STA ip
for i in range(sta_number):
checker_stings = ["R SSC%d A <SSC%d_IP>:\+STAIP:192.168.4.(\d+)" % (i + 2, i + 2)]
test_action_string = ["SSCC SSC%d ip -Q" % (i + 2)]
fail_string = "Fail, Fail to get SSC%d ip" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# else:
# print "SSC%d ip is:" % (i + 2), self.get_parameter("SSC%d_IP" % (i + 2))
# step6, create UDP socket on all targets
for i in range(sta_number):
checker_stings = ["R SSC%d A <sock%d>:\+BIND:(\d+),OK" % (i + 2, i + 2)]
test_action_string = ["SSCC SSC%d soc -B -t UDP -p %s" % (i + 2, udp_port + i + 2)]
fail_string = "Fail, SSC%d Fail to bind" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step7, do send/recv, SSC2<---->other STAs
while time.time() - start_time < test_time:
checker_stings = []
test_action_string = []
if server_echo is True:
# SSC2 send packets to SSC3-SSCn
for i in range(sta_number - 1):
ip = "192.168.4." + self.get_parameter("SSC%d_IP" % (i + 3))
test_action_string.append(
"SSC SSC2 soc -S -s <sock%d> -i %s -p %s -l %d -n 1000 -j %d" % (
i + 3, ip, udp_port + i + 3, send_len, send_delay))
checker_stings.append(
"P SSC2 RE \+SEND:%s,OK NC CLOSED NC ERROR" % self.get_parameter("sock%d" % (i + 3)))
# SSC3-SSCn send packets to SSC2
ssc2_ip = "192.168.4." + self.get_parameter("SSC2_IP")
for i in range(sta_number - 1):
test_action_string.append(
"SSC SSC%d soc -S -s <sock%d> -i %s -p %s -l %d -n 1000 -j %d" % (
i + 3, i + 3, ssc2_ip, udp_port + 2, send_len, send_delay))
checker_stings.append(
"P SSC%d RE \+SEND:%s,OK NC CLOSED NC ERROR" % (i + 3, self.get_parameter("sock%d" % (i + 3))))
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=300) is False:
break
# drop off the delay time if it's greater than 20ms
if send_delay > 20:
send_delay -= 10
NativeLog.add_trace_critical("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,246 +0,0 @@
import os
import time
import random
import threading
import socket
from TCAction import TCActionBase
from NativeLog import NativeLog
AP_PROP_KEY = ("ssid", "password", "apc")
class SendThread(threading.Thread):
def __init__(self, sock, send_len, target_addr, delay):
threading.Thread.__init__(self)
self.sock = sock
self.send_len = send_len
self.target_addr = target_addr
self.delay = delay
self.count = 0
self.exit_event = threading.Event()
pass
def exit(self):
self.exit_event.set()
def run(self):
data = "A" * self.send_len
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
self.sock.sendto(data, self.target_addr)
except StandardError:
break
self.count += 1
time.sleep(self.delay * 0.001)
def calculate(self):
return self.count
class RecvThread(threading.Thread):
def __init__(self, sock):
threading.Thread.__init__(self)
self.sock = sock
self.exit_event = threading.Event()
self.calc_event = threading.Event()
self.bytes_recv = 0
def start_calc(self):
self.calc_event.set()
def stop_calc(self):
self.calc_event.clear()
self.exit_event.set()
def run(self):
if self.sock is None:
return
ret = True
while ret:
if self.exit_event.isSet() is True:
break
try:
data, addr = self.sock.recvfrom(65535)
except StandardError:
break
if self.calc_event.isSet() is True:
self.bytes_recv += len(data)
if len(data) == 0:
start = time.time()
while time.time() - start < 30:
try:
data, addr = self.sock.recvfrom(65535)
except StandardError:
break
if len(data) == 0:
break
else:
self.bytes_recv += len(data)
else:
ret = False
def get_bytes_recv(self):
return self.bytes_recv
pass
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout, log_path)
self.att_test_list = range(60)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
pc_send = self.pc_send
target_send = self.target_send
test_time = self.test_time
delay = self.delay
ap_ssid = self.get_parameter("ap_ssid")
ap_password = self.get_parameter("ap_password")
pc_ip = self.get_parameter("pc_ip")
target_ip = self.get_parameter("target_ip")
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for UDP script, error is %s" % e)
raise StandardError("Error configuration")
udp_port = random.randint(40000, 50000)
# reboot before executing
checker_stings = ["R SSC1 C ready!!!"]
test_action_string = ["SSC SSC1 reboot"]
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# disable recv print on target
checker_stings = ["R SSC1 C +RECVPRINT"]
test_action_string = ["SSC SSC1 soc -R -o 0"]
fail_string = "Fail, Fail to disable recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# create socket on pc
udp_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
udp_sock.bind((pc_ip, udp_port))
udp_sock.settimeout(1)
# connect to AP
checker_stings = ["R SSC1 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC1 sta -C -s %s -p %s" % (ap_ssid, ap_password)]
fail_string = "Fail, Fail to JAP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=30) is False:
return
# close all connection
checker_stings = ["R SSC1 C +CLOSEALL"]
test_action_string = ["SSC SSC1 soc -T"]
fail_string = "Fail, Fail to create server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# create UDP socket on target
checker_stings = ["R SSC1 A <client_sock>:\+BIND:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -B -t UDP -p %s" % udp_port]
fail_string = "Fail, Fail bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
send_thread = SendThread(udp_sock if pc_send is True else None,
send_len, (target_ip, udp_port), delay)
send_thread.start()
recv_thread = RecvThread(udp_sock if target_send is True else None)
recv_thread.start()
# start calculate
recv_thread.start_calc()
send_count = 0
if target_send is True:
# do send from target
start = time.time()
while time.time() - start < test_time * 60:
checker_stings = ["P SSC1 RE \+SEND:0,OK"]
test_action_string = ["SSC SSC1 soc -S -s <client_sock> -l %s -n 1000 -i %s -p %s -j %s" % (
send_len, pc_ip, udp_port, delay)]
fail_string = "Fail, Fail to send"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_freq=0.1,
check_time=3000) is False:
return
send_count += 1000
else:
time.sleep(test_time * 60)
send_thread.exit()
send_thread.join()
# stop throughput calculate
while True:
if recv_thread.isAlive() is False:
recv_thread.stop_calc()
recv_thread.join()
break
recv_count = 0
if pc_send is True:
# get received data len from PC
self.load_and_exe_one_step(["R SSC1 A <recv_len>:RECVLEN:(\d+)"],
["SSC SSC1 soc -Q -s <client_sock> -o 1"],
"Fail, Fail to get recv data len")
try:
rx_data_len = int(self.get_parameter("recv_len"))
except StandardError:
rx_data_len = 0
if (rx_data_len % send_len) > 0:
recv_count = rx_data_len / send_len + 1
else:
recv_count = rx_data_len / send_len
send_count = send_thread.calculate()
if recv_thread.get_bytes_recv() > 0:
if (recv_thread.get_bytes_recv() % send_len) > 0:
recv_count = recv_thread.get_bytes_recv() / send_len + 1
else:
recv_count = recv_thread.get_bytes_recv() / send_len
udp_sock.close()
NativeLog.add_trace_critical("send_count is %s, recv_count is %s" % (send_count, recv_count))
self.result_cntx.set_result("Succeed")
NativeLog.add_trace_critical(
"UDP Packet lose rate is %.2f%%" % (float(send_count - recv_count) / send_count * 100))
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,163 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
server_echo = self.server_echo
conn_number = self.conn_number
sta_number = self.sta_number
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPTransparent script, error is %s" % e)
raise StandardError("Error configuration")
# step0 reboot
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C !!!ready!!!" % (i + 1)]
test_action_string = ["SSCC SSC%d reboot" % (i + 1)]
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# turn off recv print
for i in range(sta_number + 1):
checker_stings = ["P SSC%d C +RECVPRINT:0" % (i + 1)]
test_action_string = ["SSCC SSC%d soc -R -o 0" % (i + 1)]
fail_string = "Fail, Fail to turn off recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step1, set softAP mode on SSC1
checker_stings = ["R SSC1 C +MODE:OK"]
test_action_string = ["SSCC SSC1 op -S -o 2"]
fail_string = "Fail, Fail to set mode on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step2, set STA mode on SSC2-SSCn
for i in range(sta_number):
checker_stings = ["R SSC%d C +MODE:OK" % (i + 2)]
test_action_string = ["SSCC SSC%d op -S -o 1" % (i + 2)]
fail_string = "Fail, Fail to set mode on SSC%d" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step3, set ssid/password on SSC1
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSCC SSC1 ap -S -s %s -p %s -n 10 -t 0 -m 8" % (ssid, password)]
fail_string = "Fail, Fail to set ssid/password on SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step4, all STA join SSC1(soft AP)
for i in range(sta_number):
checker_stings = ["R SSC%d C +JAP:CONNECTED,%s" % (i + 2, ssid)]
test_action_string = ["SSCC SSC%d ap -C -s %s -p %s" % (i + 2, ssid, password)]
fail_string = "Fail, Fail to connect to SSC1"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=450) is False:
return
# step5, get all the STA ip
for i in range(sta_number):
checker_stings = ["R SSC%d A <SSC%d_IP>:\+STAIP:192.168.4.(\d+)" % (i + 2, i + 2)]
test_action_string = ["SSCC SSC%d ip -Q" % (i + 2)]
fail_string = "Fail, Fail to get SSC%d ip" % (i + 2)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
else:
print "SSC%d ip is:" % (i + 2), self.get_parameter("SSC%d_IP" % (i + 2))
udp_port_list = []
# step6, create multi UDP socket on all targets
for i in range(conn_number):
udp_port = random.randint(10000, 20000)
udp_port_list.append(udp_port)
checker_stings = ["R SSC2 A <SSC2_sock%d>:\+BIND:(\d+),OK" % i]
test_action_string = ["SSCC SSC2 soc -B -t UDP -p %s" % udp_port]
fail_string = "Fail, SSC2 Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
checker_stings = ["R SSC3 A <SSC3_sock%d>:\+BIND:(\d+),OK" % i]
test_action_string = ["SSCC SSC3 soc -B -t UDP -p %s" % (udp_port + 1)]
fail_string = "Fail, SSC3 Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step7, do send/recv, SSC2<---->other STAs
while time.time() - start_time < test_time:
# drop off the delay time if it's greater than 20ms
if send_delay > 20:
send_delay -= 10
checker_stings = []
test_action_string = []
if server_echo is True:
# SSC2 send packets to SSC3
ssc3_ip = "192.168.4." + self.get_parameter("SSC3_IP")
for i in range(conn_number):
test_action_string.append("SSC SSC2 soc -S -s <SSC2_sock%s> -i %s -p %s -l %d -n 1000 -j %d" % (
i, ssc3_ip, udp_port_list[i] + 1, send_len, send_delay))
checker_stings.append("P SSC2 RE \+SEND:\d+,OK NC CLOSED NC ERROR")
# SSC3 send packets to SSC2
ssc2_ip = "192.168.4." + self.get_parameter("SSC2_IP")
for i in range(conn_number):
test_action_string.append("SSC SSC3 soc -S -s <SSC3_sock%d> -i %s -p %s -l %d -n 1000 -j %d" % (
i, ssc2_ip, udp_port_list[i], send_len, send_delay))
checker_stings.append("P SSC3 RE \+SEND:\d+,OK NC CLOSED NC ERROR")
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=300) is False:
break
NativeLog.add_trace_critical("time escape: %s" % (time.time() - start_time))
if (time.time() - start_time) >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Failed")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,133 +0,0 @@
from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
TEST_COUNT_ONE_ROUND = 1000
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def cleanup(self):
# step 0 turn on recv print
checker_stings = ["R SSC1 C +RECVPRINT:1"]
test_action_string = ["SSC SSC1 soc -R -o 1"]
fail_string = "Fail, Fail to turn on recv print"
self.load_and_exe_one_step(checker_stings, test_action_string, fail_string)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
send_len = self.send_len
test_time = self.test_time * 60
duplex = self.duplex
conn_num = self.conn_num
send_delay = self.send_delay
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for UDPSendRecv script, error is %s" % e)
raise StandardError("Error configuration")
ssid = "".join([random.choice(string.lowercase) for m in range(10)])
password = "".join([random.choice(string.lowercase) for m in range(10)])
# step 0 set ap
checker_stings = ["R SSC1 C +SAP:OK"]
test_action_string = ["SSC SSC1 ap -S -s %s -p %s -t 3" % (ssid, password)]
fail_string = "Fail, Fail to set ap"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
# step 1 connect to ap and turn off recv print
checker_stings = ["R SSC2 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC2 sta -C -s %s -p %s" % (ssid, password)]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=200) is False:
return
checker_stings = ["R SSC2 A <sta_ip>:\+STAIP:(\d+\.\d+\.\d+\.\d+)\r"]
test_action_string = ["SSC SSC2 ip -Q -o 1"]
fail_string = "Fail, Fail to connect to server"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=200) is False:
return
checker_stings = ["P SSC1 C +RECVPRINT:0", "P SSC2 C +RECVPRINT:0"]
test_action_string = ["SSC SSC1 soc -R -o 0", "SSC SSC2 soc -R -o 0"]
fail_string = "Fail, Fail to turn off recv print"
self.load_and_exe_one_step(checker_stings, test_action_string, fail_string)
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string, check_time=200) is False:
return
# step 2 create conn_num udp socket
for i in range(1, conn_num+1):
checker_stings = ["R SSC1 A <t1_sock%d>:\+BIND:(\d+),OK" % i,
"R SSC2 A <t2_sock%d>:\+BIND:(\d+),OK" % i]
test_action_string = ["SSC SSC1 soc -B -t UDP -p <test_udp_port%i>" % i,
"SSC SSC2 soc -B -t UDP -p <test_udp_port%i>" % i]
fail_string = "Fail, Fail to create socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
return
start_time = time.time()
# step 3, do send/recv
while time.time()-start_time < test_time:
checker_stings = ["P SSC1 NC ERROR NC CLOSE NC ERROR"]
for i in range(1, conn_num+1):
test_action_string = ["SSC SSC2 soc -S -s <t2_sock%d> -l %d -n %d -j %d "
"-i <target_ap_ip> -p <test_udp_port%d>" %
(i, send_len, TEST_COUNT_ONE_ROUND, send_delay, i)]
checker_stings.append("P SSC2 RE \"\+SEND:%%%%s,OK\"%%%%(<t2_sock%d>) NC ERROR NC CLOSE NC ERROR" % i)
if duplex is True:
test_action_string.append("SSC SSC1 soc -S -s <t1_sock%d> -l %d -n %d -j %d"
" -i <sta_ip> -p <test_udp_port%d>" %
(i, send_len, TEST_COUNT_ONE_ROUND, send_delay, i))
checker_stings.append("P SSC1 RE \"\+SEND:%%%%s,OK\"%%%%(<t1_sock%d>)" % i)
fail_string = "Fail, Failed on send command"
if self.load_and_exe_one_step([], test_action_string, fail_string) is False:
break
time.sleep(1)
fail_string = "Fail, Failed to send/recv data"
if self.load_and_exe_one_step(checker_stings, ["DELAY 0.1"], fail_string,
check_freq=1, check_time=300) is False:
break
pass
NativeLog.add_prompt_trace("time escape: %s" % (time.time() - start_time))
if time.time() - start_time >= test_time:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Fail")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,321 +0,0 @@
import os
import time
import random
import threading
import socket
from TCAction import TCActionBase
from NativeLog import NativeLog
from NativeLog import ThroughputResult
from Utility import RSSICalibrator
from Utility import MakeFolder
LOG_FOLDER = os.path.join("Performance", "Throughput")
AP_PROP_KEY = ("ssid", "password", "apc")
class SendThread(threading.Thread):
def __init__(self, sock, send_len, target_addr):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.send_len = send_len
self.target_addr = target_addr
self.exit_event = threading.Event()
pass
def exit(self):
self.exit_event.set()
def run(self):
data = "A" * self.send_len
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
self.sock.sendto(data, self.target_addr)
except StandardError:
break
pass
class RecvThread(threading.Thread):
def __init__(self, sock):
threading.Thread.__init__(self)
self.setDaemon(True)
self.sock = sock
self.exit_event = threading.Event()
self.calc_event = threading.Event()
self.bytes_recv = 0
def start_calc(self):
self.calc_event.set()
def stop_calc(self):
self.calc_event.clear()
self.exit_event.set()
def run(self):
if self.sock is None:
return
while True:
if self.exit_event.isSet() is True:
break
try:
data, addr = self.sock.recvfrom(65535)
except StandardError:
break
if self.calc_event.isSet() is True:
self.bytes_recv += len(data)
def get_bytes_recv(self):
return self.bytes_recv
pass
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.performance_folder_path = log_path
self.att_test_list = range(60)
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
ap_list = self.get_parameter("shield_box_ap_list")
pc_ip = self.get_parameter("pc_ip")
send_len = self.send_len
att_test_list = self.att_test_list
tx_enable = self.tx_enable
rx_enable = self.rx_enable
measure_period = self.measure_period
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for TCPThroughput script, error is %s" % e)
raise StandardError("Error configuration")
udp_port = random.randint(40000, 50000)
# init throughput result data
test_item = ""
if tx_enable is True:
test_item += "Tx"
if rx_enable is True:
test_item += "Rx"
if test_item == "":
raise StandardError("no throughput test item")
folder_path = os.path.join(self.performance_folder_path, LOG_FOLDER)
file_name = os.path.join(folder_path,
"UDPThroughput_%s_%s" % (test_item, time.strftime("%d%H%M%S", time.localtime())))
result = ThroughputResult.ThroughputResult(file_name)
# restart before executing throughput
checker_stings = ["R SSC1 C !!!ready!!!"]
test_action_string = ["SSC SSC1 reboot"]
fail_string = "Fail, Fail to reboot"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
# disable recv print during throughput test
checker_stings = ["R SSC1 C +RECVPRINT"]
test_action_string = ["SSC SSC1 soc -R -o 0"]
fail_string = "Fail, Fail to disable recv print"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
self.result_cntx.set_result("Fail")
return
ret = True
for ap_prop in ap_list:
ssid = ap_prop[0]
password = ap_prop[1]
apc = ap_prop[2]
if ap_prop[1] == "":
# set a default string for open ap
password = "1"
# switch off all outlet, switch on AP outlet
outlet_config_dict = dict.fromkeys(range(1, 9), "OFF")
outlet_config_dict[apc] = "ON"
apc_cmd = "APC <APC1>"
for outlet in outlet_config_dict:
apc_cmd += " %s %s" % (outlet_config_dict[outlet], outlet)
checker_stings = ["P PC_COM L OK"]
fail_string = "Fail, Fail to switch apc"
if self.load_and_exe_one_step(checker_stings, [apc_cmd], fail_string) is False:
ret = False
break
# wait AP ready
time.sleep(20)
# create server
udp_sock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
udp_sock.bind((pc_ip, udp_port))
udp_sock.settimeout(1)
if tx_enable is True:
result.add_test_item(ssid + "_tx")
if rx_enable is True:
result.add_test_item(ssid + "_rx")
# create RSSI Calibrator
calibrator = RSSICalibrator.Calibrator()
for att_value in att_test_list:
# step 0 set att value
checker_stings = ["R PC_COM L OK"]
test_action_string = ["ATT <att_port> %s" % att_value]
fail_string = "Fail, Fail to set att value"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
# step 1 get AP RSSI
checker_stings = ["R SSC1 A <rssi>:\+SCAN:%s,[:\d\w]+,\d+,\d+,([-\d]+)\r" % ssid]
test_action_string = ["SSC SSC1 sta -S -s %s" % ssid]
fail_string = "Fail, Fail to scan"
rssi = scan_count = 0
for i in range(3):
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
continue
rssi += int(self.test_env.get_variable_by_name("rssi")[1])
scan_count += 1
rssi = calibrator.calibrate_rssi(float(rssi)/scan_count if scan_count > 0 else 0, att_value)
# step 2 connect to AP
checker_stings = ["R SSC1 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC1 sta -C -s %s -p %s" % (ssid, password)]
fail_string = "Fail, Fail to JAP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=30) is False:
if rssi < -89:
continue
else:
ret = False
break
# continue
checker_stings = ["R SSC1 A <target_ip>:STAIP:(\d+\.\d+\.\d+\.\d+)"]
test_action_string = ["SSC SSC1 ip -Q"]
fail_string = "Fail, Fail to get ip"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=30) is False:
if rssi < -89:
continue
else:
ret = False
break
# continue
target_ip = self.get_parameter("target_ip")
# step 3 close all connections
checker_stings = ["R SSC1 C +CLOSEALL"]
test_action_string = ["SSC SSC1 soc -T"]
fail_string = "Fail, Fail to close socket"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
# step 4 create UDP socket
checker_stings = ["R SSC1 A <client_sock>:\+BIND:(\d+),OK"]
test_action_string = ["SSC SSC1 soc -B -t UDP -i %s -p %s" % (target_ip, udp_port)]
fail_string = "Fail, Fail to bind"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
ret = False
break
# continue
# step 5 do throughput test
send_thread = SendThread(udp_sock if rx_enable is True else None,
send_len, (target_ip, udp_port))
send_thread.start()
recv_thread = RecvThread(udp_sock if tx_enable is True else None)
recv_thread.start()
if tx_enable is True:
# do send from target
test_action_string = ["SSC SSC1 soc -S -s <client_sock> -l %s -n 10000000 -i %s -p %s"
% (send_len, pc_ip, udp_port)]
fail_string = "Fail, Fail to send"
if self.load_and_exe_one_step([], test_action_string, fail_string) is False:
pass
# start throughput calculate
recv_thread.start_calc()
# sleep for measure period
time.sleep(measure_period)
# stop throughput calculate
recv_thread.stop_calc()
send_thread.exit()
send_thread.join()
recv_thread.join()
# output throughput result
# in Mbps
if rx_enable is True:
# get received data len from PC
self.load_and_exe_one_step(["R SSC1 A <recv_len>:RECVLEN:(\d+)"],
["SSC SSC1 soc -Q -s <client_sock> -o 1"],
"Fail, Fail to get recv data len")
try:
rx_data_len = int(self.get_parameter("recv_len"))
except StandardError:
rx_data_len = 0
result.log_throughput(ssid + "_rx", rssi, att_value,
float(rx_data_len * 8) / (measure_period * 1000000))
if recv_thread.get_bytes_recv() > 0:
result.log_throughput(ssid + "_tx", rssi, att_value,
float(recv_thread.get_bytes_recv() * 8) / (measure_period * 1000000))
result.output_to_file()
pass
udp_sock.close()
if not ret:
NativeLog.add_trace_critical("Test SUC for %s" % ssid)
elif ret:
NativeLog.add_trace_critical("Test FAIL for %s!!!" % ssid)
if ret:
self.result_cntx.set_result("Succeed")
else:
self.result_cntx.set_result("Fail")
# finally, execute done
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1 +0,0 @@
__all__ = ["UDPSendRecv", ]

View File

@ -1,178 +0,0 @@
import random
import time
import string
import threading
from TCAction import TCActionBase
from NativeLog import NativeLog
from TCAction import PerformanceTCBase
from Utility import Encoding
class STAJAPThread(threading.Thread):
def __init__(self, test_action, port_name, ssid, password, delay1, delay2, change_mac):
threading.Thread.__init__(self)
self.setDaemon(True)
self.test_action = test_action
self.port_name = port_name
self.ssid = ssid
self.password = password
self.delay1 = delay1
self.delay2 = delay2
self.change_mac = change_mac
self.exit_flag = threading.Event()
pass
def exit(self):
self.exit_flag.set()
pass
def run(self):
total_test_count = 0
fail_count = 0
while self.exit_flag.isSet() is False:
# change mac
if self.change_mac is True:
mac = Encoding.generate_random_mac()
self.test_action.serial_write_line(self.port_name, "mac -S -o 1 -m %s" % mac)
self.test_action.check_response(self.port_name, "+MAC:STA,OK")
time.sleep(1)
# JAP
total_test_count += 1
# flush current port data
self.test_action.flush_data(self.port_name)
self.test_action.serial_write_line(self.port_name, "sta -C -s %s -p %s" % (self.ssid, self.password))
if self.test_action.check_response(self.port_name, "+JAP:CONNECTED", 45) is False:
fail_count += 1
NativeLog.add_trace_critical("[%s] Failed to JAP, Failed/Total : %d/%d"
% (self.port_name, fail_count, total_test_count))
continue
time.sleep(random.randint(self.delay1[0], self.delay1[1]))
# QAP
self.test_action.serial_write_line(self.port_name, "sta -D")
if self.test_action.check_response(self.port_name, "+QAP:OK", 5) is False:
NativeLog.add_trace_critical("[%s] Failed to QAP" % self.port_name)
time.sleep(random.randint(self.delay2[0], self.delay2[1]))
# make sure quit AP
self.test_action.serial_write_line(self.port_name, "sta -D")
pass
pass
class TestCase(PerformanceTCBase.PerformanceTCBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.sta_num = 0
self.max_sta = 4
self.test_time = 60
self.delay1 = [5, 30]
self.delay2 = [5, 10]
self.change_mac = True
self.channel = 11
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy" and cmd_set[i][0] != "":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
pass
def process(self):
# configurable parameters
try:
sta_num = self.sta_num
max_sta = self.max_sta
test_time = self.test_time
# delay between JAP succeed and QAP
delay1 = self.delay1
# delay between QAP and JAP
delay2 = self.delay2
# if change mac each time before JAP
change_mac = self.change_mac
# channel
channel = self.channel
except StandardError, e:
raise StandardError("miss mandatory parameters")
# step 0, set op mode and enable dhcp
self.serial_write_line("SSC1", "op -S -o 2")
if self.check_response("SSC1", "+MODE:OK", 2) is False:
NativeLog.add_trace_critical("Failed to set ap mode")
return
self.serial_write_line("SSC1", "dhcp -E -o 2")
if self.check_response("SSC1", "+DHCP:AP,OK", 2) is False:
NativeLog.add_trace_critical("Failed to enable ap dhcp")
return
self.serial_write_line("SSC1", "dhcp -L -s 192.168.4.2 -e 192.168.4.100 -t 1")
if self.check_response("SSC1", "+DHCP:LEASE,OK", 2) is False:
NativeLog.add_trace_critical("Failed to enable ap dhcp")
return
self.serial_write_line("SSC1", "dhcp -S -o 2")
if self.check_response("SSC1", "+DHCP:AP,OK", 2) is False:
NativeLog.add_trace_critical("Failed to enable ap dhcp")
return
for i in range(sta_num):
self.serial_write_line("SSC%d" % (i+2), "op -S -o 1")
if self.check_response("SSC%d" % (i+2), "+MODE:OK", 2) is False:
NativeLog.add_trace_critical("Failed to set sta mode")
return
self.serial_write_line("SSC%d" % (i+2), "dhcp -S -o 1")
if self.check_response("SSC%d" % (i+2), "+DHCP:STA,OK", 2) is False:
NativeLog.add_trace_critical("Failed to enable sta dhcp")
# step 1, set ap config and load
ap_ssid = "".join([random.choice(string.uppercase) for m in range(15)])
ap_password = "".join([random.choice(string.lowercase) for m in range(15)])
self.serial_write_line("SSC1", "ap -S -s %s -p %s -t 3 -m %s -n %s"
% (ap_ssid, ap_password, max_sta, channel))
if self.check_response("SSC1", "+SAP:OK", 2) is False:
NativeLog.add_trace_critical("Failed to set AP")
return
# step 2, start thread to let STA JAP
sta_thread_list = []
for i in range(sta_num):
sta_thread_list.append(STAJAPThread(self, "SSC%d" % (i+2),
ap_ssid, ap_password, delay1, delay2, change_mac))
for sta_thread in sta_thread_list:
sta_thread.start()
# step 3, sleep for test time
for i in range(test_time):
self.flush_data("SSC1")
time.sleep(60)
# step 4, close all thread, will disconnect when exit thread
for sta_thread in sta_thread_list:
sta_thread.exit()
for sta_thread in sta_thread_list:
sta_thread.join()
# wait and make sure disconnect done
time.sleep(1)
# step 5, join AP and check
sta_num_temp = max_sta if sta_num > max_sta else sta_num
for i in range(sta_num_temp):
self.serial_write_line("SSC%d" % (i+2), "sta -C -s %s -p %s" % (ap_ssid, ap_password))
if self.check_response("SSC%d" % (i+2), "+JAP:CONNECTED", 45) is False:
self.set_result("Fail")
break
pass
else:
self.set_result("Succeed")
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,240 +0,0 @@
from NativeLog import NativeLog
import time
import random
ERROR_AP_PROP = {"ssid": "123456789012345678901234567890",
"ssid_len": 30,
"pwd": "12345678901234567890",
"pwd_len": 20,
"channel": 10,
"enc": 3,
"apc": 9, # invalid apc count
}
class WifiConnUtilError(StandardError):
pass
class WifiConnUtility(object):
def __init__(self, tc_action):
self.tc_action = tc_action
self.target_type = tc_action.target_type
pass
def set_mode(self, mode):
ret = True
fail_string = "set mode fail"
cmd = []
checker_stings = []
for i in range(2):
if self.target_type[0] == "SSC":
cmd.append("SSCC SSC%d op -S -o %d" % (i+1, mode[i]))
checker_stings.append("SSCP SSC%d C +MODE:OK" % (i+1))
pass
else:
cmd.append("ATC AT%d CWMODE %d" % (i+1, mode[i]))
checker_stings.append("ATP AT%d L OK" % (i+1))
pass
if self.tc_action.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=50) is False:
NativeLog.add_trace_critical("Failed to set mode")
ret = False
return ret
pass
def _apc_switch(self, outlet_list, action_list):
checker_stings = ["R PC_COM C OK"]
switch_cmd = "APC <APC1>"
fail_string = "Error when switching APC"
ret = True
for [_outlet, _action] in zip(action_list, outlet_list):
switch_cmd += " %s %d" % (_action, _outlet)
if self.tc_action.load_and_exe_one_step(checker_stings, [switch_cmd],
fail_string, check_time=50) is False:
NativeLog.add_trace_critical("Error when switching APC")
ret = False
return ret
pass
def _set_target_ap(self, ap_prop):
ret = True
fail_string = "set target ap fail, %s, %s" % (ap_prop["ssid"], ap_prop["pwd"])
if self.target_type[1] == "SSC":
if ap_prop["pwd"] == "":
cmd = ["SSCC SSC2 ap -S -s %s -t %d" % (ap_prop["ssid"],
ap_prop["enc"])
]
else:
cmd = ["SSCC SSC2 ap -S -s %s -p %s -t %d" % (ap_prop["ssid"],
ap_prop["pwd"],
ap_prop["enc"])
]
checker_stings = ["SSCP SSC2 C +SAP:OK"]
pass
else:
cmd = ["ATC AT2 CWSAP \"%s\" \"%s\" %d %d" % (ap_prop["ssid"],
ap_prop["pwd"],
ap_prop["channel"],
ap_prop["enc"])
]
checker_stings = ["ATR AT2 L OK"]
pass
if self.tc_action.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=50) is False:
NativeLog.add_trace_critical("set target ap fail")
ret = False
return ret
pass
def setup_ap(self, ap_type, ap_prop):
if ap_type == "target":
ret = self._set_target_ap(ap_prop)
pass
else:
ret = self._apc_switch(["ON"], [ap_prop["apc"]])
# delay for 5 seconds, wait AP ready
time.sleep(5)
pass
return ret
def do_scan(self, ap_prop):
fail_string = "Scan fail"
ret = True
# do not check if the set AP can be scanned
if self.target_type[1] == "SSC":
cmd = ["SSCC SSC1 sta -S"]
checker_stings = ["SSCR SSC1 C +SCANDONE"]
pass
else:
cmd = ["ATS AT1 AT+CWLAP"]
checker_stings = ["ATR AT1 L OK"]
pass
if self.tc_action.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=100) is False:
NativeLog.add_trace_critical("Scan fail")
ret = False
return ret
pass
def _switch_off_target_ap(self, delay):
time.sleep(delay)
self._set_target_ap(ERROR_AP_PROP)
pass
def _switch_on_target_ap(self, ap_prop, delay):
time.sleep(delay)
self._set_target_ap(ap_prop)
pass
def _switch_off_ap(self, ap_type, ap_prop, delay_range):
delay = random.randint(delay_range[0]*10, delay_range[1]*10)/10
if ap_type == "target":
self._switch_off_target_ap(delay)
else:
delay -= 1.5
time.sleep(delay if delay > 0 else 0)
self._apc_switch(["OFF"], [ap_prop["apc"]])
pass
def _switch_on_ap(self, ap_type, ap_prop, delay_range):
delay = random.randint(delay_range[0]*10, delay_range[1]*10)/10
if ap_type == "target":
self._switch_on_target_ap(ap_prop, delay)
else:
delay -= 1.5
time.sleep(delay if delay > 0 else 0)
self._apc_switch(["ON"], [ap_prop["apc"]])
pass
def _join_ap(self, ap_prop, test_method):
fail_string = "join target ap fail, %s, %s" % (ap_prop["ssid"], ap_prop["pwd"])
if self.target_type[1] == "SSC":
cmd = ["SSCC SSC1 ap -C -s %s -p %s" % (ap_prop["ssid"],
ap_prop["pwd"],)
]
checker_stings = ["SSCR SSC1 C +JAP:CONNECTED"]
pass
else:
cmd = ["ATC AT1 CWJAP \"%s\" \"%s\"" % (ap_prop["ssid"],
ap_prop["pwd"])
]
checker_stings = ["ATR AT1 NC ERROR NC FAIL L OK"]
pass
if test_method == "Normal":
ret = self.tc_action.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_freq=0.1, check_time=350)
if ret is not False:
ret *= 0.1
else:
ret = self.tc_action.load_and_exe_one_step([], cmd, fail_string)
return ret
pass
def _check_join_ap_result(self, ap_prop):
ret = False
fail_string = "join ap fail, %s, %s" % (ap_prop["ssid"], ap_prop["pwd"])
if self.target_type[1] == "SSC":
checker_stings = ["SSCR SSC1 C +JAP:CONNECTED"]
ret = self.tc_action.load_and_exe_one_step(checker_stings, ["DELAY 0"],
fail_string, check_freq=1, check_time=120)
pass
else:
cmd = ["ATS AT1 AT+CWJAP?"]
checker_stings = ["ATR AT1 NC busy NC No%20AP C +CWJAP"]
for i in range(3):
ret = self.tc_action.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_freq=1, check_time=2)
if ret is not False:
break
time.sleep(15)
return ret
pass
def join_ap(self, join_test_method, ap_type, ap_prop, delay):
if join_test_method == "WRONG_PROP":
_prop = ERROR_AP_PROP
else:
_prop = ap_prop
ret = self._join_ap(_prop, join_test_method)
if join_test_method == "OFF_ON":
self._switch_off_ap(ap_type, ap_prop, delay[0])
self._switch_on_ap(ap_type, ap_prop, delay[1])
ret = self._check_join_ap_result(_prop)
pass
elif join_test_method == "OFF":
self._switch_off_ap(ap_type, ap_prop, delay[0])
time.sleep(25)
pass
return ret
pass
def do_reconnect(self, reconnect_test_method, ap_type, ap_prop, delay):
ret = True
if reconnect_test_method == "OFF_ON":
self._switch_off_ap(ap_type, ap_prop, delay[0])
self._switch_on_ap(ap_type, ap_prop, delay[1])
ret = self._check_join_ap_result(ap_prop)
pass
elif reconnect_test_method == "OFF":
self._switch_off_ap(ap_type, ap_prop, delay[0])
pass
return ret
pass
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,219 +0,0 @@
import os
import random
import time
import WifiConnUtility
from NativeLog import NativeLog
from TCAction import TCActionBase
from Utility import Encoding
from Utility import MakeFolder
STEPS = {"SCAN1": 0x01, "JAP": 0x02, "SCAN2": 0x04, "RECONNECT": 0x08}
AP_PROP = ("ssid", "ssid_len", "pwd",
"pwd_len", "channel", "enc", "apc")
JAP_TEST_METHOD = ("Normal", "OFF_ON", "OFF", "WRONG_PROP")
RECONNECT_TEST_METHOD = ("OFF_ON", "OFF")
LOG_FOLDER = os.path.join("Performance", "JAP")
SSID_LEN_RANGE = (1, 32) # in bytes
ENC_TYPE = (0, 2, 3, 4) # do not support WEP for 8266 soft AP
PWD_RANGE = {0: [0, 0],
1: [5, 5],
2: [8, 63],
3: [8, 63],
4: [8, 63],
}
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
# default value for optional configurable params
self.performance_folder_path = log_path
self.pwd_len = [8, 64]
self.step_config = [0x03, 0x01, 0x02, 0x0B, 0x0F]
self.join_test_method = ["Normal"]
self.join_delay = [[1.5, 5], [1.5, 5]]
self.reconnect_test_method = ["OFF_ON"]
self.reconnect_delay = [[1.5, 5], [1.5, 6]]
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy" and cmd_set[i][0] != "":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
# read AP list
self.ap_list = []
for i in range(1, len(cmd_set)):
for j in range(len(cmd_set[i][1])):
if cmd_set[i][1][j] != "":
cmd_string = "self.ap_list.append(dict(zip(AP_PROP, " + cmd_set[i][1][j] + ")))"
exec cmd_string
folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER)
file_name = "JAP_log_%s.log" % (time.strftime("%m%d%H%M%S", time.localtime()))
self._performance_log_file = os.path.join(folder_path, file_name)
# test statistics
self._succeed_count = self._fail_count = self._time_cost_count = 0
self._total_time = self._longest_time = 0
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
# get target type "SSC" or "AT"
self.target_type = ["SSC" if test_env.get_port_by_name("AT1") is None else "AT"]
self.target_type.append("SSC" if test_env.get_port_by_name("AT2") is None else "AT")
self._utility = WifiConnUtility.WifiConnUtility(self)
pass
def _generate_random_ap_prop(self):
ap_prop = dict.fromkeys(AP_PROP)
# generate target ap_value
ap_prop["ssid_len"] = random.randint(SSID_LEN_RANGE[0], SSID_LEN_RANGE[1])
ap_prop["channel"] = random.choice(range(1, 14))
ap_prop["enc"] = random.choice(ENC_TYPE)
ap_prop["pwd_len"] = random.randint(PWD_RANGE[ap_prop["enc"]][0], PWD_RANGE[ap_prop["enc"]][1])
# generate string
if self.target_type[0] == self.target_type[1] == "AT":
ap_prop["ssid"] = Encoding.generate_random_utf8_str(ap_prop["ssid_len"])
ap_prop["pwd"] = Encoding.generate_random_utf8_str(ap_prop["pwd_len"])
# NativeLog.add_trace_info("ssid hex is : %x" % ap_prop["ssid"])
# NativeLog.add_trace_info("pwd hex is : %x" % ap_prop["pwd"])
else:
ap_prop["ssid"] = Encoding.generate_random_printable_str(ap_prop["ssid_len"])
ap_prop["pwd"] = Encoding.generate_random_printable_str(ap_prop["pwd_len"])
return ap_prop
def _logging_performance(self, ssid, join_method="Normal", time_cost=0):
# log performance to performance log file
with open(self._performance_log_file, "ab+") as f:
# log time and ssid
f.write("\r\n[%s]:\r\n[AP name] %s\r\n" %
(time.strftime("%m-%d %H:%M:%S", time.localtime()), ssid))
if join_method == "Normal" or join_method == "OFF_ON":
if time_cost is not False:
self._succeed_count += 1
if join_method == "Normal":
f.write("[Succeed][%f]\r\n" % time_cost)
self._longest_time = (time_cost > self._longest_time and
[time_cost] or [self._longest_time])[0]
self._time_cost_count += 1
self._total_time += time_cost
else:
f.write("[Succeed][%s]\r\n" % join_method)
else:
self._fail_count += 1
f.write("[Fail][%s]\r\n" % join_method)
pass
def _logging_fail_step(self, ssid, step):
with open(self._performance_log_file, "ab+") as f:
f.write("\r\n[%s]:\r\n[AP name] %s\r\n" %
(time.strftime("%m-%d %H:%M:%S", time.localtime()), ssid))
f.write("[Fail][%s]\r\n" % step)
pass
def _generate_performance_report(self):
with open(self._performance_log_file, "ab+") as f:
f.write("[Test report] Succeed: %d\r\n" % self._succeed_count)
f.write("[Test report] Failed: %d\r\n" % self._fail_count)
if self._succeed_count > 0 or self._fail_count > 0:
f.write("[Test report] Pass Rate: %f\r\n" %
(self._succeed_count/(self._fail_count+self._succeed_count)))
if self._time_cost_count > 0:
f.write("[Test report] Average time: %f\r\n" % (self._total_time/self._time_cost_count))
f.write("[Test report] Longest time: %f\r\n" % self._longest_time)
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
# mandatory configurable params
try:
target_ap_num = self.target_ap_num
test_count = self.test_count
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for WifiJAP script, error is %s" % e)
raise StandardError("Error configuration")
# prepare ap list
_ap_list = [["target", None]] * target_ap_num
for _ap_prop in self.ap_list:
_ap_list.append(["AP", _ap_prop])
# set to correct mode first
self._utility.set_mode([1, 2])
for i in xrange(test_count):
_ap = random.choice(_ap_list)
# arrange ap
_ap_type = _ap[0]
_ap_prop = _ap[1]
if _ap_type == "target":
_ap_prop = self._generate_random_ap_prop()
pass
# step 1 : mandatory step, set up AP
if self._utility.setup_ap(_ap_type, _ap_prop) is False:
self._logging_fail_step(_ap_prop["ssid"], "Set AP")
NativeLog.add_prompt_trace("[Step1] setup AP Fail")
continue
step_config = random.choice(self.step_config)
NativeLog.add_prompt_trace("[Step1] setup AP succeed")
# step 2 : optional step, do scan before connect
if step_config & STEPS["SCAN1"] != 0: # check option
if self._utility.do_scan(_ap_prop) is False:
self._logging_fail_step(_ap_prop["ssid"], "Scan before JAP")
NativeLog.add_prompt_trace("[Step2] Scan Done")
# step 3 : mandatory step, join AP
if step_config & STEPS["JAP"] != 0: # check option
_join_test_method = random.choice(self.join_test_method)
time_cost = self._utility.join_ap(_join_test_method, _ap_type, _ap_prop, self.join_delay)
# log performance to performance log file
self._logging_performance(_ap_prop["ssid"], _join_test_method, time_cost)
if time_cost is False:
# do scan once to check if AP exist
self._utility.do_scan(_ap_prop)
continue
NativeLog.add_prompt_trace("[Step3] Join AP done")
# step 4 : optional step, scan after join AP
if step_config & STEPS["SCAN2"] != 0: # check option
if self._utility.do_scan(_ap_prop) is False:
self._logging_fail_step(_ap_prop["ssid"], "Scan after JAP")
NativeLog.add_prompt_trace("[Step4] Scan done")
# step 5 : optional step, reconnect test
if step_config & STEPS["RECONNECT"] != 0: # check option
_reconnect_test_method = random.choice(self.reconnect_test_method)
if self._utility.do_reconnect(_reconnect_test_method,
_ap_type, _ap_prop, self.reconnect_delay) is False:
self._logging_fail_step(_ap_prop["ssid"], "Reconnect")
NativeLog.add_prompt_trace("[Step5] Reconnect done")
# continue to next loop
NativeLog.add_prompt_trace("[WifiJAP] Test count %d done" % i)
# generate report and cleanup
self._generate_performance_report()
self.result_cntx.set_result("Succeed")
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,193 +0,0 @@
import os
import time
from TCAction import TCActionBase
from NativeLog import NativeLog
from Utility import RSSICalibrator
from Utility import MakeFolder
MAX_RSSI = 0
MIN_RSSI = -110
MAX_ATT = 60
LOG_FOLDER = os.path.join("Performance", "JAP")
AP_PROP_KEY = ("ssid", "password", "apc")
class Performance(object):
RSSI_THRESHOLD = -90
def __init__(self):
self.succeed_rssi = dict.fromkeys(range(MIN_RSSI, MAX_RSSI), 0)
self.failed_rssi = dict.fromkeys(range(MIN_RSSI, MAX_RSSI), 0)
self.failed_att = dict.fromkeys(range(MAX_ATT), 0)
self.result = True
pass
def log_performance(self, result, att, rssi):
if result == "Succeed":
self.succeed_rssi[rssi] += 1
else:
if rssi == 0:
self.failed_att[att] += 1
else:
self.failed_rssi[rssi] += 1
if rssi > self.RSSI_THRESHOLD:
self.result = False
pass
def get_result(self):
return self.result
def __str__(self):
data = "Succeed:\r\n"
for rssi in self.succeed_rssi:
if self.succeed_rssi[rssi] > 0:
data += "\tRSSI%4d: %2d times\r\n" % (rssi, self.succeed_rssi[rssi])
data += "Failed during scan:\r\n"
for att in self.failed_att:
if self.failed_att[att] > 0:
data += "\tATT%3d: %2d times\r\n" % (att, self.failed_att[att])
data += "Failed during JAP:\r\n"
for rssi in self.failed_rssi:
if self.failed_rssi[rssi] > 0:
data += "\tRSSI%4d: %2d times\r\n" % (rssi, self.failed_rssi[rssi])
return data
pass
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.att_test_list = range(60)
self.performance_folder_path = log_path
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
self.ap_list = self.get_parameter("shield_box_ap_list")
self.performance = dict([(ap_prop["ssid"], Performance()) for ap_prop in self.ap_list])
# create log file
folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER)
self.performance_log = os.path.join(folder_path,
"JAP_Att_%s.log" % time.strftime("%d%H%M%S", time.localtime()))
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def log_performance(self, att, rssi, ssid, result):
NativeLog.add_prompt_trace("[%s][ssid %s] [att %s] [rssi %s]" % (result, ssid, att, rssi))
data = ""
self.performance[ssid].log_performance(result, att, rssi)
for _ssid in self.performance:
data += "[ssid] %s\r\n%s\r\n" % (_ssid, self.performance[_ssid])
with open(self.performance_log, "wb+") as f:
f.write(data)
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
try:
# configurable params
ap_list = self.ap_list
att_test_list = self.att_test_list
test_count = self.test_count
# configurable params
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for JAPAtt script, error is %s" % e)
raise StandardError("Error configuration")
for x in xrange(test_count):
for ap_prop in ap_list:
ssid = ap_prop[0]
password = ap_prop[1]
apc = ap_prop[2]
if ap_prop[1] == "":
# set a default string for open ap
password = "1"
# switch off all outlet, switch on AP outlet
outlet_config_dict = dict.fromkeys(range(1, 9), "OFF")
outlet_config_dict[apc] = "ON"
apc_cmd = "APC <APC1>"
for outlet in outlet_config_dict:
apc_cmd += " %s %s" % (outlet_config_dict[outlet], outlet)
checker_stings = ["P PC_COM L OK"]
fail_string = "Fail, Fail to switch apc"
if self.load_and_exe_one_step(checker_stings, [apc_cmd], fail_string) is False:
return
# wait AP ready
time.sleep(20)
# create RSSI Calibrator
calibrator = RSSICalibrator.Calibrator()
ret = True
for att_value in att_test_list:
# step 0 set att value
checker_stings = ["R PC_COM L OK"]
test_action_string = ["ATT <att_port> %s" % att_value]
fail_string = "Fail, Fail to set att value"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string) is False:
continue
# step 1 get AP RSSI
checker_stings = ["R SSC1 A <rssi>:\+SCAN:%s,[:\d\w]+,\d+,\d+,([-\d]+)" % ssid]
test_action_string = ["SSC SSC1 sta -S -s %s" % ssid]
fail_string = "Fail, Fail to scan"
rssi = scan_count = 0
for i in range(3):
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=5) is False:
self.log_performance(att_value, 0, ssid, "Failed to measure RSSI")
continue
rssi += int(self.test_env.get_variable_by_name("rssi")[1])
scan_count += 1
rssi = calibrator.calibrate_rssi(float(rssi) / scan_count if scan_count > 0 else 0, att_value)
# step 2 connect to AP
checker_stings = ["R SSC1 C +JAP:CONNECTED"]
test_action_string = ["SSC SSC1 sta -C -s %s -p %s" % (ssid, password)]
fail_string = "Fail, Fail to JAP"
if self.load_and_exe_one_step(checker_stings, test_action_string, fail_string,
check_freq=1, check_time=45) is False:
self.log_performance(att_value, rssi, ssid, "Failed to JAP")
if rssi < -90:
continue
else:
ret = False
break
if ret:
self.log_performance(att_value, rssi, ssid, "Succeed")
else:
self.log_performance(att_value, rssi, ssid, "Failed")
# finally, execute done
for ssid in self.performance:
if self.performance[ssid].get_result() is False:
self.result_cntx.set_result("Failed")
break
else:
self.result_cntx.set_result("Succeed")
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1,274 +0,0 @@
import random
import os
import time
import copy
from TCAction import TCActionBase
from NativeLog import NativeLog
from Utility import Encoding
from Utility import MakeFolder
AP_PROP = ("ssid", "ssid_len", "pwd",
"pwd_len", "channel", "enc", "apc")
SMART_TYPE = ("esp-touch", "airkiss")
TEST_METHOD = ("ssid_broadcast", "ssid_hidden")
HT = ("ht20", "ht40")
TEST_STAT = ("total count", "fail count", "total time", "longest time")
_TEST_STAT_INIT_DICT = {"total count": 0,
"fail count": 0,
"total time": 0,
"longest time": 0,
}
LOG_FOLDER = os.path.join("Performance", "SmartConfig")
SSID_LEN_RANGE = (1, 32) # in bytes
ENC_TYPE = (0, 2, 3, 4) # do not support WEP for 8266 soft AP
PWD_RANGE = {0: [0, 0],
1: [5, 5],
2: [8, 32],
3: [8, 32],
4: [8, 32],
}
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path)
self.performance_folder_path = log_path
# default value for optional configurable params
self.test_method = ["ssid_hidden", "ssid_broadcast"]
self.bssid = "ff:ff:ff:ff:ff:ff"
self.ht_ap = dict(zip(HT, [("<ht20_ap_ssid>", "<ht20_ap_password>"),
("<ht40_ap_ssid>", "<ht40_ap_password>")]))
self.ap_channel = {"ht20": 1, "ht40": 1}
self.delay_time = 3 # default 3s, wait for scan done
# load param from excel
cmd_set = test_case["cmd set"]
for i in range(1, len(cmd_set)):
if cmd_set[i][0] != "dummy" and cmd_set[i][0] != "":
cmd_string = "self." + cmd_set[i][0]
exec cmd_string
folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER)
file_name = "SmartConfig_log_%s.log" % (time.strftime("%m%d%H%M%S", time.localtime()))
self._performance_log_file = os.path.join(folder_path, file_name)
# type
self.target_type = ["SSC" if test_env.get_port_by_name("AT1") is None else "AT"]
self.target_type.append("SSC" if test_env.get_port_by_name("AT2") is None else "AT")
# test statistics
# better ways to create?
_test_stat = dict.fromkeys(TEST_STAT, 0)
_test_method = dict.fromkeys(TEST_METHOD)
_test_ht = dict.fromkeys(HT)
self.test_stat = dict.fromkeys(SMART_TYPE)
for i in SMART_TYPE:
self.test_stat[i] = copy.deepcopy(_test_ht)
for j in HT:
self.test_stat[i][j] = copy.deepcopy(_test_method)
for k in TEST_METHOD:
self.test_stat[i][j][k] = copy.deepcopy(_test_stat)
self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name)
pass
def _generate_random_ap_prop(self, ht_type):
ap_prop = dict.fromkeys(AP_PROP)
# generate target ap_value
ap_prop["ssid_len"] = random.randint(SSID_LEN_RANGE[0], SSID_LEN_RANGE[1])
ap_prop["channel"] = self.ap_channel[ht_type]
ap_prop["enc"] = random.choice(ENC_TYPE)
ap_prop["pwd_len"] = random.randint(PWD_RANGE[ap_prop["enc"]][0], PWD_RANGE[ap_prop["enc"]][1])
ap_prop["ssid"] = Encoding.generate_random_printable_str(ap_prop["ssid_len"])
ap_prop["pwd"] = Encoding.generate_random_printable_str(ap_prop["pwd_len"])
return ap_prop
def _logging_performance(self, time_cost, ssid, password, smart_type, test_method, ht_type):
# update test statistics
stat = self.test_stat[smart_type][ht_type][test_method]
stat["total count"] += 1
# log performance to performance log file
with open(self._performance_log_file, "ab+") as f:
# log time and ssid
if time_cost is not False:
time_tmp = float(time_cost)/10
f.write("\r\n[%s]:\r\n[Succeed] [%.2f]\r\n" %
(time.strftime("%m-%d %H:%M:%S", time.localtime()), time_tmp))
stat["total time"] += time_tmp
stat["longest time"] = time_tmp if time_tmp > stat["longest time"] else stat["longest time"]
else:
f.write("\r\n[%s]:\r\n[Fail]\r\n" %
time.strftime("%m-%d %H:%M:%S", time.localtime()))
stat["fail count"] += 1
f.write("[%s] [%s] [%s]\r\n" %
(smart_type, test_method, ht_type))
f.write("[ssid] %s \r\n[password] %s\r\n" %
(ssid, password))
pass
def _generate_performance_report(self):
with open(self._performance_log_file, "ab+") as f:
for i in SMART_TYPE:
for j in HT:
for k in TEST_METHOD:
stat = self.test_stat[i][j][k]
f.write("\r\n[Test report] [%s] [%s] [%s]\r\n" % (i, j, k))
if stat["total count"] > 0:
f.write("[Total]: %d\r\n" % stat["total count"])
f.write("[Failed]: %d\r\n" % stat["fail count"])
f.write("[Fail ratio]: %.2f%%\r\n" %
(float(stat["fail count"])/stat["total count"] * 100))
f.write("[Longest time cost]: %.2f\r\n" % stat["longest time"])
if (stat["total count"] - stat["fail count"]) > 0:
f.write("[Average time cost]: %.2f\r\n" %
(stat["total time"]/(stat["total count"]-stat["fail count"])))
@staticmethod
def cmd_exception_catcher(e):
raise e
pass
def execute(self):
TCActionBase.TCActionBase.execute(self)
self.result_cntx.start()
# mandatory configurable params
try:
test_count = self.test_count
delay_time = self.delay_time
except StandardError, e:
NativeLog.add_trace_critical("Error configuration for WifiJAP script, error is %s" % e)
raise StandardError("Error configuration")
# step 0 : set AT1 mode
fail_string = "Fail to restore init condition"
if self.target_type[0] == "AT":
cmd = ["ATS AT1 AT+CWMODE=1"]
checker_stings = ["R AT1 L OK"]
else:
cmd = ["SSC SSC1 op -S -o 1"]
checker_stings = ["R SSC1 C +MODE:OK"]
if self.target_type[1] == "AT":
cmd.append("ATS AT2 AT+CWMODE=2")
checker_stings.append("R AT2 L OK")
else:
cmd.append("SSC SSC2 op -S -o 2")
checker_stings.append("R SSC2 C +MODE:OK")
if self.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=150) is False:
NativeLog.add_trace_critical(fail_string)
return
for i in xrange(test_count):
_method = random.choice(self.test_method)
_ht = random.choice(self.ht)
_ap_prop = self._generate_random_ap_prop(_ht)
_smart_type = random.choice(self.smart_type)
_ht_ap = self.ht_ap[_ht]
is_hidden = 0 if _method == "ssid_broadcast" else 1
# get ip and
# step 1 : restore init condition
fail_string = "Fail to restore init condition"
if self.target_type[0] == "AT":
cmd = ["ATS AT1 AT+CWSTOPSMART", "WIFI <pc_wifi_nic> CONN %s %s <pc_ip_sc>" % (_ht_ap[0], _ht_ap[1])]
checker_stings = ["P AT1 L OK", "P PC_COM L OK"]
else:
cmd = ["SSC SSC1 smart -E", "WIFI <pc_wifi_nic> CONN %s %s <pc_ip_sc>" % (_ht_ap[0], _ht_ap[1])]
checker_stings = ["P SSC1 C +SC:OK", "P PC_COM L OK"]
if self.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=200) is False:
NativeLog.add_trace_critical(fail_string)
continue
NativeLog.add_prompt_trace("Step1 Done")
# step 2 : test method is ssid_broadcast, then set AP on target 2
if _method == "ssid_broadcast":
fail_string = "Fail to set AP"
if self.target_type[1] == "AT":
cmd = ["ATS AT2 AT+CWSAP=\"%s\",\"%s\",%d,%d" % (_ap_prop["ssid"], _ap_prop["pwd"],
_ap_prop["channel"], _ap_prop["enc"])]
checker_stings = ["R AT2 L OK"]
else:
cmd = ["SSC SSC2 ap -S -s %s -p %s -n %d -t %d" % (_ap_prop["ssid"], _ap_prop["pwd"],
_ap_prop["channel"], _ap_prop["enc"])]
checker_stings = ["R SSC2 C +SAP:OK"]
if self.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=50) is False:
NativeLog.add_trace_critical(fail_string)
continue
NativeLog.add_prompt_trace("Step2 Done")
# step 3 : start SMART
fail_string = "Fail to start smart config"
if self.target_type[0] == "AT":
cmd = ["ATS AT1 AT+CWSTARTSMART"]
checker_stings = ["R AT1 L OK"]
else:
cmd = ["SSC SSC1 smart -S -a 0"]
checker_stings = ["R SSC1 C +SC:OK"]
if self.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=50) is False:
NativeLog.add_trace_critical(fail_string)
continue
# sleep for delay_time seconds to wait scan done or simulate delay config situation
time.sleep(delay_time)
NativeLog.add_prompt_trace("Step3 Done")
# step 4 : do smart config
fail_string = "Fail in smart config"
cmd = ["SMART %s <pc_ip_sc> %s %s %s %d"
% (_smart_type, _ap_prop["ssid"], _ap_prop["pwd"], self.bssid, is_hidden)]
if self.target_type[0] == "AT":
checker_stings = ["P AT1 C Smart%20get%20wifi%20info",
"P LOG1 C %s C %s" % (_ap_prop["ssid"], _ap_prop["pwd"])]
else:
checker_stings = ["P SSC1 C %s C %s" % (_ap_prop["ssid"], _ap_prop["pwd"])]
try:
time_cost = self.load_and_exe_one_step(checker_stings, cmd,
fail_string, check_time=400,
cmd_exception_catcher=self.cmd_exception_catcher)
except StandardError:
NativeLog.add_prompt_trace("Exception occurred during executing cmd")
continue
pass
self._logging_performance(time_cost, _ap_prop["ssid"], _ap_prop["pwd"],
_smart_type, _method, _ht)
if time_cost is False:
NativeLog.add_prompt_trace(fail_string)
continue
# continue to next loop
NativeLog.add_prompt_trace("[WifiSmartConfig] Test count %d done" % i)
# generate report and cleanup
self._generate_performance_report()
self.result_cntx.set_result("Succeed")
def result_check(self, port_name, data):
TCActionBase.CommonTCActionBase.result_check(self, port_name, data)
self.result_cntx.append_data(port_name, data)
def main():
pass
if __name__ == '__main__':
main()

View File

@ -1 +0,0 @@
__all__ = ["WifiJAP", ]

View File

@ -1,299 +0,0 @@
test environment:
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_1,
test environment detail: 'PC has 2 wired NIC connected to AP.
PC has 1 WiFi NIC.
1 AT target connect with PC by UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_2,
test environment detail: 'PC has 1 WiFi NIC.
1 AT target connect with PC by UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_3,
test environment detail: 'Able to access WAN after connect to AP.
1 AT target connect with PC by UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_ADC,
test environment detail: 'PC has 1 wired NIC connected to AP.
Analog input connect to AT1 TOUT.
Multimeter connect to input, able to measure input voltage.
1 AT target connect with PC by UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_APC1,
test environment detail: "PC has 1 wired NIC connected to AP.\nPC has 1 wired NIC\
\ connected to APC (static IP within the same subnet with APC). \nAPC control\
\ AP power supply. \nPC has 1 WiFi NIC. \n1 AT target connect with PC by UART\
\ (AT and LOG port).", test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_APC2,
test environment detail: "Able to access WAN after connect to AP.\nPC has 1 wired\
\ NIC connected to APC (static IP within the same subnet with APC). \nAPC control\
\ AP power supply.\nPC has 1 WiFi NIC.\n1 AT target connect with PC by UART (AT\
\ and LOG port).", test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_HighSpeedUART,
test environment detail: 'PC has 2 wired NIC connected to AP.
PC has 1 WiFi NIC.
1 AT target connect with PC by high speed UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: AT_T1_SmartConfigIOT,
test environment detail: '1 AT target connect with PC by UART (AT and LOG port).
PC has 1 wired NIC connect to Common AP.
Several AP are placed near AT target.
Several smart phone installed test APK are placed near AT target.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: AT_T2_1,
test environment detail: 'PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
2 AT target connect with PC by UART (AT and LOG port).', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: AT_T2_JAP,
test environment detail: "Several AP are placed near AT target.\nPC has 1 wired\
\ NIC connected to APC (static IP within the same subnet with APC).\nAPC control\
\ power supply for all APs. \n2 AT target connect with PC by UART (AT and LOG\
\ port).", test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: AT_T2_Sleep,
test environment detail: 'AP support DTIM placed with AT target.
2 AT target connect with PC by UART (AT and LOG port).
Multimeter connect with PC via GPIB.
Series multimeter between GND and VCC of AT1.
AT1''s light sleep wakeup pin and wakeup indication connect with AT2''s GPIO.',
test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: AT_T2_SmartConfig,
test environment detail: '2 AT target connect with PC by UART (AT and LOG port).
PC has 1 WiFi NIC.
One HT20 AP and One HT40 AP are placed near target.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, UART ports: 'SSC1
SSC2', additional param list: '', basic param list: '', script path: EnvBase.py,
tag: IR_T2_1, test environment detail: '[TBD] 本测试为非自动测试, 红外能够做到数据收发吻合即可通过', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: NVS_T1_1,
test environment detail: '1 NVS target connect with PC by UART.
1 SSC target connect with PC by UART.
SSC2 GPIO connect to NVS1 power control pin.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, UART ports: SSC_1, additional param list: '',
basic param list: '', script path: EnvBase.py, tag: PWM_T1_1, test environment detail: "[TBD]\
\ 1. PWM OS SDK 以及 Non-OS SDK的测试建议分开进行, 放在不同的文件夹, 防止文件命名混淆\n2. 分析CSV文件的Python脚本只能分析单个channel\
\ \n3. 如果Init脚本打印\"Network Error\" 检查TCP Server是不是正常发送data", test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_1,
test environment detail: 'PC has 2 wired NIC connected to AP.
PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_2,
test environment detail: 'Able to access WAN after connect to AP.
1 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_8089,
test environment detail: 'PC has 1 wired NIC connected to AP.
1 8089 tablet able to run iperf test placed near SSC1.
1 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_ADC,
test environment detail: 'PC has 1 wired NIC connected to AP.
Analog input connect to SSC1 TOUT.
Multimeter connect to input, able to measure input voltage.
1 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_APC,
test environment detail: "PC has 1 wired NIC connected to AP.\nPC has 1 wired NIC\
\ connected to APC (static IP within the same subnet with APC). \nAPC control\
\ AP power supply. \nPC has 1 WiFi NIC. \n1 SSC target connect with PC by UART.",
test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_Enterprise,
test environment detail: "AP use WPA2-Etherprise is placed near SSC1. \n1 SSC target\
\ connect with PC by UART.", test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_IOT1,
test environment detail: 'PC has 1 WiFi NIC.
1 SSC target connect with PC by UART.
AP todo IOT test are placed near SSC1.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T1_InitData,
test environment detail: '2 SSC target connect with PC by UART.
SSC1 use 40M crystal oscillator.
SSC2 use normal 26M crystal oscillator.
SSC2 GPIO connect to SSC1 power control pin.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_ShieldBox,
test environment detail: 'refer to figure.
All APs and APC should be set to the same IP subnet.
PC wired NIC should set static IP address within the same subnet with AP.
Must use onboard wired NIC.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_Sleep1,
test environment detail: 'AP support DTIM placed with AT target.
SSC target connect with Raspberry Pi by UART.
Multimeter connect with Raspberry Pi via GPIB.
Series multimeter between GND and VCC of SSC1.
SSC1''s light sleep wakeup pin and wakeup indication connect with Raspberry Pi''s
GPIO.
SSC1''s XPD connect with RSTB.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_Sleep2,
test environment detail: 'AP support DTIM placed with AT target.
SSC target connect with Raspberry Pi by UART.
Multimeter connect with Raspberry Pi via GPIB.
Series multimeter between GND and VCC of SSC1.
SSC1''s RSTB pin connect with Raspberry Pi''s GPIO.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_TempBox,
test environment detail: '1 SSC target connect with PC by UART.
Put SSC target to temperature box.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, UART ports: SSC_1, additional param list: '',
basic param list: '', script path: EnvBase.py, tag: SSC_T1_Timer, test environment detail: '[TBD]
通过串口工具调节Timer, 将GPIO_13端口连接到逻辑分析仪', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_VDD33,
test environment detail: '1 SSC target connect with PC by UART.
Multimeter connect to VDD33, able to measure voltage.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T1_WEP,
test environment detail: '1 SSC target connect with PC by UART.
One WEP share key AP placed near SSC1.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_1,
test environment detail: 'PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
2 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, UART ports: 'SSC1
SSC2', additional param list: '', basic param list: '', script path: EnvBase.py,
tag: SSC_T2_GPIO1, test environment detail: '[TBD] 2个ESP_8266通过UART连到PC, ESP_8266的
GPIO_6相连', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, UART ports: 'SSC1
SSC2', additional param list: '', basic param list: '', script path: EnvBase.py,
tag: SSC_T2_GPIO2, test environment detail: '[TBD] 1. 2个ESP_8266通过UART连到PC, ESP_8266的
GPIO_15通过面包板相连
2. 可借助面包板, 将GPIO_15, 以及中断函数被打开的8266板的GPIO_2 相连', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, UART ports: 'SSC1
SSC2', additional param list: '', basic param list: '', script path: EnvBase.py,
tag: SSC_T2_GPIO3, test environment detail: '[TBD] 2个ESP_8266通过UART连到PC, ESP_8266之间需要测试的Target_GPIO相连',
test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_JAP,
test environment detail: 'PC has 1 wired NIC connected to APC.
APC control the power supply of multiple APs.
2 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_PhyMode,
test environment detail: '2 SSC target connect with PC by UART.
PC has one WiFi NIC support capture wlan packet using libpcap.
Set 4 AP with phy mode 11b, 11g, 11n HT20, 11n HT40.
Put 4 APs near SSC targets.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_ShieldBox,
test environment detail: '2 SSC target connect with PC by UART.
Put them to Shield box.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_SmartConfig,
test environment detail: '2 SSC target connect with PC by UART.
PC has 1 WiFi NIC.
One HT20 AP and One HT40 AP are placed near target.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 3.0, script path: EnvBase.py, tag: SSC_T3_PhyMode,
test environment detail: '3 SSC target connect with PC by UART.
PC has one WiFi NIC support capture wlan packet using libpcap.
Set 4 AP with (HT20, channel1), (HT20, channel2), (HT40, channel1), (HT40, channel2).
Put 4 APs near SSC targets.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 5.0, script path: EnvBase.py, tag: SSC_T5_1,
test environment detail: 5 SSC target connect with PC by UART., test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 5.0, script path: EnvBase.py, tag: SSC_T5_IOT1,
test environment detail: '5 SSC targets connect with PC by UART.
some Android smart phone are placed near SSC targets.', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: SSC_T6_1,
test environment detail: 'PC has 1 wired NIC connected to AP.
PC has 1 WiFi NIC.
6 SSC target connect with PC by UART.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: TempSensor_T1_1,
test environment detail: 'Tempeture sensor target connect with PC by UART.
AP support DTIM placed with AT target.
Multimeter connect with PC via GPIB.
Series multimeter between GND and VCC of TempSensor1.
PC has 1 wired NIC connected to switch.
APC, AP also connect with swtich.
All devices connected with switch use the same IP subnet.
APC control AP power supply.', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, UART ports: SSC_1, additional param list: '',
basic param list: '', script path: EnvBase.py, tag: UART_T1_1, test environment detail: '[TBD]
将ESP_8266通过UART连到PC', test script: EnvBase}
- {PC OS: '', Special: Y, Target Count: 1.0, UART ports: 'SSC1
SSC2', additional param list: '', basic param list: '', script path: EnvBase.py,
tag: UART_T1_2, test environment detail: '[TBD] ESP_8266通过UART_0通过USB, UART_1 TXD
通过 TTLcable 连到PC', test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_1,
test environment detail: Environment for running ESP32 unit tests, test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SDMODE,
test environment detail: Environment for running sd card sd mode unit tests, test script: EnvBase}
- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SPIMODE,
test environment detail: Environment for running sd card spi mode unit tests, test script: EnvBase}
- {PC OS: linux, Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: WebServer_T1_1,
test environment detail: 'Web Server target connect with PC by UART.
PC has 1 wired NIC connected to switch.
APC, AP also connect with swtich.
All devices connected with switch use same IP subnet.
APC control AP power supply.', test script: EnvBase}
- {PC OS: linux, Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: WebServer_T1_2,
test environment detail: 'Web Server target connect with PC by UART.
4 PC with WiFi NIC placed near WebServer1.', test script: EnvBase}
- PC OS: ''
Special: N
Target Count: 1
script path: EnvBase.py
tag: SSC_T1_3
test environment detail: 'PC has one BT adapter (dongle). 1 SSC target connect with PC by UART.'
test script: EnvBase