Exemplo n.º 1
0
func (a *ReleaseTestSuite) TestReadLsbNotFound(c *C) {
	reset := release.HackLsbReleasePath("not-there")
	defer reset()

	_, err := release.ReadLsb()
	c.Assert(err, ErrorMatches, "cannot read lsb-release:.*")
}
Exemplo n.º 2
0
func (a *ReleaseTestSuite) TestReadLsb(c *C) {
	reset := release.HackLsbReleasePath(makeMockLsbRelease(c))
	defer reset()

	lsb, err := release.ReadLsb()
	c.Assert(err, IsNil)
	c.Assert(lsb.ID, Equals, "Ubuntu")
	c.Assert(lsb.Release, Equals, "18.09")
	c.Assert(lsb.Codename, Equals, "awsome")
}