From 4a99568fa325846e5baf32be38d447c7091b62a0 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 22 Mar 2024 15:41:12 -0700 Subject: [PATCH] [stable-2.14] ansible-test - Fix Alpine libexpat bootstrapping (#82898) * [stable-2.14] ansible-test - Fix Alpine libexpat bootstrapping (cherry picked from commit ca168eb3674a01d5fffccd6f237f0872eb386e46) Co-authored-by: Matt Clay * Alpine 3.16 has `expat` instead of `libexpat` --- changelogs/fragments/ansible-test-alpine-libexpat.yml | 2 ++ test/lib/ansible_test/_util/target/setup/bootstrap.sh | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 changelogs/fragments/ansible-test-alpine-libexpat.yml diff --git a/changelogs/fragments/ansible-test-alpine-libexpat.yml b/changelogs/fragments/ansible-test-alpine-libexpat.yml new file mode 100644 index 00000000000..d0f0f19dd80 --- /dev/null +++ b/changelogs/fragments/ansible-test-alpine-libexpat.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - The ``libexpat`` package is automatically upgraded during remote bootstrapping to maintain compatibility with newer Python packages. diff --git a/test/lib/ansible_test/_util/target/setup/bootstrap.sh b/test/lib/ansible_test/_util/target/setup/bootstrap.sh index ea17dad3875..1dec3dc8562 100644 --- a/test/lib/ansible_test/_util/target/setup/bootstrap.sh +++ b/test/lib/ansible_test/_util/target/setup/bootstrap.sh @@ -111,6 +111,15 @@ bootstrap_remote_alpine() echo "Failed to install packages. Sleeping before trying again..." sleep 10 done + + # Upgrade the `expat` package to ensure that an upgraded Python (`pyexpat`) continues to work. + while true; do + # shellcheck disable=SC2086 + apk upgrade -q expat \ + && break + echo "Failed to upgrade expat. Sleeping before trying again..." + sleep 10 + done } bootstrap_remote_fedora()