Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o/devicestate: cleanup system actions supported by recover mode #8686

Merged

Conversation

bboozzoo
Copy link
Collaborator

It does not make sense for recover mode to go boot into recover mode again.

This is stacked on top of #8672

Tweak the system actions to allow recovery mode system to enter reinstall or run
modes.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@pedronis pedronis self-requested a review May 18, 2020 09:53
@bboozzoo bboozzoo added the UC20 label May 18, 2020
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment not to address here, one about the test situation

@@ -891,7 +908,7 @@ func (m *DeviceManager) Systems() ([]*System, error) {
}
if currentSys != nil && isCurrentSystem(currentSys, system) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still feel this should actually be integrated back in systemFromSeed by passing all the needed info in, but can be done when moving it to systems.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we'll do this after #8689 lands.

@@ -335,40 +335,38 @@ func (s *deviceMgrSystemsSuite) TestRequestSameModeSameSystem(c *C) {
s.state.Unlock()

label := s.mockedSystemSeeds[0].label

happyModes := []string{"run", "recover"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we have just moved recover to sadModes, are we not testing that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, silly me. I'll restore the test.

@zyga
Copy link
Collaborator

zyga commented May 19, 2020

@bboozzoo is this related?

+ snap remove --purge jq
error: cannot remove "jq": snap "jq" is not removable: no snaps are removable
       in any of the ephemeral modes

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
…fferent seed

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
…rent modes

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@pedronis pedronis self-requested a review May 19, 2020 14:06
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@bboozzoo
Copy link
Collaborator Author

The failure on 18.04 is unrelated:

2020-05-19T14:32:19.7542481Z ##[error]2020-05-19 14:32:19 Error preparing google:ubuntu-18.04-64:tests/regression/lp-1867193 (may191409-158977) : 
2020-05-19T14:32:19.7565774Z -----
...
2020-05-19T14:32:19.7680079Z Removing snapd state
2020-05-19T14:32:19.7680309Z + lxc exec bionic -- apt update
2020-05-19T14:32:19.7680361Z 
2020-05-19T14:32:19.7680460Z WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2020-05-19T14:32:19.7680518Z 
2020-05-19T14:32:19.7680804Z E: Type 'bionic-security' is not known on line 50 in source list /etc/apt/sources.list
2020-05-19T14:32:19.7680909Z E: The list of sources could not be read.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

s.restartRequests = nil
s.bootloader.BootVars = map[string]string{}
}
s.testRequestModeWithRestart(c, []string{"install", "run"}, s.mockedSystemSeeds[0].label)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@mvo5 mvo5 merged commit 09ab13e into snapcore:master May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants