Merge branch 'test/ci_add_ble_cases' into 'master'

CI: add ble cases to CI

See merge request !917
pull/746/head
Ivan Grokhotkov 2017-06-27 23:49:17 +08:00
commit bd09f186b6
10 zmienionych plików z 5269 dodań i 0 usunięć

Wyświetl plik

@ -567,6 +567,12 @@ IT_001_08:
- ESP32_IDF
- SSC_T1_1
IT_001_09:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T1_1
IT_002_01:
<<: *test_template
tags:
@ -591,6 +597,30 @@ IT_003_03:
- ESP32_IDF
- SSC_T2_1
IT_003_04:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_05:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_06:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_003_07:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T2_1
IT_004_01:
<<: *test_template
tags:
@ -621,6 +651,12 @@ IT_008_01:
- ESP32_IDF
- SSC_T2_PhyMode
IT_009_01:
<<: *test_template
tags:
- ESP32_IDF
- SSC_T1_3
IT_501_01:
<<: *test_template
tags:

Wyświetl plik

@ -0,0 +1,302 @@
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"]

Wyświetl plik

@ -0,0 +1,138 @@
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"]

Wyświetl plik

@ -2969,3 +2969,229 @@ initial condition:
script path: InitCondBase.py
tag: UTINIT1
test script: InitCondBase
- tag: BLE_DEINIT1
initial condition detail: 1 DUT which BLE is not enabled
script path: InitCondBase.py
test script: InitCondBase
check cmd set:
- ''
- - SSC SSC1 bt -Q
- ['R SSC1 C +BT:status,DEINIT']
restore cmd set:
- ''
- - SSC SSC1 bt -D -z disable
- ['R SSC1 C +BT:']
- - SSC SSC1 bt -D -z deinit
- ['R SSC1 C +BT:']
- - SSC SSC1 bt -Q
- ['R SSC1 C +BT:status,DEINIT']
force restore cmd set:
- ''
- - SSC SSC1 reboot
- ['R SSC1 C !!!ready!!!']
- - SSC SSC1 bt -D -z stop
- ['R SSC1 C +BT:OK']
restore post cmd set:
- ''
- - SSC SSC1 ram
- ['R SSC1 A <heap_size>:(\d+)']
- tag: BLE_INIT1
initial condition detail: 1 DUT which BLE is enabled, no active connection
script path: InitCondBase.py
test script: InitCondBase
check cmd set:
- ''
- - SSC SSC1 bt -Q
- ['R SSC1 C +BT:status,ENABLE']
- - SSC SSC1 ble -R
- ['R SSC1 C +BLE:']
- - SSC SSC1 bleconn -Q
- ['R SSC1 C +BLECONN:ConnCount,0']
restore cmd set:
- ''
- - SSC SSC1 bt -D -z init
- ['R SSC1 C +BT:']
- - SSC SSC1 bt -D -z enable
- ['R SSC1 C +BT:']
- - SSC SSC1 ble -R
- ['R SSC1 C +BLE:']
- - SSC SSC1 bleconn -D -z all
- ['R SSC1 C +BLECONN:']
force restore cmd set:
- ''
- - SSC SSC1 reboot
- ['R SSC1 C !!!ready!!!']
- - SSC SSC1 bt -D -z init
- ['R SSC1 C +BT:']
- - SSC SSC1 bt -D -z enable
- ['R SSC1 C +BT:']
- - SSC SSC1 ble -R
- ['R SSC1 C +BLE:']
restore post cmd set:
- ''
- - SSC SSC1 bleconn -D -z all
- ['R SSC1 C +BLECONN:']
- - SSC SSC1 gatts -S -z delete
- ['R SSC1 C +GATTS:']
- - SSC SSC1 ram
- ['R SSC1 A <heap_size>:(\d+)']
- tag: BLE_INIT2
initial condition detail: 2 DUT which BLE is enabled, no active connection, DUT2 start adv
script path: InitCondBase.py
test script: InitCondBase
check cmd set:
- ''
- - "SSC SSC[1-2] bt -Q"
- ['R SSC[1-2] C +BT:status,ENABLE']
restore cmd set:
- ''
- - "SSC SSC[1-2] bt -D -z init"
- ['R SSC[1-2] C +BT:']
- - "SSC SSC[1-2] bt -D -z enable"
- ['R SSC[1-2] C +BT:']
force restore cmd set:
- ''
- - "SSC SSC[1-2] reboot"
- ['R SSC[1-2] C !!!ready!!!']
- - "SSC SSC[1-2] bt -D -z init"
- ['R SSC[1-2] C +BT:']
- - "SSC SSC[1-2] bt -D -z enable"
- ['R SSC[1-2] C +BT:']
restore post cmd set:
- ''
- - "SSC SSC[1-2] ble -R"
- ['R SSC[1-2] C +BLE:']
- - "SSC SSC[1-2] bleconn -D -z all"
- ['R SSC[1-2] C +BLECONN:']
- - "SSC SSC[1-2] gatts -S -z delete"
- ['R SSC[1-2] C +GATTS:']
- - "SSC SSC[1-2] bleadv -D -z stop"
- ['R SSC[1-2] C +BLEADV:OK']
- - "SSC SSC2 bleadv -L -c 0 -t 3"
- ['R SSC2 C +BLEADV:SetAdv,OK']
- - "SSC SSC2 bleadv -D -z start"
- ['R SSC2 C +BLEADV:OK']
- - SSC SSC1 ram
- ['R SSC1 A <heap_size>:(\d+)']
- check cmd set:
- ''
- - ASSERT
- ['']
force restore cmd set:
- ''
- - SSC SSC[1-2] reboot
- ['R SSC[1-2] C !!!ready!!!']
- - SSC SSC[1-2] ble -R
- ['R SSC[1-2] C +BLE:']
- - SSC SSC[1-2] bleconn -D -z all
- ['R SSC[1-2] C +BLECONN:']
- - SSC SSC[1-2] gatts -S -z delete
- ['R SSC[1-2] C +GATTS:']
- - SSC SSC[1-2] bleadv -D -z stop
- ['R SSC[1-2] C +BLEADV:OK']
- - SSC SSC2 bleadv -L -c 0 -t 3
- ['R SSC2 C +BLEADV:SetAdv,OK']
- - SSC SSC2 bleadv -D -z start
- ['R SSC2 C +BLEADV:OK']
- - SSC SSC2 gatts -S -z load -p 0xA0
- ['R SSC2 C +GATTS:StartService,OK,A000']
- - SSC SSC1 bleconn -C -p 0x10 -a <dut2_bt_mac>
- ['R SSC1 C +BLE:GattcConnect,OK']
- - SSC SSC1 gattc -F -r <dut2_bt_mac>
- ['R SSC1 C +GATTC:OK']
initial condition detail: 2 DUT which BLE is enabled, DUT1 connected with DUT2,
DUT2 created GATT service 0xA000
restore cmd set:
- ''
- - SSC SSC[1-2] bt -D -z init
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] bt -D -z enable
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] ble -R
- ['R SSC[1-2] C +BLE:']
- - SSC SSC[1-2] bleconn -D -z all
- ['R SSC[1-2] C +BLECONN:']
- - SSC SSC[1-2] gatts -S -z delete
- ['R SSC[1-2] C +GATTS:']
- - SSC SSC[1-2] bleadv -D -z stop
- ['R SSC[1-2] C +BLEADV:OK']
- - SSC SSC2 bleadv -L -c 0 -t 3
- ['R SSC2 C +BLEADV:SetAdv,OK']
- - SSC SSC2 bleadv -D -z start
- ['R SSC2 C +BLEADV:OK']
- - SSC SSC2 gatts -S -z load -p 0xA0
- ['R SSC2 C +GATTS:StartService,OK,A000']
- - SSC SSC1 bleconn -C -p 0x10 -a <dut2_bt_mac>
- ['R SSC1 C +BLE:GattcConnect,OK']
- - SSC SSC1 gattc -F -r <dut2_bt_mac>
- ['R SSC1 C +GATTC:OK']
restore post cmd set:
- ''
- - SSC SSC1 ram
- ['R SSC1 A <heap_size>:(\d+)']
script path: InitCondBase.py
tag: BLE_CONN2
test script: InitCondBase
- check cmd set:
- ''
- - ASSERT
- ['']
force restore cmd set:
- ''
- - SSC SSC[1-2] reboot
- ['R SSC[1-2] C !!!ready!!!']
- - SSC SSC[1-2] bt -D -z start
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] bt -D -z enable
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] ble -R
- ['R SSC[1-2] C +BLE:']
- - SSC SSC[1-2] bleconn -D -z all
- ['R SSC[1-2] C +BLECONN:']
- - SSC SSC[1-2] gatts -S -z delete
- ['R SSC[1-2] C +GATTS:']
- - SSC SSC[1-2] bleadv -D -z stop
- ['R SSC[1-2] C +BLEADV:OK']
- - SSC SSC2 bleadv -L -c 0 -t 3
- ['R SSC2 C +BLEADV:SetAdv,OK']
- - SSC SSC2 bleadv -D -z start
- ['R SSC2 C +BLEADV:OK']
- - SSC SSC2 gatts -S -z load -p 0xA2
- ['R SSC2 C +GATTS:StartService,OK,A002']
- - SSC SSC1 bleconn -C -p 0x10 -a <dut2_bt_mac>
- ['R SSC1 C +BLE:GattcConnect,OK']
- - SSC SSC1 gattc -F -r <dut2_bt_mac>
- ['R SSC1 C +GATTC:OK']
initial condition detail: 2 DUT which BLE is enabled, DUT1 connected with DUT2,
DUT2 created GATT service 0xA002
restore cmd set:
- ''
- - SSC SSC[1-2] bt -D -z init
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] bt -D -z enable
- ['R SSC[1-2] C +BT:']
- - SSC SSC[1-2] ble -R
- ['R SSC[1-2] C +BLE:']
- - SSC SSC[1-2] bleconn -D -z all
- ['R SSC[1-2] C +BLECONN:']
- - SSC SSC[1-2] gatts -S -z delete
- ['R SSC[1-2] C +GATTS:']
- - SSC SSC[1-2] bleadv -D -z stop
- ['R SSC[1-2] C +BLEADV:OK']
- - SSC SSC2 bleadv -L -c 0 -t 3
- ['R SSC2 C +BLEADV:SetAdv,OK']
- - SSC SSC2 bleadv -D -z start
- ['R SSC2 C +BLEADV:OK']
- - SSC SSC2 gatts -S -z load -p 0xA2
- ['R SSC2 C +GATTS:StartService,OK,A002']
- - SSC SSC1 bleconn -C -p 0x10 -a <dut2_bt_mac>
- ['R SSC1 C +BLE:GattcConnect,OK']
- - SSC SSC1 gattc -F -r <dut2_bt_mac>
- ['R SSC1 C +GATTC:OK']
restore post cmd set:
- ''
- - SSC SSC1 ram
- ['R SSC1 A <heap_size>:(\d+)']
script path: InitCondBase.py
tag: BLE_CONN3
test script: InitCondBase

Wyświetl plik

@ -212,3 +212,48 @@ TCPIP_DNS_0102_01
TCPIP_DNS_0103
TCPIP_DNS_0103_01
# BT Stack
# GAP
BTSTK_GAP_07003
BTSTK_GAP_06003
# GATT
BTSTK_GATT_21005
BTSTK_GATT_25013
# 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_GATT_20002
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_COEXIST_0101
BTSTK_COEXIST_0102
BTSTK_COEXIST_0103
BTSTK_COEXIST_0201
BTSTK_COEXIST_0202
BTSTK_COEXIST_0203
BTSTK_COEXIST_0301

Wyświetl plik

@ -0,0 +1,125 @@
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

Wyświetl plik

@ -0,0 +1 @@
import AdvInterval

Wyświetl plik

@ -286,3 +286,10 @@ test environment:
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