-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflow: add basic smoke test #124
base: master
Are you sure you want to change the base?
Conversation
Do a very basic check that the snap is valid after the building. Thanks to Sergio for the suggestion.
@@ -32,3 +32,5 @@ jobs: | |||
sudo chroot $CHROOT apt install -y livecd-rootfs snapcraft | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -32,3 +32,5 @@ jobs: | |||
sudo chroot $CHROOT apt install -y livecd-rootfs snapcraft | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.