1
# Test that we can upgrade to the latest image version and roll back to the
2
# original version. Test will be skipped the testbed does not offer reboot
3
# (needs autopkgtest with a supporting runner).
6
can_reboot || { echo "SKIP: cannot reboot testbed"; return; }
13
# second reboot: after rollback
14
if [ -e "${ADT_ARTIFACTS}/rolled_back" ]; then
15
orig_current=$(cat "${ADT_ARTIFACTS}/current")
16
[ "$orig_current" = "$current" ] || fail "did not roll back to version $orig_current ($all_versions)"
20
# first reboot: after upgrade
21
orig_avail=$(cat "${ADT_ARTIFACTS}/avail")
22
[ "$orig_avail" = "$current" ] || fail "did not upgrade to current version $orig_avail != $current ($all_versions)"
24
echo "rolling back..."
25
sudo snappy rollback ubuntu-core
26
touch "${ADT_ARTIFACTS}/rolled_back"
31
# fake new available version by doing a current--
32
switch_channel "s/build_number: $current/build_number: $((current-1))/"
34
# we should have something now :)
37
[ $avail -gt $current ] || fail "$avail is not newer than $current"
39
# save version for post-upgrade test
40
save_version_info $avail $current