-
Notifications
You must be signed in to change notification settings - Fork 5
/
example.sh
executable file
·50 lines (39 loc) · 1.67 KB
/
example.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
# either test against a local server or in a container testnet
#export SERVER_ROOT=https://localhost
export SERVER_ROOT=https://server
export USERNAME_ALICE=alice
export PASSWORD_ALICE=123
export SERVER2_ROOT=https://solidcommunity.net
export USERNAME_BOB=solid-crud-tests-example-1
export BOB_ROOT=https://$USERNAME_BOB.solidcommunity.net
export PASSWORD_BOB=123
export RESULTS_PATH=../NSS-wac-results.json
echo Automated way to get an OIDC issuer cookie for Alice:
export CURL_RESULT_ALICE=`curl -ki $SERVER_ROOT/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:
export OIDC_ISSUER_ALICE=$SERVER_ROOT
export WEBID_ALICE=$SERVER_ROOT/profile/card#me
export STORAGE_ROOT_ALICE=$SERVER_ROOT/
echo Automated way to get an OIDC issuer cookie for Bob:
export CURL_RESULT_BOB=`curl -ki $SERVER2_ROOT/login/password -d"username=$USERNAME_BOB&password=$PASSWORD_BOB" | grep Set-Cookie`
export COOKIE_BOB=`expr "$CURL_RESULT_BOB" : '^Set-Cookie:\ \(.*\).'`
echo Other env vars for Bob:
export OIDC_ISSUER_BOB=$SERVER2_ROOT
export WEBID_BOB=$BOB_ROOT/profile/card#me
export STORAGE_ROOT_BOB=$BOB_ROOT/
echo Running with these values for Alice:
echo Cookie: $COOKIE_ALICE
echo OIDC issuer: $OIDC_ISSUER_ALICE
echo WebID: $WEBID_ALICE
echo Storage Root: $STORAGE_ROOT_ALICE
echo Running with these values for Bob:
echo Cookie: $COOKIE_BOB
echo OIDC issuer: $OIDC_ISSUER_BOB
echo WebID: $WEBID_BOB
echo Storage Root: $STORAGE_ROOT_BOB
export NODE_TLS_REJECT_UNAUTHORIZED=0
# npm run jest "$@"
npm run jest -- --json --outputFile="$RESULTS_PATH" "$@"