Skip to content

Commit

Permalink
Merge branch 'main' into semi_pdref
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsong-cnyn authored Sep 26, 2024
2 parents 94e7b6e + ff7227e commit 33f7bef
Show file tree
Hide file tree
Showing 140 changed files with 6,766 additions and 1,627 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/border_router.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
name: ${{ matrix.name }}
env:
PACKET_VERIFICATION: ${{ matrix.packet_verification }}
THREAD_VERSION: 1.3
THREAD_VERSION: 1.4
VIRTUAL_TIME: 0
PYTHONUNBUFFERED: 1
REFERENCE_DEVICE: 1
Expand Down Expand Up @@ -173,15 +173,15 @@ jobs:
run: |
export CI_ENV="$(bash <(curl -s https://codecov.io/env)) -e GITHUB_ACTIONS -e OTBR_COVERAGE"
echo "CI_ENV=${CI_ENV}"
(cd third_party/openthread/repo && sudo -E ./script/test cert_suite ${{ matrix.cert_scripts }} || (sudo chmod a+r *.log *.json *.pcap && false))
(cd third_party/openthread/repo && sudo -E ./script/test cert_suite ${{ matrix.cert_scripts }} || (sudo chmod a+r ot_testing/* && false))
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.check_cache_result.outputs.cache-hit != 'true' }}
with:
name: thread-1-3-backbone-results
name: thread-1-4-backbone-results
path: |
third_party/openthread/repo/*.pcap
third_party/openthread/repo/*.json
third_party/openthread/repo/*.log
third_party/openthread/repo/ot_testing/*.pcap
third_party/openthread/repo/ot_testing/*.json
third_party/openthread/repo/ot_testing/*.log
- name: Codecov
if: ${{ success() && steps.check_cache_result.outputs.cache-hit != 'true' }}
uses: codecov/codecov-action@v4
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ concurrency:

jobs:
build-check:
runs-on: macos-12
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -54,14 +54,13 @@ jobs:
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*
brew update
brew reinstall boost cmake cpputest dbus jsoncpp ninja protobuf@21 pkg-config
brew upgrade node
brew reinstall boost cmake dbus jsoncpp ninja protobuf@21 pkg-config
- name: Build
run: |
OTBR_OPTIONS="-DOTBR_BORDER_AGENT=OFF \
-DOTBR_MDNS=OFF \
-DOTBR_ADVERTISING_PROXY=OFF \
-DOTBR_DISCOVERY_PROXY=OFF \
-DOTBR_SRP_ADVERTISING_PROXY=OFF \
-DOTBR_DNSSD_DISCOVERY_PROXY=OFF \
-DOTBR_TREL=OFF \
-DOT_FIREWALL=OFF \
-DOTBR_DBUS=OFF" ./script/test build
1 change: 1 addition & 0 deletions .github/workflows/meshcop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
- name: Build
env:
OTBR_MDNS: ${{ matrix.mdns }}
OTBR_COVERAGE: 1
run: |
script/bootstrap
script/test build
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/ncp_mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Copyright (c) 2024, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

name: NcpMode

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.repository == 'openthread/ot-br-posix' && github.run_id) || github.ref }}
cancel-in-progress: true

jobs:

ncp_mode:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mdns: ["mDNSResponder", "avahi"]
env:
BUILD_TARGET: check
OTBR_MDNS: ${{ matrix.mdns }}
OTBR_COVERAGE: 1
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Bootstrap
run: tests/scripts/bootstrap.sh
- name: Build
run: |
OTBR_BUILD_DIR="./build/temp" script/cmake-build -DCMAKE_BUILD_TYPE=Debug -DOT_THREAD_VERSION=1.4 -DOTBR_COVERAGE=ON -DOTBR_DBUS=ON -DOTBR_FEATURE_FLAGS=ON -DOTBR_TELEMETRY_DATA_API=ON -DOTBR_WEB=ON -DOTBR_UNSECURE_JOIN=ON -DOTBR_TREL=ON
- name: Run
run: OTBR_VERBOSE=1 OTBR_TOP_BUILDDIR="./build/temp" script/test ncp_mode
- name: Codecov
uses: codecov/codecov-action@v4
1 change: 0 additions & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ extraction:
- libboost-dev
- libboost-filesystem-dev
- libboost-system-dev
- libcpputest-dev
- libdbus-1-dev
- libjsoncpp-dev
- ninja-build
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)

if(BUILD_TESTING)
pkg_check_modules(CPPUTEST cpputest REQUIRED)
add_subdirectory(tests)
endif()

Expand Down
7 changes: 1 addition & 6 deletions etc/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ ENV OTBR_DOCKER_DEPS git ca-certificates

# Required and installed during build (script/bootstrap), could be removed
ENV OTBR_BUILD_DEPS apt-utils build-essential psmisc ninja-build cmake wget ca-certificates \
libreadline-dev libncurses-dev libcpputest-dev libdbus-1-dev libavahi-common-dev \
libreadline-dev libncurses-dev libdbus-1-dev libavahi-common-dev \
libavahi-client-dev libboost-dev libboost-filesystem-dev libboost-system-dev \
libnetfilter-queue-dev

# Required for OpenThread Backbone CI
ENV OTBR_OT_BACKBONE_CI_DEPS curl lcov wget build-essential python3-dbus python3-zeroconf socat

# Required and installed during build (script/bootstrap) when RELEASE=1, could be removed
ENV OTBR_NORELEASE_DEPS \
cpputest-dev

RUN apt-get update \
&& apt-get install --no-install-recommends -y $OTBR_DOCKER_REQS $OTBR_DOCKER_DEPS \
&& ([ "${OT_BACKBONE_CI}" != "1" ] || apt-get install --no-install-recommends -y $OTBR_OT_BACKBONE_CI_DEPS) \
Expand All @@ -107,7 +103,6 @@ RUN ([ "${DNS64}" = "0" ] || chmod 644 /etc/bind/named.conf.options) \
&& mv /tmp/etc . \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_DOCKER_DEPS \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_BUILD_DEPS \
&& ([ "${RELEASE}" = 1 ] || apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false "$OTBR_NORELEASE_DEPS";) \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
))
Expand Down
12 changes: 10 additions & 2 deletions etc/docker/docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ function parse_args()
shift
shift
;;
--debug-level)
DEBUG_LEVEL=$2
shift
shift
;;
*)
shift
;;
Expand All @@ -81,12 +86,15 @@ parse_args "$@"
[ -n "$TUN_INTERFACE_NAME" ] || TUN_INTERFACE_NAME="wpan0"
[ -n "$BACKBONE_INTERFACE" ] || BACKBONE_INTERFACE="eth0"
[ -n "$NAT64_PREFIX" ] || NAT64_PREFIX="64:ff9b::/96"
[ -n "$DEBUG_LEVEL" ] || DEBUG_LEVEL="7"
[ -n "$HTTP_PORT" ] || HTTP_PORT=80

echo "RADIO_URL:" $RADIO_URL
echo "TREL_URL:" "$TREL_URL"
echo "TUN_INTERFACE_NAME:" $TUN_INTERFACE_NAME
echo "BACKBONE_INTERFACE: $BACKBONE_INTERFACE"
echo "NAT64_PREFIX:" $NAT64_PREFIX
echo "DEBUG_LEVEL:" $DEBUG_LEVEL

NAT64_PREFIX=${NAT64_PREFIX/\//\\\/}
TAYGA_CONF=/etc/tayga.conf
Expand All @@ -96,8 +104,8 @@ BIND_CONF_OPTIONS=/etc/bind/named.conf.options
! test -f $BIND_CONF_OPTIONS || sed -i "s/dns64.*$/dns64 $NAT64_PREFIX {};/" $BIND_CONF_OPTIONS
sed -i "s/$INFRA_IF_NAME/$BACKBONE_INTERFACE/" /etc/sysctl.d/60-otbr-accept-ra.conf

echo "OTBR_AGENT_OPTS=\"-I $TUN_INTERFACE_NAME -B $BACKBONE_INTERFACE -d7 $RADIO_URL $TREL_URL\"" >/etc/default/otbr-agent
echo "OTBR_WEB_OPTS=\"-I $TUN_INTERFACE_NAME -d7 -p 80\"" >/etc/default/otbr-web
echo "OTBR_AGENT_OPTS=\"-I $TUN_INTERFACE_NAME -B $BACKBONE_INTERFACE -d${DEBUG_LEVEL} $RADIO_URL $TREL_URL\"" >/etc/default/otbr-agent
echo "OTBR_WEB_OPTS=\"-I $TUN_INTERFACE_NAME -d${DEBUG_LEVEL} -p $HTTP_PORT\"" >/etc/default/otbr-web

/app/script/server

Expand Down
2 changes: 1 addition & 1 deletion etc/openwrt/openthread-br/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CMAKE_OPTIONS+= \
-DOT_FIREWALL=ON \
-DOT_POSIX_SETTINGS_PATH=\"/etc/openthread\" \
-DOT_READLINE=OFF \
-DOTBR_NAT64=ON \
-DOTBR_NAT64=OFF \
-DNAT64_SERVICE=\"openthread\"

TARGET_CFLAGS += -DOPENTHREAD_POSIX_CONFIG_DAEMON_SOCKET_BASENAME=\\\"/var/run/openthread-%s\\\"
Expand Down
6 changes: 2 additions & 4 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ install_packages_apt()

sudo apt-get install --no-install-recommends -y build-essential ninja-build cmake

with RELEASE || sudo apt-get install --no-install-recommends -y libcpputest-dev

sudo apt-get install --no-install-recommends -y rsyslog

# For DBus server
Expand Down Expand Up @@ -132,7 +130,7 @@ EOF
sudo apt-get install --no-install-recommends -y libjsoncpp-dev

# reference device
without REFERENCE_DEVICE || sudo apt-get install --no-install-recommends -y radvd dnsutils avahi-utils
without REFERENCE_DEVICE || sudo apt-get install --no-install-recommends -y radvd dnsutils avahi-utils iperf3

# backbone-router
without BACKBONE_ROUTER || sudo apt-get install --no-install-recommends -y libnetfilter-queue1 libnetfilter-queue-dev
Expand Down Expand Up @@ -173,7 +171,7 @@ install_packages_rpm()

install_packages_brew()
{
brew install boost cmake cpputest dbus jsoncpp ninja
brew install boost cmake dbus jsoncpp ninja
}

install_packages_source()
Expand Down
2 changes: 1 addition & 1 deletion script/clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if command -v clang-format-14 >/dev/null; then
alias clang-format=clang-format-14
elif command -v clang-format >/dev/null; then
case "$(clang-format --version)" in
"$CLANG_FORMAT_VERSION"*) ;;
*"$CLANG_FORMAT_VERSION"*) ;;

*)
die "$(clang-format --version); clang-format 14.0 required"
Expand Down
10 changes: 7 additions & 3 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ readonly OTBR_REST
OTBR_OPTIONS="${OTBR_OPTIONS-}"
readonly OTBR_OPTIONS

OTBR_TOP_BUILDDIR="${BUILD_DIR}/otbr"
OTBR_TOP_BUILDDIR="${OTBR_TOP_BUILDDIR:-${BUILD_DIR}/otbr}"
readonly OTBR_TOP_BUILDDIR

#######################################
Expand Down Expand Up @@ -128,7 +128,7 @@ do_build()
otbr_options=(
"-DCMAKE_BUILD_TYPE=${OTBR_BUILD_TYPE}"
"-DCMAKE_INSTALL_PREFIX=/usr"
"-DOT_THREAD_VERSION=1.3"
"-DOT_THREAD_VERSION=1.4"
"-DOTBR_DBUS=ON"
"-DOTBR_FEATURE_FLAGS=ON"
"-DOTBR_TELEMETRY_DATA_API=ON"
Expand All @@ -152,7 +152,8 @@ do_check()
{
(cd "${OTBR_TOP_BUILDDIR}" \
&& ninja && sudo ninja install \
&& CTEST_OUTPUT_ON_FAILURE=1 ninja test)
&& CTEST_OUTPUT_ON_FAILURE=1 ctest -LE sudo \
&& CTEST_OUTPUT_ON_FAILURE=1 sudo ctest -L sudo) # Seperate running tests for sudo and non-sudo cases.
}

do_doxygen()
Expand Down Expand Up @@ -236,6 +237,9 @@ main()
meshcop)
top_builddir="${OTBR_TOP_BUILDDIR}" print_result ./tests/scripts/meshcop
;;
ncp_mode)
top_builddir="${OTBR_TOP_BUILDDIR}" print_result ./tests/scripts/ncp_mode
;;
openwrt)
print_result ./tests/scripts/openwrt
;;
Expand Down
Loading

0 comments on commit 33f7bef

Please sign in to comment.