From: José Bollo Date: Fri, 22 Jun 2018 16:30:43 +0000 (+0200) Subject: coverage: Add coverage test X-Git-Tag: flounder_5.99.1^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=57e09344b57d98515bf02165e0e33a1d43134af0 coverage: Add coverage test This is a first version of the coverage tests. Change-Id: Iec2feaba12c369b2ff5fb82e246fa0cad87813f5 Signed-off-by: José Bollo --- diff --git a/coverage/apis/auto/saha b/coverage/apis/auto/saha new file mode 120000 index 00000000..403904c6 --- /dev/null +++ b/coverage/apis/auto/saha @@ -0,0 +1 @@ +../../bin/saha.so \ No newline at end of file diff --git a/coverage/apis/auto/x-hello b/coverage/apis/auto/x-hello new file mode 120000 index 00000000..77b3cf6c --- /dev/null +++ b/coverage/apis/auto/x-hello @@ -0,0 +1 @@ +../ws/hello \ No newline at end of file diff --git a/coverage/apis/auto/x-salut b/coverage/apis/auto/x-salut new file mode 120000 index 00000000..0e28e432 --- /dev/null +++ b/coverage/apis/auto/x-salut @@ -0,0 +1 @@ +../ws/salut \ No newline at end of file diff --git a/coverage/bin/bug.c b/coverage/bin/bug.c new file mode 100644 index 00000000..ddebdef7 --- /dev/null +++ b/coverage/bin/bug.c @@ -0,0 +1,6 @@ +#define AFB_BINDING_VERSION 3 +#include +int afbBindingEntry(afb_api_t api) +{ + return ((int(*)())(intptr_t)0)(); +} diff --git a/coverage/ldpath/weak/noise1 b/coverage/ldpath/weak/noise1 new file mode 100644 index 00000000..e69de29b diff --git a/coverage/ldpath/weak/noise2 b/coverage/ldpath/weak/noise2 new file mode 100644 index 00000000..e69de29b diff --git a/coverage/ldpath/weak/noise3 b/coverage/ldpath/weak/noise3 new file mode 120000 index 00000000..33027900 --- /dev/null +++ b/coverage/ldpath/weak/noise3 @@ -0,0 +1 @@ +noise5 \ No newline at end of file diff --git a/coverage/ldpath/weak/noise4 b/coverage/ldpath/weak/noise4 new file mode 120000 index 00000000..b276fe15 --- /dev/null +++ b/coverage/ldpath/weak/noise4 @@ -0,0 +1 @@ +noise1 \ No newline at end of file diff --git a/coverage/ldpath/weak/sub/noise1 b/coverage/ldpath/weak/sub/noise1 new file mode 100644 index 00000000..e69de29b diff --git a/coverage/ldpath/weak/sub/noise2/noise b/coverage/ldpath/weak/sub/noise2/noise new file mode 100644 index 00000000..e69de29b diff --git a/coverage/ldpath/weak/sub/noise3 b/coverage/ldpath/weak/sub/noise3 new file mode 120000 index 00000000..33027900 --- /dev/null +++ b/coverage/ldpath/weak/sub/noise3 @@ -0,0 +1 @@ +noise5 \ No newline at end of file diff --git a/coverage/ldpath/weak/sub/noise4 b/coverage/ldpath/weak/sub/noise4 new file mode 120000 index 00000000..b276fe15 --- /dev/null +++ b/coverage/ldpath/weak/sub/noise4 @@ -0,0 +1 @@ +noise1 \ No newline at end of file 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 + diff --git a/coverage/www/index.html b/coverage/www/index.html new file mode 100644 index 00000000..60722feb --- /dev/null +++ b/coverage/www/index.html @@ -0,0 +1,4 @@ + + +test + diff --git a/coverage/www/marrus-orthocanna.jpg b/coverage/www/marrus-orthocanna.jpg new file mode 100644 index 00000000..82fb038c Binary files /dev/null and b/coverage/www/marrus-orthocanna.jpg differ diff --git a/coverage/www/test.js b/coverage/www/test.js new file mode 100644 index 00000000..e69de29b