Exemplo n.º 1
0
func (s *FunctionsSuite) TestGetCloudArchiveSourceUbuntu(c *gc.C) {
	expectedSrc := packaging.PackageSource{
		URL: fmt.Sprintf("deb %s %s-updates/cloud-tools main", config.UbuntuCloudArchiveUrl, "precise"),
		Key: config.UbuntuCloudArchiveSigningKey,
	}

	expectedPrefs := packaging.PackagePreferences{
		Path:        config.UbuntuCloudToolsPrefsPath,
		Explanation: "Pin with lower priority, not to interfere with charms.",
		Package:     "*",
		Pin:         fmt.Sprintf("release n=%s-updates/cloud-tools", "precise"),
		Priority:    400,
	}

	src, prefs := config.GetCloudArchiveSource("precise")

	c.Assert(src, gc.Equals, expectedSrc)
	c.Assert(prefs, gc.Equals, expectedPrefs)
}
Exemplo n.º 2
0
func (s *FunctionsSuite) TestGetCloudArchiveSourceCentOS(c *gc.C) {
	src, prefs := config.GetCloudArchiveSource("centos7")

	c.Assert(src, gc.Equals, packaging.PackageSource{})
	c.Assert(prefs, gc.Equals, packaging.PackagePreferences{})
}
Exemplo n.º 3
0
// AddCloudArchiveCloudTools is defined on the AdvancedPackagingConfig.
func (cfg *centOSCloudConfig) AddCloudArchiveCloudTools() {
	src, pref := config.GetCloudArchiveSource(cfg.series)
	cfg.AddPackageSource(src)
	cfg.AddPackagePreferences(pref)
}