Ejemplo n.º 1
0
func reserveAddress(t *testing.T, s *lochness.Subnet) net.IP {
	ip, err := s.ReserveAddress("fake")
	h.Ok(t, err)

	h.Assert(t, strings.Contains(ip.String(), "10.10.10."), "unexpected ip address")

	h.Equals(t, 90, len(s.AvailibleAddresses()))

	h.Equals(t, 1, len(s.Addresses()))

	// make sure change persists
	err = s.Refresh()
	h.Ok(t, err)

	h.Equals(t, 90, len(s.AvailibleAddresses()))

	return ip

}
Ejemplo n.º 2
0
func removeSubnet(t *testing.T, s *lochness.Subnet) {
	err := s.Delete()
	h.Ok(t, err)
}