Skip to content

Commit 1ae373e

Browse files
committed
Add verification for alternatives migration to extended upgrades test
1 parent 354f924 commit 1ae373e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/kola/upgrade/extended/test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,23 @@ selinux-sanity-check() {
244244

245245
ok "Reached version: $version"
246246

247+
verify-alternatives-migration() {
248+
# Verify /var/lib/alternatives dir is removed
249+
if [[ -e /var/lib/alternatives ]]; then
250+
fatal "Error: migration didn't remove /var/lib/alternatives"
251+
fi
252+
253+
# Verify iptables migration
254+
if [[ $(alternatives --display iptables | grep -c -E 'link currently points to /usr/(bin|sbin)/iptables-nft') != "1" ]]; then
255+
fatal "Error: migration did not set iptables to nft backend"
256+
fi
257+
if [[ $(iptables --version | grep -c "nf_tables") != "1" ]]; then
258+
fatal "Error: iptables not reset to nftables backend"
259+
fi
260+
261+
ok "alternatives migration verification passed."
262+
}
263+
247264
# Are we all the way at the desired target version?
248265
# If so then we can exit with success!
249266
if vereq $version $target_version; then
@@ -256,6 +273,8 @@ if vereq $version $target_version; then
256273
fi
257274
# One last check!
258275
selinux-sanity-check
276+
# One more last check
277+
verify-alternatives-migration
259278
exit 0
260279
fi
261280

0 commit comments

Comments
 (0)