From 4165761434cc7d77dc6bd21e2db75e5c5802c666 Mon Sep 17 00:00:00 2001 From: Song GUO Date: Wed, 1 Feb 2023 17:31:40 +0800 Subject: [PATCH] [Hotfix] Fix ot-br-posix crash in cirque (#24773) * [Hotfix] Fix ot-br-posix crash in cirque * Restyled by shellharden * Fix * Update ot-br-posix for mDNS Responder source name * Specify infra interface when starting ot-br-agent --------- Co-authored-by: Restyled.io --- .../CHIPCirqueDaemon.py | 2 +- .../chip-cirque-device-base/build.sh | 19 +++++++++++++------ .../chip-cirque-device-base/cachekey.sh | 4 ++++ .../chip-cirque-device-base/version | 2 +- scripts/tests/cirque_tests.sh | 5 +++++ third_party/ot-br-posix/repo | 2 +- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py b/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py index a24403cdfe1c7e..a96868a4593c67 100755 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/CHIPCirqueDaemon.py @@ -90,7 +90,7 @@ def CommandFactory(args): def ServerMain(args): extraOptions = { - "otbr-agent": ShellCommand(["otbr-agent", "-I", "wpan0", "spinel+hdlc+uart:///dev/ttyUSB0"]) + "otbr-agent": ShellCommand(["otbr-agent", "-I", "wpan0", "-B", "eth0", "spinel+hdlc+uart:///dev/ttyUSB0"]) } with Listener(SERVER_ADDRESS) as listener: diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/build.sh b/integrations/docker/ci-only-images/chip-cirque-device-base/build.sh index 2bea878a71d95d..768a71b5c0e9e9 100755 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/build.sh +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/build.sh @@ -22,8 +22,12 @@ # This script expects to find a Dockerfile next to $0, so symlink # in an image name directory is the expected use case. -me=$(basename "$0") -cd "$(dirname "$0")" +set -xe + +SOURCE=${BASH_SOURCE[0]} +cd "$(dirname "$SOURCE")" + +SOURCE_DIR=$PWD ORG=${DOCKER_BUILD_ORG:-connectedhomeip} @@ -35,6 +39,13 @@ VERSION=${DOCKER_BUILD_VERSION:-$(sed 's/ .*//' version)} GITHUB_ACTION_RUN=${GITHUB_ACTION_RUN:-"0"} +REPO_DIR="$SOURCE_DIR/../../../../" + +if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then + # Note: This script will be invoked in docker on CI, We should ensure CHIP repo to safe directory to silent git error messages. + git config --global --add safe.directory /home/runner/work/connectedhomeip/connectedhomeip +fi + # The image build will clone its own ot-br-posix checkout due to limitations of git submodule. # Using the same ot-br-posix version as chip OT_BR_POSIX=$REPO_DIR/third_party/ot-br-posix/repo @@ -85,10 +96,6 @@ else fi fi -SOURCE=${BASH_SOURCE[0]} -SOURCE_DIR=$(cd "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd) -REPO_DIR="$SOURCE_DIR/../../../../" - docker build -t "$ORG/$IMAGE" -f "$SOURCE_DIR/Dockerfile" "${BUILD_ARGS[@]}" --build-arg OT_BR_POSIX_CHECKOUT="$OT_BR_POSIX_CHECKOUT" "$SOURCE_DIR" if [[ -n GITHUB_ACTION_RUN ]]; then diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/cachekey.sh b/integrations/docker/ci-only-images/chip-cirque-device-base/cachekey.sh index ee7f5fa23ee397..4e5c754538a5f0 100755 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/cachekey.sh +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/cachekey.sh @@ -24,6 +24,10 @@ me=$(basename "$0") cd "$(dirname "$0")" +SOURCE=${BASH_SOURCE[0]} +SOURCE_DIR=$(cd "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd) +REPO_DIR="$SOURCE_DIR/../../../../" + # The image build will clone its own ot-br-posix checkout due to limitations of git submodule. # Using the same ot-br-posix version as chip OT_BR_POSIX=$REPO_DIR/third_party/ot-br-posix/repo diff --git a/integrations/docker/ci-only-images/chip-cirque-device-base/version b/integrations/docker/ci-only-images/chip-cirque-device-base/version index 2b2a18d2659ec8..4add8a3f3185ce 100644 --- a/integrations/docker/ci-only-images/chip-cirque-device-base/version +++ b/integrations/docker/ci-only-images/chip-cirque-device-base/version @@ -1 +1 @@ -0.4.20 +0.4.21 diff --git a/scripts/tests/cirque_tests.sh b/scripts/tests/cirque_tests.sh index b018117df6216a..07f243c8bc13ac 100755 --- a/scripts/tests/cirque_tests.sh +++ b/scripts/tests/cirque_tests.sh @@ -112,6 +112,11 @@ function cirquetest_bootstrap() { make NO_GRPC=1 install -j + if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then + # Note: This script will be invoked in docker on CI, We should add CHIP repo to safe directory to silent git error messages. + git config --global --add safe.directory /home/runner/work/connectedhomeip/connectedhomeip + fi + "$REPO_DIR"/integrations/docker/ci-only-images/chip-cirque-device-base/build.sh __cirquetest_build_ot_lazy diff --git a/third_party/ot-br-posix/repo b/third_party/ot-br-posix/repo index 1813352247aa60..a032a864d21983 160000 --- a/third_party/ot-br-posix/repo +++ b/third_party/ot-br-posix/repo @@ -1 +1 @@ -Subproject commit 1813352247aa60fb8993773918f1e5b4af6f3b79 +Subproject commit a032a864d219835691ab2dbf74b3624f57ecbddf