Conversation
Do a very basic check that the snap is valid after the building. Thanks to Sergio for the suggestion.
| sudo cp -a Makefile snapcraft.yaml hooks live-build extra-files $CHROOT/build | ||
| sudo chroot $CHROOT sh -c 'mount -t proc proc /proc; mount -t sysfs sys /sys; cd build; snapcraft' | ||
| # basic smoke testing | ||
| unsquashfs -ll core*.snap | grep /usr/lib/snapd/snapd$ |
There was a problem hiding this comment.
do we need the $ at the end of the line? Also I feel like a more efficient way to check this is:
| unsquashfs -ll core*.snap | grep /usr/lib/snapd/snapd$ | |
| unsquashfs -ll core*.snap /usr/lib/snapd/snapd | grep /usr/lib/snapd/snapd |
otherwise grep will check every single file in the snap
There was a problem hiding this comment.
The $ ensures that the test will fail if the snapd binary is replaced by a directory (like /usr/lib/snapd/snapd/foo), which is highly unlikely but it still makes the test more robust, so I'd vote for keeping it. Your suggestion about limiting the filtering in unsquashfs itself is also good.
| sudo cp -a Makefile snapcraft.yaml hooks live-build extra-files $CHROOT/build | ||
| sudo chroot $CHROOT sh -c 'mount -t proc proc /proc; mount -t sysfs sys /sys; cd build; snapcraft' | ||
| # basic smoke testing | ||
| unsquashfs -ll core*.snap | grep /usr/lib/snapd/snapd$ |
There was a problem hiding this comment.
The $ ensures that the test will fail if the snapd binary is replaced by a directory (like /usr/lib/snapd/snapd/foo), which is highly unlikely but it still makes the test more robust, so I'd vote for keeping it. Your suggestion about limiting the filtering in unsquashfs itself is also good.
Do a very basic check that the snap is valid after the building.
Thanks to Sergio for the suggestion.