summaryrefslogtreecommitdiff
diff options
authorMichael Vogt <mvo@ubuntu.com>2020-09-16 18:13:15 +0200
committerMichael Vogt <mvo@ubuntu.com>2020-09-16 18:13:15 +0200
commitbbd420dbdc6a3cfdfca0a780b78651105cc5c326 (patch)
tree6c244aa6866aa5dae7f02475576b9b6f60f4dc61
parent1372b413699dfe07f608747aaa946f1ac1215653 (diff)
tests: make gadget-reseal more robustimprove-gadget-reseal
This addresses the review point in: https://github.com/snapcore/snapd/pull/9359#discussion_r489482735 It's very unlikely that the PE header we modify changes but we should still double-check.
-rw-r--r--tests/nested/core20/gadget-reseal/task.yaml4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/nested/core20/gadget-reseal/task.yaml b/tests/nested/core20/gadget-reseal/task.yaml
index f088d512f4..6dd1f74039 100644
--- a/tests/nested/core20/gadget-reseal/task.yaml
+++ b/tests/nested/core20/gadget-reseal/task.yaml
@@ -27,8 +27,10 @@ execute: |
rm -rf pc-gadget
snap download --basename=pc --channel="20/edge" pc
unsquashfs -d pc-gadget pc.snap
- # change a few bytes in the compat header
+ # change a few bytes in the compat header and ensure sed worked
sed -i 's/This program cannot be run in DOS mode/This program cannot be run in XXX mode/' pc-gadget/grubx64.efi
+ grep -q -a "This program cannot be run in XXX mode" pc-gadget/grubx64.efi
+
./manip_gadget.py pc-gadget/meta/gadget.yaml > modified_gadget.yaml
mv modified_gadget.yaml pc-gadget/meta/gadget.yaml