Esempio n. 1
0
func (s *FirstBootTestSuite) TestTwoRuns(c *C) {
	c.Assert(boot.FirstBoot(), IsNil)
	_, err := os.Stat(dirs.SnapFirstBootStamp)
	c.Assert(err, IsNil)

	c.Assert(boot.FirstBoot(), Equals, boot.ErrNotFirstBoot)
}
Esempio n. 2
0
func (x *cmdInternalFirstBoot) Execute(args []string) error {
	if len(args) > 0 {
		return ErrExtraArgs
	}

	return boot.FirstBoot()
}
Esempio n. 3
0
func (s *FirstBootTestSuite) TestFirstBootnableEther(c *C) {
	release.MockOnClassic(false)
	firstBootEnableFirstEtherRun := false
	restore := boot.MockFirstbootInitialNetworkConfig(func() error {
		firstBootEnableFirstEtherRun = true
		return nil
	})
	defer restore()

	c.Assert(boot.FirstBoot(), IsNil)
	c.Assert(firstBootEnableFirstEtherRun, Equals, true)
}
Esempio n. 4
0
func (s *FirstBootTestSuite) TestNoErrorWhenNoGadget(c *C) {
	c.Assert(boot.FirstBoot(), IsNil)
	_, err := os.Stat(dirs.SnapFirstBootStamp)
	c.Assert(err, IsNil)
}