Skip to content
Snippets Groups Projects
Commit d2554af4 authored by Frédéric Dalleau's avatar Frédéric Dalleau
Browse files

Generate broken ostree static delta for rollback test


The broken ostree commit is generated after the successful commit.
Removing updatectl, it makes it impossible to mark an update successful.
Hence the bootcount will be increased at each boot, eventually causing
rollback to the previous deployment.

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 2d8cdca9
No related branches found
No related tags found
No related merge requests found
......@@ -264,6 +264,23 @@ def buildOStree(architecture, type, board, debosarguments = "", repo = "repo") {
--filename ${image_name}.delta""")
}
def buildOStreeBad(architecture, type, board, debosarguments = "", repo = "repo") {
def image_name = imageName(architecture, type, board, true)
def branch = "${osname}/${release}/${architecture}-${board}/${type}"
def bad_branch = "${osname}/${release}/${architecture}-${board}/${type}_bad"
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
ostree --repo=${repo} static-delta generate \
--from=${branch} \
--to=${bad_branch} \
--inline \
--min-fallback-size=1024 \
--filename ${image_name}_bad.delta""")
}
/** Generate the image name
*
* To have a single place for image name generation.
......@@ -321,6 +338,7 @@ def buildOStreeImage(architecture, type, board, debosarguments = "") {
stage("${architecture} ${type} ${board} OStree image build") {
buildOStree(architecture, type, board, debosarguments, repo)
buildOStreeBad(architecture, type, board, debosarguments, repo)
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
......
......@@ -82,3 +82,13 @@ actions:
repository: {{ $ostree }}
branch: {{ $branch }}
subject: {{ $message }}
- action: run
chroot: true
command: rm /usr/bin/updatectl
- action: ostree-commit
repository: {{ $ostree }}
branch: {{ $branch }}_bad
subject: {{ $message }} bad commit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment