mirror of https://github.com/docker/docs.git
Merge pull request #443 from chanwit/bats-func-tests
Proposal: PoC for Bats integration tests
This commit is contained in:
commit
fd8ff48bec
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load vars
|
||||||
|
|
||||||
|
@test "managing non-available node should be timed out" {
|
||||||
|
|
||||||
|
#
|
||||||
|
# timeout does not accept a bash function, so hard-coded path is required
|
||||||
|
#
|
||||||
|
run timeout 15s $GOBIN/swarm manage -H 127.0.0.1:2375 nodes://8.8.8.8:2375
|
||||||
|
|
||||||
|
[ "$status" -ne 0 ]
|
||||||
|
[[ ${lines[0]} =~ "Listening for HTTP" ]]
|
||||||
|
[[ ${lines[1]} =~ "ConnectEx tcp: i/o timeout" ]]
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function swarm() {
|
||||||
|
$GOBIN/swarm $@
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
load vars
|
||||||
|
|
||||||
|
@test "version string should contain a proper number with git commit" {
|
||||||
|
run swarm -v
|
||||||
|
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ ${lines[0]} =~ version\ [0-9]+\.[0-9]+\.[0-9]+\ \([0-9a-f]{7}\)$ ]]
|
||||||
|
}
|
Loading…
Reference in New Issue