Failed to load plugin: unknown plugin: 'checkbox-provider'

Hi,

I am following this page for creating a custom Checkbox application for Ubuntu Core testing:

I also found this forum post, but the advice in it didn’t solve my problem:

My versions: snapcraft 7.3.1 autoconf 2.71

The error I’m getting is: Failed to load plugin: unknown plugin: 'checkbox-provider’

The other post mentions that “Snapcraft 4.x has deprecated the way we designed the checkbox provider plugin.” Is that still the case, and are there new workarounds to get a base case working?

Also, ./cleanup.sh doesn’t exist anymore, so I’m guessing the commands in the docs just need a little updating.

Thanks!

Hi mckeesh, I was able to follow the tutorial with a slightly modified procedure. For it you need as a prerequisite to install lxd (snap install lxd) and configure it (lxd init) for building the snap with snapcraft.

  1. Create and prepare an lxc container
lxc launch ubuntu:22.04 jammy
lxc exec jammy bash -

Into the container:

apt update
apt upgrade
snap install snapcraft --channel=6.x/stable --classic
sudo apt install autoconf
  1. Clone and configure checkbox-configure
git clone https://git.launchpad.net/~checkbox-dev/checkbox/+git/checkbox-configure
cd checkbox-configure
autoconf
./configure --with-provider-included project=myproject base=22
cd ..
  1. Clone checkbox and merge checkbox-config with
git clone https://github.com/canonical/checkbox.git
cd checkbox/checkbox-snap/
./prepare_uc.sh series_uc22
cd ~/checkbox-configure/checkbox-myproject
cp -r checkbox-provider-myproject ~/checkbox/checkbox-snap/series_uc22/
cd snap/
cp -r plugins ~/checkbox/checkbox-snap/series_uc22/snap/
  1. Add the checkbox-provider-myproject part the snapcraft.yaml (take it from ~/checkbox-configure/checkbox-myproject/snap/snapcraft.yaml)

    edit ~/checkbox/checkbox-snap/series_uc22/snap/snapcraft.yaml

(...)
parts:
  checkbox-provider-myproject:
    plugin: checkbox-provider
    source: ./checkbox-provider-myproject
    source-type: local
    build-attributes: [no-patchelf]
  version-calculator:
(...)
  1. Edit the version file

    edit ~/checkbox/checkbox-snap/series_uc22/version.txt type a version number (e.g. 0.1)

  2. Add the .pxu file edit ~/checkbox/checkbox-snap/series_uc22/checkbox-provider-myproject/units/my-first-test-plan.pxu

id: my-first-job
_summary: Is 10GB available in $HOME
_description:
    this test checks if there's at least 10gb of free space in user's home
        Directory
plugin: shell
estimated_duration: 0.01
command: [ `df -B 1G --output=avail $HOME |tail -n1` -gt 10 ]

unit: test plan
id: my-first-test-plan
_name: my first test plan
_description:
    This is my first test plan
include:
    my-first-job
  1. Build the snap
cd ~/checkbox/checkbox-snap/series_uc22/
snapcraft --destructive-mode
exit
  1. Copy the snap on your host

    From your host:

lxc file pull jammy/root/checkbox/checkbox-snap/series_uc22/checkbox_0.1_amd64.snap .
  1. install checkbox
snap install checkbox22
snap install checkbox_0.1_amd64.snap --devmode
snap connect checkbox:checkbox-runtime checkbox22:checkbox-runtime
  1. run the test plan
checkbox.checkbox-cli

then select “my first test plan”

Of course, in case you need a difference base (e.g. 20) you need create a 20.04 container instead, to replace “base=22” with “base=20” and “series_uc22” with “series_uc20”. You’d need also to install checkbox20 snap instead of checkbox22.

1 Like