From 16ebac8a179d4f7ffa51585b892b2f3027f79e5e Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 12 Mar 2021 16:33:13 -0800 Subject: [PATCH] [build] set Thread 1.2 as default version (#6281) --- .github/workflows/posix.yml | 3 +++ .../{simulation.yml => simulation-1.1.yml} | 18 +++++++++++++++--- CMakeLists.txt | 2 +- examples/common-switches.mk | 2 +- script/check-arm-build-autotools | 2 ++ script/check-arm-build-cmake | 7 ++++++- script/test | 14 +++++++++----- src/core/openthread-core-config.h | 2 +- 8 files changed, 38 insertions(+), 12 deletions(-) rename .github/workflows/{simulation.yml => simulation-1.1.yml} (98%) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index d31264520..0c64cd932 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -47,6 +47,7 @@ jobs: CXXFLAGS: -DCLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER=1 -DOPENTHREAD_CONFIG_MLE_MAX_CHILDREN=15 -DOPENTHREAD_CONFIG_MAC_SCAN_DURATION=500 CC: clang CXX: clang++ + THREAD_VERSION: 1.1 steps: - uses: actions/checkout@v2 - name: Bootstrap @@ -142,6 +143,7 @@ jobs: PYTHONUNBUFFERED: 1 READLINE: readline REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 VIRTUAL_TIME_UART: 1 steps: @@ -182,6 +184,7 @@ jobs: PYTHONUNBUFFERED: 1 READLINE: readline REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 VIRTUAL_TIME_UART: 1 steps: diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation-1.1.yml similarity index 98% rename from .github/workflows/simulation.yml rename to .github/workflows/simulation-1.1.yml index 1807198d4..08958c3fd 100644 --- a/.github/workflows/simulation.yml +++ b/.github/workflows/simulation-1.1.yml @@ -26,7 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. # -name: Simulation +name: Simulation 1.1 on: [push, pull_request] @@ -46,6 +46,7 @@ jobs: CC: clang CXX: clang++ REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 steps: - uses: actions/checkout@v2 @@ -72,6 +73,7 @@ jobs: LDFLAGS: -m32 COVERAGE: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 VIRTUAL_TIME_UART: 1 MAX_NETWORK_SIZE: 999 @@ -120,9 +122,10 @@ jobs: packet-verification: runs-on: ubuntu-20.04 env: - REFERENCE_DEVICE: 1 - VIRTUAL_TIME: 1 PACKET_VERIFICATION: 1 + REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 + VIRTUAL_TIME: 1 steps: - uses: actions/checkout@v2 with: @@ -167,6 +170,7 @@ jobs: LDFLAGS: -m32 COVERAGE: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 steps: - uses: actions/checkout@v2 @@ -208,6 +212,7 @@ jobs: LDFLAGS: -m32 COVERAGE: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 USE_MTD: 1 VIRTUAL_TIME: 1 MESSAGE_USE_HEAP: ${{ matrix.message_use_heap }} @@ -248,6 +253,7 @@ jobs: LDFLAGS: -m32 COVERAGE: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 TIME_SYNC: 1 VIRTUAL_TIME: 1 steps: @@ -284,6 +290,7 @@ jobs: env: CFLAGS: -DCLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER=1 -DOPENTHREAD_CONFIG_MLE_MAX_CHILDREN=15 CXXFLAGS: -DCLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER=1 -DOPENTHREAD_CONFIG_MLE_MAX_CHILDREN=15 + THREAD_VERSION: 1.1 steps: - uses: actions/checkout@v2 - name: Bootstrap @@ -316,6 +323,8 @@ jobs: external-commissioner: runs-on: ubuntu-20.04 + env: + THREAD_VERSION: 1.1 steps: - uses: actions/checkout@v2 with: @@ -361,6 +370,7 @@ jobs: COVERAGE: 1 MULTIPLE_INSTANCE: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 steps: - uses: actions/checkout@v2 @@ -400,6 +410,7 @@ jobs: NODE_TYPE: ncp-sim PYTHONUNBUFFERED: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 steps: - uses: actions/checkout@v2 @@ -438,6 +449,7 @@ jobs: NODE_TYPE: ncp-sim PYTHONUNBUFFERED: 1 REFERENCE_DEVICE: 1 + THREAD_VERSION: 1.1 VIRTUAL_TIME: 1 CC: clang CXX: clang++ diff --git a/CMakeLists.txt b/CMakeLists.txt index e676babb3..548dc8c8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,7 @@ target_compile_definitions(ot-config INTERFACE "PACKAGE_VERSION=\"${OT_VERSION}\"" ) -set(OT_THREAD_VERSION "1.1" CACHE STRING "Thread version chosen by the user at configure time") +set(OT_THREAD_VERSION "1.2" CACHE STRING "Thread version chosen by the user at configure time") set_property(CACHE OT_THREAD_VERSION PROPERTY STRINGS "1.1" "1.2") if(${OT_THREAD_VERSION} EQUAL "1.1") target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1") diff --git a/examples/common-switches.mk b/examples/common-switches.mk index b4b549f52..2e8e94e61 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -80,7 +80,7 @@ SLAAC ?= 1 SNTP_CLIENT ?= 0 SRP_CLIENT ?= 0 SRP_SERVER ?= 0 -THREAD_VERSION ?= 1.1 +THREAD_VERSION ?= 1.2 TIME_SYNC ?= 0 TREL ?= 0 UDP_FORWARD ?= 0 diff --git a/script/check-arm-build-autotools b/script/check-arm-build-autotools index a741f4c96..2187b33b9 100755 --- a/script/check-arm-build-autotools +++ b/script/check-arm-build-autotools @@ -58,6 +58,8 @@ build_cc2538() "DNS_CLIENT=1" "JOINER=1" "SLAAC=1" + # cc2538 does not have enough resources to support Thread 1.2 + "THREAD_VERSION=1.1" ) reset_source diff --git a/script/check-arm-build-cmake b/script/check-arm-build-cmake index eec305977..17a8b65e9 100755 --- a/script/check-arm-build-cmake +++ b/script/check-arm-build-cmake @@ -56,8 +56,13 @@ build_cc1352() build_cc2538() { + local options=( + # cc2538 does not have enough resources to support Thread 1.2 + "-DOT_THREAD_VERSION=1.1" + ) + reset_source - "$(dirname "$0")"/cmake-build cc2538 "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" + "$(dirname "$0")"/cmake-build cc2538 "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" "${options[@]}" } build_cc2650() diff --git a/script/test b/script/test index 9bde5bca9..a8118bdbf 100755 --- a/script/test +++ b/script/test @@ -42,7 +42,7 @@ readonly 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.1}" +readonly THREAD_VERSION="${THREAD_VERSION:-1.2}" readonly INTER_OP="${INTER_OP:-0}" readonly VERBOSE="${VERBOSE:-0}" readonly BORDER_ROUTING="${BORDER_ROUTING:-1}" @@ -371,7 +371,7 @@ 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.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. @@ -401,10 +401,14 @@ EXAMPLES: VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py + # Test Thread 1.1 CLI with real time + 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. - THREAD_VERSION=1.2 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py - THREAD_VERSION=1.2 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_router_5_1_1.py - THREAD_VERSION=1.2 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert_suite tests/scripts/thread-cert/v1_2_* + 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_* # Run a single expect test $0 clean build expect tests/scripts/expect/cli-log-level.exp diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index acac4a622..dabb42f31 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -47,7 +47,7 @@ #endif #ifndef OPENTHREAD_CONFIG_THREAD_VERSION -#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_1 +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_2 #endif #include "config/openthread-core-default-config.h"