mirror of
https://github.com/docker/docs.git
synced 2026-10-31 10:34:26 +03:00
add integration test for token discovery
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
This commit is contained in:
29
test/integration/token-discovery.bats
Normal file
29
test/integration/token-discovery.bats
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load helpers
|
||||
|
||||
function token_cleanup() {
|
||||
curl -X DELETE https://discovery-stage.hub.docker.com/v1/clusters/$1
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
swarm_join_cleanup
|
||||
swarm_manage_cleanup
|
||||
stop_docker
|
||||
}
|
||||
|
||||
@test "token discovery should be working properly" {
|
||||
start_docker 2
|
||||
|
||||
TOKEN=$(swarm create)
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${TOKEN} =~ ^[0-9a-f]{32}$ ]]
|
||||
|
||||
swarm_manage token://$TOKEN
|
||||
swarm_join token://$TOKEN
|
||||
|
||||
run docker_swarm info
|
||||
[[ "${lines[3]}" == *"Nodes: 2"* ]]
|
||||
|
||||
token_cleanup $TOKEN
|
||||
}
|
||||
Reference in New Issue
Block a user