mirror of https://github.com/docker/docs.git
using output instead of lines
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
This commit is contained in:
parent
b5756d6018
commit
b0b2290e25
|
@ -55,15 +55,11 @@ function teardown() {
|
||||||
# jimmyxian/centos7-wssh is an image with websocket CLI(WSSH) wirtten in Nodejs
|
# jimmyxian/centos7-wssh is an image with websocket CLI(WSSH) wirtten in Nodejs
|
||||||
# if connected successfull, it returns two lines, "Session Open" and "Session Closed"
|
# if connected successfull, it returns two lines, "Session Open" and "Session Closed"
|
||||||
# Note: with stdout=1&stdin=1&stream=1: it can be used as SSH
|
# Note: with stdout=1&stdin=1&stream=1: it can be used as SSH
|
||||||
docker_host pull jimmyxian/centos7-wssh
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
|
|
||||||
URL="ws://${SWARM_HOST}/${CLIENT_API_VERSION}/containers/test_container/attach/ws?stderr=1"
|
URL="ws://${SWARM_HOST}/${CLIENT_API_VERSION}/containers/test_container/attach/ws?stderr=1"
|
||||||
run docker_host run --rm --net=host jimmyxian/centos7-wssh wssh $URL
|
run docker_host run --rm --net=host jimmyxian/centos7-wssh wssh $URL
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${#lines[@]}" -eq 2 ]
|
[[ "${output}" == *"Session Open"* ]]
|
||||||
[[ "${lines[0]}" == *"Session Open"* ]]
|
[[ "${output}" == *"Session Closed"* ]]
|
||||||
[[ "${lines[1]}" == *"Session Closed"* ]]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "docker build" {
|
@test "docker build" {
|
||||||
|
|
Loading…
Reference in New Issue