after a successful update and reboot, the bootloader snappy_mode is set to 'try'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Low
|
Unassigned |
Bug Description
After a snappy update, reboot and successful boot, it's possible to run commands before the boot-ok service has run and updated the bootloader config file.
This causes the rollback test to go crazy because snappy rollback updates the bootloader conf, then boot-ok runs and changes the values of the file.
It shouldn't be possible to log in before boot-ok has finished running.
This doesn't affect manual scenarios because for a person it's slow to do something like snappy rollback. It affects the integration suite because after ssh all the commands are executed very fast.
I have proposed a branch with a workaround for the integration suite. Also a branch with an assertion that exposes the problem. Once this is fixed, the second branch should be merged and the workaround removed.
Original report
===============
To reproduce:
$ go run ./_integration-
****** Resuming rollbackSuite.
PASS: <autogenerated>:52: rollbackSuite.
snappy list
Name Date Version Developer
ubuntu-core 2015-09-21 180 ubuntu
generic-amd64 2015-09-22 1.4 canonical
/home/elopio/
...open /home/elopio/
... obtained bool = false
... expected bool = true
The test expects ubuntu core to be 179, the previous version. But it boots on 180.
I think this is something that the test causes, and not a snappy issue.
Related branches
- Federico Gimenez (community): Approve
-
Diff: 67 lines (+10/-4)3 files modified_integration-tests/tests/rollback_test.go (+5/-0)
_integration-tests/testutils/partition/bootloader.go (+4/-3)
_integration-tests/testutils/partition/bootloader_test.go (+1/-1)
- Snappy Developers: Pending requested
-
Diff: 13 lines (+3/-0)1 file modified_integration-tests/tests/update_test.go (+3/-0)
summary: |
- fake rollback integration test fails + after a successful boot, the bootloader snappy_mode is set to 'try' |
summary: |
- after a successful boot, the bootloader snappy_mode is set to 'try' + after a successful update and reboot, the bootloader snappy_mode is set + to 'try' |
description: | updated |
Changed in snappy: | |
status: | New → Confirmed |
affects: | snappy → snapd |
I'm getting this randomly, most of the time it's working. It seems to be related to the value of snappy_trial_boot on /boot/grub/grubenv, when it succeeds the file has:
# GRUB Environment Block
snappy_mode=try
snappy_ab=a
snappy_trial_boot=0
and when it fails:
# GRUB Environment Block
snappy_mode=try
snappy_ab=a
snappy_trial_boot=1
Leo, can you please confirm?