Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Bugfix/lp1488114 import msg #14
Merged
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a34f83e
auto-retry if the lock is taken
mvo5 b13f5c2
show autopilot specific message if its running and add integration test
mvo5 35f5a35
Added a sudo wrapper that preserves the user path.
elopio 6547c29
Make the file writable.
elopio 533a189
Fixed the path.
elopio 700737b
merged lp:~elopio/snappy/sudo_path (many thanks)
mvo5 f2d4f69
rename withMutex->withMutexAndRetry (thanks Leo!)
mvo5 08228d5
_integration-tests/tests/autopilot-msg_test.go: add missing cleanup
mvo5 bfb31e7
merged lp:snappy and resolved conflicts
mvo5 9a5b0fe
merged lp:snappy
mvo5 9cdc363
update to compile with trunk
mvo5 46ab3ea
Merge branch 'master' into bugfix/lp1488114-import-msg
mvo5 9732070
run ./update-pot
mvo5 f324eb3
update "Another snappy is running" string
mvo5
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,56 @@ | ||
| +// -*- Mode: Go; indent-tabs-mode: t -*- | ||
| + | ||
| +/* | ||
| + * Copyright (C) 2015 Canonical Ltd | ||
| + * | ||
| + * This program is free software: you can redistribute it and/or modify | ||
| + * it under the terms of the GNU General Public License version 3 as | ||
| + * published by the Free Software Foundation. | ||
| + * | ||
| + * This program is distributed in the hope that it will be useful, | ||
| + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| + * GNU General Public License for more details. | ||
| + * | ||
| + * You should have received a copy of the GNU General Public License | ||
| + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| + * | ||
| + */ | ||
| + | ||
| +package tests | ||
| + | ||
| +import ( | ||
| + "os/exec" | ||
| + | ||
| + "launchpad.net/snappy/_integration-tests/testutils/cli" | ||
| + "launchpad.net/snappy/_integration-tests/testutils/common" | ||
| + | ||
| + check "gopkg.in/check.v1" | ||
| +) | ||
| + | ||
| +var _ = check.Suite(&autopilotMsgSuite{}) | ||
| + | ||
| +type autopilotMsgSuite struct { | ||
| + common.SnappySuite | ||
| +} | ||
| + | ||
| +// Test that there is a proper message if the autopilot runs in the | ||
| +// background | ||
| +func (s *autopilotMsgSuite) TestAutoPilotMessageIsPrinted(c *check.C) { | ||
| + cli.ExecCommand(c, "sudo", "systemctl", "start", "snappy-autopilot") | ||
| + | ||
| + // do not pollute the other tests with the now installed hello-world | ||
| + s.AddCleanup(func() { | ||
| + common.RemoveSnap(c, "hello-world") | ||
| + }) | ||
| + | ||
| + // FIXME: risk of race | ||
| + // (i.e. systemctl start finishes before install runs) | ||
| + snappyOutput, _ := exec.Command("sudo", "snappy", "install", "hello-world").CombinedOutput() | ||
| + | ||
| + expected := "(?ms)" + | ||
| + ".*" + | ||
| + "^The snappy autopilot is updating your system.*\n" + | ||
| + ".*" | ||
| + c.Assert(string(snappyOutput), check.Matches, expected) | ||
| +} |