Skip to content

Commit 5034859

Browse files
committed
Add verification for alternatives migration to extended upgrades test
1 parent 1e7c003 commit 5034859

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/kola/upgrade/extended/test.sh

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

245245
ok "Reached version: $version"
246246

247+
verify-alternatives-migration() {
248+
# Verify iptables migration
249+
if [[ $(alternatives --admindir /etc/alternatives-admindir --display iptables | grep -c -E 'link currently points to /usr/(bin|sbin)/iptables-nft') != "1" ]]; then
250+
fatal "Error: migration did not set iptables to nft backend"
251+
fi
252+
if [[ $(iptables --version | grep -c "nf_tables") != "1" ]]; then
253+
fatal "Error: iptables not reset to nftables backend"
254+
fi
255+
256+
ok "alternatives migration verification passed."
257+
258+
}
259+
247260
# Are we all the way at the desired target version?
248261
# If so then we can exit with success!
249262
if vereq $version $target_version; then
@@ -256,6 +269,8 @@ if vereq $version $target_version; then
256269
fi
257270
# One last check!
258271
selinux-sanity-check
272+
#One more last check
273+
verify-alternatives-migration
259274
exit 0
260275
fi
261276

0 commit comments

Comments
 (0)