From 0f10480ed616f9d23a73f65579de838d4efa5d5e Mon Sep 17 00:00:00 2001 From: Jiachen Dong Date: Thu, 25 Aug 2022 01:53:11 +0800 Subject: [PATCH] [harness-simulation] fix `build_docker_image.sh` error (#8072) --- tools/harness-simulation/posix/build_docker_image.sh | 11 +++-------- tools/harness-simulation/posix/launch_testbed.py | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/harness-simulation/posix/build_docker_image.sh b/tools/harness-simulation/posix/build_docker_image.sh index 7664b7c89..634b04f15 100755 --- a/tools/harness-simulation/posix/build_docker_image.sh +++ b/tools/harness-simulation/posix/build_docker_image.sh @@ -31,13 +31,8 @@ set -euxo pipefail -if [[ $OT_PATH == "" ]]; then - OT_PATH="/home/pi/repo/openthread" -fi - -if [[ $OTBR_DOCKER_IMAGE == "" ]]; then - OTBR_DOCKER_IMAGE="otbr-reference-device-1.2" -fi +OT_PATH=${OT_PATH:-"/home/pi/repo/openthread"} +OTBR_DOCKER_IMAGE=${OTBR_DOCKER_IMAGE:-"otbr-reference-device-1.2"} DOCKER_BUILD_OTBR_OPTIONS=( "-DOTBR_DUA_ROUTING=ON" @@ -73,7 +68,7 @@ ETC_PATH="${OT_PATH}/tools/harness-simulation/posix/etc" --build-arg WEB_GUI=0 \ --build-arg REST_API=0 \ --build-arg EXTERNAL_COMMISSIONER=1 \ - --build-arg OTBR_OPTIONS="'${DOCKER_BUILD_OTBR_OPTIONS[*]}'" + --build-arg OTBR_OPTIONS="${DOCKER_BUILD_OTBR_OPTIONS[*]}" ) rm -rf ot-br-posix diff --git a/tools/harness-simulation/posix/launch_testbed.py b/tools/harness-simulation/posix/launch_testbed.py index c26f41bb3..0038135d3 100644 --- a/tools/harness-simulation/posix/launch_testbed.py +++ b/tools/harness-simulation/posix/launch_testbed.py @@ -193,6 +193,9 @@ def main(): for i in range(args.sniffer_num): sniffer_procs.append(start_sniffer(addr, i + SNIFFER_SERVER_PORT_BASE)) + # OTBR firewall scripts create rules inside the Docker container + # Run modprobe to load the kernel modules for iptables + subprocess.run(['sudo', 'modprobe', 'ip6table_filter']) # Start the BRs otbr_dockers = [] for nodeid in range(args.ot_num + 1, args.ot_num + args.otbr_num + 1):