Dump the zone database status on "weave status"
Fix the smoke test by updating the regexps used for parsing "weave status" output
This commit is contained in:
1 parent
32627eccbf
commit
40d7b2a87d
2 files changed
+3
-2
No files matched your search
@@ -23,6 +23,7 @@ func ListenHTTP(version string, server *DNSServer, domain string, db Zone, port
|
|||||||
muxRouter.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
muxRouter.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintln(w, "weave DNS", version)
|
fmt.Fprintln(w, "weave DNS", version)
|
||||||
fmt.Fprintln(w, server.Status())
|
fmt.Fprintln(w, server.Status())
|
||||||
|
fmt.Fprintln(w, db.Status())
|
||||||
})
|
})
|
||||||
|
|
||||||
muxRouter.Methods("PUT").Path("/name/{id:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
muxRouter.Methods("PUT").Path("/name/{id:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ assert_zone_records() {
|
|||||||
FQDN=$1; shift
|
FQDN=$1; shift
|
||||||
|
|
||||||
# Assert correct number of records exist
|
# Assert correct number of records exist
|
||||||
assert "weave_on $HOST status | grep \"^$CID\" | wc -l" $#
|
assert "weave_on $HOST status | grep \"^$CID\" | grep -oE \"\b([0-9]{1,3}\.){3}[0-9]{1,3}\b\" | wc -l" $#
|
||||||
|
|
||||||
# Assert correct records exist
|
# Assert correct records exist
|
||||||
for IP; do
|
for IP; do
|
||||||
assert_raises "weave_on $HOST status | grep \"^$CID $IP $FQDN$\""
|
assert_raises "weave_on $HOST status | grep \"$CID\" | grep \"$IP\" | grep \"$FQDN\""
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user