From 578458604148beb6d4daedbdbae604d2f1406a7c Mon Sep 17 00:00:00 2001 From: Yinling Date: Tue, 1 Nov 2016 19:30:42 +0800 Subject: [PATCH 1/7] integrate unit test to CI --- .gitlab-ci.yml | 63 ++- .../CIConfigs/IT_Function_TCPIP_01.yml | 8 +- .../CIConfigs/IT_Function_TCPIP_02.yml | 2 +- .../CIConfigs/IT_Function_TCPIP_03.yml | 8 +- .../CIConfigs/IT_Function_TCPIP_04.yml | 2 +- .../CIConfigs/IT_Function_TCPIP_07.yml | 6 +- .../CIConfigs/IT_Function_TCPIP_08.yml | 6 +- .../CIConfigs/IT_Function_TCPIP_09.yml | 2 +- .../CIConfigs/IT_Function_TCPIP_11.yml | 2 +- .../CIConfigs/IT_Function_TCPIP_12.yml | 2 +- .../integration_test/InitialConditionAll.yml | 24 + .../idf_test/integration_test/TestEnvAll.yml | 47 +- components/idf_test/uint_test/TestCaseAll.yml | 1 - .../CIConfigs/UT_Function_SYS_01.yml | 8 + .../InitialConditionAll.yml | 24 + components/idf_test/unit_test/TestCaseAll.yml | 484 ++++++++++++++++++ .../TestCaseScript/IDFUnitTest/UnitTest.py | 47 ++ .../TestCaseScript/IDFUnitTest/__init__.py | 1 + .../{uint_test => unit_test}/TestEnvAll.yml | 47 +- 19 files changed, 699 insertions(+), 85 deletions(-) delete mode 100644 components/idf_test/uint_test/TestCaseAll.yml create mode 100644 components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml rename components/idf_test/{uint_test => unit_test}/InitialConditionAll.yml (99%) create mode 100644 components/idf_test/unit_test/TestCaseAll.yml create mode 100644 components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py create mode 100755 components/idf_test/unit_test/TestCaseScript/IDFUnitTest/__init__.py rename components/idf_test/{uint_test => unit_test}/TestEnvAll.yml (95%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aff9bea8d1..e51c9dd020 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + - unit_test - test - deploy @@ -75,6 +76,23 @@ build_ssc: - chmod +x gen_misc_ng.sh - ./gen_misc_ng.sh +build_esp_idf_tests: + <<: *build_template + artifacts: + paths: + - ./esp-idf-tests/build/*.bin + - ./esp-idf-tests/build/*.elf + - ./esp-idf-tests/build/*.map + - ./esp-idf-tests/build/bootloader/*.bin + expire_in: 6 mos + + script: + - git clone $GITLAB_SSH_SERVER/idf/esp-idf-tests.git + - cd esp-idf-tests + - git checkout ${CI_BUILD_REF_NAME} || echo "Using default branch..." + - make defconfig + - make + build_examples: <<: *build_template artifacts: @@ -176,7 +194,7 @@ push_master_to_github: APP_NAME: "ssc" LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF" # append test level folder to TEST_CASE_FILE_PATH in before_script of test job - TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test" + TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test" # jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary artifacts: @@ -222,13 +240,34 @@ push_master_to_github: # run test - python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH +# template for unit test jobs +.unit_test_template: &unit_test_template + <<: *test_template + allow_failure: false + stage: unit_test + + variables: + # jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary + LOCAL_ENV_CONFIG_PATH: /home/gitlab-runner/LocalConfig/ESP32_IDF + BIN_PATH: "$CI_PROJECT_DIR/esp-idf-tests/build/" + LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF" + APP_NAME: "ut" + TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/unit_test" + +UT_Function_SYS_01: + <<: *test_template + tags: + - ESP32_IDF + - UT_T1_1 + before_script: + - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/UT_Function_SYS_01.yml + IT_Function_SYS_01: <<: *test_template tags: - ESP32_IDF - SSC_T1_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_SYS_01.yml IT_Function_WIFI_01: @@ -238,7 +277,6 @@ IT_Function_WIFI_01: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_01.yml IT_Function_WIFI_02: @@ -248,7 +286,6 @@ IT_Function_WIFI_02: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_02.yml IT_Function_TCPIP_01: @@ -258,7 +295,6 @@ IT_Function_TCPIP_01: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_01.yml IT_Function_TCPIP_02: @@ -268,7 +304,6 @@ IT_Function_TCPIP_02: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_02.yml IT_Function_TCPIP_03: @@ -278,7 +313,6 @@ IT_Function_TCPIP_03: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_03.yml IT_Function_TCPIP_04: @@ -288,7 +322,6 @@ IT_Function_TCPIP_04: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_04.yml IT_Function_TCPIP_05: @@ -298,7 +331,6 @@ IT_Function_TCPIP_05: - SSC_T1_1 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_05.yml IT_Function_TCPIP_06: @@ -307,7 +339,6 @@ IT_Function_TCPIP_06: - ESP32_IDF - SSC_T1_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_06.yml IT_Function_WIFI_03: @@ -316,7 +347,6 @@ IT_Function_WIFI_03: - ESP32_IDF - SSC_T3_PhyMode before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_03.yml IT_Function_WIFI_04: @@ -325,7 +355,6 @@ IT_Function_WIFI_04: - ESP32_IDF - SSC_T1_APC before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_04.yml IT_Function_WIFI_05: @@ -334,7 +363,6 @@ IT_Function_WIFI_05: - ESP32_IDF - SSC_T1_WEP before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_05.yml IT_Function_WIFI_06: @@ -343,7 +371,6 @@ IT_Function_WIFI_06: - ESP32_IDF - SSC_T2_PhyMode before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_06.yml IT_Function_TCPIP_07: @@ -354,7 +381,6 @@ IT_Function_TCPIP_07: - SSC_T1_2 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_07.yml IT_Function_TCPIP_08: @@ -363,7 +389,6 @@ IT_Function_TCPIP_08: - ESP32_IDF - SSC_T1_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_08.yml IT_Function_TCPIP_09: @@ -372,7 +397,6 @@ IT_Function_TCPIP_09: - ESP32_IDF - SSC_T1_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_09.yml IT_Function_TCPIP_10: @@ -383,7 +407,6 @@ IT_Function_TCPIP_10: - SSC_T1_2 - SSC_T2_1 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_10.yml IT_Function_TCPIP_11: @@ -391,8 +414,8 @@ IT_Function_TCPIP_11: tags: - ESP32_IDF - SSC_T1_1 + - SSC_T1_2 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_11.yml IT_Function_TCPIP_12: @@ -400,7 +423,5 @@ IT_Function_TCPIP_12: tags: - ESP32_IDF - SSC_T1_1 - - SSC_T1_2 before_script: - - TEST_CASE_FILE_PATH=$TEST_CASE_FILE_PATH/integration_test - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_12.yml diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_01.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_01.yml index 25a3ccda99..e86fac28ae 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_01.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_01.yml @@ -4,7 +4,7 @@ Filter: - Add: ID: [^TCPIP_DHCP_0302, TCPIP_DHCP_0302, TCPIP_DHCP_0301, TCPIP_TCP_0403, TCPIP_TCP_0402, TCPIP_TCP_0401, TCPIP_TCP_0407, TCPIP_TCP_0406, ^TCPIP_TCP_0411, TCPIP_TCP_0404, - TCPIP_TCP_0408, TCPIP_TCP_0110, TCPIP_TCP_0115, TCPIP_IP_0101, TCPIP_IP_0102, - ^TCPIP_IGMP_0102, ^TCPIP_IGMP_0101, ^TCPIP_IGMP_0104, TCPIP_IGMP_0104, TCPIP_IGMP_0103, - TCPIP_IGMP_0102, TCPIP_IGMP_0101, TCPIP_UDP_0108, TCPIP_UDP_0106, TCPIP_UDP_0107, - TCPIP_UDP_0105, TCPIP_UDP_0101, TCPIP_IGMP_0204, TCPIP_IGMP_0201, TCPIP_IGMP_0202] + TCPIP_TCP_0408, TCPIP_TCP_0110, ^TCPIP_TCP_0111, TCPIP_TCP_0115, TCPIP_IP_0101, + TCPIP_IP_0102, ^TCPIP_IGMP_0102, ^TCPIP_IGMP_0101, ^TCPIP_IGMP_0104, TCPIP_IGMP_0104, + TCPIP_IGMP_0103, TCPIP_IGMP_0102, TCPIP_IGMP_0101, TCPIP_UDP_0108, TCPIP_UDP_0106, + TCPIP_UDP_0107, TCPIP_UDP_0105, TCPIP_UDP_0101, TCPIP_IGMP_0204, TCPIP_IGMP_0201] diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_02.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_02.yml index 73618e0d70..a746cdd913 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_02.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_02.yml @@ -2,7 +2,7 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC2, SSC1] Filter: - Add: - ID: [TCPIP_IGMP_0203, ^TCPIP_TCP_0403, ^TCPIP_TCP_0408, TCPIP_UDP_0201, TCPIP_UDP_0202, + ID: [TCPIP_IGMP_0202, TCPIP_IGMP_0203, ^TCPIP_TCP_0403, ^TCPIP_TCP_0408, TCPIP_UDP_0201, ^TCPIP_DHCP_0301, ^TCPIP_TCP_0101, ^TCPIP_TCP_0103, ^TCPIP_TCP_0105, ^TCPIP_TCP_0104, ^TCPIP_TCP_0107, ^TCPIP_TCP_0106, ^TCPIP_DHCP_0210, ^TCPIP_DHCP_0211, ^TCPIP_DHCP_0212, ^TCPIP_TCP_0404, TCPIP_TCP_0212, TCPIP_TCP_0210, ^TCPIP_TCP_0406, ^TCPIP_TCP_0407, diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_03.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_03.yml index b326ed721c..f5f0abe5db 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_03.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_03.yml @@ -4,7 +4,7 @@ Filter: - Add: ID: [^TCPIP_IP_0102, ^TCPIP_UDP_0105, ^TCPIP_UDP_0107, ^TCPIP_UDP_0106, ^TCPIP_UDP_0101, TCPIP_TCP_0202, ^TCPIP_UDP_0108, ^TCPIP_IGMP_0201, ^TCPIP_IGMP_0203, ^TCPIP_IGMP_0202, - ^TCPIP_IGMP_0103, TCPIP_UDP_0114, TCPIP_UDP_0113, TCPIP_UDP_0112, TCPIP_DHCP_0205, - TCPIP_DHCP_0202, TCPIP_DHCP_0203, ^TCPIP_TCP_0102, TCPIP_TCP_0106, TCPIP_TCP_0107, - TCPIP_TCP_0104, TCPIP_TCP_0105, TCPIP_TCP_0102, TCPIP_TCP_0103, TCPIP_TCP_0101, - ^TCPIP_TCP_0116, ^TCPIP_TCP_0114, ^TCPIP_TCP_0115, ^TCPIP_TCP_0112, ^TCPIP_TCP_0113] + ^TCPIP_IGMP_0103, TCPIP_UDP_0114, TCPIP_UDP_0113, TCPIP_UDP_0112, TCPIP_UDP_0202, + TCPIP_DHCP_0205, TCPIP_DHCP_0202, TCPIP_DHCP_0203, ^TCPIP_TCP_0102, TCPIP_TCP_0106, + TCPIP_TCP_0107, TCPIP_TCP_0104, TCPIP_TCP_0105, TCPIP_TCP_0102, TCPIP_TCP_0103, + TCPIP_TCP_0101, ^TCPIP_TCP_0116, ^TCPIP_TCP_0114, ^TCPIP_TCP_0115, ^TCPIP_TCP_0112] diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_04.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_04.yml index 314de4a7e0..b59e8c60cd 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_04.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_04.yml @@ -2,7 +2,7 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC2, SSC1] Filter: - Add: - ID: [^TCPIP_TCP_0110, ^TCPIP_TCP_0111, TCPIP_DHCP_0209, ^TCPIP_DHCP_0209, ^TCPIP_DHCP_0207, + ID: [^TCPIP_TCP_0113, ^TCPIP_TCP_0110, TCPIP_DHCP_0209, ^TCPIP_DHCP_0209, ^TCPIP_DHCP_0207, ^TCPIP_DHCP_0206, ^TCPIP_DHCP_0205, ^TCPIP_DHCP_0204, ^TCPIP_DHCP_0203, ^TCPIP_DHCP_0202, ^TCPIP_DHCP_0201, TCPIP_TCP_0204, TCPIP_TCP_0207, TCPIP_TCP_0206, TCPIP_TCP_0201, ^TCPIP_DHCP_0101, TCPIP_TCP_0203, ^TCPIP_DHCP_0103, ^TCPIP_DHCP_0208, TCPIP_TCP_0208, diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_07.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_07.yml index 9b3d943fed..839ac972f4 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_07.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_07.yml @@ -2,9 +2,9 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC2, SSC1] Filter: - Add: - ID: [TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, + ID: [TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303, + TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_ICMP_0101, TCPIP_DNS_0102, TCPIP_DNS_0102, TCPIP_DNS_0102, TCPIP_DNS_0102, TCPIP_DNS_0102, TCPIP_DNS_0101, TCPIP_DNS_0101, TCPIP_DNS_0101, TCPIP_DNS_0101, TCPIP_DNS_0101, ^TCPIP_ICMP_0101, ^TCPIP_ICMP_0101, ^TCPIP_ICMP_0101, ^TCPIP_ICMP_0101, ^TCPIP_ICMP_0101, - TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109, - TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104] + TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109, TCPIP_UDP_0109] diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_08.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_08.yml index a2f8f0df07..b318b09377 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_08.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_08.yml @@ -2,9 +2,9 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC1] Filter: - Add: - ID: [TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, + ID: [TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104, TCPIP_UDP_0104, + TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0102, TCPIP_UDP_0103, TCPIP_UDP_0103, TCPIP_UDP_0103, TCPIP_UDP_0103, TCPIP_UDP_0103, ^TCPIP_UDP_0307, ^TCPIP_UDP_0307, ^TCPIP_UDP_0307, ^TCPIP_UDP_0307, ^TCPIP_UDP_0307, ^TCPIP_UDP_0306, ^TCPIP_UDP_0306, ^TCPIP_UDP_0306, ^TCPIP_UDP_0306, ^TCPIP_UDP_0306, - ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, - ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304] + ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305, ^TCPIP_UDP_0305] diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_09.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_09.yml index 146b98cf7d..50b50a3eb6 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_09.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_09.yml @@ -2,7 +2,7 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC1] Filter: - Add: - ID: [^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, + ID: [^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0304, ^TCPIP_UDP_0302, ^TCPIP_UDP_0302, ^TCPIP_UDP_0302, ^TCPIP_UDP_0302, ^TCPIP_UDP_0302, ^TCPIP_UDP_0301, ^TCPIP_UDP_0301, ^TCPIP_UDP_0301, ^TCPIP_UDP_0301, ^TCPIP_UDP_0301, ^TCPIP_UDP_0104, ^TCPIP_UDP_0104, ^TCPIP_UDP_0104, ^TCPIP_UDP_0104, ^TCPIP_UDP_0104, diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_11.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_11.yml index 86690db67c..be615d0878 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_11.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_11.yml @@ -7,4 +7,4 @@ Filter: TCPIP_UDP_0307, TCPIP_UDP_0307, TCPIP_UDP_0307, TCPIP_UDP_0307, TCPIP_UDP_0307, TCPIP_UDP_0301, TCPIP_UDP_0301, TCPIP_UDP_0301, TCPIP_UDP_0301, TCPIP_UDP_0301, TCPIP_UDP_0302, TCPIP_UDP_0302, TCPIP_UDP_0302, TCPIP_UDP_0302, TCPIP_UDP_0302, - TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303, TCPIP_UDP_0303] + TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103] diff --git a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_12.yml b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_12.yml index 4e0495e44d..73b0187eed 100644 --- a/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_12.yml +++ b/components/idf_test/integration_test/CIConfigs/IT_Function_TCPIP_12.yml @@ -2,5 +2,5 @@ Config: {execute count: 1, execute order: in order} DUT: [SSC1] Filter: - Add: - ID: [TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103, TCPIP_DNS_0103, + ID: [^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0303, ^TCPIP_UDP_0110, ^TCPIP_UDP_0110, ^TCPIP_UDP_0110, ^TCPIP_UDP_0110, ^TCPIP_UDP_0110] diff --git a/components/idf_test/integration_test/InitialConditionAll.yml b/components/idf_test/integration_test/InitialConditionAll.yml index ba06af9f87..3821894552 100644 --- a/components/idf_test/integration_test/InitialConditionAll.yml +++ b/components/idf_test/integration_test/InitialConditionAll.yml @@ -2933,3 +2933,27 @@ initial condition: start: 87.0 tag: T3_PHY1 test script: InitCondBase +- check cmd set: + - '' + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + force restore cmd set: + - '' + - - FREBOOT UT1 + - [''] + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + initial condition detail: At UT menu page + restore cmd set: + - '' + - - FREBOOT UT1 + - [''] + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + restore post cmd set: + - '' + - - DELAY 0.1 + - [''] + script path: InitCondBase.py + tag: UTINIT1 + test script: InitCondBase diff --git a/components/idf_test/integration_test/TestEnvAll.yml b/components/idf_test/integration_test/TestEnvAll.yml index 2e59961d97..6b21760150 100644 --- a/components/idf_test/integration_test/TestEnvAll.yml +++ b/components/idf_test/integration_test/TestEnvAll.yml @@ -141,6 +141,29 @@ test environment: 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. @@ -191,28 +214,6 @@ test environment: test environment detail: '2 SSC target connect with PC by UART. Put them to Shield box.', test script: EnvBase} -- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_Sleep1, - test environment detail: 'AP support DTIM placed with AT target. - - 2 SSC target connect with PC by UART. - - Multimeter connect with PC via GPIB. - - Series multimeter between GND and VCC of SSC1. - - SSC1''s light sleep wakeup pin and wakeup indication connect with AT2''s GPIO. - - SSC1''s XPD connect with RSTB.', test script: EnvBase} -- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_Sleep2, - test environment detail: 'AP support DTIM placed with AT target. - - 2 SSC target connect with PC by UART. - - Multimeter connect with PC via GPIB. - - Series multimeter between GND and VCC of SSC1. - - SSC1''s RSTB pin connect with AT2''s GPIO.', 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. @@ -263,6 +264,8 @@ test environment: 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: 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. diff --git a/components/idf_test/uint_test/TestCaseAll.yml b/components/idf_test/uint_test/TestCaseAll.yml deleted file mode 100644 index 2b2c65e0bd..0000000000 --- a/components/idf_test/uint_test/TestCaseAll.yml +++ /dev/null @@ -1 +0,0 @@ -test cases: [] diff --git a/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml b/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml new file mode 100644 index 0000000000..86e191cedf --- /dev/null +++ b/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml @@ -0,0 +1,8 @@ +Config: {execute count: 1, execute order: in order} +DUT: [UT1] +Filter: +- Add: + ID: [SYS_OS_0101, SYS_OS_0102, SYS_MISC_0103, SYS_MISC_0102, SYS_MISC_0105, SYS_MISC_0104, + SYS_MISC_0107, SYS_MISC_0106, SYS_MISC_0109, SYS_MISC_0108, SYS_MISC_0112, SYS_MISC_0113, + SYS_MISC_0110, SYS_MISC_0111, SYS_MISC_0115, SYS_LIB_0103, SYS_LIB_0102, SYS_LIB_0101, + SYS_LIB_0106, SYS_LIB_0105, SYS_LIB_0104] diff --git a/components/idf_test/uint_test/InitialConditionAll.yml b/components/idf_test/unit_test/InitialConditionAll.yml similarity index 99% rename from components/idf_test/uint_test/InitialConditionAll.yml rename to components/idf_test/unit_test/InitialConditionAll.yml index ba06af9f87..3821894552 100644 --- a/components/idf_test/uint_test/InitialConditionAll.yml +++ b/components/idf_test/unit_test/InitialConditionAll.yml @@ -2933,3 +2933,27 @@ initial condition: start: 87.0 tag: T3_PHY1 test script: InitCondBase +- check cmd set: + - '' + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + force restore cmd set: + - '' + - - FREBOOT UT1 + - [''] + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + initial condition detail: At UT menu page + restore cmd set: + - '' + - - FREBOOT UT1 + - [''] + - - UT UT1 - + - [R UT1 C Tests C Failures C Ignored] + restore post cmd set: + - '' + - - DELAY 0.1 + - [''] + script path: InitCondBase.py + tag: UTINIT1 + test script: InitCondBase diff --git a/components/idf_test/unit_test/TestCaseAll.yml b/components/idf_test/unit_test/TestCaseAll.yml new file mode 100644 index 0000000000..8732296bfc --- /dev/null +++ b/components/idf_test/unit_test/TestCaseAll.yml @@ -0,0 +1,484 @@ +test cases: +- CI ready: 'Yes' + ID: SYS_LIB_0101 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "12" + - [dummy] + comment: check if ROM is used for functions + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_LIB_0102 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "13" + - [dummy] + comment: test time functions + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_LIB_0103 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "14" + - [dummy] + comment: test sscanf function + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_LIB_0104 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "15" + - [dummy] + comment: test sprintf function + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_LIB_0105 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "16" + - [dummy] + comment: test atoX functions + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_LIB_0106 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "17" + - [dummy] + comment: test ctype functions + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run lib test + sub module: Std Lib + summary: lib unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: lib + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0102 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "21" + - [dummy] + comment: mbedtls MPI self-tests + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run bignum test + sub module: Misc + summary: bignum unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: bignum + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0103 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "25" + - [dummy] + comment: test AES thread safety + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run hwcrypto test + sub module: Misc + summary: hwcrypto unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: hwcrypto + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0104 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "26" + - [dummy] + comment: test AES acceleration + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run hwcrypto test + sub module: Misc + summary: hwcrypto unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: hwcrypto + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0105 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "27" + - [dummy] + comment: test SHA thread safety + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run hwcrypto test + sub module: Misc + summary: hwcrypto unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: hwcrypto + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0106 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "33" + - [dummy] + comment: context switch saves FP registers + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run fp test + sub module: Misc + summary: fp unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: fp + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0107 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "34" + - [dummy] + comment: test FP sqrt + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run fp test + sub module: Misc + summary: fp unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: fp + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0108 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "35" + - [dummy] + comment: test FP div + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run fp test + sub module: Misc + summary: fp unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: fp + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0109 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "36" + - [dummy] + comment: test FP mul + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run fp test + sub module: Misc + summary: fp unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: fp + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0110 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "37" + - [dummy] + comment: test FP add + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run fp test + sub module: Misc + summary: fp unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: fp + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_MISC_0111 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "3" + - [dummy] + comment: Test JPEG decompression library + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run JPEG decompression test + sub module: Misc + summary: JPEG decompression library unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: tjpgd + version: v1 (2016-10-31) +- CI ready: 'Yes' + ID: SYS_MISC_0112 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "22" + - [dummy] + comment: mbedtls AES self-tests + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run mbedtls AES self-tests + sub module: Misc + summary: mbedtls AES unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: mbedtls AES + version: v1 (2016-10-31) +- CI ready: 'Yes' + ID: SYS_MISC_0113 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "17" + - [dummy] + comment: mbedtls SHA self-tests + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run mbedtls SHA self-tests + sub module: Misc + summary: mbedtls SHA unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: mbedtls SHA + version: v1 (2016-10-31) +- CI ready: 'Yes' + ID: SYS_MISC_0115 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "28" + - [dummy] + comment: test SHA acceleration + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run SHA acceleration test + sub module: Misc + summary: SHA acceleration unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: SHA acceleration + version: v1 (2016-10-31) +- CI ready: 'Yes' + ID: SYS_OS_0101 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "31" + - [dummy] + comment: FreeRTOS Event Groups + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run freertos test + sub module: OS + summary: freertos unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: freertos + version: v1 (2016-10-26) +- CI ready: 'Yes' + ID: SYS_OS_0102 + SDK: ESP32_IDF + Test App: testje + auto test: 'Yes' + category: Function + cmd set: + - IDFUnitTest/UnitTest + - - test_case = "2" + - [dummy] + comment: Freertos TLS delete cb + execution time: 0 + expected result: 1. set succeed + initial condition: UTINIT1 + level: Unit + module: System + steps: 1. run Freertos TLS delete cb test + sub module: OS + summary: Freertos TLS delete cb unit test + test environment: UT_T1_1 + test point 1: basic function + test point 2: Freertos TLS delete cb + version: v1 (2016-10-31) diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py new file mode 100644 index 0000000000..6e7cac4109 --- /dev/null +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -0,0 +1,47 @@ +import re +import time + +from TCAction import PerformanceTCBase +from TCAction import TCActionBase +from NativeLog import NativeLog + +class UnitTest(PerformanceTCBase.PerformanceTCBase): + def __init__(self, name, test_env, cmd_set, timeout=30, log_path=TCActionBase.LOG_PATH): + PerformanceTCBase.PerformanceTCBase.__init__(self, name, test_env, cmd_set=cmd_set, + timeout=timeout, log_path=log_path) + + self.test_case = None + self.test_timeout = 6 + + # 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 send_commands(self): + self.flush_data("UT1") + + try: + self.serial_write_line("UT1", self.test_case) + time.sleep(self.test_timeout) #wait for test to run before reading result + data = self.serial_read_data("UT1") + if re.search('[^0] Tests 0 F', data): #check that number of tests run != 0 and number of tests failed == 0 + self.set_result("Success") + else: + self.set_result("Fail") + + except StandardError,e: + NativeLog.add_exception_log(e) + + def execute(self): + TCActionBase.TCActionBase.execute(self) + self.send_commands() + +def main(): + pass + +if __name__ == '__main__': + pass diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/__init__.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/__init__.py new file mode 100755 index 0000000000..876a5d4023 --- /dev/null +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/__init__.py @@ -0,0 +1 @@ +__all__ = ["UnitTest"] diff --git a/components/idf_test/uint_test/TestEnvAll.yml b/components/idf_test/unit_test/TestEnvAll.yml similarity index 95% rename from components/idf_test/uint_test/TestEnvAll.yml rename to components/idf_test/unit_test/TestEnvAll.yml index 2e59961d97..6b21760150 100644 --- a/components/idf_test/uint_test/TestEnvAll.yml +++ b/components/idf_test/unit_test/TestEnvAll.yml @@ -141,6 +141,29 @@ test environment: 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. @@ -191,28 +214,6 @@ test environment: test environment detail: '2 SSC target connect with PC by UART. Put them to Shield box.', test script: EnvBase} -- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_Sleep1, - test environment detail: 'AP support DTIM placed with AT target. - - 2 SSC target connect with PC by UART. - - Multimeter connect with PC via GPIB. - - Series multimeter between GND and VCC of SSC1. - - SSC1''s light sleep wakeup pin and wakeup indication connect with AT2''s GPIO. - - SSC1''s XPD connect with RSTB.', test script: EnvBase} -- {PC OS: '', Special: Y, Target Count: 2.0, script path: EnvBase.py, tag: SSC_T2_Sleep2, - test environment detail: 'AP support DTIM placed with AT target. - - 2 SSC target connect with PC by UART. - - Multimeter connect with PC via GPIB. - - Series multimeter between GND and VCC of SSC1. - - SSC1''s RSTB pin connect with AT2''s GPIO.', 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. @@ -263,6 +264,8 @@ test environment: 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: 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. From c67ac340c71b2b623ca12a2ee3d85f6f6e6ca96c Mon Sep 17 00:00:00 2001 From: Yinling Date: Tue, 1 Nov 2016 20:33:23 +0800 Subject: [PATCH 2/7] use correct template for unit test jobs --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e51c9dd020..ae93421599 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -255,7 +255,7 @@ push_master_to_github: TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/unit_test" UT_Function_SYS_01: - <<: *test_template + <<: *unit_test_template tags: - ESP32_IDF - UT_T1_1 From fdff6b2b012ac29f6aa6218ebfcc37b881d8ad9c Mon Sep 17 00:00:00 2001 From: Yinling Date: Wed, 2 Nov 2016 19:08:55 +0800 Subject: [PATCH 3/7] run unit test case by case name --- .../idf_test/integration_test/TestEnvAll.yml | 6 + .../CIConfigs/UT_Function_SYS_01.yml | 2 +- components/idf_test/unit_test/TestCaseAll.yml | 103 +++++++----------- .../TestCaseScript/IDFUnitTest/UnitTest.py | 14 ++- components/idf_test/unit_test/TestEnvAll.yml | 6 + 5 files changed, 61 insertions(+), 70 deletions(-) diff --git a/components/idf_test/integration_test/TestEnvAll.yml b/components/idf_test/integration_test/TestEnvAll.yml index 6b21760150..b8a2a497c6 100644 --- a/components/idf_test/integration_test/TestEnvAll.yml +++ b/components/idf_test/integration_test/TestEnvAll.yml @@ -202,6 +202,12 @@ test environment: 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. diff --git a/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml b/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml index 86e191cedf..c3561aa0c5 100644 --- a/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml +++ b/components/idf_test/unit_test/CIConfigs/UT_Function_SYS_01.yml @@ -2,7 +2,7 @@ Config: {execute count: 1, execute order: in order} DUT: [UT1] Filter: - Add: - ID: [SYS_OS_0101, SYS_OS_0102, SYS_MISC_0103, SYS_MISC_0102, SYS_MISC_0105, SYS_MISC_0104, + ID: [SYS_OS_0102, SYS_MISC_0103, SYS_MISC_0102, SYS_MISC_0105, SYS_MISC_0104, SYS_MISC_0107, SYS_MISC_0106, SYS_MISC_0109, SYS_MISC_0108, SYS_MISC_0112, SYS_MISC_0113, SYS_MISC_0110, SYS_MISC_0111, SYS_MISC_0115, SYS_LIB_0103, SYS_LIB_0102, SYS_LIB_0101, SYS_LIB_0106, SYS_LIB_0105, SYS_LIB_0104] diff --git a/components/idf_test/unit_test/TestCaseAll.yml b/components/idf_test/unit_test/TestCaseAll.yml index 8732296bfc..6f974e0bf5 100644 --- a/components/idf_test/unit_test/TestCaseAll.yml +++ b/components/idf_test/unit_test/TestCaseAll.yml @@ -2,12 +2,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0101 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "12" + - - test_case = "check if ROM is used for functions" - [dummy] comment: check if ROM is used for functions execution time: 0 @@ -25,12 +25,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0102 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "13" + - - test_case = "test time functions" - [dummy] comment: test time functions execution time: 0 @@ -48,12 +48,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0103 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "14" + - - test_case = "test sscanf function" - [dummy] comment: test sscanf function execution time: 0 @@ -71,12 +71,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0104 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "15" + - - test_case = "test sprintf function" - [dummy] comment: test sprintf function execution time: 0 @@ -94,12 +94,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0105 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "16" + - - test_case = "test atoX functions" - [dummy] comment: test atoX functions execution time: 0 @@ -117,12 +117,12 @@ test cases: - CI ready: 'Yes' ID: SYS_LIB_0106 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "17" + - - test_case = "test ctype functions" - [dummy] comment: test ctype functions execution time: 0 @@ -140,12 +140,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0102 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "21" + - - test_case = "mbedtls MPI self-tests" - [dummy] comment: mbedtls MPI self-tests execution time: 0 @@ -163,12 +163,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0103 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "25" + - - test_case = "test AES thread safety" - [dummy] comment: test AES thread safety execution time: 0 @@ -186,12 +186,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0104 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "26" + - - test_case = "test AES acceleration" - [dummy] comment: test AES acceleration execution time: 0 @@ -209,12 +209,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0105 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "27" + - - test_case = "test SHA thread safety" - [dummy] comment: test SHA thread safety execution time: 0 @@ -232,12 +232,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0106 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "33" + - - test_case = "context switch saves FP registers" - [dummy] comment: context switch saves FP registers execution time: 0 @@ -255,12 +255,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0107 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "34" + - - test_case = "test FP sqrt" - [dummy] comment: test FP sqrt execution time: 0 @@ -278,12 +278,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0108 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "35" + - - test_case = "test FP div" - [dummy] comment: test FP div execution time: 0 @@ -301,12 +301,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0109 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "36" + - - test_case = "test FP mul" - [dummy] comment: test FP mul execution time: 0 @@ -324,12 +324,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0110 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "37" + - - test_case = "test FP add" - [dummy] comment: test FP add execution time: 0 @@ -347,12 +347,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0111 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "3" + - - test_case = "Test JPEG decompression library" - [dummy] comment: Test JPEG decompression library execution time: 0 @@ -370,12 +370,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0112 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "22" + - - test_case = "mbedtls AES self-tests" - [dummy] comment: mbedtls AES self-tests execution time: 0 @@ -393,12 +393,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0113 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "17" + - - test_case = "mbedtls SHA self-tests" - [dummy] comment: mbedtls SHA self-tests execution time: 0 @@ -416,12 +416,12 @@ test cases: - CI ready: 'Yes' ID: SYS_MISC_0115 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "28" + - - test_case = "test SHA acceleration" - [dummy] comment: test SHA acceleration execution time: 0 @@ -436,38 +436,15 @@ test cases: test point 1: basic function test point 2: SHA acceleration version: v1 (2016-10-31) -- CI ready: 'Yes' - ID: SYS_OS_0101 - SDK: ESP32_IDF - Test App: testje - auto test: 'Yes' - category: Function - cmd set: - - IDFUnitTest/UnitTest - - - test_case = "31" - - [dummy] - comment: FreeRTOS Event Groups - execution time: 0 - expected result: 1. set succeed - initial condition: UTINIT1 - level: Unit - module: System - steps: 1. run freertos test - sub module: OS - summary: freertos unit test - test environment: UT_T1_1 - test point 1: basic function - test point 2: freertos - version: v1 (2016-10-26) - CI ready: 'Yes' ID: SYS_OS_0102 SDK: ESP32_IDF - Test App: testje + Test App: UT auto test: 'Yes' category: Function cmd set: - IDFUnitTest/UnitTest - - - test_case = "2" + - - test_case = "Freertos TLS delete cb" - [dummy] comment: Freertos TLS delete cb execution time: 0 diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py index 6e7cac4109..2af4747e5d 100644 --- a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -11,7 +11,7 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): timeout=timeout, log_path=log_path) self.test_case = None - self.test_timeout = 6 + self.test_timeout = 20 # load param from excel for i in range(1, len(cmd_set)): @@ -26,12 +26,14 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): try: self.serial_write_line("UT1", self.test_case) - time.sleep(self.test_timeout) #wait for test to run before reading result - data = self.serial_read_data("UT1") - if re.search('[^0] Tests 0 F', data): #check that number of tests run != 0 and number of tests failed == 0 - self.set_result("Success") + data = "" + for _ in range(self.timeout): + time.sleep(1) #wait for test to run before reading result + data += self.serial_read_data("UT1") + if re.search('[^0] Tests 0 F', data): #check that number of tests run != 0 and number of tests failed == 0 + self.set_result("Success") else: - self.set_result("Fail") + self.set_result("Fail") except StandardError,e: NativeLog.add_exception_log(e) diff --git a/components/idf_test/unit_test/TestEnvAll.yml b/components/idf_test/unit_test/TestEnvAll.yml index 6b21760150..b8a2a497c6 100644 --- a/components/idf_test/unit_test/TestEnvAll.yml +++ b/components/idf_test/unit_test/TestEnvAll.yml @@ -202,6 +202,12 @@ test environment: 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. From 2e319705ecfd6e2b3c159a771911ff0968652396 Mon Sep 17 00:00:00 2001 From: Yinling Date: Wed, 2 Nov 2016 19:41:33 +0800 Subject: [PATCH 4/7] forget to break when test succeed --- .../idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py index 2af4747e5d..ab29a97f9b 100644 --- a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -32,6 +32,7 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): data += self.serial_read_data("UT1") if re.search('[^0] Tests 0 F', data): #check that number of tests run != 0 and number of tests failed == 0 self.set_result("Success") + break else: self.set_result("Fail") From c12aeb11279b9deecdd43e3259d6e52d66fe3661 Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Wed, 2 Nov 2016 20:12:43 +0800 Subject: [PATCH 5/7] add case select by name mark " before case name --- .../idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py index ab29a97f9b..3ec87d24bc 100644 --- a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -25,7 +25,8 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): self.flush_data("UT1") try: - self.serial_write_line("UT1", self.test_case) + # add case select by name mark " before case name + self.serial_write_line("UT1", "/"" + self.test_case) data = "" for _ in range(self.timeout): time.sleep(1) #wait for test to run before reading result From e56b745527a96ab41765e8bbe2316920e2d7b602 Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Wed, 2 Nov 2016 20:21:46 +0800 Subject: [PATCH 6/7] incorrect "/", should be "\" --- .../idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py index 3ec87d24bc..35bb62c6d8 100644 --- a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -26,7 +26,7 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): try: # add case select by name mark " before case name - self.serial_write_line("UT1", "/"" + self.test_case) + self.serial_write_line("UT1", "\"" + self.test_case) data = "" for _ in range(self.timeout): time.sleep(1) #wait for test to run before reading result From 47910466ce3b646fcbff677f2a8035f30ae8f183 Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Wed, 2 Nov 2016 20:54:22 +0800 Subject: [PATCH 7/7] Set result "Succeed" for passed cases --- .../idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py index 35bb62c6d8..bfc8edeaa9 100644 --- a/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py +++ b/components/idf_test/unit_test/TestCaseScript/IDFUnitTest/UnitTest.py @@ -32,7 +32,7 @@ class UnitTest(PerformanceTCBase.PerformanceTCBase): time.sleep(1) #wait for test to run before reading result data += self.serial_read_data("UT1") if re.search('[^0] Tests 0 F', data): #check that number of tests run != 0 and number of tests failed == 0 - self.set_result("Success") + self.set_result("Succeed") break else: self.set_result("Fail")