25
. "launchpad.net/snappy/_integration-tests/testutils/common"
27
check "gopkg.in/check.v1"
26
"launchpad.net/snappy/_integration-tests/testutils/build"
27
"launchpad.net/snappy/_integration-tests/testutils/cli"
28
"launchpad.net/snappy/_integration-tests/testutils/common"
30
33
var _ = check.Suite(&infoSuite{})
32
35
type infoSuite struct {
36
39
func (s *infoSuite) TestInfoMustPrintReleaseAndChannel(c *check.C) {
37
40
// skip test when having a remote testbed (we can't know which the
38
41
// release and channels are)
39
if Cfg.RemoteTestbed {
42
if common.Cfg.RemoteTestbed {
40
43
c.Skip(fmt.Sprintf(
41
44
"Skipping %s while testing in remote testbed",
45
infoOutput := ExecCommand(c, "snappy", "info")
48
infoOutput := cli.ExecCommand(c, "snappy", "info")
47
50
expected := "(?ms)" +
48
fmt.Sprintf("^release: ubuntu-core/%s/%s\n", Cfg.Release, Cfg.Channel) +
51
fmt.Sprintf("^release: ubuntu-core/%s/%s\n", common.Cfg.Release, common.Cfg.Channel) +
51
54
c.Assert(infoOutput, check.Matches, expected)
54
57
func (s *infoSuite) TestInfoMustPrintInstalledApps(c *check.C) {
55
InstallSnap(c, "hello-world")
57
RemoveSnap(c, "hello-world")
59
infoOutput := ExecCommand(c, "snappy", "info")
58
snapPath, err := build.LocalSnap(c, build.BasicSnapName)
59
defer os.Remove(snapPath)
60
c.Assert(err, check.IsNil)
61
common.InstallSnap(c, snapPath)
62
defer common.RemoveSnap(c, build.BasicSnapName)
64
infoOutput := cli.ExecCommand(c, "snappy", "info")
61
66
expected := "(?ms)" +
63
"^apps: .*hello-world.*\n"
68
"^apps: .*" + build.BasicSnapName + "\\.sideload.*\n"
64
69
c.Assert(infoOutput, check.Matches, expected)
67
72
func (s *infoSuite) TestInfoMustPrintInstalledFrameworks(c *check.C) {
68
InstallSnap(c, "hello-dbus-fwk.canonical")
73
common.InstallSnap(c, "hello-dbus-fwk.canonical")
69
74
s.AddCleanup(func() {
70
RemoveSnap(c, "hello-dbus-fwk.canonical")
75
common.RemoveSnap(c, "hello-dbus-fwk.canonical")
72
infoOutput := ExecCommand(c, "snappy", "info")
77
infoOutput := cli.ExecCommand(c, "snappy", "info")
74
79
expected := "(?ms)" +