test: Four fixes for RHEL for Edge tests
1. Remove ansible-blocking-io.py workaround. It's not required. 2. Variable should be PROD_REPO_URL, not STAGE_REPO_URL in ostree-raw-image.sh 3. Use --reboot in rpm-ostree install to reboot VM instead of a reboot ansible task 4. Wait until config file serviceinfo_api_server.yml exists, to avoid file not available to use flaky issue
This commit is contained in:
parent
6040c10e10
commit
2baaa20859
7 changed files with 14 additions and 51 deletions
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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" \
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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} \
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue