-
Notifications
You must be signed in to change notification settings - Fork 4
/
unit-tests.sh
executable file
·25 lines (20 loc) · 1.03 KB
/
unit-tests.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
#!/bin/bash
set -x
#
# Note that the pytests delete nodes_log table !
#
curl -s localhost:5000/beehives -d '{"id": "my-beehive", "key-type": "rsa-sha2-256", "rmq-host":"host", "rmq-port": 5, "upload-host":"host", "upload-port": 6}'
# TODO(sean) If we're going to use test keys which are valid forever, we may as well hard code them as test
# data. Then, we can just init new beehives with a function.
(
cd test-data/beehive_ca
curl -s -F "tls-key=@tls/cakey.pem" -F "tls-cert=@tls/cacert.pem" -F "ssh-key=@ssh/ca" -F "ssh-pub=@ssh/ca.pub" -F "ssh-cert=@ssh/ca-cert.pub" localhost:5000/beehives/my-beehive
)
# NOTE(sean) --no-TTY allows docker-compose exec to run correctly in CI.
until docker exec -i $(docker-compose ps -q bk-sshd) test -e /home_dirs/node-0000000000000001/rtun.sock; do
echo waiting for /home_dirs/node-0000000000000001/rtun.sock
sleep 1
done
### TEST BEEKEEPER API
set -x
docker exec -e TESTING=1 -i $(docker-compose ps -q bk-api) /bin/bash -c 'coverage run -m pytest -v && coverage report -m --fail-under 85 --include=./*'