From a8001680775270ab686ffd9446e0e11713b6634d Mon Sep 17 00:00:00 2001 From: PonomarevDA Date: Thu, 21 Sep 2023 23:52:28 +0300 Subject: [PATCH] add test scenario --- scripts/test_scenario.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/test_scenario.sh diff --git a/scripts/test_scenario.sh b/scripts/test_scenario.sh new file mode 100755 index 0000000..83cca2d --- /dev/null +++ b/scripts/test_scenario.sh @@ -0,0 +1,25 @@ +#!/bin/bash +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +REPOSITORY_DIR="$(dirname "$SCRIPT_DIR")" +MISSIONS_DIR=$REPOSITORY_DIR/missions + +autopilot_tools_version=$(pip show autopilot_tools | grep Version) +if [ ! -z "$autopilot_tools_version" ]; then + IFS=':' read -ra version <<< "$autopilot_tools_version" + IFS='.' read -ra version <<< ${version[1]} + echo -n "autopilot-tools: $autopilot_tools_version" + if (( ${version[1]} >= 4 )); then + echo "" + else + echo " (Consider updating)" + fi +else + echo "Error: autopilot-tools is not installed." + exit +fi + +mission=$MISSIONS_DIR/square_2_minutes.plan +log=$REPOSITORY_DIR/latest_log.ulg + +rm -f $log +test-scenario $mission --device serial --timeout 500 --output $log --verbose