aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-08-18 11:11:20 +0200
committerMauro Sardara <msardara@cisco.com>2022-08-18 11:42:39 +0200
commite9128a4b15e32f94ef10d4b841093d9b89949050 (patch)
treec413ab8fbe4cf007edd9f0885ca1c377daf0e20e
parent309fafddc51697deb9c6f8bf723c10539224cb4d (diff)
test(hicn-light): fix hicn-light functional tests
Ref: HICN-743 Change-Id: Id49ab872b5cf545c9e021a51a877341ff7ab9337 Signed-off-by: Mauro Sardara <msardara@cisco.com>
-rw-r--r--tests/1-node.yml2
-rwxr-xr-xtests/config.sh6
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/1-node.yml b/tests/1-node.yml
index 5b412d2fb..515ca6871 100644
--- a/tests/1-node.yml
+++ b/tests/1-node.yml
@@ -15,7 +15,7 @@ services:
- |
if [ -d /workspace/build-dev ]; then
git config --global --add safe.directory \*
- ninja -C /workspace/build-dev install
+ sudo ninja -C /workspace/build-dev install
fi
sudo ip addr add 192.168.1.1/24 dev eth0
diff --git a/tests/config.sh b/tests/config.sh
index 2d8323a56..a6bc6ad2d 100755
--- a/tests/config.sh
+++ b/tests/config.sh
@@ -451,9 +451,13 @@ declare -A ctrl_tests=(
["routes"]="test_routes"
)
+function ctrl_test_exists() {
+ [[ "${!ctrl_tests[*]}" =~ ${1} ]] && return 0 || return 1
+}
+
function ctrl() {
type=$1
- if [[ ! -v "ctrl_tests[${type}]" ]]; then
+ if ! ctrl_test_exists "${type}"; then
error "Error: hicn-light-contrl test does not exist."
exit 1
fi