Skip to content

Commit

Permalink
Test tools update (#69)
Browse files Browse the repository at this point in the history
1) Set multi-db configuration file path for REST gotests
2) Enable verbose logs in test REST server
3) Fix clish lookup path for test cli
  • Loading branch information
sachinholla committed Nov 3, 2020
1 parent f548d67 commit 69da7f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/test/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ export SHOW_CONFIG_TOOLS=${CLIBUILD}/render-templates
export CLISH_PATH=${CLIBUILD}/command-tree

# KLISH_BIN can be set to use klish exe and libs from other directory.
[[ ! -d "${KLISH_BIN}" ]] && KLISH_BIN=${CLIBUILD}
if [[ -z ${KLISH_BIN} ]]; then
if [[ -f ${CLIBUILD}/clish ]]; then
KLISH_BIN=${CLIBUILD}
elif [[ -f ${BUILDDIR}/target/clish ]]; then
KLISH_BIN=${BUILDDIR}/target
else
echo "Error: could not locate clish."
exit 1
fi
fi

PYTHONPATH+=:${CLISOURCE}/actioner
PYTHONPATH+=:${CLISOURCE}/renderer
Expand Down
2 changes: 2 additions & 0 deletions tools/test/rest-gotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ MGMT_COMMON_DIR=$(realpath ${TOPDIR}/../sonic-mgmt-common)

export CVL_SCHEMA_PATH=${MGMT_COMMON_DIR}/build/cvl/schema

export DB_CONFIG_PATH=${MGMT_COMMON_DIR}/tools/test/database_config.json

PKG="github.com/Azure/sonic-mgmt-framework/rest/server"
DIR="${PWD}"

Expand Down
6 changes: 6 additions & 0 deletions tools/test/rest-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ for V in $@; do
case $V in
-cert|--cert|-cert=*|--cert=*) HAS_CRTFILE=1;;
-key|--key|-key=*|--key=*) HAS_KEYFILE=1;;
-v|--v|-v=*|--v=*) HAS_V=1;;
-client_auth|--client_auth) HAS_AUTH=1;;
-client_auth=*|--client_auth=*) HAS_AUTH=1;;
esac
done

[[ -z ${HAS_V} ]] && EXTRA_ARGS+=" -v 1"
[[ -z ${HAS_AUTH} ]] && EXTRA_ARGS+=" -client_auth none"

cd $SERVER_DIR

##
Expand Down

0 comments on commit 69da7f4

Please sign in to comment.