Skip to content

Commit

Permalink
tests: fix uc-update-assets-secure nested test in uc24 (#14262)
Browse files Browse the repository at this point in the history
* tests:fix uc-update-assets-secure nested test

This test failes with the executables are moved to EFI/ubuntu instead of
EFI/boot

* fix also core20-install-mode-shutdown-via-hook test

used the code we have in nested.sh to check "cloud-init status --wait"

* fix case when 'cloud-init status --wait' doesn't fail

prevent unbound variable error
  • Loading branch information
sergiocazzolato authored Jul 26, 2024
1 parent 33fff7a commit b6c89d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ execute: |
# Wait for snap seeding to be done
remote.exec "sudo snap wait system seed.loaded"
# Wait for cloud init to be done
remote.exec "cloud-init status --wait"
ret=0
remote.exec "cloud-init status --wait" || ret=$?
if [ "$ret" -ne 0 ] && [ "$ret" -ne 2 ]; then
echo "cloud-init finished with error $ret"
exit 1
fi
echo "The device is using encrypted ubuntu-data and is in run mode now"
remote.exec test -L /dev/disk/by-label/ubuntu-data-enc
Expand Down
11 changes: 8 additions & 3 deletions tests/nested/manual/uc-update-assets-secure/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,24 @@ prepare: |
snap pack pc --filename=pc_2.snap
grubx64_dir=boot
if os.query is-ubuntu-ge 24.04; then
grubx64_dir=ubuntu
fi
cat <<EOF >>expected-before
${old_shim_sha} */boot/efi/EFI/boot/bootx64.efi
${old_grub_sha} */boot/efi/EFI/boot/grubx64.efi
${old_grub_sha} */boot/efi/EFI/${grubx64_dir}/grubx64.efi
EOF
if [ "${UPDATE_SEED}" = true ]; then
cat <<EOF >>expected-after
${new_shim_sha} */boot/efi/EFI/boot/bootx64.efi
${new_grub_sha} */boot/efi/EFI/boot/grubx64.efi
${new_grub_sha} */boot/efi/EFI/${grubx64_dir}/grubx64.efi
EOF
else
cat <<EOF >>expected-after
${old_shim_sha} */boot/efi/EFI/boot/bootx64.efi
${old_grub_sha} */boot/efi/EFI/boot/grubx64.efi
${old_grub_sha} */boot/efi/EFI/${grubx64_dir}/grubx64.efi
EOF
fi
Expand Down

0 comments on commit b6c89d6

Please sign in to comment.