From 57e09344b57d98515bf02165e0e33a1d43134af0 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Fri, 22 Jun 2018 18:30:43 +0200 Subject: coverage: Add coverage test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a first version of the coverage tests. Change-Id: Iec2feaba12c369b2ff5fb82e246fa0cad87813f5 Signed-off-by: José Bollo --- coverage/scripts/00-trace.sh | 4 ++++ coverage/scripts/01-http.sh | 17 ++++++++++++++ coverage/scripts/02-hello.sh | 53 ++++++++++++++++++++++++++++++++++++++++++ coverage/scripts/03-x-hello.sh | 35 ++++++++++++++++++++++++++++ coverage/scripts/04-monitor.sh | 10 ++++++++ coverage/scripts/run-parts.sh | 26 +++++++++++++++++++++ coverage/scripts/run-test.sh | 53 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 198 insertions(+) create mode 100755 coverage/scripts/00-trace.sh create mode 100755 coverage/scripts/01-http.sh create mode 100755 coverage/scripts/02-hello.sh create mode 100755 coverage/scripts/03-x-hello.sh create mode 100755 coverage/scripts/04-monitor.sh create mode 100755 coverage/scripts/run-parts.sh create mode 100755 coverage/scripts/run-test.sh (limited to 'coverage/scripts') diff --git a/coverage/scripts/00-trace.sh b/coverage/scripts/00-trace.sh new file mode 100755 index 00000000..34a19bb0 --- /dev/null +++ b/coverage/scripts/00-trace.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +$R/bin/afb-client -k $WSURL monitor trace '{"add":{"api":"*","request":"*","event":"*","session":"*","global":"*"}}' & + diff --git a/coverage/scripts/01-http.sh b/coverage/scripts/01-http.sh new file mode 100755 index 00000000..191318c0 --- /dev/null +++ b/coverage/scripts/01-http.sh @@ -0,0 +1,17 @@ +#!/bin/sh + + +curl $URL/index.html +curl $URL/marrus-orthocanna.jpg +curl $URL/test.js +curl $URL/icons/marrus-orthocanna.jpg + +curl $URL/fake-file.html + +curl "$URL/api/salut/ping?arg1=null&arg1=%22a+string%22" +curl "$URL/api/hello/ping" \ + -F image=@$R/www/marrus-orthocanna.jpg \ + -F name=test +curl -X POST "$URL/api/hello/ping" \ + --header 'content-type: application/json' \ + --data-binary '[null,3,{"hello":false,"salut":4.5},true]' diff --git a/coverage/scripts/02-hello.sh b/coverage/scripts/02-hello.sh new file mode 100755 index 00000000..fbbb307d --- /dev/null +++ b/coverage/scripts/02-hello.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +$R/bin/afb-client -s -e $WSURL < /dev/null + +$R/bin/afb-daemon-cov --version > /dev/null + +$R/bin/afb-daemon-cov --fake-option > /dev/null + +$R/bin/afb-daemon-cov \ + --verbose \ + --verbose \ + --verbose \ + --verbose \ + --quiet \ + --quiet \ + --quiet \ + --quiet \ + --quiet \ + --quiet \ + --log error,warning,notice,info,debug,critical,alert-error,warning,notice,info,debug,critical,alert+error,warning,notice,info,debug,critical,alert \ + --foreground \ + --name binder-cov \ + --roothttp $R/www \ + --rootbase /opx \ + --rootapi /api \ + --alias /icons:$R/www \ + --apitimeout 90 \ + --cntxtimeout 3600 \ + --cache-eol 200 \ + --workdir . \ + --uploaddir . \ + --rootdir . \ + --ldpaths $R/ldpath/strong \ + --binding $R/bin/demat.so \ + --weak-ldpaths $R/ldpath/weak \ + --auto-api $R/apis/auto \ + --token HELLO \ + --random-token \ + --session-max 1000 \ + --tracereq all \ + --traceapi all \ + --traceses all \ + --traceevt all \ + --call demat/ping:true \ + --ws-server unix:$R/apis/ws/hello \ + --ws-server unix:$R/apis/ws/salut \ + --exec $R/scripts/run-parts.sh @p @t + +exit 0 + -- cgit