Пример #1
0
func (s *apiSuite) TestInstallLeaveOld(c *check.C) {
	orig := snappyInstall
	defer func() { snappyInstall = orig }()

	calledFlags := snappy.InstallFlags(42)

	snappyInstall = func(name string, flags snappy.InstallFlags, meter progress.Meter) (string, error) {
		calledFlags = flags

		return "", nil
	}

	inst := &packageInstruction{
		Action:   "install",
		LeaveOld: true,
	}

	err := inst.dispatch()()

	c.Check(calledFlags, check.Equals, snappy.InstallFlags(0))
	c.Check(err, check.IsNil)
}
Пример #2
0
// The undo handler of the setup-profiles task will honor `old-devmode` that
// is optionally stored in the task state and use it to set the DevMode flag in
// the SnapState.
//
// This variant checks restoring DevMode to false
func (s *interfaceManagerSuite) TestSetupProfilesUndoDevModeFalse(c *C) {
	s.undoDevModeCheck(c, snappy.InstallFlags(0), false)
}
Пример #3
0
func (b *defaultBackend) CopySnapData(newInfo, oldInfo *snap.Info, flags int) error {
	meter := &progress.NullProgress{}
	return snappy.CopyData(newInfo, oldInfo, snappy.InstallFlags(flags), meter)
}
Пример #4
0
func (b *defaultBackend) SetupSnap(snapFilePath string, sideInfo *snap.SideInfo, flags int) error {
	meter := &progress.NullProgress{}
	_, err := snappy.SetupSnap(snapFilePath, sideInfo, snappy.InstallFlags(flags), meter)
	return err
}
Пример #5
0
func (b *defaultBackend) CheckSnap(snapFilePath string, curInfo *snap.Info, flags int) error {
	meter := &progress.NullProgress{}
	return snappy.CheckSnap(snapFilePath, curInfo, snappy.InstallFlags(flags), meter)
}
Пример #6
0
func (b *defaultBackend) UndoCopySnapData(newInfo *snap.Info, flags int) error {
	meter := &progress.NullProgress{}
	snappy.UndoCopyData(newInfo, snappy.InstallFlags(flags), meter)
	return nil
}