Esempio n. 1
0
func (s *binariesTestSuite) TestAddSnapBinariesAndRemove(c *C) {
	info := snaptest.MockSnap(c, packageHello, &snap.SideInfo{Revision: snap.R(11)})

	err := wrappers.AddSnapBinaries(info)
	c.Assert(err, IsNil)

	link := filepath.Join(s.tempdir, "/snap/bin/hello-snap.hello")
	target, err := os.Readlink(link)
	c.Assert(err, IsNil)
	c.Check(target, Equals, "/usr/bin/snap")

	err = wrappers.RemoveSnapBinaries(info)
	c.Assert(err, IsNil)

	c.Check(osutil.FileExists(link), Equals, false)
}
Esempio n. 2
0
func generateWrappers(s *snap.Info) error {
	// add the CLI apps from the snap.yaml
	if err := wrappers.AddSnapBinaries(s); err != nil {
		return err
	}
	// add the daemons from the snap.yaml
	if err := wrappers.AddSnapServices(s, &progress.NullProgress{}); err != nil {
		return err
	}
	// add the desktop files
	if err := wrappers.AddSnapDesktopFiles(s); err != nil {
		return err
	}

	return nil
}