osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/35119?usp=email )
Change subject: ttcn3: add aliases hss -> hss-ogs etc. ...................................................................... ttcn3: add aliases hss -> hss-ogs etc. Some open5gs testsuites end in -ogs (hss, mme, ggsn), others do not (pgw). Let the user omit -ogs and choose the right one automatically. Change-Id: I64fb519c15cfff8a8b560d51ff8b6b5d1aada8f7 --- M ttcn3/ttcn3.sh 1 file changed, 31 insertions(+), 4 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/ttcn3/ttcn3.sh b/ttcn3/ttcn3.sh index 701e323..3a501b0 100755 --- a/ttcn3/ttcn3.sh +++ b/ttcn3/ttcn3.sh @@ -34,6 +34,12 @@ exit 0 } +set_project() { + PROJECT="$1" + PROJECT_UPPER="$(echo "$PROJECT" | tr '[:lower:]' '[:upper:]')" + PROJECT_NO_OGS="$(echo "$PROJECT" | sed 's/-ogs$//')" +} + parse_args() { while getopts 'ht:dkf' OPTION; do case "$OPTION" in @@ -95,7 +101,9 @@ echo " $name -k ggsn" echo " $name -k -f ggsn" echo " $name ggsn-ogs" - echo " $name hss-ogs" + echo " $name hss" + echo " $name mme" + echo " $name pgw" exit 1 ;; esac @@ -106,9 +114,16 @@ parse_args -h fi - PROJECT="$1" - PROJECT_UPPER="$(echo "$PROJECT" | tr '[:lower:]' '[:upper:]')" - PROJECT_NO_OGS="$(echo "$PROJECT" | sed 's/-ogs$//')" + set_project "$1" + if ! [ -d "$(get_testsuite_dir_docker)" ]; then + set_project "$1-ogs" + if ! [ -d "$(get_testsuite_dir_docker)" ]; then + echo "ERROR: can't find testsuite_dir, adjust" \ + "get_testsuite_dir_docker" + fi + fi + + echo "PROJECT: $PROJECT" } check_usage() { -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/35119?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I64fb519c15cfff8a8b560d51ff8b6b5d1aada8f7 Gerrit-Change-Number: 35119 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osm...@sysmocom.de> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-MessageType: merged