-
Notifications
You must be signed in to change notification settings - Fork 73
/
test.sh
executable file
·43 lines (33 loc) · 2.57 KB
/
test.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
#! /bin/bash
set -e
set -o pipefail
cd $(dirname "$BASH_SOURCE")
venv_two="./venv_python2"
if [[ ! -e "$venv_two" ]] ; then
echo === creating Python 2 virtualenv ===
virtualenv -p python2 "$venv_two"
(source "$venv_two/bin/activate" && pip install --editable .)
fi
venv_three="./venv_python3"
if [[ ! -e "$venv_three" ]] ; then
echo === creating Python 3 virtualenv ===
virtualenv -p python3 "$venv_three"
(source "$venv_three/bin/activate" && pip install --editable .)
fi
runtests() {
key=$(clinacl secretgen)
nonce=$(head -c 24 /dev/zero | xxd -p)
echo with nonce | clinacl encrypt $key --nonce $nonce | clinacl decrypt $key
echo without nonce | clinacl encrypt $key | clinacl decrypt $key
signingkey=$(clinacl signinggen)
verifykey=$(clinacl verifygen $signingkey)
echo verified | clinacl sign $signingkey | clinacl verify $verifykey
link='g6Rib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgb0QEGch1mSRBwXnmm+ElpwHWSpGF4Y5wGq9Wz1BEOsYKp3BheWxvYWTFA5x7ImJvZHkiOnsiZGV2aWNlIjp7ImlkIjoiZjRmZTNkMWYwYzgxM2QxMzBiZDUwNTllMWFkMzI4MTgiLCJzdGF0dXMiOjIsInR5cGUiOiJkZXNrdG9wIn0sImtleSI6eyJlbGRlc3Rfa2lkIjoiMDEwMTA0ZTcyNDM2MmU3YmE2NjMzOTgwYTYyNTdmMDQzZjdjM2Q4NzMzNTUwNTk0YTc5MmFhY2Y2YzZkNDY3N2RkOTQwYSIsImhvc3QiOiJrZXliYXNlLmlvIiwia2lkIjoiMDEyMDZmNDQwNDE5Yzg3NTk5MjQ0MWMxNzllNjliZTEyNWE3MDFkNjRhOTE4NWUxOGU3MDFhY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$signingkey | clinacl keybase verify
}
echo === testing Python 2 ===
(source "$venv_two/bin/activate" && runtests)
echo === testing Python 3 ===
(source "$venv_three/bin/activate" && runtests)