summaryrefslogtreecommitdiffstats
path: root/coverage/scripts
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-06-22 18:30:43 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-06-22 18:30:43 +0200
commit57e09344b57d98515bf02165e0e33a1d43134af0 (patch)
treee135a770ca7d0357c3d3ef9c25b2987fa30681ab /coverage/scripts
parent1f9e60c26a10bc4232b4827e85235dafcee17120 (diff)
coverage: Add coverage testflounder_5.99.1flounder/5.99.15.99.1
This is a first version of the coverage tests. Change-Id: Iec2feaba12c369b2ff5fb82e246fa0cad87813f5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'coverage/scripts')
-rwxr-xr-xcoverage/scripts/00-trace.sh4
-rwxr-xr-xcoverage/scripts/01-http.sh17
-rwxr-xr-xcoverage/scripts/02-hello.sh53
-rwxr-xr-xcoverage/scripts/03-x-hello.sh35
-rwxr-xr-xcoverage/scripts/04-monitor.sh10
-rwxr-xr-xcoverage/scripts/run-parts.sh26
-rwxr-xr-xcoverage/scripts/run-test.sh53
7 files changed, 198 insertions, 0 deletions
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 <<EOC
+hello ping true
+HELLO PING false
+hello pIngNull true
+hello PingBug true
+hello PiNgJsOn {"well":"formed","json":[1,2,3,4.5,true,false,null,"oups"]}
+hello subcall {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello subcall {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello subcallsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello subcallsync {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello subcall {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello subcallsync {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello eventadd {"tag":"ev1","name":"event-A"}
+hello eventadd {"tag":"ev2","name":"event-B"}
+hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello eventpush {"tag":"ev2","data":{"item":0}}
+hello eventsub {"tag":"ev2"}
+hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello eventpush {"tag":"ev2","data":{"item":0}}
+hello eventsub {"tag":"ev1"}
+hello subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
+hello subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+hello subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
+hello subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+hello eventunsub {"tag":"ev2"}
+hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello eventpush {"tag":"ev2","data":{"item":0}}
+hello eventdel {"tag":"ev1"}
+hello eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello eventpush {"tag":"ev2","data":{"item":0}}
+hello broadcast {"name":"xev","data":"true"}
+hello broadcast {"tag":"ev2","data":"true"}
+hello eventdel {"tag":"ev2"}
+hello hasperm {"perm":"some-permissison"}
+hello appid true
+hello uid true
+hello set-loa 1
+hello set-loa 3
+hello close true
+hello setctx "some-text-0"
+hello setctxif "some-text-1"
+hello getctx
+hello setctx "some-text-2"
+hello getctx
+#------------------------
+# TODO bug to be fixed!
+#hello info
+#hello verbose {"level":2,"message":"hello"}
+#------------------------
+EOC
+
diff --git a/coverage/scripts/03-x-hello.sh b/coverage/scripts/03-x-hello.sh
new file mode 100755
index 00000000..9d3726e4
--- /dev/null
+++ b/coverage/scripts/03-x-hello.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+$R/bin/afb-client -s -e $WSURL <<EOC
+x-hello ping true
+x-HELLO PING false
+x-hello pIngNull true
+x-hello PingBug true
+x-hello PiNgJsOn {"well":"formed","json":[1,2,3,4.5,true,false,null,"oups"]}
+x-hello subcall {"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}
+x-hello subcall {"api":"x-hello","verb":"subcall","args":{"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+x-hello subcallsync {"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}
+x-hello subcallsync {"api":"x-hello","verb":"subcall","args":{"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+x-hello subcall {"api":"x-hello","verb":"subcallsync","args":{"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+x-hello subcallsync {"api":"x-hello","verb":"subcallsync","args":{"api":"x-hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+x-hello eventadd {"tag":"ev1","name":"event-A"}
+x-hello eventadd {"tag":"ev2","name":"event-B"}
+x-hello eventpush {"tag":"ev1","data":[1,2,"x-hello"]}
+x-hello eventpush {"tag":"ev2","data":{"item":0}}
+x-hello eventsub {"tag":"ev2"}
+x-hello eventpush {"tag":"ev1","data":[1,2,"x-hello"]}
+x-hello eventpush {"tag":"ev2","data":{"item":0}}
+x-hello eventsub {"tag":"ev1"}
+x-hello subcall {"api":"x-hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"x-hello"]}}
+x-hello subcall {"api":"x-hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+x-hello subcallsync {"api":"x-hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"x-hello"]}}
+x-hello subcallsync {"api":"x-hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+x-hello eventunsub {"tag":"ev2"}
+x-hello eventpush {"tag":"ev1","data":[1,2,"x-hello"]}
+x-hello eventpush {"tag":"ev2","data":{"item":0}}
+x-hello eventdel {"tag":"ev1"}
+x-hello eventpush {"tag":"ev1","data":[1,2,"x-hello"]}
+x-hello eventpush {"tag":"ev2","data":{"item":0}}
+x-hello eventdel {"tag":"ev2"}
+EOC
+
diff --git a/coverage/scripts/04-monitor.sh b/coverage/scripts/04-monitor.sh
new file mode 100755
index 00000000..cc9453f5
--- /dev/null
+++ b/coverage/scripts/04-monitor.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+$R/bin/afb-client -s -e $WSURL <<EOC
+monitor get {"verbosity":true}
+monitor get {"apis":true}
+monitor set {"verbosity":"debug"}
+monitor session {"refresh-token":false}
+monitor session {"refresh-token":true}
+EOC
+
diff --git a/coverage/scripts/run-parts.sh b/coverage/scripts/run-parts.sh
new file mode 100755
index 00000000..a34bf8dd
--- /dev/null
+++ b/coverage/scripts/run-parts.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+export PORT=$1
+export TOKEN=$2
+export URL=localhost:$PORT
+export WSURL="$URL/api?token=$TOKEN"
+export R=$(realpath $(dirname $0)/..)
+
+ls $R/scripts/[0-9][0-9]-*.sh |
+sort -n |
+while read x
+do
+ echo
+ echo
+ echo
+ echo
+ echo
+ echo
+ echo ===========================================================================
+ echo ===========================================================================
+ echo ==
+ echo == $(basename $x)
+ echo ==
+ echo ===========================================================================
+ $x
+done
diff --git a/coverage/scripts/run-test.sh b/coverage/scripts/run-test.sh
new file mode 100755
index 00000000..ef280b64
--- /dev/null
+++ b/coverage/scripts/run-test.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+export R=$(realpath $(dirname $0)/..)
+export PATH="$R/bin:$R/scripts:$PATH"
+
+$R/bin/afb-daemon-cov --help > /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
+