Beispiel #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)
}
Beispiel #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)
}
Beispiel #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)
}
Beispiel #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
}
Beispiel #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)
}
Beispiel #6
0
func (b *defaultBackend) UndoCopySnapData(newInfo *snap.Info, flags int) error {
	meter := &progress.NullProgress{}
	snappy.UndoCopyData(newInfo, snappy.InstallFlags(flags), meter)
	return nil
}