Exemplo n.º 1
0
// Test that there is a proper message if autoupdate runs in the
// background
func (s *autoupdateMsgSuite) TestAutoUpdateMessageIsPrinted(c *check.C) {
	cli.ExecCommand(c, "sudo", "systemctl", "start", "snappy-autopilot")

	s.AddCleanup(func() {
		cli.ExecCommand(c, "sudo", "systemctl", "stop", "snappy-autopilot")
		// do not pollute the other tests with hello-world, in case it is installed
		_, err := exec.Command("sudo", "snappy", "remove", "hello-world").CombinedOutput()
		if err != nil {
			fmt.Println("hello-world didn't get installed")
		}
	})

	// FIXME: risk of race
	// (i.e. systemctl start finishes before install runs)
	snappyOutput, _ := exec.Command("sudo", "snappy", "install", "hello-world").CombinedOutput()

	var expectedTxt string
	if common.Release(c) == "15.04" {
		expectedTxt = "another snappy is running, try again later"
	} else {
		expectedTxt = "Snappy is updating your system"
	}
	expectedPattern := "(?ms).*^" + expectedTxt + ".*\n.*"

	c.Assert(string(snappyOutput), check.Matches, expectedPattern)
}
Exemplo n.º 2
0
func (s *activateSuite) SetUpTest(c *check.C) {
	s.SnappySuite.SetUpTest(c)
	if common.Release(c) == "15.04" {
		c.Skip("activate CLI command not available on 15.04, reenable the test when present")
	}
	var err error
	s.snapPath, err = build.LocalSnap(c, activateSnapName)
	c.Assert(err, check.IsNil, check.Commentf("Error building local snap: %s", err))
	common.InstallSnap(c, s.snapPath)
}
Exemplo n.º 3
0
func (s *fanTestSuite) SetUpTest(c *check.C) {
	if common.Release(c) == "15.04" {
		c.Skip("Ubuntu Fan not available in 15.04")
	}

	s.SnappySuite.SetUpTest(c)
	var err error
	s.subjectIP, err = getIPAddr(c)
	c.Assert(err, check.IsNil, check.Commentf("Error getting IP address: %s", err))

	s.fanCtl(c, "up")
	s.bridgeIP = s.fanBridgeIP(c)
}