mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-05-13 13:58:57 +00:00
test(server): add new PUT API to the integration test (#1504)
This commit is contained in:
parent
06646f791b
commit
a62b25b54c
2 changed files with 13 additions and 3 deletions
|
|
@ -165,7 +165,7 @@ modified image.
|
|||
To run the integration test:
|
||||
|
||||
```
|
||||
npm run action shadowbox/integration_test/start
|
||||
npm run action shadowbox/integration_test/run
|
||||
```
|
||||
|
||||
This will set up three containers and two networks:
|
||||
|
|
@ -186,7 +186,7 @@ npm run action shadowbox/docker/build && docker tag quay.io/outline/shadowbox $U
|
|||
If you need to test an unsigned image (e.g. your dev one):
|
||||
|
||||
```
|
||||
DOCKER_CONTENT_TRUST=0 SB_IMAGE=$USER/shadowbox npm run action shadowbox/integration_test/start
|
||||
DOCKER_CONTENT_TRUST=0 SB_IMAGE=$USER/shadowbox npm run action shadowbox/integration_test/run
|
||||
```
|
||||
|
||||
You can add tags if you need different versions in different clients.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function setup() {
|
|||
# Target service.
|
||||
docker build --force-rm -t "${TARGET_IMAGE}" "$(dirname "$0")/target"
|
||||
docker run -d --rm -p "10080:80" --network="${NET_OPEN}" --network-alias="target" --name="${TARGET_CONTAINER}" "${TARGET_IMAGE}"
|
||||
|
||||
|
||||
# Shadowsocks service.
|
||||
declare -ar shadowbox_flags=(
|
||||
-d
|
||||
|
|
@ -223,6 +223,15 @@ function cleanup() {
|
|||
&& fail "Deleted access key is still active") || (($? == 56))
|
||||
}
|
||||
|
||||
function test_create_key_with_id() {
|
||||
# Verify that we can create key with a given key ID.
|
||||
local ACCESS_KEY_JSON
|
||||
ACCESS_KEY_JSON="$(client_curl --insecure -X PUT "${SB_API_URL}/access-keys/myKeyId")"
|
||||
if [[ "${ACCESS_KEY_JSON}" != *'"id":"myKeyId"'* ]]; then
|
||||
fail "Could not create new access key with ID 'myKeyId'"
|
||||
fi
|
||||
}
|
||||
|
||||
function test_port_for_new_keys() {
|
||||
# Verify that we can change the port for new access keys
|
||||
client_curl --insecure -X PUT -H "Content-Type: application/json" -d '{"port": 12345}' "${SB_API_URL}/server/port-for-new-access-keys" \
|
||||
|
|
@ -301,6 +310,7 @@ function cleanup() {
|
|||
}
|
||||
|
||||
test_networking
|
||||
test_create_key_with_id
|
||||
test_port_for_new_keys
|
||||
test_hostname_for_new_keys
|
||||
test_encryption_for_new_keys
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue