Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: project-chip/certification-tool-backend
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 260cd4f2172139a7ee9b3ae04d468e09f0c2c18d
Choose a base ref
...
head repository: project-chip/certification-tool-backend
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 792918f5909084bef6d6b5028787d7217f625bd6
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Jun 13, 2024

  1. Improving scripts

    hiltonlima committed Jun 13, 2024
    Copy the full SHA
    81863cd View commit details
  2. Remove debug option

    hiltonlima committed Jun 13, 2024
    Copy the full SHA
    a2dd8b6 View commit details
  3. Improve logs

    hiltonlima committed Jun 13, 2024
    Copy the full SHA
    792918f View commit details
11 changes: 10 additions & 1 deletion test_collections/matter/scripts/OTBR/otbr_srp_restart.sh
Original file line number Diff line number Diff line change
@@ -14,7 +14,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ROOT_DIR=$(realpath $(dirname "$0")/../..)
TH_SCRIPTS_DIR="$ROOT_DIR/scripts"

source "$TH_SCRIPTS_DIR/utils.sh"

print_start_of_script

print_script_step "Restarting OTBR service"
sudo docker exec -t otbr-chip ot-ctl srp server disable
sleep 2
sudo docker exec -t otbr-chip ot-ctl srp server enable
sudo docker exec -t otbr-chip ot-ctl srp server enable

print_end_of_script
21 changes: 15 additions & 6 deletions test_collections/matter/scripts/OTBR/otbr_start.sh
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ROOT_DIR=$(realpath $(dirname "$0")/../..)
TH_SCRIPTS_DIR="$ROOT_DIR/scripts"

DEFAULT_OTBR_INTERFACE="eth0"
BR_INTERFACE=${1:-$DEAFULT_OTBR_INTERFACE}
@@ -24,21 +25,27 @@ BR_IMAGE_BASE="nrfconnect/otbr"
BR_IMAGE_TAG="9185bda"
BR_IMAGE=$BR_IMAGE_BASE":"$BR_IMAGE_TAG

source "$TH_SCRIPTS_DIR/utils.sh"

print_start_of_script

print_script_step "Removing 'otbr-chip' container"
docker rm otbr-chip > /dev/null 2>&1

if docker images | grep $BR_IMAGE_BASE | grep $BR_IMAGE_TAG;
then
echo "otbr image "$BR_IMAGE" already installed"
else
echo "pulling otbr image "$BR_IMAGE
print_script_step "Pulling $BR_IMAGE image"
docker pull $BR_IMAGE || exit 1
fi

print_script_step "Starting 'otbr-chip' container"
AVAHI_PATH=$ROOT_DIR/backend/app/otbr_manager/avahi
sudo modprobe ip6table_filter || exit 1
sudo docker run --privileged -d --network host --name otbr-chip -e NAT64=1 -e DNS64=0 -e WEB_GUI=0 -v $AVAHI_PATH:/etc/avahi -v /dev/ttyACM0:/dev/radio $BR_IMAGE --radio-url spinel+hdlc+uart:///dev/radio?uart-baudrate=115200 -B $BR_INTERFACE || exit 1

echo "waiting 10 seconds to give the the docker container enough time to start up..."

print_script_step "waiting 10 seconds to give the the docker container enough time to start up..."
sleep 10

BR_CHANNEL_HEX=$(printf '%02x' $BR_CHANNEL)
@@ -63,15 +70,17 @@ BR_PARAMS=(
"dataset active -x"
)

print_script_step "Setting up Thread Network"

for i in "${BR_PARAMS[@]}"
do
echo "Param: '"$i"'"
printf "Param: '$i'"
sudo docker exec -t otbr-chip ot-ctl $i || exit 1
done

BR_SIMPLE_DATASET="00030000"${BR_CHANNEL_HEX}"0208"${BR_EXTPANID}"0510"${BR_NETWORKKEY}"0102"${BR_PANID}
sudo echo ${BR_SIMPLE_DATASET} > /tmp/otbr_simple_dataset.txt
echo "Simple Dataset: " ${BR_SIMPLE_DATASET}
printf "Simple Dataset: $BR_SIMPLE_DATASET"

# Also make sure to restart the Raspi avahi to have it in a clean state
print_script_step "Also make sure to restart the Raspi avahi to have it in a clean state"
sudo service avahi-daemon restart
11 changes: 10 additions & 1 deletion test_collections/matter/scripts/OTBR/otbr_stop.sh
Original file line number Diff line number Diff line change
@@ -14,7 +14,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ROOT_DIR=$(realpath $(dirname "$0")/../..)
TH_SCRIPTS_DIR="$ROOT_DIR/scripts"

source "$TH_SCRIPTS_DIR/utils.sh"

print_start_of_script

print_script_step "Stoping OTBR service"
sudo docker exec -t otbr-chip ot-ctl srp server disable
sleep 2
sudo docker kill otbr-chip
sudo docker kill otbr-chip

print_end_of_script
33 changes: 27 additions & 6 deletions test_collections/matter/scripts/update-paa-certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#! /usr/bin/env bash

#
# Copyright (c) 2023 Project CHIP Authors
@@ -14,7 +14,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -e


@@ -28,25 +27,34 @@ set -e

# Paths
MATTER_PROGRAM_DIR=$(realpath $(dirname "$0")/..)
TH_SCRIPTS_DIR="$MATTER_PROGRAM_DIR/../../../scripts"
TMP_SDK_FOLDER="sdk-sparse"
TMP_SDK_PATH="/tmp/$TMP_SDK_FOLDER"
SDK_CERT_PATH="credentials/development/paa-root-certs"
SDK_CERT_DEVELOPMENT_PATH="credentials/development"
CERT_PATH="/var/paa-root-certs"
DEVELOPMENT_PATH="/var/credentials/development"

source "$TH_SCRIPTS_DIR/utils.sh"

# Store the current dir
CURRENT_DIR=$(pwd)

print_start_of_script

# If SDK path is not present, then do local checkout
if [ -z "$SDK_PATH" ]
then

# If SDK SHA is not present, then fetch from Matter program config file
if [ -z "$SDK_SHA" ]
then
cd $MATTER_PROGRAM_DIR
print_script_step "Read SDK_SHA from $MATTER_PROGRAM_DIR/config.py file"
SDK_SHA=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_SHA | cut -d'"' -f 2 | cut -d"'" -f 2)
fi

# Checkout SDK sparsely
printf "SDK_SHA: $SDK_SHA\n"

print_script_step "Checkout SDK sparsely"
rm -rf $TMP_SDK_PATH
cd /tmp
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/project-chip/connectedhomeip.git $TMP_SDK_FOLDER
@@ -57,20 +65,33 @@ then
SDK_PATH="$TMP_SDK_PATH"
fi

printf "\nSDK_PATH: $SDK_PATH\n"

# Back to execution dir
cd $CURRENT_DIR

# Create folder if missing (owned by user)
if [ ! -d "$CERT_PATH" ]
then
print_script_step "Creating certification folder"
sudo mkdir -p $CERT_PATH
sudo chown $USER:$USER $CERT_PATH
fi

# Create folder if missing (owned by user)
if [ ! -d "$DEVELOPMENT_PATH" ]
then
print_script_step "Creating developer certification folder"
sudo mkdir -p $DEVELOPMENT_PATH
sudo chown $USER:$USER $DEVELOPMENT_PATH
fi

# Copy certs from SDK
print_script_step "Copying Certificates from SDK"
echo "Running copy command: cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/"
cp "$SDK_PATH/$SDK_CERT_PATH/"* $CERT_PATH/

print_script_step "Copying Developer Certificates from SDK"
echo "Running copy command: cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/"
cp -R "$SDK_PATH/$SDK_CERT_DEVELOPMENT_PATH/"** $DEVELOPMENT_PATH/

print_end_of_script
9 changes: 9 additions & 0 deletions test_collections/matter/scripts/update-sample-apps.sh
Original file line number Diff line number Diff line change
@@ -15,12 +15,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
MATTER_PROGRAM_DIR=$(realpath $(dirname "$0")/..)
TH_SCRIPTS_DIR="$MATTER_PROGRAM_DIR/../../../scripts"

source "$TH_SCRIPTS_DIR/utils.sh"

print_start_of_script

print_script_step "Pulling the SDK Docker image"
# We are fetching SDK docker image and tag name from backend
# This is done to minimize the places the SDK version is tracked.
SDK_DOCKER_IMAGE=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_DOCKER_IMAGE | cut -d'"' -f 2 | cut -d"'" -f 2)
SDK_DOCKER_TAG=$(cat $MATTER_PROGRAM_DIR/config.py | grep SDK_DOCKER_TAG | cut -d'"' -f 2 | cut -d"'" -f 2)
sudo docker pull $SDK_DOCKER_IMAGE:$SDK_DOCKER_TAG

print_script_step "Updating Sample APPs"
sudo docker run -t -v ~/apps:/apps $SDK_DOCKER_IMAGE:$SDK_DOCKER_TAG bash -c "rm -v /apps/*; cp -v * /apps/;"
sudo chown -R `whoami` ~/apps

print_end_of_script