Beispiel #1
0
func (s *ReleaseTestSuite) TestSetup(c *C) {
	c.Assert(release.Setup(c.MkDir()), IsNil)
	c.Check(release.String(), Equals, "16-core")
	rel := release.Get()
	c.Check(rel.Flavor, Equals, "core")
	c.Check(rel.Series, Equals, "16")
}
Beispiel #2
0
func (s *apiSuite) mkrelease(c *check.C) {
	// set up release
	root := c.MkDir()
	d := filepath.Join(root, "etc", "system-image")
	c.Assert(os.MkdirAll(d, 0755), check.IsNil)
	c.Assert(ioutil.WriteFile(filepath.Join(d, "channel.ini"), []byte("[service]\nchannel: ubuntu-flavor/release/channel"), 0644), check.IsNil)
	c.Assert(release.Setup(root), check.IsNil)
}
Beispiel #3
0
func init() {
	// init the global directories at startup
	root := os.Getenv("SNAPPY_GLOBAL_ROOT")
	if root == "" {
		root = "/"
	}

	dirs.SetRootDir(root)

	// we don't need to care for the error here to take into account when
	// initialized on a non snappy system
	release.Setup(dirs.GlobalRootDir)
}