Browse Source

Use a different HTTP port number for testing

(I thought there was a function to find a free port, but I can't find it
or an easy way to get the port number back when listening to port 0)
Ask Bjørn Hansen 12 years ago
parent
commit
3a3c0425ea
1 changed files with 4 additions and 2 deletions
  1. 4 2
      monitor_test.go

+ 4 - 2
monitor_test.go

@@ -18,6 +18,8 @@ var _ = Suite(&MonitorSuite{})
 func (s *MonitorSuite) SetUpSuite(c *C) {
 func (s *MonitorSuite) SetUpSuite(c *C) {
 	s.zones = make(Zones)
 	s.zones = make(Zones)
 
 
+	*flaghttp = ":8881"
+
 	fmt.Println("Starting http server")
 	fmt.Println("Starting http server")
 
 
 	zonesReadDir("dns", s.zones)
 	zonesReadDir("dns", s.zones)
@@ -28,12 +30,12 @@ func (s *MonitorSuite) SetUpSuite(c *C) {
 func (s *MonitorSuite) TestMonitorVersion(c *C) {
 func (s *MonitorSuite) TestMonitorVersion(c *C) {
 	c.Check(true, DeepEquals, true)
 	c.Check(true, DeepEquals, true)
 
 
-	res, err := http.Get("http://localhost:8053/version")
+	res, err := http.Get("http://localhost:8881/version")
 	c.Assert(err, IsNil)
 	c.Assert(err, IsNil)
 	page, _ := ioutil.ReadAll(res.Body)
 	page, _ := ioutil.ReadAll(res.Body)
 	c.Check(string(page), Matches, ".*<title>GeoDNS [0-9].*")
 	c.Check(string(page), Matches, ".*<title>GeoDNS [0-9].*")
 
 
-	res, err = http.Get("http://localhost:8053/status")
+	res, err = http.Get("http://localhost:8881/status")
 	c.Assert(err, IsNil)
 	c.Assert(err, IsNil)
 	page, _ = ioutil.ReadAll(res.Body)
 	page, _ = ioutil.ReadAll(res.Body)
 	// just check that template basically works
 	// just check that template basically works