Closed farshidtz closed 1 year ago
Installing the snapd
snap before running the tests solves this issue:
sudo snap install snapd
$ sudo DEFAULT_TEST_CHANNEL="latest/beta" checkbox-edgexfoundry.latest
Cloning into 'tmp/edgex-snap-testing'...
Running Go snap tests for edgexfoundry:
2023/02/10 11:39:34 [CLEAN]
2023/02/10 11:39:34 [exec] sudo snap remove --purge edgexfoundry
2023/02/10 11:39:34 [stderr] snap "edgexfoundry" is not installed
2023/02/10 11:39:34 [SETUP]
2023/02/10 11:39:34 [exec] sudo snap install edgexfoundry --channel=latest/beta
2023/02/10 11:40:15 [stdout] edgexfoundry (beta) 3.0.0-dev.29 from Canonical** installed
...
Snapd is actually installed already, perhaps coming from the core
snap. The problem is that the core20 checkbox-edgexfoundry snap replaces the snap
binary with a symbolic link to where the snapped snapd would have been installed:
ubuntu@uc16:~$ snap version
snap 2.58
snapd 2.58
series 16
kernel 4.4.0-187-generic
ubuntu@uc16:~$ ls -l /usr/bin/snap
-rwxr-xr-x 1 root root 25033504 Dec 1 20:41 /usr/bin/snap
ubuntu@uc16:~$ sudo snap run --shell checkbox-edgexfoundry.latest
root@uc16:/home/ubuntu# snap version
bash: snap: command not found
root@uc16:/home/ubuntu# ls -l /usr/bin/snap
lrwxrwxrwx 1 root root 32 Jan 26 06:46 /usr/bin/snap -> /snap/snapd/current/usr/bin/snap
After the upgrade to core20 base snap (https://github.com/canonical/edgex-checkbox-provider/pull/49), the snap command is no longer works when running the tests on a host with Ubuntu Core 16:
Steps to reproduce: