From 0c48ade2ffb6fafd17a9b1ff94e3da453e4c519d Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 8 Jun 2022 11:44:23 -0700 Subject: [PATCH] [tests] change 1.2 builds to 1.3 (#7756) --- .github/workflows/otbr.yml | 10 ++--- .github/workflows/otci.yml | 2 +- .github/workflows/simulation-1.2.yml | 44 +++++++++---------- script/check-arm-build-autotools | 2 +- script/check-arm-build-cmake | 2 +- script/check-gn-build | 4 +- script/check-simulation-build-autotools | 14 +++--- script/check-simulation-build-cmake | 16 +++---- script/check-size | 6 +-- script/make-pretty | 6 +-- script/test | 42 +++++++++--------- src/core/BUILD.gn | 2 + tests/scripts/thread-cert/config.py | 1 + tests/scripts/thread-cert/node.py | 22 +++++----- tests/scripts/thread-cert/pktverify/consts.py | 2 + .../thread-cert/pktverify/packet_verifier.py | 2 +- tests/scripts/thread-cert/run_cert_suite.py | 4 +- tests/scripts/thread-cert/thread_cert.py | 11 +++-- ...Power_6_1_07_PreferringARouterOverAReed.py | 8 ++-- .../scripts/thread-cert/v1_2_router_5_1_1.py | 6 +-- .../v1_2_test_enhanced_keep_alive.py | 6 +-- 21 files changed, 111 insertions(+), 101 deletions(-) diff --git a/.github/workflows/otbr.yml b/.github/workflows/otbr.yml index 159c84d59..368dc72df 100644 --- a/.github/workflows/otbr.yml +++ b/.github/workflows/otbr.yml @@ -46,7 +46,7 @@ jobs: REFERENCE_DEVICE: 1 VIRTUAL_TIME: 0 PACKET_VERIFICATION: 1 - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 INTER_OP: 1 COVERAGE: 1 MULTIPLY: 1 @@ -83,12 +83,12 @@ jobs: sudo -E ./script/test cert_suite ./tests/scripts/thread-cert/backbone/*.py || (sudo chmod a+r *.log *.json *.pcap && false) - uses: actions/upload-artifact@v2 with: - name: cov-thread-1-2-backbone-docker + name: cov-thread-1-3-backbone-docker path: /tmp/coverage/ - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: - name: thread-1-2-backbone-results + name: thread-1-3-backbone-results path: | *.pcap *.json @@ -100,7 +100,7 @@ jobs: ./script/test generate_coverage gcc - uses: actions/upload-artifact@v2 with: - name: cov-thread-1-2-backbone + name: cov-thread-1-3-backbone path: tmp/coverage.info thread-border-router: @@ -144,7 +144,7 @@ jobs: REFERENCE_DEVICE: 1 VIRTUAL_TIME: 0 PACKET_VERIFICATION: ${{ matrix.packet_verification }} - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 INTER_OP: 1 COVERAGE: 1 MULTIPLY: 1 diff --git a/.github/workflows/otci.yml b/.github/workflows/otci.yml index 5023d7c16..a1e3a9b99 100644 --- a/.github/workflows/otci.yml +++ b/.github/workflows/otci.yml @@ -61,7 +61,7 @@ jobs: - name: Build run: | ./bootstrap - make -f examples/Makefile-simulation THREAD_VERSION=1.2 DUA=1 MLR=1 BACKBONE_ROUTER=1 CSL_RECEIVER=1 + make -f examples/Makefile-simulation THREAD_VERSION=1.3 DUA=1 MLR=1 BACKBONE_ROUTER=1 CSL_RECEIVER=1 - name: Install OTCI Python Library run: | (cd tools/otci && python3 setup.py install --user) diff --git a/.github/workflows/simulation-1.2.yml b/.github/workflows/simulation-1.2.yml index 7b7a949c9..26166466d 100644 --- a/.github/workflows/simulation-1.2.yml +++ b/.github/workflows/simulation-1.2.yml @@ -26,7 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. # -name: Simulation 1.2 +name: Simulation 1.3 on: [push, pull_request] @@ -40,15 +40,15 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" if: "github.ref != 'refs/heads/main'" - thread-1-2: - name: thread-1-2-${{ matrix.compiler.c }}-${{ matrix.arch }} + thread-1-3: + name: thread-1-3-${{ matrix.compiler.c }}-${{ matrix.arch }} runs-on: ubuntu-20.04 env: CFLAGS: -${{ matrix.arch }} CXXFLAGS: -${{ matrix.arch }} LDFLAGS: -${{ matrix.arch }} COVERAGE: 1 - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 VIRTUAL_TIME: 1 INTER_OP: 1 CC: ${{ matrix.compiler.c }} @@ -87,12 +87,12 @@ jobs: - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: - name: thread-1-2-${{ matrix.compiler.c }}-${{ matrix.arch }}-pcaps + name: thread-1-3-${{ matrix.compiler.c }}-${{ matrix.arch }}-pcaps path: "*.pcap" - uses: actions/upload-artifact@v2 if: ${{ failure() && env.CRASHED == '1' }} with: - name: core-packet-verification-thread-1-2 + name: core-packet-verification-thread-1-3 path: | ./ot-core-dump/* - name: Generate Coverage @@ -100,7 +100,7 @@ jobs: ./script/test generate_coverage "${{ matrix.compiler.gcov }}" - uses: actions/upload-artifact@v2 with: - name: cov-thread-1-2-${{ matrix.compiler.c }}-${{ matrix.arch }} + name: cov-thread-1-3-${{ matrix.compiler.c }}-${{ matrix.arch }} path: tmp/coverage.info packet-verification-low-power: @@ -110,7 +110,7 @@ jobs: VIRTUAL_TIME: 1 COVERAGE: 1 PACKET_VERIFICATION: 1 - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 MAC_FILTER: 1 INTER_OP: 1 INTER_OP_BBR: 0 @@ -164,13 +164,13 @@ jobs: name: cov-packet-verification-low-power path: tmp/coverage.info - packet-verification-1-1-on-1-2: + packet-verification-1-1-on-1-3: runs-on: ubuntu-20.04 env: REFERENCE_DEVICE: 1 VIRTUAL_TIME: 1 PACKET_VERIFICATION: 1 - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 MULTIPLY: 3 steps: - uses: actions/checkout@v2 @@ -193,7 +193,7 @@ jobs: - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: - name: packet-verification-1.1-on-1.2-pcaps + name: packet-verification-1.1-on-1.3-pcaps path: | *.pcap *.json @@ -202,14 +202,14 @@ jobs: ./script/test generate_coverage gcc - uses: actions/upload-artifact@v2 with: - name: cov-packet-verification-1-1-on-1-2 + name: cov-packet-verification-1-1-on-1-3 path: tmp/coverage.info expects: runs-on: ubuntu-20.04 env: COVERAGE: 1 - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 VIRTUAL_TIME: 0 steps: - uses: actions/checkout@v2 @@ -232,7 +232,7 @@ jobs: - uses: actions/upload-artifact@v2 if: ${{ failure() && env.CRASHED == '1' }} with: - name: core-expect-1-2 + name: core-expect-1-3 path: | ./ot-core-dump/* - name: Generate Coverage @@ -243,13 +243,13 @@ jobs: name: cov-expects path: tmp/coverage.info - thread-1-2-posix: + thread-1-3-posix: runs-on: ubuntu-20.04 env: COVERAGE: 1 PYTHONUNBUFFERED: 1 READLINE: readline - THREAD_VERSION: 1.2 + THREAD_VERSION: 1.3 OT_NODE_TYPE: rcp USE_MTD: 1 VIRTUAL_TIME: 1 @@ -285,12 +285,12 @@ jobs: - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: - name: thread-1-2-posix-pcaps + name: thread-1-3-posix-pcaps path: "*.pcap" - uses: actions/upload-artifact@v2 if: ${{ failure() && env.CRASHED == '1' }} with: - name: core-thread-1-2-posix + name: core-thread-1-3-posix path: | ./ot-core-dump/* - name: Generate Coverage @@ -298,16 +298,16 @@ jobs: ./script/test generate_coverage gcc - uses: actions/upload-artifact@v2 with: - name: cov-thread-1-2-posix + name: cov-thread-1-3-posix path: tmp/coverage.info upload-coverage: needs: - - thread-1-2 + - thread-1-3 - packet-verification-low-power - - packet-verification-1-1-on-1-2 + - packet-verification-1-1-on-1-3 - expects - - thread-1-2-posix + - thread-1-3-posix runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/script/check-arm-build-autotools b/script/check-arm-build-autotools index 4390ff8da..e994c2025 100755 --- a/script/check-arm-build-autotools +++ b/script/check-arm-build-autotools @@ -43,7 +43,7 @@ build_cc2538() "DNS_CLIENT=1" "JOINER=1" "SLAAC=1" - # cc2538 does not have enough resources to support Thread 1.2 + # cc2538 does not have enough resources to support Thread 1.3 "THREAD_VERSION=1.1" ) diff --git a/script/check-arm-build-cmake b/script/check-arm-build-cmake index d8210ab1f..3ee62b06e 100755 --- a/script/check-arm-build-cmake +++ b/script/check-arm-build-cmake @@ -51,7 +51,7 @@ reset_source() build_cc2538() { local options=( - # cc2538 does not have enough resources to support Thread 1.2 + # cc2538 does not have enough resources to support Thread 1.3 "-DOT_THREAD_VERSION=1.1" ) diff --git a/script/check-gn-build b/script/check-gn-build index 2a02c3ffe..68b17a7b7 100755 --- a/script/check-gn-build +++ b/script/check-gn-build @@ -43,10 +43,10 @@ main() ninja -C gn-out test -f gn-out/obj/src/core/libopenthread-ftd.a - # Check GN build for OT1.2 + # Check GN build for OT1.3 rm gn-out -r || true mkdir gn-out - echo 'openthread_config_thread_version = "1.2"' >gn-out/args.gn + echo 'openthread_config_thread_version = "1.3"' >gn-out/args.gn gn gen --check gn-out gn args gn-out --list ninja -C gn-out diff --git a/script/check-simulation-build-autotools b/script/check-simulation-build-autotools index 086f2688c..6605c5209 100755 --- a/script/check-simulation-build-autotools +++ b/script/check-simulation-build-autotools @@ -93,7 +93,7 @@ build_all_features() "-DOPENTHREAD_CONFIG_MAC_OUTGOING_BEACON_PAYLOAD_ENABLE=1" ) - local options_1_2=( + local options_1_3=( "-DOPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1" "-DOPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1" "-DOPENTHREAD_CONFIG_DUA_ENABLE=1" @@ -110,15 +110,15 @@ build_all_features() reset_source make -f examples/Makefile-simulation THREAD_VERSION=1.1 FULL_LOGS=1 - # Build Thread 1.2 with full features and logs - export CPPFLAGS="${options[*]} ${options_1_2[*]} -DOPENTHREAD_CONFIG_LOG_OUTPUT=OT_LOG_OUTPUT_NONE" + # Build Thread 1.3 with full features and logs + export CPPFLAGS="${options[*]} ${options_1_3[*]} -DOPENTHREAD_CONFIG_LOG_OUTPUT=OT_LOG_OUTPUT_NONE" reset_source - make -f examples/Makefile-simulation THREAD_VERSION=1.2 + make -f examples/Makefile-simulation THREAD_VERSION=1.3 - # Build Thread 1.2 with full features and full logs - export CPPFLAGS="${options[*]} ${options_1_2[*]}" + # Build Thread 1.3 with full features and full logs + export CPPFLAGS="${options[*]} ${options_1_3[*]}" reset_source - make -f examples/Makefile-simulation THREAD_VERSION=1.2 FULL_LOGS=1 + make -f examples/Makefile-simulation THREAD_VERSION=1.3 FULL_LOGS=1 # Build Thread 1.1 with ASSERT disabled export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_ASSERT_ENABLE=0" diff --git a/script/check-simulation-build-cmake b/script/check-simulation-build-cmake index e9a3b4549..f296ab1ec 100755 --- a/script/check-simulation-build-cmake +++ b/script/check-simulation-build-cmake @@ -53,7 +53,7 @@ build_all_features() -DOT_FTD=OFF \ -DOT_MTD=OFF - # Thread 1.2 options + # Thread 1.3 options local options=( "-DOT_BACKBONE_ROUTER=ON" "-DOT_BORDER_ROUTING=ON" @@ -61,18 +61,18 @@ build_all_features() "-DOT_MLR=ON" "-DOT_OTNS=ON" "-DOT_SIMULATION_VIRTUAL_TIME=ON" - "-DOT_THREAD_VERSION=1.2" + "-DOT_THREAD_VERSION=1.3" ) - # Build Thread 1.2 with full features + # Build Thread 1.3 with full features reset_source "$(dirname "$0")"/cmake-build simulation "${options[@]}" -DOT_DUA=ON - # Build Thread 1.2 Backbone Router without DUA ND Proxying + # Build Thread 1.3 Backbone Router without DUA ND Proxying reset_source "$(dirname "$0")"/cmake-build simulation "${options[@]}" -DOT_BACKBONE_ROUTER_DUA_NDPROXYING=OFF - # Build Thread 1.2 Backbone Router without Multicast Routing + # Build Thread 1.3 Backbone Router without Multicast Routing reset_source "$(dirname "$0")"/cmake-build simulation "${options[@]}" -DOT_BACKBONE_ROUTER_MULTICAST_ROUTING=OFF @@ -82,11 +82,11 @@ build_all_features() -DOT_THREAD_VERSION=1.1 \ -DOT_VENDOR_EXTENSION=../../src/core/common/extension_example.cpp - # Build Thread 1.2 with no additional features + # Build Thread 1.3 with no additional features reset_source - "$(dirname "$0")"/cmake-build simulation -DOT_THREAD_VERSION=1.2 + "$(dirname "$0")"/cmake-build simulation -DOT_THREAD_VERSION=1.3 - # Build Thread 1.2 with full features and OT_ASSERT=OFF + # Build Thread 1.3 with full features and OT_ASSERT=OFF reset_source "$(dirname "$0")"/cmake-build simulation "${options[@]}" -DOT_DUA=ON -DOT_ASSERT=OFF diff --git a/script/check-size b/script/check-size index 2163d0576..e81c0bfaf 100755 --- a/script/check-size +++ b/script/check-size @@ -151,9 +151,9 @@ size_nrf52840_version() local thread_version=$1 - if [[ ${thread_version} == "1.2" ]]; then + if [[ ${thread_version} != "1.1" ]]; then options+=( - "-DOT_THREAD_VERSION=1.2" + "-DOT_THREAD_VERSION=1.3" "-DOT_BACKBONE_ROUTER=ON" "-DOT_DUA=ON" "-DOT_MLR=ON" @@ -243,7 +243,7 @@ size_nrf52840() "${reporter}" init OpenThread size_nrf52840_version 1.1 - size_nrf52840_version 1.2 + size_nrf52840_version 1.3 "${reporter}" post } diff --git a/script/make-pretty b/script/make-pretty index 70984de7c..22201c3f1 100755 --- a/script/make-pretty +++ b/script/make-pretty @@ -121,7 +121,7 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=( '-DOT_SNTP_CLIENT=ON' '-DOT_SRP_CLIENT=ON' '-DOT_SRP_SERVER=ON' - '-DOT_THREAD_VERSION=1.2' + '-DOT_THREAD_VERSION=1.3' '-DOT_TREL=ON' '-DOT_COVERAGE=ON' '-DOT_LOG_LEVEL_DYNAMIC=ON' @@ -177,7 +177,7 @@ do_clang_tidy_fix() (mkdir -p ./build/cmake-tidy \ && cd ./build/cmake-tidy \ - && THREAD_VERSION=1.2 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \ + && THREAD_VERSION=1.3 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \ && ../../script/clang-tidy -header-filter='.*' -checks="${OT_CLANG_TIDY_CHECKS}" -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}" -fix) } @@ -190,7 +190,7 @@ do_clang_tidy_check() ( mkdir -p ./build/cmake-tidy \ && cd ./build/cmake-tidy \ - && THREAD_VERSION=1.2 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \ + && THREAD_VERSION=1.3 cmake "${OT_CLANG_TIDY_BUILD_OPTS[@]}" ../.. \ && ../../script/clang-tidy -header-filter='.*' -checks="${OT_CLANG_TIDY_CHECKS}" -j"$OT_BUILD_JOBS" "${OT_CLANG_TIDY_FIX_DIRS[@]}" \ | grep -v -E "third_party" >output.txt if grep -q "warning: \|error: " output.txt; then diff --git a/script/test b/script/test index 2c5226145..631013ad2 100755 --- a/script/test +++ b/script/test @@ -42,7 +42,7 @@ readonly OT_COLOR_NONE='\033[0m' readonly OT_NODE_TYPE="${OT_NODE_TYPE:-cli}" readonly OT_NATIVE_IP="${OT_NATIVE_IP:-0}" -readonly THREAD_VERSION="${THREAD_VERSION:-1.2}" +readonly THREAD_VERSION="${THREAD_VERSION:-1.3}" readonly INTER_OP="${INTER_OP:-0}" readonly VERBOSE="${VERBOSE:-0}" readonly BORDER_ROUTING="${BORDER_ROUTING:-1}" @@ -81,7 +81,7 @@ build_simulation() options+=("-DOT_FULL_LOGS=ON") fi - if [[ ${version} == "1.2" ]]; then + if [[ ${version} != "1.1" ]]; then options+=("-DOT_DUA=ON") options+=("-DOT_MLR=ON") fi @@ -90,7 +90,7 @@ build_simulation() options+=("-DOT_SIMULATION_VIRTUAL_TIME=ON") fi - if [[ ${version} == "1.2" ]]; then + if [[ ${version} != "1.1" ]]; then options+=("-DOT_CSL_RECEIVER=ON") options+=("-DOT_LINK_METRICS_INITIATOR=ON") options+=("-DOT_LINK_METRICS_SUBJECT=ON") @@ -106,7 +106,7 @@ build_simulation() OT_CMAKE_NINJA_TARGET=ot-rcp OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}" "${OT_SRCDIR}"/script/cmake-build simulation "${options[@]}" "-DOT_SIMULATION_VIRTUAL_TIME_UART=ON" fi - if [[ ${version} == "1.2" && ${INTER_OP_BBR} == 1 ]]; then + if [[ ${version} != "1.1" && ${INTER_OP_BBR} == 1 ]]; then options+=("-DOT_BACKBONE_ROUTER=ON") @@ -124,7 +124,7 @@ build_posix() local version="$1" local options=("-DOT_MESSAGE_USE_HEAP=ON" "-DOT_THREAD_VERSION=${version}" "-DBUILD_TESTING=ON") - if [[ ${version} == "1.2" ]]; then + if [[ ${version} != "1.1" ]]; then options+=("-DOT_DUA=ON") options+=("-DOT_MLR=ON") fi @@ -147,7 +147,7 @@ build_posix() OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-posix-${version}" "${OT_SRCDIR}"/script/cmake-build posix "${options[@]}" - if [[ ${version} == "1.2" && ${INTER_OP_BBR} == 1 ]]; then + if [[ ${version} != "1.1" && ${INTER_OP_BBR} == 1 ]]; then options+=("-DOT_BACKBONE_ROUTER=ON") @@ -170,7 +170,7 @@ do_build() { build_for_one_version "${THREAD_VERSION}" - if [[ ${THREAD_VERSION} == "1.2" && ${INTER_OP} == "1" ]]; then + if [[ ${THREAD_VERSION} != "1.1" && ${INTER_OP} == "1" ]]; then build_for_one_version 1.1 fi } @@ -201,8 +201,8 @@ do_unit() { do_unit_version "${THREAD_VERSION}" - if [[ ${THREAD_VERSION} == "1.2" && ${INTER_OP_BBR} == 1 ]]; then - do_unit_version "1.2-bbr" + if [[ ${THREAD_VERSION} != "1.1" && ${INTER_OP_BBR} == 1 ]]; then + do_unit_version "1.3-bbr" fi } @@ -220,8 +220,8 @@ do_cert() ;; esac - if [[ ${THREAD_VERSION} == "1.2" ]]; then - export top_builddir_1_2_bbr="${OT_BUILDDIR}/openthread-simulation-1.2-bbr" + if [[ ${THREAD_VERSION} != "1.1" ]]; then + export top_builddir_1_3_bbr="${OT_BUILDDIR}/openthread-simulation-1.3-bbr" if [[ ${INTER_OP} == "1" ]]; then export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1" fi @@ -238,8 +238,8 @@ do_cert_suite() { export top_builddir="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}" - if [[ ${THREAD_VERSION} == "1.2" ]]; then - export top_builddir_1_2_bbr="${OT_BUILDDIR}/openthread-simulation-1.2-bbr" + if [[ ${THREAD_VERSION} != "1.1" ]]; then + export top_builddir_1_3_bbr="${OT_BUILDDIR}/openthread-simulation-1.3-bbr" if [[ ${INTER_OP} == "1" ]]; then export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1" fi @@ -386,7 +386,7 @@ do_expect() test_patterns=(-name 'tun-*.exp') else test_patterns=(-name 'posix-*.exp' -o -name 'cli-*.exp') - if [[ ${THREAD_VERSION} == "1.2" ]]; then + if [[ ${THREAD_VERSION} != "1.1" ]]; then test_patterns+=(-o -name 'v1_2-*.exp') fi fi @@ -421,9 +421,9 @@ ENVIRONMENTS: VERBOSE 1 to build or test verbosely. The default is 0. VIRTUAL_TIME 1 for virtual time, otherwise real time. The default value is 0 when running expect tests, otherwise default value is 1. - THREAD_VERSION 1.1 for Thread 1.1 stack, 1.2 for Thread 1.2 stack. The default is 1.2. - INTER_OP 1 to build 1.1 together. Only works when THREAD_VERSION is 1.2. The default is 0. - INTER_OP_BBR 1 to build bbr version together. Only works when THREAD_VERSION is 1.2. The default is 1. + THREAD_VERSION 1.1 for Thread 1.1 stack, 1.3 for Thread 1.3 stack. The default is 1.3. + INTER_OP 1 to build 1.1 together. Only works when THREAD_VERSION is 1.3. The default is 0. + INTER_OP_BBR 1 to build bbr version together. Only works when THREAD_VERSION is 1.3. The default is 1. COMMANDS: clean Clean built files to prepare for new build. @@ -455,7 +455,7 @@ EXAMPLES: THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py - # Test Thread 1.2 with real time, use 'INTER_OP=1' when the case needs both versions. + # Test Thread 1.3 with real time, use 'INTER_OP=1' when the case needs both versions. VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_router_5_1_1.py INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert_suite tests/scripts/thread-cert/v1_2_* @@ -559,10 +559,10 @@ envsetup() export RADIO_DEVICE="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}/examples/apps/ncp/ot-rcp" export OT_CLI_PATH="${OT_BUILDDIR}/openthread-posix-${THREAD_VERSION}/src/posix/ot-cli" - if [[ ${THREAD_VERSION} == "1.2" ]]; then + if [[ ${THREAD_VERSION} != "1.1" ]]; then export RADIO_DEVICE_1_1="${OT_BUILDDIR}/openthread-simulation-1.1/examples/apps/ncp/ot-rcp" export OT_CLI_PATH_1_1="${OT_BUILDDIR}/openthread-posix-1.1/src/posix/ot-cli" - export OT_CLI_PATH_1_2_BBR="${OT_BUILDDIR}/openthread-posix-1.2-bbr/src/posix/ot-cli" + export OT_CLI_PATH_BBR="${OT_BUILDDIR}/openthread-posix-1.3-bbr/src/posix/ot-cli" fi fi @@ -606,7 +606,7 @@ main() fi [[ ${VIRTUAL_TIME} == 1 ]] && echo "Using virtual time" || echo "Using real time" - [[ ${THREAD_VERSION} == "1.2" ]] && echo "Using Thread 1.2 stack" || echo "Using Thread 1.1 stack" + [[ ${THREAD_VERSION} != "1.1" ]] && echo "Using Thread 1.3 stack" || echo "Using Thread 1.1 stack" while [[ $# != 0 ]]; do case "$1" in diff --git a/src/core/BUILD.gn b/src/core/BUILD.gn index 8b2b2c05e..5de07c157 100644 --- a/src/core/BUILD.gn +++ b/src/core/BUILD.gn @@ -37,6 +37,8 @@ if (openthread_enable_core_config_args) { defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1" ] } else if (openthread_config_thread_version == "1.2") { defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2" ] + } else if (openthread_config_thread_version == "1.3") { + defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_3" ] } else if (openthread_config_thread_version != "") { assert(false, "Unrecognized Thread version: ${openthread_config_thread_version}") diff --git a/tests/scripts/thread-cert/config.py b/tests/scripts/thread-cert/config.py index 7f10f27a6..a7f0e3b14 100755 --- a/tests/scripts/thread-cert/config.py +++ b/tests/scripts/thread-cert/config.py @@ -146,6 +146,7 @@ LEADER_NOTIFY_SED_BY_CHILD_UPDATE_REQUEST = True THREAD_VERSION_1_1 = 2 THREAD_VERSION_1_2 = 3 +THREAD_VERSION_1_3 = 4 PACKET_VERIFICATION_NONE = 0 PACKET_VERIFICATION_DEFAULT = 1 diff --git a/tests/scripts/thread-cert/node.py b/tests/scripts/thread-cert/node.py index ccc400ed2..d8b254c5f 100755 --- a/tests/scripts/thread-cert/node.py +++ b/tests/scripts/thread-cert/node.py @@ -441,7 +441,7 @@ class OtCli: cmd = './ot-cli-%s' % (mode) # For Thread 1.2 MTD node, use ot-cli-mtd build regardless of OT_CLI_PATH - if self.version == '1.2' and mode == 'mtd' and 'top_builddir' in os.environ: + if self.version != '1.1' and mode == 'mtd' and 'top_builddir' in os.environ: srcdir = os.environ['top_builddir'] cmd = '%s/examples/apps/cli/ot-cli-%s %d' % (srcdir, mode, nodeid) @@ -449,11 +449,11 @@ class OtCli: elif self.version == self.env_version: # Load Thread 1.2 BBR device when testing Thread 1.2 scenarios # which requires device with Backbone functionality. - if self.version == '1.2' and self.is_bbr: - if 'OT_CLI_PATH_1_2_BBR' in os.environ: - cmd = os.environ['OT_CLI_PATH_1_2_BBR'] - elif 'top_builddir_1_2_bbr' in os.environ: - srcdir = os.environ['top_builddir_1_2_bbr'] + if self.version != '1.1' and self.is_bbr: + if 'OT_CLI_PATH_BBR' in os.environ: + cmd = os.environ['OT_CLI_PATH_BBR'] + elif 'top_builddir_1_3_bbr' in os.environ: + srcdir = os.environ['top_builddir_1_3_bbr'] cmd = '%s/examples/apps/cli/ot-cli-%s' % (srcdir, mode) # Load Thread device of the testing environment version (may be 1.1 or 1.2) @@ -518,14 +518,14 @@ class OtCli: # Load Thread 1.2 BBR device when testing Thread 1.2 scenarios # which requires device with Backbone functionality. - if self.version == '1.2' and self.is_bbr: - if 'OT_NCP_PATH_1_2_BBR' in os.environ: + if self.version != '1.1' and self.is_bbr: + if 'OT_NCP_PATH_1_3_BBR' in os.environ: cmd = 'spinel-cli.py -p "%s%s" -n' % ( - os.environ['OT_NCP_PATH_1_2_BBR'], + os.environ['OT_NCP_PATH_1_3_BBR'], args, ) - elif 'top_builddir_1_2_bbr' in os.environ: - srcdir = os.environ['top_builddir_1_2_bbr'] + elif 'top_builddir_1_3_bbr' in os.environ: + srcdir = os.environ['top_builddir_1_3_bbr'] cmd = '%s/examples/apps/ncp/ot-ncp-%s' % (srcdir, mode) cmd = 'spinel-cli.py -p "%s%s" -n' % ( cmd, diff --git a/tests/scripts/thread-cert/pktverify/consts.py b/tests/scripts/thread-cert/pktverify/consts.py index 888e9e7e5..9afde5aa8 100644 --- a/tests/scripts/thread-cert/pktverify/consts.py +++ b/tests/scripts/thread-cert/pktverify/consts.py @@ -387,7 +387,9 @@ CSL_DEFAULT_TIMEOUT = 30 CSL_DEFAULT_CHANNEL = 12 # Thread Version TLV value +THREAD_VERSION_1_1 = 2 THREAD_VERSION_1_2 = 3 +THREAD_VERSION_1_3 = 4 # ICMPv6 Types ICMPV6_TYPE_DESTINATION_UNREACHABLE = 1 diff --git a/tests/scripts/thread-cert/pktverify/packet_verifier.py b/tests/scripts/thread-cert/pktverify/packet_verifier.py index c78ec7e0b..6873cf90c 100644 --- a/tests/scripts/thread-cert/pktverify/packet_verifier.py +++ b/tests/scripts/thread-cert/pktverify/packet_verifier.py @@ -176,7 +176,7 @@ class PacketVerifier(object): for i, topo in self.test_info.topology.items(): name = self.test_info.get_node_name(i) if topo['version']: - self._vars[name + '_VERSION'] = {'1.1': 2, '1.2': 3}[topo['version']] + self._vars[name + '_VERSION'] = {'1.1': 2, '1.2': 3, '1.3': 4}[topo['version']] def verify_attached(self, child: str, parent: str = None, child_type: str = 'FTD', pkts=None) -> VerifyResult: """ diff --git a/tests/scripts/thread-cert/run_cert_suite.py b/tests/scripts/thread-cert/run_cert_suite.py index 512ab815d..6af09d864 100755 --- a/tests/scripts/thread-cert/run_cert_suite.py +++ b/tests/scripts/thread-cert/run_cert_suite.py @@ -94,8 +94,8 @@ def cleanup_backbone_env(): def setup_backbone_env(): - if THREAD_VERSION != '1.2': - raise RuntimeError('Backbone tests only work with THREAD_VERSION=1.2') + if THREAD_VERSION == '1.1': + raise RuntimeError('Backbone tests do not work with THREAD_VERSION=1.1') if VIRTUAL_TIME: raise RuntimeError('Backbone tests only work with VIRTUAL_TIME=0') diff --git a/tests/scripts/thread-cert/thread_cert.py b/tests/scripts/thread-cert/thread_cert.py index fdbdacec4..369ed5075 100755 --- a/tests/scripts/thread-cert/thread_cert.py +++ b/tests/scripts/thread-cert/thread_cert.py @@ -482,15 +482,20 @@ class TestCase(NcpSupportMixin, unittest.TestCase): params = params or {} if params.get('is_bbr') or params.get('is_otbr'): - # BBRs must use thread version 1.2 - assert params.get('version', '1.2') == '1.2', params - params['version'] = '1.2' + # BBRs must not use thread version 1.1 + version = params.get('version', '1.3') + assert version != '1.1', params + params['version'] = version params.setdefault('bbr_registration_jitter', config.DEFAULT_BBR_REGISTRATION_JITTER) elif params.get('is_host'): # Hosts must not specify thread version assert params.get('version', '') == '', params params['version'] = '' + # use 1.3 node for 1.2 tests + if params.get('version') == '1.2': + params['version'] = '1.3' + is_ftd = (not params.get('is_mtd') and not params.get('is_host')) effective_params = DEFAULT_PARAMS.copy() diff --git a/tests/scripts/thread-cert/v1_2_LowPower_6_1_07_PreferringARouterOverAReed.py b/tests/scripts/thread-cert/v1_2_LowPower_6_1_07_PreferringARouterOverAReed.py index ca468e425..c5114f720 100755 --- a/tests/scripts/thread-cert/v1_2_LowPower_6_1_07_PreferringARouterOverAReed.py +++ b/tests/scripts/thread-cert/v1_2_LowPower_6_1_07_PreferringARouterOverAReed.py @@ -118,7 +118,7 @@ class LowPower_6_1_07_PreferringARouterOverAReed_Base(thread_cert.TestCase): .filter_mle_cmd(consts.MLE_PARENT_REQUEST) \ .filter_mle_has_tlv(TlvType.CHALLENGE, TlvType.MODE) \ .filter(lambda p: p.mle.tlv.scan_mask.r == 1 and p.mle.tlv.scan_mask.e == 0) \ - .filter(lambda p: p.mle.tlv.version == 3) \ + .filter(lambda p: p.mle.tlv.version >= config.THREAD_VERSION_1_2) \ .filter(lambda p: p.ipv6.hlim == 255) \ .filter_LLARMA() \ .must_next() @@ -127,7 +127,7 @@ class LowPower_6_1_07_PreferringARouterOverAReed_Base(thread_cert.TestCase): pkts.filter_wpan_src64(ROUTER_1) \ .filter_wpan_dst64(DUT) \ .filter_mle_cmd(consts.MLE_PARENT_RESPONSE) \ - .filter(lambda p: p.mle.tlv.version == 2) \ + .filter(lambda p: p.mle.tlv.version == config.THREAD_VERSION_1_1) \ .must_next() # Step 5 - DUT sends another multicast MLE Parent Request to the all-routers multicast with the Scan Mask TLV @@ -136,7 +136,7 @@ class LowPower_6_1_07_PreferringARouterOverAReed_Base(thread_cert.TestCase): .filter_mle_cmd(consts.MLE_PARENT_REQUEST) \ .filter_mle_has_tlv(TlvType.CHALLENGE, TlvType.MODE) \ .filter(lambda p: p.mle.tlv.scan_mask.r == 1 and p.mle.tlv.scan_mask.e == 1) \ - .filter(lambda p: p.mle.tlv.version == consts.THREAD_VERSION_1_2) \ + .filter(lambda p: p.mle.tlv.version >= consts.THREAD_VERSION_1_2) \ .filter(lambda p: p.ipv6.hlim == 255) \ .filter_LLARMA() \ .must_next() @@ -152,7 +152,7 @@ class LowPower_6_1_07_PreferringARouterOverAReed_Base(thread_cert.TestCase): .filter_mle_cmd(consts.MLE_CHILD_ID_REQUEST) \ .filter_wpan_dst64(ROUTER_1) \ .filter_mle_has_tlv(TlvType.ADDRESS_REGISTRATION, TlvType.LINK_LAYER_FRAME_COUNTER, TlvType.MODE, TlvType.RESPONSE, TlvType.TIMEOUT, TlvType.TLV_REQUEST) \ - .filter(lambda p: p.mle.tlv.version == consts.THREAD_VERSION_1_2) \ + .filter(lambda p: p.mle.tlv.version >= consts.THREAD_VERSION_1_2) \ .must_next() diff --git a/tests/scripts/thread-cert/v1_2_router_5_1_1.py b/tests/scripts/thread-cert/v1_2_router_5_1_1.py index 39e0c357e..8af0ae5d5 100755 --- a/tests/scripts/thread-cert/v1_2_router_5_1_1.py +++ b/tests/scripts/thread-cert/v1_2_router_5_1_1.py @@ -79,7 +79,7 @@ class Router_5_1_01(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.Challenge) msg.assertMleMessageContainsTlv(mle.ScanMask) msg.assertMleMessageContainsTlv(mle.Version) - assert msg.get_mle_message_tlv(mle.Version).version == 3 + assert msg.get_mle_message_tlv(mle.Version).version >= config.THREAD_VERSION_1_2 scan_mask_tlv = msg.get_mle_message_tlv(mle.ScanMask) self.assertEqual(1, scan_mask_tlv.router) @@ -97,7 +97,7 @@ class Router_5_1_01(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.LinkMargin) msg.assertMleMessageContainsTlv(mle.Connectivity) msg.assertMleMessageContainsTlv(mle.Version) - assert msg.get_mle_message_tlv(mle.Version).version == 3 + assert msg.get_mle_message_tlv(mle.Version).version >= config.THREAD_VERSION_1_2 # 4 - Router_1 receives the MLE Parent Response and sends a Child ID Request msg = router_messages.next_mle_message(mle.CommandType.CHILD_ID_REQUEST) @@ -110,7 +110,7 @@ class Router_5_1_01(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.Version) msg.assertMleMessageContainsTlv(mle.TlvRequest) msg.assertMleMessageDoesNotContainTlv(mle.AddressRegistration) - assert msg.get_mle_message_tlv(mle.Version).version == 3 + assert msg.get_mle_message_tlv(mle.Version).version >= config.THREAD_VERSION_1_2 # 5 - Leader responds with a Child ID Response msg = leader_messages.next_mle_message(mle.CommandType.CHILD_ID_RESPONSE) diff --git a/tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py b/tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py index 04d55d252..a104a51ac 100755 --- a/tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py +++ b/tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py @@ -88,7 +88,7 @@ class SED_EnhancedKeepAlive(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.Challenge) msg.assertMleMessageContainsTlv(mle.ScanMask) msg.assertMleMessageContainsTlv(mle.Version) - self.assertEqual(msg.get_mle_message_tlv(mle.Version).version, 3) + self.assertGreaterEqual(msg.get_mle_message_tlv(mle.Version).version, config.THREAD_VERSION_1_2) scan_mask_tlv = msg.get_mle_message_tlv(mle.ScanMask) self.assertEqual(1, scan_mask_tlv.router) @@ -106,7 +106,7 @@ class SED_EnhancedKeepAlive(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.LinkMargin) msg.assertMleMessageContainsTlv(mle.Connectivity) msg.assertMleMessageContainsTlv(mle.Version) - self.assertEqual(msg.get_mle_message_tlv(mle.Version).version, 3) + self.assertGreaterEqual(msg.get_mle_message_tlv(mle.Version).version, config.THREAD_VERSION_1_2) # 4 - SED_1 receives the MLE Parent Response and sends a Child ID Request msg = sed_messages.next_mle_message(mle.CommandType.CHILD_ID_REQUEST) @@ -118,7 +118,7 @@ class SED_EnhancedKeepAlive(thread_cert.TestCase): msg.assertMleMessageContainsTlv(mle.Timeout) msg.assertMleMessageContainsTlv(mle.Version) msg.assertMleMessageContainsTlv(mle.TlvRequest) - self.assertEqual(msg.get_mle_message_tlv(mle.Version).version, 3) + self.assertGreaterEqual(msg.get_mle_message_tlv(mle.Version).version, config.THREAD_VERSION_1_2) # 5 - Leader responds with a Child ID Response msg = leader_messages.next_mle_message(mle.CommandType.CHILD_ID_RESPONSE)