From 1c395a8c286bbe1aebfa2b95e65f684752a955d4 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 10 Apr 2024 09:15:02 +0200 Subject: [PATCH 01/11] Draft snap for core24 --- checkbox-core-snap/series24/.gitignore | 21 + .../series24/snap/snapcraft.yaml | 575 ++++++++++++++++++ 2 files changed, 596 insertions(+) create mode 100644 checkbox-core-snap/series24/.gitignore create mode 100644 checkbox-core-snap/series24/snap/snapcraft.yaml diff --git a/checkbox-core-snap/series24/.gitignore b/checkbox-core-snap/series24/.gitignore new file mode 100644 index 0000000000..281cc4dbcf --- /dev/null +++ b/checkbox-core-snap/series24/.gitignore @@ -0,0 +1,21 @@ +*.pyc +*.snap +__pycache__ +build/mo/* +dist/*.tar.gz +parts/ +snap/.snapcraft +snap/gui/ +stage/ +prime/ + +# following files are populated by the prepare.sh script and should be ignored +config/ +checkbox-ng/ +checkbox-support/ +providers/ +version.txt + +# following files are the result of the build process +checkbox*.txt +checkbox*.snap diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml new file mode 100644 index 0000000000..76a8d17e79 --- /dev/null +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -0,0 +1,575 @@ +name: checkbox24 +summary: Checkbox runtime and public providers +description: "Checkbox runtime and public providers" +grade: devel +confinement: strict + +adopt-info: version-calculator + +base: core24 +build-base: devel + +# Don't forget to add a new slot if a new provider part is added in the parts +# section below. +slots: + provider-resource: + interface: content + read: + - $SNAP/providers/checkbox-provider-resource + provider-checkbox: + interface: content + read: + - $SNAP/providers/checkbox-provider-base + provider-docker: + interface: content + read: + - $SNAP/providers/checkbox-provider-docker + provider-tpm2: + interface: content + read: + - $SNAP/providers/checkbox-provider-tpm2 + provider-iiotg: + interface: content + read: + - $SNAP/providers/checkbox-provider-iiotg + provider-engineering-tests: + interface: content + read: + - $SNAP/providers/checkbox-provider-engineering-tests + provider-sru: + interface: content + read: + - $SNAP/providers/checkbox-provider-sru + provider-gpgpu: + interface: content + read: + - $SNAP/providers/checkbox-provider-gpgpu + provider-certification-client: + interface: content + read: + - $SNAP/providers/checkbox-provider-certification-client + provider-certification-server: + interface: content + read: + - $SNAP/providers/checkbox-provider-certification-server + provider-tutorial: + interface: content + read: + - $SNAP/providers/checkbox-provider-tutorial + checkbox-runtime: + interface: content + read: + - / + +package-repositories: + - type: apt + ppa: checkbox-dev/stable + +parts: + version-calculator: + plugin: dump + source: . + override-pull: | + craftctl default + # version.txt created by prepare.sh + export version=`cat $CRAFT_PART_SRC/version.txt` + [ $version ] || exit 1 + craftctl set version=$version + stage: + - version.txt +################################################################################ +# Upstream: https://kernel.ubuntu.com/git/hwe/fwts.git/plain/snapcraft.yaml + fwts: + source-tag: "V23.09.00" + source-depth: 1 + plugin: autotools + source: https://github.com/fwts/fwts.git + autotools-configure-parameters: + - --prefix=/ + stage-packages: + - libfdt1 + - libbsd0 + - libpci3 + build-packages: + - gcc + - make + - autoconf + - automake + - libtool + - libjson-c-dev + - flex + - bison + - dh-autoreconf + - libglib2.0-dev + - libfdt-dev + - libbsd-dev + after: [version-calculator] +################################################################################ +# Upstream: https://kernel.ubuntu.com/git/cking/stress-ng.git/plain/snap/snapcraft.yaml + stress-ng: + source-tag: "V0.15.09" + source-depth: 1 + plugin: make + build-environment: + - CFLAGS: "-fstack-protector-strong -Wformat -Werror=format-security" + - LDFLAGS: "-Wl,-z,relro -lrt" + source: https://github.com/ColinIanKing/stress-ng.git + make-parameters: + - STATIC=1 VERBOSE=1 + build-packages: + - gcc + - make + - zlib1g-dev + - libbsd-dev + - libgcrypt20-dev + - libkeyutils-dev + - libapparmor-dev + - libaio-dev + - libcap-dev + - libsctp-dev + - libatomic1 + - libjudy-dev + - libjpeg-dev + - libkmod-dev + - libattr1-dev + - libxxhash-dev + - libmd-dev + - on amd64: [ libipsec-mb-dev ] + after: [fwts] +################################################################################ +# Upstream: https://kernel.ubuntu.com/git/cking/snapcraft-snaps.git/tree/acpica/snapcraft.yaml + acpi-tools: + source-tag: "R10_20_22" + source-depth: 1 + plugin: make + source: https://github.com/acpica/acpica.git + build-packages: + - gcc + - make + - bison + - flex + prime: + - usr/bin/ + after: [stress-ng] +################################################################################ + checkbox-support: + plugin: python + source: checkbox-support + source-type: local + stage-packages: + # actual requirements + - python3-bluez + - python3-pyparsing + - python3-requests-unixsocket + - python3-systemd + # added to stage python: + - libpython3-stdlib + - libpython3.10-stdlib + - libpython3.10-minimal + - python3-pip + - python3-setuptools + - python3-wheel + - python3-venv + - python3-minimal + - python3-distutils + - python3-pkg-resources + - python3.10-minimal + build-packages: + - libbluetooth-dev + - python3-dev + python-packages: + - pynmea2 + after: [acpi-tools] + stage: + - -pyvenv.cfg + - -bin/activate* + - -**/RECORD + - -**/__pycache__ + - -debian + build-environment: + - C_INCLUDE_PATH: /usr/include/python3.10 + - PYTHONPATH: $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages:${PYTHONPATH:-} + - SETUPTOOLS_SCM_PRETEND_VERSION: "$(cat $CRAFT_STAGE/version.txt)" + override-build: | + craftctl default +################################################################################ + checkbox-ng: + plugin: python + source: checkbox-ng + source-type: local + build-packages: + - zlib1g-dev + - build-essential + stage-packages: + - python3-markupsafe + - python3-jinja2 + - python3-packaging + - python3-padme + - python3-requests-oauthlib + - python3-urwid + - python3-xlsxwriter + # added to stage python: + - libpython3-stdlib + - libpython3.10-stdlib + - libpython3.10-minimal + - python3-pip + - python3-setuptools + - python3-wheel + - python3-venv + - python3-minimal + - python3-distutils + - python3-pkg-resources + - python3.10-minimal + python-packages: + - tqdm + - picamera # p-p-c dep that wouldnt install in another part + after: [checkbox-support] + stage: + - -pyvenv.cfg + - -bin/activate* + - -**/RECORD + - -**/__pycache__ + - -debian + build-environment: + - PYTHONPATH: $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages:${PYTHONPATH:-} + - READTHEDOCS: 'True' # simplifies picamera install + - SETUPTOOLS_SCM_PRETEND_VERSION: "$(cat $CRAFT_STAGE/version.txt)" + override-build: | + craftctl default +################################################################################ + checkbox-provider-resource: + plugin: dump + source: providers/resource + source-type: local + stage-packages: + - cpu-checker + - dpkg + - dmidecode + - libjson-xs-perl + - pciutils + - python3-requests-unixsocket + - smartmontools + override-build: | + cd src && autoreconf -i && cd - + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-resource --root="$CRAFT_PART_INSTALL" + build-packages: + - autoconf + - automake + - libnl-3-dev + - libnl-genl-3-dev + - pkg-config + after: [checkbox-ng] +################################################################################ + checkbox-provider-base: + plugin: dump + source: providers/base + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-base --root="$CRAFT_PART_INSTALL" + stage-packages: + - bc + - bluez-tests + - bonnie++ + - cryptsetup-bin + - dbus + - debsums + - dmidecode + - dmsetup + - efibootmgr + - ethtool + - freeipmi-tools + - fswebcam + - gir1.2-cheese-3.0 + - gir1.2-clutter-1.0 + - gir1.2-gst-plugins-base-1.0 + - gir1.2-gudev-1.0 + - glmark2-es2 + - gnome-screenshot + - gstreamer1.0-tools + - gstreamer1.0-pulseaudio + - on amd64: [hdapsd] # optional as not available for arm + - hdparm + - i2c-tools + - ipmitool + - iperf + - iperf3 + - iw + - jq + - kmod + - libasound2 + - libcap2-bin + - libfdt1 + - libsvm3 + - lsb-release + - lshw + - mesa-utils + - mokutil + - net-tools + - nmap + - nux-tools + - nvme-cli + - obexftp + - parted + - pciutils + - pulseaudio-utils + - pyotherside + - python3-dbus + - python3-evdev + - python3-gi + - python3-natsort + - python3-pil + - python3-psutil + - python3-pyqrcode + - python3-serial + - python3-yaml + - python3-zbar + - qml-module-qtquick-controls + - qml-module-qtquick-layouts + - qmlscene + - smartmontools + - usbutils + - util-linux + - uuid-runtime + - wget + - wmctrl + - xz-utils + - rt-tests # For realtime performance test + - mdadm + - on armhf: + - python3-rpi.gpio # only in focal + - on arm64: + - python3-rpi.gpio # only in focal + build-packages: + - libasound2-dev + - libcap-dev + organize: + usr/lib/lib*.so*: usr/lib/$CRAFT_ARCH_TRIPLET/ + after: [checkbox-provider-resource] +################################################################################ + checkbox-provider-docker: + plugin: dump + source: providers/docker + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-docker --root="$CRAFT_PART_INSTALL" + stage-packages: + - apache2-utils + after: [checkbox-provider-base] +################################################################################ + checkbox-provider-tpm2: + plugin: dump + source: providers/tpm2 + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tpm2 --root="$CRAFT_PART_INSTALL" + stage-packages: + - clevis-tpm2 + after: [checkbox-provider-docker] +################################################################################ + checkbox-provider-iiotg: + plugin: dump + source: providers/iiotg + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-iiotg --root="$CRAFT_PART_INSTALL" + + after: [checkbox-provider-tpm2] +################################################################################ + checkbox-provider-sru: + plugin: dump + source: providers/sru + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-sru --root="$CRAFT_PART_INSTALL" + after: [checkbox-provider-iiotg] +################################################################################ + checkbox-provider-gpgpu: + plugin: dump + source: providers/gpgpu + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-gpgpu --root="$CRAFT_PART_INSTALL" + after: [checkbox-provider-sru] +################################################################################ + checkbox-provider-certification-client: + plugin: dump + source: providers/certification-client + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-certification-client --root="$CRAFT_PART_INSTALL" + after: [checkbox-provider-gpgpu] +################################################################################ + checkbox-provider-certification-server: + plugin: dump + source: providers/certification-server + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-certification-server --root="$CRAFT_PART_INSTALL" + after: [checkbox-provider-certification-client] +################################################################################ + checkbox-provider-tutorial: + plugin: dump + source: providers/tutorial + source-type: local + override-build: | + export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done + python3 manage.py validate + python3 manage.py build + python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tutorial --root="$CRAFT_PART_INSTALL" + after: [checkbox-provider-base] +################################################################################ + opencv: + plugin: make + source: https://github.com/opencv/opencv.git + source-tag: 4.9.0 + override-build: | + cd $CRAFT_PART_SRC + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=RELEASE \ + -DCMAKE_INSTALL_PREFIX=$CRAFT_PART_INSTALL \ + -DBUILD_LIST=videoio,features2d,highgui,flann,python3 .. + make -j$(nproc) + make install + build-packages: + - build-essential + - cmake + - pkg-config + - libjpeg-dev + - libpng-dev + - libtiff-dev + - libavcodec-dev + - libavformat-dev + - libswscale-dev + - libv4l-dev + - libxvidcore-dev + - libx264-dev + - libgtk-3-dev + - gfortran + - python3-dev + - python3-numpy + stage-packages: + - libjpeg8 + - libpng16-16 + - libtiff5 + - libavcodec58 + - libavformat58 + - libfreetype6 + - libswscale5 + - libv4l-0 + - libxvidcore4 + - libx264-dev + - python3-minimal + - python3.10-minimal + - python3-numpy +################################################################################ + gnome-randr: + source: https://github.com/maxwellainatchi/gnome-randr-rust.git + plugin: rust + build-packages: + - libdbus-1-dev + after: [rust-deps] +################################################################################ + rust-deps: + plugin: nil + build-packages: + - wget + override-pull: | + # Do not use rustup to work around https://forum.snapcraft.io/t/armhf-builds-on-launchpad-timing-out/31008 + REQUIRED_RUST_VERSION=nightly + ROOT=https://static.rust-lang.org/dist/rust-$REQUIRED_RUST_VERSION + if [ $CRAFT_TARGET_ARCH = "amd64" ]; then + BINARIES_SUFFIX=x86_64-unknown-linux-gnu + elif [ $CRAFT_TARGET_ARCH = "armhf" ]; then + BINARIES_SUFFIX=armv7-unknown-linux-gnueabihf + elif [ $CRAFT_TARGET_ARCH = "arm64" ]; then + BINARIES_SUFFIX=aarch64-unknown-linux-gnu + fi + wget -O - $ROOT-$BINARIES_SUFFIX.tar.gz | tar -x -z --strip-components=1 + ./install.sh --prefix=/usr --destdir=$CRAFT_STAGE +################################################################################ + rpi-support-binaries: + plugin: nil + stage-packages: + - on armhf: + - libraspberrypi0 + - on arm64: + - libraspberrypi0 + organize: + usr/lib/lib*.so: usr/lib/$CRAFT_ARCH_TRIPLET/ +################################################################################ + lk-boot-env: + plugin: nil + source: . + override-pull: | + craftctl default + wget https://raw.githubusercontent.com/snapcore/snapd/master/include/lk/snappy_boot_common.h + wget https://raw.githubusercontent.com/snapcore/snapd/master/include/lk/snappy_boot_v2.h + wget https://raw.githubusercontent.com/kubiko/dragonboard-gadget/20-lk/snap-boot-sel/lk-boot-env.c + build-packages: + - wget + - on amd64 to armhf: + - gcc-arm-linux-gnueabihf:amd64 + - on amd64 to arm64: + - gcc-aarch64-linux-gnu:amd64 + override-build: | + mkdir -p ${CRAFT_PART_INSTALL}/bin + if [ "${CRAFT_ARCH_TRIPLET}" = "arm-linux-gnueabihf" ]; then + arm-linux-gnueabihf-gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env + elif [ "${CRAFT_ARCH_TRIPLET}" = "aarch64-linux-gnu" ]; then + aarch64-linux-gnu-gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env + else + # native build + gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env + fi +################################################################################ + parts-meta-info: + plugin: nil + build-environment: + - RUNTIME_VERSION: "$(cat $CRAFT_STAGE/version.txt)" + override-build: | + craftctl default + echo "checkbox-runtime:" >> $CRAFT_PART_INSTALL/parts_meta_info + echo "$RUNTIME_VERSION" >> $CRAFT_PART_INSTALL/parts_meta_info + after: [checkbox-provider-certification-server] +################################################################################ + common-config: + plugin: dump + source: config/ From 277605e2672f7234211f12037ee3502fbcd7e5a4 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 10 Apr 2024 15:31:49 +0200 Subject: [PATCH 02/11] First draft that creates a snap --- .../series24/snap/snapcraft.yaml | 180 +++++------------- 1 file changed, 50 insertions(+), 130 deletions(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index 76a8d17e79..da1c979da2 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -78,78 +78,22 @@ parts: stage: - version.txt ################################################################################ -# Upstream: https://kernel.ubuntu.com/git/hwe/fwts.git/plain/snapcraft.yaml fwts: - source-tag: "V23.09.00" - source-depth: 1 - plugin: autotools - source: https://github.com/fwts/fwts.git - autotools-configure-parameters: - - --prefix=/ + plugin: nil stage-packages: - - libfdt1 - - libbsd0 - - libpci3 - build-packages: - - gcc - - make - - autoconf - - automake - - libtool - - libjson-c-dev - - flex - - bison - - dh-autoreconf - - libglib2.0-dev - - libfdt-dev - - libbsd-dev + - fwts after: [version-calculator] ################################################################################ -# Upstream: https://kernel.ubuntu.com/git/cking/stress-ng.git/plain/snap/snapcraft.yaml stress-ng: - source-tag: "V0.15.09" - source-depth: 1 - plugin: make - build-environment: - - CFLAGS: "-fstack-protector-strong -Wformat -Werror=format-security" - - LDFLAGS: "-Wl,-z,relro -lrt" - source: https://github.com/ColinIanKing/stress-ng.git - make-parameters: - - STATIC=1 VERBOSE=1 - build-packages: - - gcc - - make - - zlib1g-dev - - libbsd-dev - - libgcrypt20-dev - - libkeyutils-dev - - libapparmor-dev - - libaio-dev - - libcap-dev - - libsctp-dev - - libatomic1 - - libjudy-dev - - libjpeg-dev - - libkmod-dev - - libattr1-dev - - libxxhash-dev - - libmd-dev - - on amd64: [ libipsec-mb-dev ] + plugin: nil + stage-packages: + - stress-ng after: [fwts] ################################################################################ -# Upstream: https://kernel.ubuntu.com/git/cking/snapcraft-snaps.git/tree/acpica/snapcraft.yaml acpi-tools: - source-tag: "R10_20_22" - source-depth: 1 - plugin: make - source: https://github.com/acpica/acpica.git - build-packages: - - gcc - - make - - bison - - flex - prime: - - usr/bin/ + plugin: nil + stage-packages: + - acpica-tools after: [stress-ng] ################################################################################ checkbox-support: @@ -164,16 +108,15 @@ parts: - python3-systemd # added to stage python: - libpython3-stdlib - - libpython3.10-stdlib - - libpython3.10-minimal + - libpython3.12-stdlib + - libpython3.12-minimal - python3-pip - python3-setuptools - python3-wheel - python3-venv - python3-minimal - - python3-distutils - python3-pkg-resources - - python3.10-minimal + - python3.12-minimal build-packages: - libbluetooth-dev - python3-dev @@ -187,7 +130,7 @@ parts: - -**/__pycache__ - -debian build-environment: - - C_INCLUDE_PATH: /usr/include/python3.10 + - C_INCLUDE_PATH: /usr/include/python3.12 - PYTHONPATH: $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages:${PYTHONPATH:-} - SETUPTOOLS_SCM_PRETEND_VERSION: "$(cat $CRAFT_STAGE/version.txt)" override-build: | @@ -210,16 +153,15 @@ parts: - python3-xlsxwriter # added to stage python: - libpython3-stdlib - - libpython3.10-stdlib - - libpython3.10-minimal + - libpython3.12-stdlib + - libpython3.12-minimal - python3-pip - python3-setuptools - python3-wheel - python3-venv - python3-minimal - - python3-distutils - python3-pkg-resources - - python3.10-minimal + - python3.12-minimal python-packages: - tqdm - picamera # p-p-c dep that wouldnt install in another part @@ -249,9 +191,11 @@ parts: - pciutils - python3-requests-unixsocket - smartmontools + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | cd src && autoreconf -i && cd - - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -268,15 +212,17 @@ parts: plugin: dump source: providers/base source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-base --root="$CRAFT_PART_INSTALL" stage-packages: + - python3-opencv - bc - - bluez-tests - bonnie++ - cryptsetup-bin - dbus @@ -320,7 +266,10 @@ parts: - parted - pciutils - pulseaudio-utils - - pyotherside + - pyotherside-doc + - pyotherside-tests + - qml-module-io-thp-pyotherside + - qml6-module-io-thp-pyotherside - python3-dbus - python3-evdev - python3-gi @@ -358,8 +307,10 @@ parts: plugin: dump source: providers/docker source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -372,8 +323,10 @@ parts: plugin: dump source: providers/tpm2 source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -386,8 +339,10 @@ parts: plugin: dump source: providers/iiotg source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -399,8 +354,10 @@ parts: plugin: dump source: providers/sru source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -411,8 +368,10 @@ parts: plugin: dump source: providers/gpgpu source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -423,8 +382,10 @@ parts: plugin: dump source: providers/certification-client source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -435,8 +396,10 @@ parts: plugin: dump source: providers/certification-server source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build @@ -447,58 +410,15 @@ parts: plugin: dump source: providers/tutorial source-type: local + build-environment: + - PYTHONPYCACHEPREFIX: "/tmp" override-build: | - export PYTHONPATH=$CRAFT_STAGE/lib/python3.10/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages + export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tutorial --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-base] -################################################################################ - opencv: - plugin: make - source: https://github.com/opencv/opencv.git - source-tag: 4.9.0 - override-build: | - cd $CRAFT_PART_SRC - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=RELEASE \ - -DCMAKE_INSTALL_PREFIX=$CRAFT_PART_INSTALL \ - -DBUILD_LIST=videoio,features2d,highgui,flann,python3 .. - make -j$(nproc) - make install - build-packages: - - build-essential - - cmake - - pkg-config - - libjpeg-dev - - libpng-dev - - libtiff-dev - - libavcodec-dev - - libavformat-dev - - libswscale-dev - - libv4l-dev - - libxvidcore-dev - - libx264-dev - - libgtk-3-dev - - gfortran - - python3-dev - - python3-numpy - stage-packages: - - libjpeg8 - - libpng16-16 - - libtiff5 - - libavcodec58 - - libavformat58 - - libfreetype6 - - libswscale5 - - libv4l-0 - - libxvidcore4 - - libx264-dev - - python3-minimal - - python3.10-minimal - - python3-numpy ################################################################################ gnome-randr: source: https://github.com/maxwellainatchi/gnome-randr-rust.git From d5ce28df1a03a912ce4386e488c57dcc24405663 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 10 Apr 2024 16:04:13 +0200 Subject: [PATCH 03/11] Classic series24 snap --- checkbox-snap/series_classic24/.gitignore | 18 +++++ checkbox-snap/series_classic24/config_vars | 38 +++++++++ .../launchers/client-cert-iot-server | 18 +++++ .../series_classic24/launchers/configure | 58 +++++++++++++ .../launchers/odm-certification | 16 ++++ .../launchers/odm-certification-app | 24 ++++++ .../series_classic24/launchers/test-runner | 9 +++ .../series_classic24/launchers/wrapper_local | 45 +++++++++++ .../series_classic24/snap/hooks/configure | 55 +++++++++++++ .../series_classic24/snap/snapcraft.yaml | 81 +++++++++++++++++++ 10 files changed, 362 insertions(+) create mode 100644 checkbox-snap/series_classic24/.gitignore create mode 100644 checkbox-snap/series_classic24/config_vars create mode 100755 checkbox-snap/series_classic24/launchers/client-cert-iot-server create mode 100755 checkbox-snap/series_classic24/launchers/configure create mode 100644 checkbox-snap/series_classic24/launchers/odm-certification create mode 100755 checkbox-snap/series_classic24/launchers/odm-certification-app create mode 100755 checkbox-snap/series_classic24/launchers/test-runner create mode 100755 checkbox-snap/series_classic24/launchers/wrapper_local create mode 100755 checkbox-snap/series_classic24/snap/hooks/configure create mode 100644 checkbox-snap/series_classic24/snap/snapcraft.yaml diff --git a/checkbox-snap/series_classic24/.gitignore b/checkbox-snap/series_classic24/.gitignore new file mode 100644 index 0000000000..7876785d74 --- /dev/null +++ b/checkbox-snap/series_classic24/.gitignore @@ -0,0 +1,18 @@ +*.pyc +*.snap +__pycache__ +build/mo/* +dist/*.tar.gz +parts/ +snap/.snapcraft +snap/gui/ +stage/ +prime/ + +# following files are populated by the prepare.sh script and should be ignored +launchers/checkbox-cli-wrapper +launchers/shell-wrapper +launchers/sru +snap/hooks/install +snap/hooks/remove +version.txt diff --git a/checkbox-snap/series_classic24/config_vars b/checkbox-snap/series_classic24/config_vars new file mode 100644 index 0000000000..b6596b3bfe --- /dev/null +++ b/checkbox-snap/series_classic24/config_vars @@ -0,0 +1,38 @@ +# follow KEY=value syntax +WIFI_INTERFACE=mlan0 +WATCHDOG_KERNEL_MOD=iTCO_wdt +ALSADEVICE=hw:CARD=bytrt5660,DEV=0 +NET_DEVICE_INFO=ven_rsi_sdio ven_rsi_91x +OPEN_N_SSID=ubuntu-cert-n-open +OPEN_BG_SSID=ubuntu-cert-bg-open +OPEN_AC_SSID=ubuntu-cert-ac-open +OPEN_AX_SSID=ubuntu-cert-ax-open +WPA_N_SSID=ubuntu-cert-n-wpa +WPA_BG_SSID=ubuntu-cert-bg-wpa +WPA_AC_SSID=ubuntu-cert-ac-wpa +WPA_AX_SSID=ubuntu-cert-ax-wpa +WPA3_AX_SSID=ubuntu-cert-ax-wpa3 +WPA_N_PSK=insecure +WPA_BG_PSK=insecure +WPA_AC_PSK=insecure +WPA_AX_PSK=insecure +WPA3_AX_PSK=insecure +OBEX_TARGET=00:02:72:C5:F9:1F +WWAN_APN=internet +WWAN_NET_IF=ppp0 +WWAN_CONTROL_IF=ttyACM3 +STRESS_BOOT_ITERATIONS=100 +STRESS_S3_ITERATIONS=100 +STRESS_S4_ITERATIONS=100 +TEST_TARGET_IPERF=10.101.47.93 +STRESS_S4_WAIT_DELAY=120 +STRESS_S4_SLEEP_DELAY=60 +STRESS_S3_SLEEP_DELAY=60 +STRESS_BOOT_WAKEUP_DELAY=60 +STRESS_S3_WAIT_DELAY=120 +STRESS_BOOT_WAIT_DELAY=120 +WIFI_AP_SETUPTIME=30 +WWAN_SETUPTIME=30 +TPM2TOOLS_TCTI_NAME=device +TPM2TOOLS_DEVICE_FILE=/dev/tpm0 +MODEL_GRADE=signed diff --git a/checkbox-snap/series_classic24/launchers/client-cert-iot-server b/checkbox-snap/series_classic24/launchers/client-cert-iot-server new file mode 100755 index 0000000000..ac56236bd2 --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/client-cert-iot-server @@ -0,0 +1,18 @@ +#!/usr/bin/env checkbox-cli-wrapper +[launcher] +app_id = com.canonical.certification:checkbox +launcher_version = 1 +stock_reports = text, submission_files + +[test plan] +unit = com.canonical.certification::client-cert-iot-server-22-04-automated +forced = yes + +[test selection] +forced = yes + +[ui] +type = silent +auto_retry = yes +max_attempts = 4 +delay_before_retry = 30 diff --git a/checkbox-snap/series_classic24/launchers/configure b/checkbox-snap/series_classic24/launchers/configure new file mode 100755 index 0000000000..36d6204d1b --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/configure @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +# Copyright 2018-2022 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Maciej Kisielewski +# Sylvain Pineau +import os +import re +import sys + +sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) +sitepkgpath = "$SNAP/lib/python3.12/site-packages" +sys.path.append(os.path.expandvars(sitepkgpath)) + +sys.path.append(os.path.expandvars( + "/snap/checkbox24/current/usr/lib/python3/dist-packages")) +runtimepath = "/snap/checkbox24/current/lib/python3.12/site-packages" +sys.path.append(os.path.expandvars(runtimepath)) + +try: + from checkbox_support.snap_utils.config import update_configuration + from checkbox_support.snap_utils.config import print_checkbox_conf +except ImportError: + msg = """ +checkbox-support not found! +You need to install the checkbox24 snap: + +snap install checkbox24 + """ + print(os.path.expandvars(msg), file=sys.stderr) + sys.exit(1) + + +def main(): + # we need run as root to be able to write to /var/snap/... + if os.geteuid() != 0: + print('You have to run this command with sudo') + return + + if len(sys.argv) > 1 and sys.argv[1] == '-l': + print_checkbox_conf() + return + + key_re = re.compile(r"^(?:[A-Z0-9]+_?)*[A-Z](?:_?[A-Z0-9])*$") + vars_to_set = dict() + for pair in sys.argv[1:]: + k, _, v = pair.partition('=') + if not key_re.match(k) or not v: + raise SystemExit("'%s' is not a valid configuration entry. " + "Should be KEY=val" % pair) + k = k.replace('_', '-').lower() + vars_to_set[k] = v + update_configuration(vars_to_set) + + +if __name__ == '__main__': + main() diff --git a/checkbox-snap/series_classic24/launchers/odm-certification b/checkbox-snap/series_classic24/launchers/odm-certification new file mode 100644 index 0000000000..f685fdeb3c --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/odm-certification @@ -0,0 +1,16 @@ +[launcher] +app_id = com.canonical.certification:checkbox +launcher_version = 1 +stock_reports = text, submission_files + +[test plan] +unit = com.canonical.certification::client-cert-odm-desktop-22-04-manual +filter = com.canonical.certification::client-cert-odm-desktop-22-04-* + com.canonical.certification::client-cert-odm-desktop-20-04-* + com.canonical.certification::client-cert-odm-desktop-18-04-* + com.canonical.certification::client-cert-odm-server-22-04-* + com.canonical.certification::client-cert-odm-server-20-04-* + com.canonical.certification::client-cert-odm-server-18-04-* + com.canonical.certification::client-cert-odm-ubuntucore-22-* + com.canonical.certification::client-cert-odm-ubuntucore-20-* + com.canonical.certification::client-cert-odm-ubuntucore-18-* diff --git a/checkbox-snap/series_classic24/launchers/odm-certification-app b/checkbox-snap/series_classic24/launchers/odm-certification-app new file mode 100755 index 0000000000..3c68c29c12 --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/odm-certification-app @@ -0,0 +1,24 @@ +#!/bin/sh + +print_usage() { + echo "Usage:" + echo " checkbox.odm-certification IP" + echo "" + echo " IP Provide IP address of the System Under Test" + echo "" + exit 1 +} + +if [ $# -ne 1 ]; then + print_usage +fi + +if expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then + true +elif [ "$1" = "localhost" ]; then + true +else + print_usage +fi + +exec checkbox-cli control "$1" "$SNAP"/bin/odm-certification diff --git a/checkbox-snap/series_classic24/launchers/test-runner b/checkbox-snap/series_classic24/launchers/test-runner new file mode 100755 index 0000000000..0dd6f14b3c --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/test-runner @@ -0,0 +1,9 @@ +#!/usr/bin/env checkbox-cli-wrapper +[launcher] +app_id = com.canonical.certification:checkbox +api_flags = restartable +launcher_version = 1 +stock_reports = text, submission_files, certification + +[test plan] +filter = com.canonical.certification::client-cert-iot-server-22-04-* diff --git a/checkbox-snap/series_classic24/launchers/wrapper_local b/checkbox-snap/series_classic24/launchers/wrapper_local new file mode 100755 index 0000000000..de47d1872b --- /dev/null +++ b/checkbox-snap/series_classic24/launchers/wrapper_local @@ -0,0 +1,45 @@ +#!/bin/bash + +case "$SNAP_ARCH" in + "amd64") ARCH='x86_64-linux-gnu' + ;; + "i386") ARCH='i386-linux-gnu' + ;; + "arm64") ARCH='aarch64-linux-gnu' + ;; + "armhf") ARCH='arm-linux-gnueabihf' + ;; + *) + echo "Unsupported architecture: $SNAP_ARCH" + ;; +esac + +################################################ +# Launcher common exports for any checkbox app # +################################################ + +RUNTIME=/snap/checkbox24/current +if [ ! -d "$RUNTIME" ]; then + echo "You need to install the checkbox24 snap." + echo "" + echo "You can do this with this command:" + echo "snap install checkbox24" + exit 1 +fi + +export LC_ALL=C.UTF-8 +PERL_VERSION=$(perl -e '$^V=~/^v(\d+\.\d+)/;print $1') +export PERL5LIB="$PERL5LIB:$SNAP/usr/lib/$ARCH/perl/$PERL_VERSION:$SNAP/usr/lib/$ARCH/perl5/$PERL_VERSION:$SNAP/usr/share/perl/$PERL_VERSION:$SNAP/usr/share/perl5" +export GI_TYPELIB_PATH=$SNAP/usr/lib/girepository-1.0:$SNAP/usr/lib/$ARCH/girepository-1.0 +export PATH="$SNAP/usr/sbin:$SNAP/sbin:$SNAP/usr/bin:$SNAP/bin:/snap/bin:$PATH" +export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf:$SNAP/usr/share/alsa/pcm/default.conf +export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH" + +if [ -e $RUNTIME/wrapper_common_classic ]; then + . $RUNTIME/wrapper_common_classic +else + echo "ERROR: no $RUNTIME/wrapper_common_classic found" + exit 1 +fi + +exec "$@" diff --git a/checkbox-snap/series_classic24/snap/hooks/configure b/checkbox-snap/series_classic24/snap/hooks/configure new file mode 100755 index 0000000000..84abb4053b --- /dev/null +++ b/checkbox-snap/series_classic24/snap/hooks/configure @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# Copyright 2021-2022 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Sylvain Pineau +""" +This hook reads `config_vars` file from the root of a snap and reenters this +configuration using snapd's config facilities and rewrites the file to a +checkbox config format in `$SNAP_DATA/checkbox.conf`. + +config_vars should list all the configuration variables in a `key=value` +syntax. The line can list variable name only, if the variable should not have a +default value. All keys should comprise of CAPS, numbers and undescores (_). +E.g.: + +OPEN_N_SSID +OPEN_BG_SSID +STRESS_S3_WAIT_DELAY=60 + +To change those values use the configure launcher. +E.g. + $ checkbox.configure OPEN_N_SSID=my-wifi + +If you __really__ need to change those values using `snap set` command, +you need to change CAPS to lowercase and underscores to dashes (-). + +E.g. + $ snap set checkbox open-n-ssid=my-wifi +""" + +import os +import sys + +sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) +sitepkgpath = "$SNAP/lib/python3.12/site-packages" +sys.path.append(os.path.expandvars(sitepkgpath)) + +sys.path.append(os.path.expandvars( + "/snap/checkbox24/current/usr/lib/python3/dist-packages")) +runtimepath = "/snap/checkbox24/current/lib/python3.12/site-packages" +sys.path.append(os.path.expandvars(runtimepath)) + +try: + from checkbox_support.snap_utils.config import refresh_configuration +except ImportError: + msg = """ +checkbox-support not found! +You need to install the checkbox24 snap: + +snap install checkbox24 + """ + print(os.path.expandvars(msg), file=sys.stderr) + sys.exit(1) +refresh_configuration() diff --git a/checkbox-snap/series_classic24/snap/snapcraft.yaml b/checkbox-snap/series_classic24/snap/snapcraft.yaml new file mode 100644 index 0000000000..7f9e90dcb2 --- /dev/null +++ b/checkbox-snap/series_classic24/snap/snapcraft.yaml @@ -0,0 +1,81 @@ +name: checkbox +summary: Checkbox test runner +description: | + Checkbox is a flexible test automation software. + It’s the main tool used in Ubuntu Certification program. +adopt-info: version-calculator +grade: devel +confinement: classic + +base: core24 +build-base: devel + +apps: + checkbox-cli: + command-chain: [bin/wrapper_local] + command: bin/checkbox-cli-wrapper + test-runner: + command-chain: [bin/wrapper_local] + command: bin/test-runner + sru: + command-chain: [bin/wrapper_local] + command: bin/sru + client-cert-iot-server: + command-chain: [bin/wrapper_local] + command: bin/client-cert-iot-server + odm-certification: + command-chain: [bin/wrapper_local] + command: bin/odm-certification-app + configure: + command: bin/configure + agent: + command-chain: [bin/wrapper_local] + command: bin/checkbox-cli-wrapper run-agent + daemon: simple + restart-condition: always + restart-delay: 1s + shell: + command-chain: [bin/wrapper_local] + command: bin/shell-wrapper + +passthrough: + hooks: + configure: + command-chain: [bin/wrapper_local] + +parts: + version-calculator: + plugin: dump + source: . + override-pull: | + snapcraftctl pull + # version.txt created by prepare.sh + export version=`cat $SNAPCRAFT_PART_SRC/version.txt` + [ $version ] || exit 1 + snapcraftctl set-version $version + stage: + - version.txt + launchers: + plugin: dump + source: launchers/ + build-attributes: [no-patchelf] + organize: + '*': bin/ + config-variables: + plugin: dump + source: . + build-attributes: [no-patchelf] + stage: [config_vars] + workaround-automated-review-issue: + plugin: nil + override-build: | + # This is a workaround for an upstream bug in the automated snap review tool + # remove this once this issue is resolved: + # https://bugs.launchpad.net/review-tools/+bug/2049093 + # Note: this cats /dev/urandom because the squashfs will collapse any + # predictable output to less than the desired size making this + # ineffective + echo "This file is a workaround for a bug in the automated snap review tool" > $SNAPCRAFT_PART_INSTALL/size_workaround + echo "this only contains random bytes to pad the snap to 16kb" >> $SNAPCRAFT_PART_INSTALL/size_workaround + echo "see: https://bugs.launchpad.net/review-tools/+bug/2049093" >> $SNAPCRAFT_PART_INSTALL/size_workaround + head -c 16384 /dev/urandom >> $SNAPCRAFT_PART_INSTALL/size_workaround From 2f1156255d2d6255f9be059a10ea26be2536b53c Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 10 Apr 2024 16:04:51 +0200 Subject: [PATCH 04/11] Core24 snap for uc24 --- checkbox-snap/series_uc24/.gitignore | 10 ++ .../launchers/client-cert-iot-ubuntucore | 18 +++ checkbox-snap/series_uc24/launchers/configure | 67 +++++++++ .../series_uc24/launchers/odm-certification | 16 +++ .../launchers/odm-certification-app | 24 ++++ .../series_uc24/launchers/shell-wrapper | 6 + .../series_uc24/launchers/test-runner | 9 ++ .../series_uc24/launchers/wrapper_local | 52 +++++++ .../series_uc24/snap/hooks/configure | 65 +++++++++ checkbox-snap/series_uc24/snap/snapcraft.yaml | 128 ++++++++++++++++++ 10 files changed, 395 insertions(+) create mode 100644 checkbox-snap/series_uc24/.gitignore create mode 100755 checkbox-snap/series_uc24/launchers/client-cert-iot-ubuntucore create mode 100755 checkbox-snap/series_uc24/launchers/configure create mode 100644 checkbox-snap/series_uc24/launchers/odm-certification create mode 100755 checkbox-snap/series_uc24/launchers/odm-certification-app create mode 100755 checkbox-snap/series_uc24/launchers/shell-wrapper create mode 100755 checkbox-snap/series_uc24/launchers/test-runner create mode 100755 checkbox-snap/series_uc24/launchers/wrapper_local create mode 100755 checkbox-snap/series_uc24/snap/hooks/configure create mode 100644 checkbox-snap/series_uc24/snap/snapcraft.yaml diff --git a/checkbox-snap/series_uc24/.gitignore b/checkbox-snap/series_uc24/.gitignore new file mode 100644 index 0000000000..a4811de6a9 --- /dev/null +++ b/checkbox-snap/series_uc24/.gitignore @@ -0,0 +1,10 @@ +*.pyc +*.snap +__pycache__ +build/mo/* +dist/*.tar.gz +parts/ +snap/.snapcraft +snap/gui/ +stage/ +prime/ diff --git a/checkbox-snap/series_uc24/launchers/client-cert-iot-ubuntucore b/checkbox-snap/series_uc24/launchers/client-cert-iot-ubuntucore new file mode 100755 index 0000000000..1b70d7306e --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/client-cert-iot-ubuntucore @@ -0,0 +1,18 @@ +#!/usr/bin/env checkbox-cli-wrapper +[launcher] +app_id = com.canonical.certification:checkbox +launcher_version = 1 +stock_reports = text, submission_files + +[test plan] +unit = com.canonical.certification::client-cert-iot-ubuntucore-22-automated +forced = yes + +[test selection] +forced = yes + +[ui] +type = silent +auto_retry = yes +max_attempts = 4 +delay_before_retry = 30 diff --git a/checkbox-snap/series_uc24/launchers/configure b/checkbox-snap/series_uc24/launchers/configure new file mode 100755 index 0000000000..6a576bc0f1 --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/configure @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +# Copyright 2018-2022 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Maciej Kisielewski +# Sylvain Pineau +import os +import re +import sys + +sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) +sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format( + sys.version_info[0], sys.version_info[1]) +sys.path.append(os.path.expandvars(sitepkgpath)) + +sys.path.append(os.path.expandvars( + "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages")) +runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format( + sys.version_info[0], sys.version_info[1]) +sys.path.append(os.path.expandvars(runtimepath)) + +try: + from checkbox_support.snap_utils.config import update_configuration + from checkbox_support.snap_utils.config import print_checkbox_conf +except ImportError: + msg = """ +checkbox-support not found! +You need to connect this snap to the checkbox24 snap. + +You can do this with those commands: + +snap connect $SNAP_NAME:checkbox-runtime checkbox24:checkbox-runtime +snap connect $SNAP_NAME:provider-resource checkbox24:provider-resource +snap connect $SNAP_NAME:provider-checkbox checkbox24:provider-checkbox +snap connect $SNAP_NAME:provider-docker checkbox24:provider-docker +snap connect $SNAP_NAME:provider-tpm2 checkbox24:provider-tpm2 +snap connect $SNAP_NAME:provider-sru checkbox24:provider-sru + """ + print(os.path.expandvars(msg), file=sys.stderr) + sys.exit(1) + + +def main(): + # we need run as root to be able to write to /var/snap/... + if os.geteuid() != 0: + print('You have to run this command with sudo') + return + + if len(sys.argv) > 1 and sys.argv[1] == '-l': + print_checkbox_conf() + return + + key_re = re.compile(r"^(?:[A-Z0-9]+_?)*[A-Z](?:_?[A-Z0-9])*$") + vars_to_set = dict() + for pair in sys.argv[1:]: + k, _, v = pair.partition('=') + if not key_re.match(k) or not v: + raise SystemExit("'%s' is not a valid configuration entry. " + "Should be KEY=val" % pair) + k = k.replace('_', '-').lower() + vars_to_set[k] = v + update_configuration(vars_to_set) + + +if __name__ == '__main__': + main() diff --git a/checkbox-snap/series_uc24/launchers/odm-certification b/checkbox-snap/series_uc24/launchers/odm-certification new file mode 100644 index 0000000000..32085a3e6c --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/odm-certification @@ -0,0 +1,16 @@ +[launcher] +app_id = com.canonical.certification:checkbox +launcher_version = 1 +stock_reports = text, submission_files + +[test plan] +unit = com.canonical.certification::client-cert-odm-ubuntucore-22-manual +filter = com.canonical.certification::client-cert-odm-desktop-22-04-* + com.canonical.certification::client-cert-odm-desktop-20-04-* + com.canonical.certification::client-cert-odm-desktop-18-04-* + com.canonical.certification::client-cert-odm-server-22-04-* + com.canonical.certification::client-cert-odm-server-20-04-* + com.canonical.certification::client-cert-odm-server-18-04-* + com.canonical.certification::client-cert-odm-ubuntucore-22-* + com.canonical.certification::client-cert-odm-ubuntucore-20-* + com.canonical.certification::client-cert-odm-ubuntucore-18-* diff --git a/checkbox-snap/series_uc24/launchers/odm-certification-app b/checkbox-snap/series_uc24/launchers/odm-certification-app new file mode 100755 index 0000000000..3c68c29c12 --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/odm-certification-app @@ -0,0 +1,24 @@ +#!/bin/sh + +print_usage() { + echo "Usage:" + echo " checkbox.odm-certification IP" + echo "" + echo " IP Provide IP address of the System Under Test" + echo "" + exit 1 +} + +if [ $# -ne 1 ]; then + print_usage +fi + +if expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then + true +elif [ "$1" = "localhost" ]; then + true +else + print_usage +fi + +exec checkbox-cli control "$1" "$SNAP"/bin/odm-certification diff --git a/checkbox-snap/series_uc24/launchers/shell-wrapper b/checkbox-snap/series_uc24/launchers/shell-wrapper new file mode 100755 index 0000000000..ffbca8f954 --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/shell-wrapper @@ -0,0 +1,6 @@ +#!/bin/bash + +. $(dirname "$(realpath $BASH_SOURCE)")/wrapper_local + +echo "$SNAP_NAME runtime shell, type 'exit' to quit the session" +exec bash --rcfile <(cat ~/.bashrc; echo 'PS1="(checkbox-shell) $PS1"') \ No newline at end of file diff --git a/checkbox-snap/series_uc24/launchers/test-runner b/checkbox-snap/series_uc24/launchers/test-runner new file mode 100755 index 0000000000..c1fd48472f --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/test-runner @@ -0,0 +1,9 @@ +#!/usr/bin/env checkbox-cli-wrapper +[launcher] +app_id = com.canonical.certification:checkbox +api_flags = restartable +launcher_version = 1 +stock_reports = text, submission_files, certification + +[test plan] +filter = com.canonical.certification::client-cert-iot-ubuntucore-20-* diff --git a/checkbox-snap/series_uc24/launchers/wrapper_local b/checkbox-snap/series_uc24/launchers/wrapper_local new file mode 100755 index 0000000000..9988ef2d42 --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/wrapper_local @@ -0,0 +1,52 @@ +#!/bin/bash + +case "$SNAP_ARCH" in + "amd64") ARCH='x86_64-linux-gnu' + ;; + "i386") ARCH='i386-linux-gnu' + ;; + "arm64") ARCH='aarch64-linux-gnu' + ;; + "armhf") ARCH='arm-linux-gnueabihf' + ;; + *) + echo "Unsupported architecture: $SNAP_ARCH" + ;; +esac + +################################################ +# Launcher common exports for any checkbox app # +################################################ + +if [ -d $SNAP/checkbox-runtime ]; then + RUNTIME=$SNAP/checkbox-runtime + if [ ! -d $RUNTIME/usr ]; then + echo "You need to connect this snap to the checkbox24 snap." + echo "" + echo "You can do this with those commands:" + echo "snap install checkbox24" + echo "snap connect $SNAP_NAME:checkbox-runtime checkbox24:checkbox-runtime" + exit 1 + fi +fi + +export LC_ALL=C.UTF-8 +PERL_VERSION=$(perl -e '$^V=~/^v(\d+\.\d+)/;print $1') +export PERL5LIB="$PERL5LIB:$SNAP/usr/lib/$ARCH/perl/$PERL_VERSION:$SNAP/usr/lib/$ARCH/perl5/$PERL_VERSION:$SNAP/usr/share/perl/$PERL_VERSION:$SNAP/usr/share/perl5" +export GI_TYPELIB_PATH=$SNAP/usr/lib/girepository-1.0:$SNAP/usr/lib/$ARCH/girepository-1.0 +export PATH="$PATH:$SNAP/usr/sbin:$SNAP/sbin:/snap/bin" +export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH" + +if [ -e $RUNTIME/wrapper_common ]; then + . $RUNTIME/wrapper_common +else + CGROUP_NAME=$(cat /proc/self/cgroup | grep -e "^1:name") + if [[ "$CGROUP_NAME" == *"hook.configure"* ]]; then + echo "Running in configure hook, wrapper_common not required" + else + echo "ERROR: no $RUNTIME/wrapper_common found" + exit 0 + fi +fi + +exec "$@" diff --git a/checkbox-snap/series_uc24/snap/hooks/configure b/checkbox-snap/series_uc24/snap/hooks/configure new file mode 100755 index 0000000000..b9473bd8b3 --- /dev/null +++ b/checkbox-snap/series_uc24/snap/hooks/configure @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +# Copyright 2021-2022 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Sylvain Pineau +""" +This hook reads `config_vars` file from the root of a snap and reenters this +configuration using snapd's config facilities and rewrites the file to a +checkbox config format in `$SNAP_DATA/checkbox.conf`. + +config_vars should list all the configuration variables in a `key=value` +syntax. The line can list variable name only, if the variable should not have a +default value. All keys should comprise of CAPS, numbers and undescores (_). +E.g.: + +OPEN_N_SSID +OPEN_BG_SSID +STRESS_S3_WAIT_DELAY=60 + +To change those values use the configure launcher. +E.g. + $ checkbox.configure OPEN_N_SSID=my-wifi + +If you __really__ need to change those values using `snap set` command, +you need to change CAPS to lowercase and underscores to dashes (-). + +E.g. + $ snap set checkbox open-n-ssid=my-wifi +""" + +import os +import sys + +sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages")) +sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format( + sys.version_info[0], sys.version_info[1]) +sys.path.append(os.path.expandvars(sitepkgpath)) + +sys.path.append(os.path.expandvars( + "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages")) +runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format( + sys.version_info[0], sys.version_info[1]) +sys.path.append(os.path.expandvars(runtimepath)) + +try: + from checkbox_support.snap_utils.config import refresh_configuration +except ImportError: + msg = """ +checkbox-support not found! +You need to connect this snap to the checkbox24 snap. + +You can do this with those commands: + +snap connect $SNAP_NAME:checkbox-runtime checkbox24:checkbox-runtime +snap connect $SNAP_NAME:provider-resource checkbox24:provider-resource +snap connect $SNAP_NAME:provider-checkbox checkbox24:provider-checkbox +snap connect $SNAP_NAME:provider-docker checkbox24:provider-docker +snap connect $SNAP_NAME:provider-tpm2 checkbox24:provider-tpm2 +snap connect $SNAP_NAME:provider-sru checkbox24:provider-sru +snap connect $SNAP_NAME:provider-certification-client checkbox24:provider-certification-client + """ + print(os.path.expandvars(msg), file=sys.stderr) + sys.exit(0) +refresh_configuration() diff --git a/checkbox-snap/series_uc24/snap/snapcraft.yaml b/checkbox-snap/series_uc24/snap/snapcraft.yaml new file mode 100644 index 0000000000..2a51c05735 --- /dev/null +++ b/checkbox-snap/series_uc24/snap/snapcraft.yaml @@ -0,0 +1,128 @@ +name: checkbox +summary: Checkbox test runner +description: | + Checkbox is a flexible test automation software. + It’s the main tool used in Ubuntu Certification program. +adopt-info: version-calculator +grade: devel +confinement: strict + +base: core24 +build-base: devel + +plugs: + checkbox-runtime: + interface: content + target: $SNAP/checkbox-runtime + default-provider: checkbox24 + provider-resource: + interface: content + target: $SNAP/providers/checkbox-provider-resource + default-provider: checkbox24 + provider-checkbox: + interface: content + target: $SNAP/providers/checkbox-provider-checkbox + default-provider: checkbox24 + provider-docker: + interface: content + target: $SNAP/providers/checkbox-provider-docker + default-provider: checkbox24 + provider-tpm2: + interface: content + target: $SNAP/providers/checkbox-provider-tpm2 + default-provider: checkbox24 + provider-sru: + interface: content + target: $SNAP/providers/checkbox-provider-sru + default-provider: checkbox24 + provider-gpgpu: + interface: content + target: $SNAP/providers/checkbox-provider-gpgpu + default-provider: checkbox24 + provider-certification-client: + interface: content + target: $SNAP/providers/checkbox-provider-certification-client + default-provider: checkbox24 + provider-certification-server: + interface: content + target: $SNAP/providers/checkbox-provider-certification-server + default-provider: checkbox24 + +apps: + checkbox-cli: + command-chain: [bin/wrapper_local] + command: bin/checkbox-cli-wrapper + plugs: &standard [home, network-bind, hardware-observe, bluez, bluetooth-control, + gpio, modem-manager, mount-observe, network-manager, pulseaudio, serial-port, + system-observe, tpm, udisks2] + test-runner: + command-chain: [bin/wrapper_local] + command: bin/test-runner + plugs: *standard + sru: + command-chain: [bin/wrapper_local] + command: bin/sru + plugs: *standard + client-cert-iot-ubuntucore: + command-chain: [bin/wrapper_local] + command: bin/client-cert-iot-ubuntucore + plugs: *standard + odm-certification: + command-chain: [bin/wrapper_local] + command: bin/odm-certification-app + plugs: *standard + configure: + command: bin/configure + agent: + command-chain: [bin/wrapper_local] + command: bin/checkbox-cli-wrapper run-agent + daemon: simple + restart-condition: always + restart-delay: 1s + plugs: *standard + shell: + command-chain: [bin/wrapper_local] + command: bin/shell-wrapper + plugs: *standard + +passthrough: + hooks: + configure: + command-chain: [bin/wrapper_local] + +parts: + version-calculator: + plugin: dump + source: . + override-pull: | + snapcraftctl pull + # version.txt created by prepare.sh + export version=`cat $SNAPCRAFT_PART_SRC/version.txt` + [ $version ] || exit 1 + snapcraftctl set-version $version + stage: + - version.txt + launchers: + plugin: dump + source: launchers/ + build-attributes: [no-patchelf] + organize: + '*': bin/ + config-variables: + plugin: dump + source: . + build-attributes: [no-patchelf] + stage: [config_vars] + workaround-automated-review-issue: + plugin: nil + override-build: | + # This is a workaround for an upstream bug in the automated snap review tool + # remove this once this issue is resolved: + # https://bugs.launchpad.net/review-tools/+bug/2049093 + # Note: this cats /dev/urandom because the squashfs will collapse any + # predictable output to less than the desired size making this + # ineffective + echo "This file is a workaround for a bug in the automated snap review tool" > $SNAPCRAFT_PART_INSTALL/size_workaround + echo "this only contains random bytes to pad the snap to 16kb" >> $SNAPCRAFT_PART_INSTALL/size_workaround + echo "see: https://bugs.launchpad.net/review-tools/+bug/2049093" >> $SNAPCRAFT_PART_INSTALL/size_workaround + head -c 16384 /dev/urandom >> $SNAPCRAFT_PART_INSTALL/size_workaround From 74e6aeebb7f9ab8430fdd31218ec4fe1f3ed1029 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Thu, 11 Apr 2024 14:48:28 +0200 Subject: [PATCH 05/11] Also sync checkbox classic 24 --- checkbox-snap/series_uc24/config_vars | 38 +++++++++++++++++++ .../launchers/checkbox-cli-wrapper | 3 ++ checkbox-snap/series_uc24/launchers/sru | 16 ++++++++ 3 files changed, 57 insertions(+) create mode 100644 checkbox-snap/series_uc24/config_vars create mode 100755 checkbox-snap/series_uc24/launchers/checkbox-cli-wrapper create mode 100755 checkbox-snap/series_uc24/launchers/sru diff --git a/checkbox-snap/series_uc24/config_vars b/checkbox-snap/series_uc24/config_vars new file mode 100644 index 0000000000..b6596b3bfe --- /dev/null +++ b/checkbox-snap/series_uc24/config_vars @@ -0,0 +1,38 @@ +# follow KEY=value syntax +WIFI_INTERFACE=mlan0 +WATCHDOG_KERNEL_MOD=iTCO_wdt +ALSADEVICE=hw:CARD=bytrt5660,DEV=0 +NET_DEVICE_INFO=ven_rsi_sdio ven_rsi_91x +OPEN_N_SSID=ubuntu-cert-n-open +OPEN_BG_SSID=ubuntu-cert-bg-open +OPEN_AC_SSID=ubuntu-cert-ac-open +OPEN_AX_SSID=ubuntu-cert-ax-open +WPA_N_SSID=ubuntu-cert-n-wpa +WPA_BG_SSID=ubuntu-cert-bg-wpa +WPA_AC_SSID=ubuntu-cert-ac-wpa +WPA_AX_SSID=ubuntu-cert-ax-wpa +WPA3_AX_SSID=ubuntu-cert-ax-wpa3 +WPA_N_PSK=insecure +WPA_BG_PSK=insecure +WPA_AC_PSK=insecure +WPA_AX_PSK=insecure +WPA3_AX_PSK=insecure +OBEX_TARGET=00:02:72:C5:F9:1F +WWAN_APN=internet +WWAN_NET_IF=ppp0 +WWAN_CONTROL_IF=ttyACM3 +STRESS_BOOT_ITERATIONS=100 +STRESS_S3_ITERATIONS=100 +STRESS_S4_ITERATIONS=100 +TEST_TARGET_IPERF=10.101.47.93 +STRESS_S4_WAIT_DELAY=120 +STRESS_S4_SLEEP_DELAY=60 +STRESS_S3_SLEEP_DELAY=60 +STRESS_BOOT_WAKEUP_DELAY=60 +STRESS_S3_WAIT_DELAY=120 +STRESS_BOOT_WAIT_DELAY=120 +WIFI_AP_SETUPTIME=30 +WWAN_SETUPTIME=30 +TPM2TOOLS_TCTI_NAME=device +TPM2TOOLS_DEVICE_FILE=/dev/tpm0 +MODEL_GRADE=signed diff --git a/checkbox-snap/series_uc24/launchers/checkbox-cli-wrapper b/checkbox-snap/series_uc24/launchers/checkbox-cli-wrapper new file mode 100755 index 0000000000..aff044783e --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/checkbox-cli-wrapper @@ -0,0 +1,3 @@ +#!/bin/sh + +exec checkbox-cli "$@" diff --git a/checkbox-snap/series_uc24/launchers/sru b/checkbox-snap/series_uc24/launchers/sru new file mode 100755 index 0000000000..da9df67322 --- /dev/null +++ b/checkbox-snap/series_uc24/launchers/sru @@ -0,0 +1,16 @@ +#!/usr/bin/env checkbox-cli-wrapper +[launcher] +app_id = com.canonical.certification:checkbox +api_flags = restartable +launcher_version = 1 +stock_reports = text, submission_files + +[test plan] +unit = com.canonical.certification::sru-ubuntucore +forced = yes + +[test selection] +forced = yes + +[ui] +type = silent From 07c29cb4f26778cf7b919849bdd6f163f7c7c957 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Tue, 16 Apr 2024 10:13:27 +0200 Subject: [PATCH 06/11] Remove default provider and add perl everywhere --- checkbox-core-snap/series24/snap/snapcraft.yaml | 1 + checkbox-snap/series_uc24/snap/snapcraft.yaml | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index da1c979da2..41d3b6ee6c 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -144,6 +144,7 @@ parts: - zlib1g-dev - build-essential stage-packages: + - perl - python3-markupsafe - python3-jinja2 - python3-packaging diff --git a/checkbox-snap/series_uc24/snap/snapcraft.yaml b/checkbox-snap/series_uc24/snap/snapcraft.yaml index 2a51c05735..a12529543f 100644 --- a/checkbox-snap/series_uc24/snap/snapcraft.yaml +++ b/checkbox-snap/series_uc24/snap/snapcraft.yaml @@ -14,39 +14,30 @@ plugs: checkbox-runtime: interface: content target: $SNAP/checkbox-runtime - default-provider: checkbox24 provider-resource: interface: content target: $SNAP/providers/checkbox-provider-resource - default-provider: checkbox24 provider-checkbox: interface: content target: $SNAP/providers/checkbox-provider-checkbox - default-provider: checkbox24 provider-docker: interface: content target: $SNAP/providers/checkbox-provider-docker - default-provider: checkbox24 provider-tpm2: interface: content target: $SNAP/providers/checkbox-provider-tpm2 - default-provider: checkbox24 provider-sru: interface: content target: $SNAP/providers/checkbox-provider-sru - default-provider: checkbox24 provider-gpgpu: interface: content target: $SNAP/providers/checkbox-provider-gpgpu - default-provider: checkbox24 provider-certification-client: interface: content target: $SNAP/providers/checkbox-provider-certification-client - default-provider: checkbox24 provider-certification-server: interface: content target: $SNAP/providers/checkbox-provider-certification-server - default-provider: checkbox24 apps: checkbox-cli: @@ -126,3 +117,7 @@ parts: echo "this only contains random bytes to pad the snap to 16kb" >> $SNAPCRAFT_PART_INSTALL/size_workaround echo "see: https://bugs.launchpad.net/review-tools/+bug/2049093" >> $SNAPCRAFT_PART_INSTALL/size_workaround head -c 16384 /dev/urandom >> $SNAPCRAFT_PART_INSTALL/size_workaround + install_perl: + plugin: nil + stage-packages: + - perl From 0024731a773aabf0d49bd1b0375ec27ff264881d Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 17 Apr 2024 15:03:24 +0200 Subject: [PATCH 07/11] Remove exe bit from lib --- checkbox-core-snap/series24/snap/snapcraft.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index 41d3b6ee6c..50c25d81ce 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -221,7 +221,12 @@ parts: python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-base --root="$CRAFT_PART_INSTALL" + override-prime: | + craftctl default + # needed because else this will trigger the store autoreviewer and be autorejected + execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.21153 stage-packages: + - execstack # needed to clear the execstack - python3-opencv - bc - bonnie++ @@ -348,7 +353,6 @@ parts: python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-iiotg --root="$CRAFT_PART_INSTALL" - after: [checkbox-provider-tpm2] ################################################################################ checkbox-provider-sru: From 2a08262b59fa26f0a439cd46fcb6d8c9f5ea61e7 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 17 Apr 2024 16:34:42 +0200 Subject: [PATCH 08/11] Conditional removal with glob for arm64 --- checkbox-core-snap/series24/snap/snapcraft.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index 50c25d81ce..6354202e12 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -224,7 +224,10 @@ parts: override-prime: | craftctl default # needed because else this will trigger the store autoreviewer and be autorejected - execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.21153 + # cleaning this bit should not cause any issue but if it does do not only remove this line + # contact also the store/update the package because else this will always trigger + # a manual review + [ -f usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* ] && execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* stage-packages: - execstack # needed to clear the execstack - python3-opencv From 248cf00c6d171bfb89100bbdfb1ec9894ee12621 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 17 Apr 2024 16:55:36 +0200 Subject: [PATCH 09/11] Patch does not apply to non x86 builds --- checkbox-core-snap/series24/snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index 6354202e12..094f403c87 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -227,7 +227,7 @@ parts: # cleaning this bit should not cause any issue but if it does do not only remove this line # contact also the store/update the package because else this will always trigger # a manual review - [ -f usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* ] && execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* + [ -f usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* ] && execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* || exit 0 stage-packages: - execstack # needed to clear the execstack - python3-opencv From 913d3aef4a19dc087cf648e136040812664b452b Mon Sep 17 00:00:00 2001 From: Hook25 Date: Mon, 22 Apr 2024 10:39:41 +0200 Subject: [PATCH 10/11] Update classic wrapper with new LD_LIBRARY_PATH --- checkbox-core-snap/common_files/config/wrapper_common | 1 + checkbox-core-snap/common_files/config/wrapper_common_classic | 1 + 2 files changed, 2 insertions(+) diff --git a/checkbox-core-snap/common_files/config/wrapper_common b/checkbox-core-snap/common_files/config/wrapper_common index 762414d143..36d0c27742 100644 --- a/checkbox-core-snap/common_files/config/wrapper_common +++ b/checkbox-core-snap/common_files/config/wrapper_common @@ -17,6 +17,7 @@ else append_path LD_LIBRARY_PATH $RUNTIME/lib append_path LD_LIBRARY_PATH $RUNTIME/lib/$ARCH append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH + append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/fwts append_path LD_LIBRARY_PATH $RUNTIME/lib/fwts append_path GI_TYPELIB_PATH $RUNTIME/usr/lib/girepository-1.0 append_path GI_TYPELIB_PATH $RUNTIME/usr/lib/$ARCH/girepository-1.0 diff --git a/checkbox-core-snap/common_files/config/wrapper_common_classic b/checkbox-core-snap/common_files/config/wrapper_common_classic index d64634bbf3..f0b633b19e 100644 --- a/checkbox-core-snap/common_files/config/wrapper_common_classic +++ b/checkbox-core-snap/common_files/config/wrapper_common_classic @@ -25,6 +25,7 @@ else append_path LD_LIBRARY_PATH $RUNTIME/lib append_path LD_LIBRARY_PATH $RUNTIME/lib/$ARCH append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH + append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/fwts append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/blas append_path LD_LIBRARY_PATH $RUNTIME/usr/lib/$ARCH/lapack append_path LD_LIBRARY_PATH $RUNTIME/lib/fwts From 42b62f521f7f9cf153eb97192cb3cf4357fd0976 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Mon, 22 Apr 2024 16:22:55 +0200 Subject: [PATCH 11/11] Ignore error via || true instead of random exit --- checkbox-core-snap/series24/snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkbox-core-snap/series24/snap/snapcraft.yaml b/checkbox-core-snap/series24/snap/snapcraft.yaml index 094f403c87..e92148924c 100644 --- a/checkbox-core-snap/series24/snap/snapcraft.yaml +++ b/checkbox-core-snap/series24/snap/snapcraft.yaml @@ -227,7 +227,7 @@ parts: # cleaning this bit should not cause any issue but if it does do not only remove this line # contact also the store/update the package because else this will always trigger # a manual review - [ -f usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* ] && execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* || exit 0 + [ -f usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* ] && execstack --clear-execstack usr/lib/x86_64-linux-gnu/libamdhip64.so.5.2.* || true stage-packages: - execstack # needed to clear the execstack - python3-opencv