Skip to content

Commit 848fc53

Browse files
HuijingHeidustymabe
authored andcommitted
tests/upgrade: drop the rollback deployment on aarch64
We need to drop the rollback deployment. During upgrade `...-> 40.20240906.1.0 (A)-> 41.20241109.1.0 (B)-> 42.20241114.91.0 (C)` 1) A->B, A has the unfixed ostree, the upgrade will copy dtb files to `/boot/ostree` both for current A and new B with wrong label 2) B->C, B has the fixed ostree, the upgrade will prune A, leave B with wrong label, and new C with correct label 3) Finaly booting C and will check that B has the wrong label In this case we need to drop the rollback before checking. If then upgrade to newer D, the upgrade will prune B (wrong label), leave C with correct label, and new D with correct label. (We should remove the drop under this case)
1 parent a9555e2 commit 848fc53

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

tests/kola/upgrade/extended/test.sh

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -162,34 +162,35 @@ wait-for-coreos-fix-selinux-labels() {
162162
echo "Waited for coreos-fix-selinux-labels.service to finish"
163163
}
164164

165-
# Check if the rollback deployment has the dtb copy fix, which
166-
# means that the dtb files should have the correct SELinux labels.
165+
# We need to drop the rollback deployment. During upgrade
166+
# `...-> 40.20240906.1.0 (A)-> 41.20241109.1.0 (B)-> 42.20241114.91.0 (C)`
167+
# 1) A->B, A has the unfixed ostree, the upgrade will copy dtb files
168+
# to `/boot/ostree` both for current A and new B with wrong label
169+
# 2) B->C, B has the fixed ostree, the upgrade will prune A, leave B
170+
# with wrong label, and new C with correct label
171+
# 3) Finaly booting C and will check that B has the wrong label
172+
# In this case we need to drop the rollback before checking.
173+
#
174+
# If then upgrade to newer D, the upgrade will prune B (wrong label),
175+
# leave C with correct label, and new D with correct label. (We
176+
# should remove the drop under this case)
177+
#
167178
# https://github.com/coreos/fedora-coreos-tracker/issues/1808
168179
#
169-
# NOTE: we can drop this once the newest barrier release for all
170-
# streams is newer than 41.20241028.x.x.
171-
has_dtb_cp_fix() {
180+
# NOTE: we can drop this once moved to F43.
181+
drop_rollback_on_aarch64() {
172182
# The dtb copy issue was only ever an issue ever on aarch64
173-
[ "$(arch)" != 'aarch64' ] && return 0
174-
# We have the dtb copy fix if the rollback deployment is newer than
175-
# when the fixed ostree was included. It should be fixed in the
176-
# next round of releases after 41.20241028. Note 41.20241028.0.0
177-
# is not a real build and uses `0` for the stream identifier, but
178-
# should sort accordingly.
179-
previous=$(rpm-ostree status --json | jq -r '.deployments[] | select(.booted == false).version')
180-
if ! vergt $previous '41.20241028.0.0'; then
181-
return 1
182-
else
183-
return 0
184-
fi
183+
[ "$(arch)" != 'aarch64' ] && return
184+
echo "Dropping rollback deployment because it could have mislabeled dtb files"
185+
rpm-ostree cleanup -r
185186
}
186187

187188
selinux-sanity-check() {
188189
# First make sure the migrations/fix script has finished if this is the boot
189190
# where the fixes are taking place.
190191
wait-for-coreos-fix-selinux-labels
191-
# Check to see if we have the dtb copy fix
192-
has_dtb_cp_fix || add_dtb_exception='true'
192+
# Drop the rooback on aarch64 before checking.
193+
drop_rollback_on_aarch64
193194
# Verify SELinux labels are sane. Migration scripts should have cleaned
194195
# up https://github.com/coreos/fedora-coreos-tracker/issues/1772
195196
unlabeled="$(find /sysroot -context '*unlabeled_t*' -print0 | xargs --null -I{} ls -ldZ '{}')"
@@ -230,9 +231,6 @@ selinux-sanity-check() {
230231
# Add in a few temporary glob exceptions
231232
# https://github.com/coreos/fedora-coreos-tracker/issues/1806
232233
[[ "${path}" =~ /etc/selinux/targeted/active/ ]] && continue
233-
if [ "${add_dtb_exception:-}" == 'true' ]; then
234-
[[ "${path}" =~ /boot/ostree/.*/dtb ]] && continue
235-
fi
236234
if [[ "${exceptions[$path]:-noexception}" == 'noexception' ]]; then
237235
echo "Unexpected mislabeled file found: ${path}"
238236
found="1"

0 commit comments

Comments
 (0)