-
Notifications
You must be signed in to change notification settings - Fork 5
/
run-against-nss.sh
executable file
·50 lines (36 loc) · 1.65 KB
/
run-against-nss.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -e
# npm ci
export SYSTEM_UNDER_TEST=https://localhost:8443
export HELP_SERVER_HOST=solidcommunity.net
export OIDC_ISSUER_ALICE=https://localhost:8443
export USERNAME_ALICE=alice
export PASSWORD_ALICE=123
export WEBID_ALICE=https://$USERNAME_ALICE.localhost:8443/profile/card#me
export OIDC_ISSUER_BOB=https://solidcommunity.net
export USERNAME_BOB=solid-crud-tests-example-2
export PASSWORD_BOB=123
export WEBID_BOB=https://$USERNAME_BOB.$HELP_SERVER_HOST/profile/card#me
export RESULTS_PATH=../test-suite/NSS/wac-results.json
echo Automated way to get an OIDC issuer cookie for Alice:
export CURL_RESULT_ALICE=`curl -ki $OIDC_ISSUER_ALICE/login/password -d"username=$USERNAME_ALICE&password=$PASSWORD_ALICE" | grep Set-Cookie`
export COOKIE_ALICE=`expr "$CURL_RESULT_ALICE" : '^Set-Cookie:\ \(.*\).'`
echo Other env vars for Alice:
echo Automated way to get an OIDC issuer cookie for Bob:
export CURL_RESULT_BOB=`curl -ki $OIDC_ISSUER_BOB/login/password -d"username=$USERNAME_BOB&password=$PASSWORD_BOB" | grep Set-Cookie`
export COOKIE_BOB=`expr "$CURL_RESULT_BOB" : '^Set-Cookie:\ \(.*\).'`
echo Running with these values for Alice:
echo Cookie: $COOKIE_ALICE
echo OIDC issuer: $OIDC_ISSUER_ALICE
echo WebID: $WEBID_ALICE
echo Running with these values for Bob:
echo Cookie: $COOKIE_BOB
echo OIDC issuer: $OIDC_ISSUER_BOB
echo WebID: $WEBID_BOB
export NODE_TLS_REJECT_UNAUTHORIZED=0
export STORAGE_ROOT_ALICE=https://$USERNAME_ALICE.localhost:8443/
# npm run jest "$@"
# npm run jest -- --json --outputFile="$RESULTS_PATH" "$@"
export INCLUDE_MAY=1
mkdir -p ../test-suite/NSS
./node_modules/.bin/jest test/surface/ --json --outputFile="$RESULTS_PATH" "$@"