redefine IsCoreBoot as the model having a kernel
there are at least tests that show we can seed such systems
the changes ind devicemgr.go prompted fixes for some remodel tests that were
confusingly running wiht OnClassic true though they were using Core models
Is{Core,Classic}Boot() will be used to find if we are in a Ubuntu Core
device and if we are in a classic with modes (there is a modeenv file)
device respectively. That is determined by the information found in
the model assertion.
This is a purely mechanical change because it touches so many files, the real
interesting parts we need that prompted this will be followups.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
We will need to add Model to Device for UC20 cases, prepare for that
by forcing MockUC20Device to use one and produce output consistent
with it.
Make also the behavior of MockDevice a bit more consistent/realistic
though it has limited use for UC20, it allowed for mode != "run"
with HasModeenv false for example.
This is needed because the uc18/uc16 bootloader implementations do not actually
do this, and instead snapd needs to reset the value.
Also modify the bootenv bootloader logic simulation to not clean this anymore,
just as the real bootloaders do.
This all requires some slight changes to the test logic, which since they are
checking the BootVars map directly will see some additional empty keys in the
map as markSuccessful will now write those empty keys. Eventually we should port
these tests to use GetBootVars and not use the map directly since empty
string keys show up the same as missing keys with GetBootVars and that would
have prevented needing to change these tests at all.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
This internally uses Bootenv16, with snap_mode usage replaced with kernel_status
which is what we have for UC20.
Also fix doc-comment on RunBootenv20.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
In a future refactor of the boot tests, we will always need to write out a new
modeenv in the tests and never just read it, so we don't need this mocking
utility anymore.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
This is more consistent and means the same thing everywhere else, except for one
test helper which is also updated here to now mean the same thing.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>