Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Aug 19, 2021

Do a very basic check that the snap is valid after the building.
Thanks to Sergio for the suggestion.

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$
Copy link
Contributor

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:

Suggested change
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

Copy link

@mardy mardy Aug 20, 2021

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.

Copy link

@mardy mardy left a 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$
Copy link

@mardy mardy Aug 20, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants