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
snap-repair: add uc20 support #9383
Conversation
This is a minimal change for snap-repair to support uc20. The tests require a rework, ideally we would run all tests for a uc16 and a uc20 model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The direction looks good to me, some comments
061a00f
to
a8d27d9
Compare
This commit keeps the version independent tests in runnerSuite. It also uses testutil.BaseTest to simplify things.
a8d27d9
to
f2f9c24
Compare
The tests that deal with initState/writeSeedAssert now run with both uc16/uc20 where it makes sense. A new test runner20Suite.TestLoadStateInitDeviceInfoFail that checks the failure conditions for modeenv reading is also added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments/considerations, I haven't looked closely at tests except to see that new code is covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for this
@@ -1778,3 +1669,218 @@ ls -l ${PATH##*:}/repair | |||
c.Assert(err, IsNil) | |||
|
|||
} | |||
|
|||
// shared1620RunnerSuite is embedded by runner16Suite and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super super super super nitpicky, but this reads to me as "ubuntu core 1620" which is either 400 years old or 1600 years away in the future 😄
I would just rename this
// shared1620RunnerSuite is embedded by runner16Suite and | |
// sharedRunnerSuite is embedded by runner16Suite and |
also afaik, the behavior on uc16 is the same as uc18, so really it's shared between all three variants
but again nitpick, no need to rename this unless you want to appease my nitpicks
|
||
const errPrefix = "cannot set device information: " | ||
tests := []struct { | ||
breakFunc func() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah very clever!
err = ioutil.WriteFile(dirs.SnapModeenvFile, mockModeenv, 0644) | ||
c.Assert(err, IsNil) | ||
// validate that modeenv is actually valid | ||
_, err = boot.ReadModeenv("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this
This is a minimal change for snap-repair to support uc20. Some test refactor as well to make it easier to run tests with both a uc16 and uc20 setup.