Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Update smoketests to use weave report
Browse files Browse the repository at this point in the history
  • Loading branch information
awh committed Aug 3, 2015
1 parent dd94c00 commit 611bc89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion test/150_connect_forget_2_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ C1=10.2.1.4
C2=10.2.1.7

direct_peers() {
weave_on $1 status | sed -n -e 's|^Direct Peers: \(.*\)|\1|p' | tr -s ' ' '\n'
FORMAT="{{range .Router.ConnectionMaker.DirectPeers}}{{.}}
{{end}}"

weave_on $1 report -f "$FORMAT"
}

assert_peers() {
Expand Down
12 changes: 9 additions & 3 deletions test/500_weave_multi_cidr_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ NAME=multicidr.weave.local
# assert_container_cidrs <host> <cid> [<cidr> ...]
assert_container_cidrs() {
HOST=$1
CID=$2
local CID=$(echo $2|cut -b 1-12)
shift 2
CIDRS="$@"

Expand All @@ -26,7 +26,13 @@ assert_zone_records() {
FQDN=$3
shift 3

records=$(weave_on $HOST status | grep "^$CID") || true
FORMAT="{{range .DNS.Entries}}\
{{if eq \"$CID\" .ContainerID}}\
{{.Hostname}} {{.Address}}
{{end}}\
{{end}}"

records=$(weave_on $HOST report -f "$FORMAT") || true
# Assert correct number of records exist
assert "echo $records | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | wc -l | tr -d '[:space:]'" $#

Expand Down Expand Up @@ -76,7 +82,7 @@ start_suite "Weave run/start/attach/detach/expose/hide with multiple cidr argume
weave_on $HOST1 launch-router --ipalloc-range 10.2.3.0/24

# Run container with three cidrs
CID=$(start_container $HOST1 10.2.1.1/24 ip:10.2.2.1/24 net:10.2.3.0/24 --name=multicidr -h $NAME | cut -b 1-12)
CID=$(start_container $HOST1 10.2.1.1/24 ip:10.2.2.1/24 net:10.2.3.0/24 --name=multicidr -h $NAME)
assert_ips_and_dns $HOST1 $CID $NAME. 10.2.1.1/24 10.2.2.1/24 10.2.3.1/24

# Stop the container
Expand Down

0 comments on commit 611bc89

Please sign in to comment.