diff --git a/osbuild-composer.spec b/osbuild-composer.spec index a3dc94715..802975daf 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -185,7 +185,6 @@ install -m 0755 -vp _bin/osbuild-service-maintenance-tests %{buildroot}% install -m 0755 -vp _bin/osbuild-mock-openid-provider %{buildroot}%{_libexecdir}/osbuild-composer-test/ install -m 0755 -vp tools/define-compose-url.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/ install -m 0755 -vp tools/provision.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/ -install -m 0755 -vp tools/ansible-blocking-io.py %{buildroot}%{_libexecdir}/osbuild-composer-test/ install -m 0755 -vp tools/gen-certs.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/ install -m 0755 -vp tools/gen-ssh.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/ install -m 0755 -vp tools/image-info %{buildroot}%{_libexecdir}/osbuild-composer-test/ diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index 1eda981f8..e4a0083d4 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -614,10 +614,6 @@ ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" EOF -# Fix ansible error https://github.com/osbuild/osbuild-composer/issues/3309 -greenprint "fix stdio file non-blocking issue" -sudo /usr/libexec/osbuild-composer-test/ansible-blocking-io.py - # Test IoT/Edge OS greenprint "📼 Run Edge tests on BIOS VM" sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ @@ -707,10 +703,6 @@ ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" EOF -# Fix ansible error https://github.com/osbuild/osbuild-composer/issues/3309 -greenprint "fix stdio file non-blocking issue" -sudo /usr/libexec/osbuild-composer-test/ansible-blocking-io.py - # Test IoT/Edge OS greenprint "📼 Run Edge tests on UEFI VM" sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ @@ -895,10 +887,6 @@ ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" EOF -# Fix ansible error https://github.com/osbuild/osbuild-composer/issues/3309 -greenprint "fix stdio file non-blocking issue" -sudo /usr/libexec/osbuild-composer-test/ansible-blocking-io.py - # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ -e image_type="$OSTREE_OSNAME" \ diff --git a/test/cases/ostree-raw-image.sh b/test/cases/ostree-raw-image.sh index c63da4070..60c743573 100755 --- a/test/cases/ostree-raw-image.sh +++ b/test/cases/ostree-raw-image.sh @@ -561,10 +561,6 @@ ansible_become_method=sudo ansible_become_pass=${EDGE_USER_PASSWORD} EOF - # Fix ansible error https://github.com/osbuild/osbuild-composer/issues/3309 - greenprint "fix stdio file non-blocking issue" - sudo /usr/libexec/osbuild-composer-test/ansible-blocking-io.py - # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ -e image_type="${OSTREE_OSNAME}" \ @@ -987,7 +983,7 @@ if [[ "$ID" == "fedora" ]]; then # Replacing with our own local repo greenprint "Replacing default remote" sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} "echo ${EDGE_USER_PASSWORD} |sudo -S ostree remote delete ${OSTREE_OSNAME}" - sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} "echo ${EDGE_USER_PASSWORD} |sudo -S ostree remote add --no-gpg-verify ${OSTREE_OSNAME} ${STAGE_REPO_URL}" + sudo ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@${UEFI_GUEST_ADDRESS} "echo ${EDGE_USER_PASSWORD} |sudo -S ostree remote add --no-gpg-verify ${OSTREE_OSNAME} ${PROD_REPO_URL}" fi # Upgrade image/commit. diff --git a/test/cases/ostree-simplified-installer.sh b/test/cases/ostree-simplified-installer.sh index 80010e804..bf98decb8 100755 --- a/test/cases/ostree-simplified-installer.sh +++ b/test/cases/ostree-simplified-installer.sh @@ -17,6 +17,12 @@ sudo pip3 install yq==v3.2.1 sudo dnf install -y fdo-admin-cli # Start fdo-aio to have /etc/fdo/aio folder sudo systemctl enable --now fdo-aio +# Wait until config file serviceinfo_api_server.yml exists +# to avoid file not available to use flaky issue +until [ -f /etc/fdo/aio/configs/serviceinfo_api_server.yml ] +do + sleep 2 +done # Prepare service api server config filef sudo /usr/local/bin/yq -iy '.service_info.diskencryption_clevis |= [{disk_label: "/dev/vda4", reencrypt: true, binding: {pin: "tpm2", config: "{}"}}]' /etc/fdo/aio/configs/serviceinfo_api_server.yml sudo systemctl restart fdo-aio diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index a74f370a3..4d3f0a488 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -528,7 +528,7 @@ sudo mv boot.iso /var/lib/libvirt/images LOCAL_BOOT_LOCATION="/var/lib/libvirt/images/boot.iso" # Workaround to fix issue https://github.com/osbuild/osbuild-composer/issues/3216 -if [[ "${ID}-${VERSION_ID}" == "fedora-37" ]]; then +if [[ "${ID}" == "fedora" ]]; then location_arg="${LOCAL_BOOT_LOCATION}",initrd=images/pxeboot/initrd.img,kernel=images/pxeboot/vmlinuz else location_arg="${LOCAL_BOOT_LOCATION}" @@ -742,10 +742,6 @@ ansible_private_key_file=${SSH_KEY} ansible_ssh_common_args="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" EOF -# Fix ansible error https://github.com/osbuild/osbuild-composer/issues/3309 -greenprint "fix stdio file non-blocking issue" -sudo /usr/libexec/osbuild-composer-test/ansible-blocking-io.py - # Test IoT/Edge OS sudo ansible-playbook -v -i "${TEMPDIR}"/inventory \ -e image_type=${IMAGE_TYPE} \ diff --git a/test/data/ansible/check_ostree.yaml b/test/data/ansible/check_ostree.yaml index 349be380b..cfac7aeb6 100644 --- a/test/data/ansible/check_ostree.yaml +++ b/test/data/ansible/check_ostree.yaml @@ -755,21 +755,15 @@ - name: install sanely failing health check unit to test red boot status behavior block: - name: install sanely failing health check unit to test red boot status behavior - command: rpm-ostree install --cache-only https://s3.amazonaws.com/org.osbuild.test-dependencies/greenboot-failing-unit-1.0-1.el8.noarch.rpm + command: rpm-ostree install --cache-only https://s3.amazonaws.com/org.osbuild.test-dependencies/greenboot-failing-unit-1.0-1.el8.noarch.rpm --reboot become: yes - register: install_result - retries: 30 # due to https://github.com/osbuild/osbuild-composer/issues/2492 - delay: 2 - until: install_result is success + ignore_errors: yes + ignore_unreachable: yes - - name: delay 10 seconds before reboot to make system stable + - name: delay 30 seconds before reboot to make system stable pause: - seconds: 10 - - - name: reboot to deploy new ostree commit - reboot: - post_reboot_delay: 10 - become: yes + seconds: 30 + delegate_to: 127.0.0.1 - name: wait for connection to become reachable/usable wait_for_connection: diff --git a/tools/ansible-blocking-io.py b/tools/ansible-blocking-io.py deleted file mode 100755 index 58d2820c7..000000000 --- a/tools/ansible-blocking-io.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python3 - -# This python script is to fix ansible error in CI test. It's not a bug of ansible, but a side-effect of a different change -# Details can be found in https://github.com/osbuild/osbuild-composer/issues/3309 -# Will remove it later if we do not see ansible error in CI - -import os -import sys - -for handle in (sys.stdin, sys.stdout, sys.stderr): - try: - fd = handle.fileno() - except Exception: - continue - - os.set_blocking(fd, True)