|
46 | 46 | # xref https://github.com/coreos/coreos-assembler/pull/2814
|
47 | 47 | systemctl mask --now zincati
|
48 | 48 | # Create a synthetic commit for upgrade
|
49 |
| - ostree commit --no-bindings --parent="${commit}" -b staged-deploy -I --consume t |
| 49 | + ostree commit --no-bindings --parent="${commit}" -b staged-deploy -I --consume t --add-metadata-string=version=foobar |
50 | 50 | newcommit=$(ostree rev-parse staged-deploy)
|
51 | 51 | orig_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
|
52 | 52 | systemctl show -p SubState ostree-finalize-staged.path | grep -q waiting
|
|
169 | 169 | ostree admin undeploy 1
|
170 | 170 | echo "ok staged retained"
|
171 | 171 |
|
| 172 | + # Deploy a new version |
| 173 | + commit=${host_commit} |
| 174 | + ostree checkout -H ${commit} t |
| 175 | + ostree commit --no-bindings --parent="${commit}" -b same-version -I --consume t --add-metadata-string=version=foobaz |
| 176 | + ostree admin deploy same-version --retain-previous-version |
| 177 | + |
| 178 | + # Cleanup refs |
| 179 | + ostree refs --delete staged-deploy nonstaged-deploy same-version |
| 180 | + echo "ok cleanup refs" |
| 181 | + |
| 182 | + /tmp/autopkgtest-reboot "3" |
| 183 | + ;; |
| 184 | + "3") |
| 185 | + # Check currently deployed versions |
| 186 | + rpm-ostree status |
| 187 | + |
| 188 | + # Make a new commit with the same version as the previous reboot |
| 189 | + commit=$(rpmostree_query_json '.deployments[0].checksum') |
| 190 | + cd /ostree/repo/tmp |
| 191 | + ostree checkout -H ${commit} t |
| 192 | + ostree commit --no-bindings --parent="${commit}" -b same-version-again -I --consume t --add-metadata-string=version=foobaz |
| 193 | + ostree admin deploy same-version-again --retain-previous-version |
| 194 | + |
| 195 | + # Check that previous version was kept |
| 196 | + ostree admin status > status.txt |
| 197 | + test $(grep -Fce 'Version: ' status.txt) = 3 |
| 198 | + echo "ok previous version retained" |
| 199 | + |
| 200 | + # Check also for the staging path |
| 201 | + rpm-ostree cleanup -p |
| 202 | + ostree admin deploy --stage same-version-again --retain-previous-version |
| 203 | + ostree admin finalize-staged |
| 204 | + |
| 205 | + # Check that previous version was kept |
| 206 | + ostree admin status > status.txt |
| 207 | + test $(grep -Fce 'Version: ' status.txt) = 3 |
| 208 | + echo "ok previous version retained during stage" |
| 209 | + |
172 | 210 | # Cleanup refs
|
173 |
| - ostree refs --delete staged-deploy nonstaged-deploy |
| 211 | + ostree refs --delete same-version-again |
174 | 212 | echo "ok cleanup refs"
|
175 | 213 |
|
176 | 214 | # Now finally, try breaking staged updates and verify that ostree-boot-complete fails on the next boot
|
|
0 commit comments