Skip to content

Commit

Permalink
tests: added condition that only checks grubx64.efi if bootx64.efi do…
Browse files Browse the repository at this point in the history
…es not exist
  • Loading branch information
maykathm committed Dec 18, 2024
1 parent 554ba31 commit 5d95b87
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/nested/manual/uc-update-assets-secure-add-sbat/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,19 @@ prepare: |
remote.wait-for snap-command
remote.exec "sudo snap wait system seed.loaded"
debug: |
cat expected-before
cat expected-after
for file in $(remote.exec "find /run/mnt/ubuntu-boot/EFI/ -name '*.efi'"); do remote.exec "sha256sum $file"; done
for file in $(remote.exec "find /run/mnt/ubuntu-seed/EFI/ -name '*.efi'"); do remote.exec "sha256sum $file"; done
execute: |
remote.exec "sha256sum -c" <expected-before
if ! result=$(remote.exec "sha256sum -c" <expected-before 2>&1); then
MATCH 'sha256sum.*bootx64.efi.*FAILED open or read' <<< "$result"
NOMATCH 'bootx64.efi.*FAILED$' <<< "$result"
# The bootx64.efi may not exist, but the grubx64.efi must
remote.exec "sha256sum -c" <<< "$(grep grubx64 expected-before)"
fi
remote.push pc_2.snap
boot_id="$(tests.nested boot-id)"
Expand All @@ -155,4 +166,9 @@ execute: |
remote.wait-for reboot "${boot_id}"
remote.exec sudo snap watch "$REMOTE_CHG_ID"
remote.exec "sha256sum -c" <expected-after
if ! result=$(remote.exec "sha256sum -c" <expected-after 2>&1); then
MATCH 'sha256sum.*bootx64.efi.*FAILED open or read' <<< "$result"
NOMATCH 'bootx64.efi.*FAILED$' <<< "$result"
# The bootx64.efi may not exist, but the grubx64.efi must
remote.exec "sha256sum -c" <<< "$(grep grubx64 expected-after)"
fi

0 comments on commit 5d95b87

Please sign in to comment.