canonical / edgex-checkbox-provider

Checkbox tests for EdgeX snaps
Apache License 2.0
0 stars 3 forks source link

Update snap packaging (base core20 & removal of the local plugin) #49

Closed yphus closed 1 year ago

yphus commented 1 year ago

Newer base (core20) for the checkbox edgex snap and removal of the unsupported local plugin.

MonicaisHer commented 1 year ago

Error no /wrapper_common found presents when installing this snap:

snap install ./checkbox-edgexfoundry_2.0_amd64.snap --dangerous
snap connect checkbox-edgexfoundry:mount-observe :mount-observe
snap connect checkbox-edgexfoundry:system-observe :system-observe
snap restart checkbox-edgexfoundry.service
$ snap logs -f checkbox-edgexfoundry
2023-01-24T14:44:19+01:00 systemd[1]: Started Service for snap application checkbox-edgexfoundry.service.
2023-01-24T14:44:19+01:00 checkbox-edgexfoundry.service[531663]: ERROR: no /wrapper_common found
yphus commented 1 year ago

@MonicaisHer This error is expected when trying to install the snap from file and not from the store. Checkbox on core relies on auto-connection to install the content interface snap providers. In our case it's checkbox20. So to work around the problem just run sudo snap install checkbox20 prior installing the checkbox-edgexfoundry snap and right after it connect the following interfaces manually:

MonicaisHer commented 1 year ago

@yphus Thanks for your explanation. I followed your steps and here comes a new permission denied error. Here are my steps and logs:

sudo snap install checkbox20
sudo snap install ./checkbox-edgexfoundry_2.0_amd64.snap --dangerous
sudo snap connect checkbox-edgexfoundry:checkbox-runtime checkbox20:checkbox-runtime
sudo snap connect checkbox-edgexfoundry:provider-resource checkbox20:provider-resource
sudo snap connect checkbox-edgexfoundry:provider-checkbox checkbox20:provider-checkbox
$ sudo DEFAULT_TEST_CHANNEL="latest/beta" checkbox-edgexfoundry.latest
/snap/checkbox-edgexfoundry/x1/checkbox-runtime/wrapper_common: line 38: /usr/bin/findmnt: Permission denied
/snap/checkbox-edgexfoundry/x1/checkbox-runtime/wrapper_common: line 38: /usr/bin/findmnt: Permission denied
Preparing...
ERROR:plainbox.bug:Undeclared exception PermissionError raised from start_new_session
Traceback (most recent call last):
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/bin/checkbox-cli", line 8, in <module>
    sys.exit(main())
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/checkbox_ng/launcher/checkbox_cli.py", line 140, in main
    subcmd.invoked(ctx)
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/checkbox_ng/launcher/subcommands.py", line 205, in invoked
    self._start_new_session()
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/checkbox_ng/launcher/subcommands.py", line 350, in _start_new_session
    self.ctx.sa.start_new_session(title, UnifiedRunner, runner_kwargs)
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/decorators.py", line 142, in wrapper
    raise exc
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/decorators.py", line 136, in wrapper
    return func(*args, **kwargs)
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/session/assistant.py", line 483, in start_new_session
    self._manager = SessionManager.create(prefix=title + '-')
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/session/manager.py", line 166, in create
    storage = SessionStorage.create(prefix)
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/session/storage.py", line 224, in create
    WellKnownDirsHelper.populate_base()
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/lib/python3.8/site-packages/plainbox/impl/session/storage.py", line 64, in populate_base
    os.makedirs(dirname)
  File "/snap/checkbox-edgexfoundry/x1/checkbox-runtime/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/tmp/checkbox-ng'
yphus commented 1 year ago

@MonicaisHer you need to install the checkbox-edgexfoundry snap using --devmode