X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=utils%2Fci%2Ftest_sdk_monitor.sh;fp=utils%2Fci%2Ftest_sdk_monitor.sh;h=26f939f920235df3d0de6fad6fa2672d6a38497c;hp=0000000000000000000000000000000000000000;hb=fe3135b85110f06be86d047064cb6a245937f9c5;hpb=689f7d7e6d08f73998aa333548a9285aa9c2d74e diff --git a/utils/ci/test_sdk_monitor.sh b/utils/ci/test_sdk_monitor.sh new file mode 100755 index 0000000..26f939f --- /dev/null +++ b/utils/ci/test_sdk_monitor.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# test if a vnf can be monitored and deployed + +cpu_load=$(son-emu-cli monitor prometheus -d datacenter1 -vnf vnf1 -q 'sum(rate(container_cpu_usage_seconds_total{id="/docker/"}[10s]))') + +# test if prometheus query worked +regex="[0-9.]+, [0-9.']+" +if [[ $cpu_load =~ $regex ]] ; then + echo "OK" + exit 0 +else + echo $cpu_load + echo "not OK" + exit 1 +fi