Exemplo n.º 1
0
// ensureDependencies creates a set of install packages using AptGetPreparePackages
// and runs each set of packages through AptGetInstall
func ensureDependencies(series string) error {
	var err error
	aptGetInstallCommandList := apt.GetPreparePackages(requiredPackages, series)
	for _, commands := range aptGetInstallCommandList {
		err = apt.GetInstall(commands...)
		if err != nil {
			return err
		}
	}
	return err
}
Exemplo n.º 2
0
func (s *AptSuite) TestAptGetPreparePackages(c *gc.C) {
	packagesList := apt.GetPreparePackages([]string{"lxc", "bridge-utils", "git", "mongodb"}, "precise")
	c.Assert(packagesList[0], gc.DeepEquals, []string{"--target-release", "precise-updates/cloud-tools", "lxc", "mongodb"})
	c.Assert(packagesList[1], gc.DeepEquals, []string{"bridge-utils", "git"})
}