v1.1.1 : Fixed functional tests & Multiple bugfixes

This commit is contained in:
Brendan LE GLAUNEC
2016-11-12 12:55:32 +01:00
parent f80af6bd58
commit 553524ae43
34 changed files with 663 additions and 356 deletions
+17 -16
View File
@@ -1,18 +1,19 @@
{
"Output": "cameratest.log.xml",
"Cameradar" : {
"Path": "/cctv/bin/cameradar",
"Args": "-l 1 -c tmp_config",
"Ports": "554,5554,8554,5548",
"IdsPath": "/conf/ids.json",
"RoutesPath": "/conf/url.json",
"ThumbPath": "/thumbnails",
"dbHost": "mysql_cameradar",
"dbPort": 3306,
"dbUser": "root",
"dbPassword": "root",
"dbName": "cctv",
"Console": false
"output": "test-results.xml",
"cameradar" : {
"path": "/cameradar/bin/cameradar",
"args": "-s 172.17.0.0/24 -c /conf/cameradar.conf.json --gst-rtsp-server",
"ports": "554,5554,8554",
"ids_path": "conf/ids.json",
"routes_path": "conf/url.json",
"thumb_path": "/tmp",
"db_host": "cameradar-database",
"db_port": 3306,
"db_user": "root",
"db_password": "root",
"db_name": "cmrdr",
"console": false
},
"Tests" : __CAMERAS__
}
"tests" : __CAMERAS__
}
+10 -6
View File
@@ -3,7 +3,7 @@
ports=('8554' '8554' '8554' '8554' '8554' '8554')
users=('admin' 'root' 'ubnt' 'Admin' 'supervisor' '')
passwords=('admin' 'root' '12345' 'ubnt' 'password' '')
routes=('live.sdp' 'live.sdp' 'ch001.sdp' '' 'invalid' 'live_mpeg4.sdp')
routes=('cam0_0' 'live.sdp' 'ch001.sdp' 'cam' 'invalid' 'live_mpeg4.sdp')
cams_name_pattern="fake_camera_"
# json generation variable only
@@ -11,11 +11,16 @@ json="[\n"
first=true
# $1 = adress, $2 = port, $3 = path, $4 = usernam $5 = password, $6 = valid
function make_json {
# Get all data about the container, this will return three lines
# One empty that we ignore
# the two other ones with the IP of our container
# We take the second one using sed and cut to get only the IPAddress
address="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CID)"
if [ "$first" = true ] ; then first=false
else json="$json,\n"; fi
json="$json{"
json="$json\"address\":\"$1\","
json="$json\"port\":\"$2\","
json="$json\"address\":\"$address\","
json="$json\"port\":$2,"
json="$json\"route\":\"$3\","
json="$json\"username\":\"$4\","
json="$json\"password\":\"$5\","
@@ -50,13 +55,12 @@ function start {
# if conf_idx = 4 -> invalid conf
if [ "$conf_idx" == "4" ] ; then is_valid=false; fi
docker run -d --name "$name" fake-camera /start.sh "$port" "$user" "$passw" "$route"
make_json "$name" "$port" "$route" "$user" "$passw" $is_valid
CID=$(docker run -d --name "$name" fake-camera /start.sh "$port" "$user" "$passw" "$route");
make_json "$name" "$port" "$route" "$user" "$passw" $is_valid $CID
done
# finalize json
json="$json]"
echo "$json"
}
function stop {
+8 -4
View File
@@ -1,15 +1,19 @@
#!/bin/bash
while ! mysqladmin ping -h"mysql_cameradar" -P3306 --silent; do
while ! mysqladmin ping -h"cameradar-database" -P3306 --silent; do
sleep 1
done
ls -alhR /conf
cat /etc/hosts
cat /tmp/tests/cameradartest.conf.json
# build
go build
cp /tmp/tests/*.xml ./
# run test
./cameradartest /tmp/tests/cameradartest.conf.json
cp cameratest.log.xml /tmp/tests/
cat *.xml
cp *.xml /tmp/tests/
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
port=$1
user=$2
passw=$3
route=$4
url=""
# need first argument at least
if [ "$2" == "" ]; then
url="rtsp://:$port/$route"
else
url="rtsp://$user:$passw@:$port/$route"
fi
./camera_emulation_server -u $2 -p $3 -r $4
echo "Stream started on ${url}"
-16
View File
@@ -1,16 +0,0 @@
#!/bin/bash
port=$1
user=$2
passw=$3
route=$4
url=""
# need first argument at least
if [ "$2" == "" ]; then
url="rtsp://:$port/$route"
else
url="rtsp://$user:$passw@:$port/$route"
fi
./etix_rtsp_server -u $s -p $3 -r $4
# cvlc /vlc/screen.png -I dummy --sout-keep --no-drop-late-frames --no-skip-frames --image-duration 9999 --sout="#transcode{vcodec=h264,fps=15,venc=x264{preset=ultrafast,tune=zerolatency,keyint=30,bframes=0,ref=1,level=30,profile=baseline,hrd=cbr,crf=20,ratetol=1.0,vbv-maxrate=1200,vbv-bufsize=1200,lookahead=0}}:rtp{sdp=$url}" --sout-all