Example #1
0
func (s *ConfigSuite) TestProxyValuesNotSet(c *gc.C) {
	s.addJujuFiles(c)
	config := newTestConfig(c, testing.Attrs{})
	c.Assert(config.HTTPProxy(), gc.Equals, "")
	c.Assert(config.AptHTTPProxy(), gc.Equals, "")
	c.Assert(config.HTTPSProxy(), gc.Equals, "")
	c.Assert(config.AptHTTPSProxy(), gc.Equals, "")
	c.Assert(config.FTPProxy(), gc.Equals, "")
	c.Assert(config.AptFTPProxy(), gc.Equals, "")
	c.Assert(config.NoProxy(), gc.Equals, "")
}
Example #2
0
func (s *ConfigSuite) TestProxyValuesWithFallback(c *gc.C) {
	s.addJujuFiles(c)

	config := newTestConfig(c, testing.Attrs{
		"http-proxy":  "http://[email protected]",
		"https-proxy": "https://[email protected]",
		"ftp-proxy":   "ftp://[email protected]",
		"no-proxy":    "localhost,10.0.3.1",
	})
	c.Assert(config.HTTPProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.AptHTTPProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.HTTPSProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.AptHTTPSProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.FTPProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.AptFTPProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.NoProxy(), gc.Equals, "localhost,10.0.3.1")
}
Example #3
0
func (s *ConfigSuite) TestProxyValues(c *gc.C) {
	s.addJujuFiles(c)
	config := newTestConfig(c, testing.Attrs{
		"http-proxy":      "http://[email protected]",
		"https-proxy":     "https://[email protected]",
		"ftp-proxy":       "ftp://[email protected]",
		"apt-http-proxy":  "http://[email protected]",
		"apt-https-proxy": "https://[email protected]",
		"apt-ftp-proxy":   "ftp://[email protected]",
	})
	c.Assert(config.HTTPProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.AptHTTPProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.HTTPSProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.AptHTTPSProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.FTPProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.AptFTPProxy(), gc.Equals, "ftp://[email protected]")
}