Lines Matching +full:default +full:- +full:cli
33 set -euo pipefail
35 OT_BUILDDIR="${OT_BUILDDIR:-${PWD}/build}"
53 OT_NODE_TYPE="${OT_NODE_TYPE:-cli}"
56 OT_NATIVE_IP="${OT_NATIVE_IP:-0}"
59 THREAD_VERSION="${THREAD_VERSION:-1.3}"
62 INTER_OP="${INTER_OP:-0}"
65 VERBOSE="${VERBOSE:-0}"
68 BORDER_ROUTING="${BORDER_ROUTING:-1}"
71 NAT64="${NAT64:-0}"
74 NAT64_SERVICE="${NAT64_SERVICE:-openthread}"
77 INTER_OP_BBR="${INTER_OP_BBR:-0}"
80 OT_COREDUMP_DIR="${PWD}/ot-core-dump"
83 FULL_LOGS=${FULL_LOGS:-0}
86 TREL=${TREL:-0}
89 LOCAL_OTBR_DIR=${LOCAL_OTBR_DIR:-""}
96 "-DBUILD_TESTING=ON"
97 "-DOT_ANYCAST_LOCATOR=ON"
98 "-DOT_DNS_CLIENT=ON"
99 "-DOT_DNS_DSO=ON"
100 "-DOT_DNSSD_SERVER=ON"
101 "-DOT_ECDSA=ON"
102 "-DOT_EXTERNAL_HEAP=ON"
103 "-DOT_HISTORY_TRACKER=ON"
104 "-DOT_MESSAGE_USE_HEAP=OFF"
105 "-DOT_NETDATA_PUBLISHER=ON"
106 "-DOT_PING_SENDER=ON"
107 "-DOT_PLATFORM_LOG_CRASH_DUMP=ON"
108 "-DOT_REFERENCE_DEVICE=ON"
109 "-DOT_SERVICE=ON"
110 "-DOT_SRP_CLIENT=ON"
111 "-DOT_SRP_SERVER=ON"
112 "-DOT_UPTIME=ON"
113 "-DOT_THREAD_VERSION=${version}"
117 options+=("-DOT_FULL_LOGS=ON")
121 options+=("-DOT_DUA=ON")
122 options+=("-DOT_MLR=ON")
126 options+=("-DOT_SIMULATION_VIRTUAL_TIME=ON")
130 options+=("-DOT_CSL_RECEIVER=ON")
131 options+=("-DOT_LINK_METRICS_INITIATOR=ON")
132 options+=("-DOT_LINK_METRICS_SUBJECT=ON")
133 options+=("-DOT_LINK_METRICS_MANAGER=ON")
136 if [[ ${OT_NODE_TYPE} == cli* ]]; then
137 # Only enable OT_PLATFORM_BOOTLOADER_MODE when testing cli.
138 … # This is intended to test that the "reset bootloader" CLI command returns a "NotCapable" error
142 …# causing the ot-cli POSIX app to send the reset to simulation RCP successfully instead of p…
144 options+=("-DOT_PLATFORM_BOOTLOADER_MODE=ON")
151 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}" "${OT_SRCDIR}"/script/cmake-b…
154 …ARGET=ot-rcp OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}" "${OT_SRCDIR}"/s…
159 options+=("-DOT_BACKBONE_ROUTER=ON")
161 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}-bbr" "${OT_SRCDIR}"/script/cma…
164 …GET=ot-rcp OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-simulation-${version}-bbr" "${OT_SRCDIR}"…
174 "-DBUILD_TESTING=ON"
175 "-DOT_MESSAGE_USE_HEAP=ON"
176 "-DOT_PLATFORM_BOOTLOADER_MODE=ON"
177 "-DOT_PLATFORM_LOG_CRASH_DUMP=ON"
178 "-DOT_THREAD_VERSION=${version}"
182 options+=("-DOT_DUA=ON")
183 options+=("-DOT_MLR=ON")
184 options+=("-DOT_LINK_METRICS_INITIATOR=ON")
185 options+=("-DOT_LINK_METRICS_SUBJECT=ON")
186 options+=("-DOT_LINK_METRICS_MANAGER=ON")
190 options+=("-DOT_FULL_LOGS=ON")
194 options+=("-DOT_POSIX_VIRTUAL_TIME=ON")
198 options+=("-DOT_PLATFORM_UDP=ON" "-DOT_PLATFORM_NETIF=ON")
205 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-posix-${version}" "${OT_SRCDIR}"/script/cmake-build …
209 options+=("-DOT_BACKBONE_ROUTER=ON")
211 …OT_CMAKE_BUILD_DIR="${OT_BUILDDIR}/openthread-posix-${version}-bbr" "${OT_SRCDIR}"/script/cmake-bu…
237 ./script/gcda-tool clean
238 rm -rfv "${OT_BUILDDIR}" || sudo rm -rfv "${OT_BUILDDIR}"
244 local builddir="${OT_BUILDDIR}/openthread-simulation-${version}"
246 if [[ ! -d ${builddir} ]]; then
262 do_unit_version "1.3-bbr"
268 export top_builddir="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}"
272 rcp | rcp-cli | cli)
275 rcp-ncp | ncp)
276 export NODE_TYPE=ncp-sim
281 export top_builddir_1_3_bbr="${OT_BUILDDIR}/openthread-simulation-1.3-bbr"
283 export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1"
287 export PYTHONPATH=tests/scripts/thread-cert
289 [[ ! -d tmp ]] || rm -rvf tmp
296 export top_builddir="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}"
300 export top_builddir_1_3_bbr="${OT_BUILDDIR}/openthread-simulation-1.3-bbr"
302 export top_builddir_1_1="${OT_BUILDDIR}/openthread-simulation-1.1"
306 export PYTHONPATH=tests/scripts/thread-cert
311 mkdir -p ot_testing
312 …./tests/scripts/thread-cert/run_cert_suite.py --run-directory ot_testing --multiply "${MULTIPLY:-1…
318 echo "Downloading thread-wireshark from https://github.com/openthread/wireshark/releases ..."
319 …rl=https://github.com/openthread/wireshark/releases/download/ot-pktverify-20200727/thread-wireshar…
320 local save_file=/tmp/thread-wireshark.tar.gz
322 rm -rf /tmp/thread-wireshark || true
323 rm -rf "${save_file}" || true
324 curl -L "${download_url}" -o "${save_file}"
325 tar -C /tmp -xvzf "${save_file}"
327 LD_LIBRARY_PATH=/tmp/thread-wireshark /tmp/thread-wireshark/tshark -v
328 LD_LIBRARY_PATH=/tmp/thread-wireshark /tmp/thread-wireshark/dumpcap -v
329 rm -rf "${save_file}"
338 "-DOT_ANYCAST_LOCATOR=ON"
339 "-DOT_COVERAGE=ON"
340 "-DOT_DNS_CLIENT=ON"
341 "-DOT_DUA=ON"
342 "-DOT_MLR=ON"
343 "-DOT_NETDATA_PUBLISHER=ON"
344 "-DOT_SLAAC=ON"
345 "-DOT_SRP_CLIENT=ON"
346 "-DOT_FULL_LOGS=ON"
347 "-DOT_UPTIME=ON"
348 "-DOTBR_DNS_UPSTREAM_QUERY=ON"
349 "-DOTBR_DUA_ROUTING=ON"
362 "MDNS=${OTBR_MDNS:-mDNSResponder}"
363 "FIREWALL=${FIREWALL:-1}"
368 … otbr_options+=("-DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_DNSSD_SERVER_BIND_UNSPECIFIED_NETIF=1'")
372 otbr_options+=("-DOTBR_TREL=ON")
374 otbr_options+=("-DOTBR_TREL=OFF")
377 local otbr_docker_image=${OTBR_DOCKER_IMAGE:-otbr-ot12-backbone-ci}
381 docker_build_args+=("--build-arg" "$arg")
384 otbrdir=$(mktemp -d -t otbr_XXXXXX)
388 if [[ -z ${LOCAL_OTBR_DIR} ]]; then
389 … ./script/git-tool clone https://github.com/openthread/ot-br-posix.git --depth 1 "${otbrdir}"
391 rsync -r \
392 --exclude=third_party/openthread/repo \
393 --exclude=.git \
394 --exclude=build \
400 rm -rf third_party/openthread/repo
401 rsync -r \
402 --exclude=build \
403 --exclude=ot_testing \
404 --exclude=__pycache__ \
407 rm -rf .git
409 docker build -t "${otbr_docker_image}" -f etc/docker/Dockerfile . \
411 --build-arg OTBR_OPTIONS="${otbr_options[*]}"
414 rm -rf "${otbrdir}"
419 ./tests/scripts/thread-cert/pktverify/verify.py "$1"
427 echo -e "\n${OT_COLOR_PASS}EXEC${OT_COLOR_NONE} ${script}"
428 sudo killall ot-rcp || true
429 sudo killall ot-cli || true
430 sudo killall ot-cli-ftd || true
431 sudo killall ot-cli-mtd || true
432 sudo rm -rf tmp
436 sudo -E expect -df "${script}" 2>"${log_file}"
438 expect -df "${script}" 2>"${log_file}"
443 …# The exit status 77 for skipping is inherited from automake's test driver for script-based testsu…
445 echo -e "\n${OT_COLOR_SKIP}SKIP${OT_COLOR_NONE} ${script}"
448 echo -e "\n${OT_COLOR_FAIL}FAIL${OT_COLOR_NONE} ${script}"
453 echo -e "\n${OT_COLOR_PASS}PASS${OT_COLOR_NONE} ${script}"
466 test_patterns=(-name 'tun-*.exp')
468 test_patterns=(-name 'posix-*.exp' -o -name 'cli-*.exp')
470 test_patterns+=(-o -name 'v1_2-*.exp')
474 test_patterns=(-name 'cli-*.exp' -o -name 'simulation-*.exp' -o -name 'cli_non_rcp-*.exp')
481 export -f ot_exec_expect_script
483 …s/scripts/expect -type f -perm "$([[ $OSTYPE == darwin* ]] && echo '+' || echo '/')"111 \( "${test…
494 OT_NODE_TYPE 'cli' for CLI simulation, 'ncp' for NCP simulation.
495 'rcp' or 'rcp-cli' for CLI on POSIX platform.
496 'rcp-ncp' for NCP on POSIX platform.
497 The default is 'cli'.
498 OT_NATIVE_IP 1 to enable platform UDP and netif on POSIX platform. The default is 0.
499 …OT_BUILDDIR The output directory for cmake build. By default the directory is './build'. For e…
501 VERBOSE 1 to build or test verbosely. The default is 0.
502 …VIRTUAL_TIME 1 for virtual time, otherwise real time. The default value is 0 when running expec…
503 otherwise default value is 1.
504 THREAD_VERSION 1.1 for Thread 1.1 stack, 1.3 for Thread 1.3 stack. The default is 1.3.
505 … INTER_OP 1 to build 1.1 together. Only works when THREAD_VERSION is 1.3. The default is 0.
506 …OP_BBR 1 to build bbr version together. Only works when THREAD_VERSION is 1.3. The default is 1.
511 …cert Run a single thread-cert test. ENVIRONMENTS should be the same as those given to b…
512 …cert_suite Run a batch of thread-cert tests and summarize the test results. Only echo logs fo…
518 # Test CLI with default settings
519 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
520 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
522 # Test NCP with default settings
523 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
524 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
526 # Test CLI with radio only
527 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
528 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
530 # Test CLI with real time
531 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
532 VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeout.py
534 # Test Thread 1.1 CLI with real time
535 …THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/Cert_5_1_01_Router…
536 …THREAD_VERSION=1.1 VIRTUAL_TIME=0 $0 cert tests/scripts/thread-cert/Cert_5_1_02_ChildAddressTimeou…
539 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_test_enhanced_keep_alive.py
540 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert tests/scripts/thread-cert/v1_2_router_5_1_1.py
541 INTER_OP=1 VIRTUAL_TIME=0 $0 clean build cert_suite tests/scripts/thread-cert/v1_2_*
544 $0 clean build expect tests/scripts/expect/cli-log-level.exp
555 echo "$OT_COREDUMP_DIR/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern
556 rm -rf "$OT_COREDUMP_DIR"
557 mkdir -p "$OT_COREDUMP_DIR"
562 mkdir -p "$OT_COREDUMP_DIR/so-lib"
563 cp /lib/x86_64-linux-gnu/libgcc_s.so.1 "$OT_COREDUMP_DIR/so-lib"
564 cp /lib/x86_64-linux-gnu/libc.so.6 "$OT_COREDUMP_DIR/so-lib"
565 cp /lib64/ld-linux-x86-64.so.2 "$OT_COREDUMP_DIR/so-lib"
570 shopt -s nullglob
573 declare -A bin_list=([dummy]='')
575 bin=$(file "$f" | grep -E -o "execfn: '(.*')," | sed -r "s/execfn: '(.*)',/\1/")
583 if [[ $key =~ openthread-(simulation|posix)-([0-9]\.[0-9]) ]]; then
584 … postfix="-$(echo "$key" | sed -r "s/.*openthread-(simulation|posix)-([0-9]\.[0-9]).*/\2/")"
592 [[ ${#bin_list[@]} -gt 1 ]] && (
600 mkdir -p tmp/
602 rm -f tmp/coverage.lcov
605 llvm_gcov="$(mktemp -d)/llvm-gcov"
607 echo 'exec llvm-cov gcov "$@"' >>"$llvm_gcov"
609 lcov --gcov-tool "$llvm_gcov" --directory . --capture --output-file tmp/coverage.info
611 ./script/gcda-tool collect
612 ./script/gcda-tool install
614 lcov --directory . --capture --output-file tmp/coverage.info
616 lcov --list tmp/coverage.info
617 lcov --extract tmp/coverage.info "$PWD/src/core/common/message.cpp" | c++filt
622 ls -R coverage/
624 readarray -d '' files < <(find coverage/ -type f -name 'coverage*.info' -print0)
628 args+=('-a')
631 lcov "${args[@]}" -o final.info
639 …export RADIO_DEVICE="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}/examples/apps/ncp/ot-r…
640 export OT_CLI_PATH="${OT_BUILDDIR}/openthread-posix-${THREAD_VERSION}/src/posix/ot-cli"
643 … export RADIO_DEVICE_1_1="${OT_BUILDDIR}/openthread-simulation-1.1/examples/apps/ncp/ot-rcp"
644 export OT_CLI_PATH_1_1="${OT_BUILDDIR}/openthread-posix-1.1/src/posix/ot-cli"
645 export OT_CLI_PATH_BBR="${OT_BUILDDIR}/openthread-posix-1.3-bbr/src/posix/ot-cli"
649 export OT_SIMULATION_APPS="${OT_BUILDDIR}/openthread-simulation-${THREAD_VERSION}/examples/apps"
650 export OT_POSIX_APPS="${OT_BUILDDIR}/openthread-posix-${THREAD_VERSION}/src/posix"
670 export -n VERBOSE
674 read -r -a ot_extra_options <<<"${OT_OPTIONS}"
684 if [[ -z ${1-} ]]; then
747 echo -e "${OT_COLOR_FAIL}Warning:${OT_COLOR_NONE} Ignoring: '$1'"