Test log in with one-time password
-
Set up an SSO account with two-factor authentication.
-
Run snapcraft logout
-
Run snapcraft login
-
Enter the email address.
-
Enter the password.
-
Enter the one-time password.
- Check that the log in was successful.
Test file ownership is retained
- 'snapcraft build' a simple snap
- sudo touch install/test-owner-file
- sudo chown nobody:nogroup install/test-owner-file
- sudo snapcraft prime
- ensure that prime/test-owner-file is owned by nobody and nogroup
Test stage package caching
snapcraft pulla snap that haspartswithstage-packages.- Run
snapcraft clean. - Verify there is cached apt data in
~/.cache/snapcraft/<hash>/ - Run
snapcraft pullagain and notice the download is minimal. - Wipe the cached apt data.
- Run
snapcraft pullagain and notice the download is as in1.. - Run this test again, but run snapcraft on a partition separated from $HOME.
Test cleanbuild with debug shell
- Run
snapcraft cleanbuild --debugfor a snap. - Insert an error such that the code will fail to compile or
mistype the name of an entry in
stage-packages. - Run
snapcraft cleanbuild --debugagain. - Ensure you are dropped into a debug shell.
- Exit the shell.
- Ensure you are dropped back into your original shell session.
Test cleanbuild with non-ascii characters in the desktop file.
- Run
snapcraft cleanbuildfor the snap inintegration_tests/snaps/desktop-with-non-ascii- Check that the build succeeds and you get the
.snapfile.
- Check that the build succeeds and you get the
Test cleanbuild with a remote.
- Setup a remote as described on https://linuxcontainers.org/lxd/getting-started-cli/#multiple-hosts
- Select a project to build.
- Run
snapcraft cleanbuild --remote <remote>where<remote>is the name you gave the remote on step 1.
Test containerized building
- Setup LXD as described on https://linuxcontainers.org/lxd/getting-started-cli/
- Select a project to build.
- Run
SNAPCRAFT_CONTAINER_BUILDS=1 snapcraft. - Run
SNAPCRAFT_CONTAINER_BUILDS=1 snapcraft cleanand observe that build folders as well as the containersnapcraft-<project>is gone.
Test cross-compilation with Go
- Go to integration_tests/snaps/go-hello.
- Run
snapcraft snap --target-arch=armhf. - Copy the snap to a Raspberry Pi.
- Install the snap.
- Run
go-hello.
Test cross-compilation with Rust
- Go to integration_tests/snaps/rust-hello.
- Run
snapcraft snap --target-arch=armhf. - Copy the snap to a Raspberry Pi.
- Install the snap.
- Run
rust-hello.
Test cross-compilation with Autotools
- Go to integration_tests/snaps/autotools-hello.
- Run
snapcraft snap --target-arch=armhf. - Copy the snap to a Raspberry Pi.
- Install the snap.
- Run
autotools-hello.
Test cross-compilation with Waf
- Go to integration_tests/snaps/waf-with-configflags.
- Run
snapcraft snap --target-arch=armhf. - Copy the snap to a Raspberry Pi.
- Install the snap.
- Run
waf-with-configflags.
Test the PC kernel.
-
Get the PC kernel source:
$ git clone -b pc https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-snap/+git/xenial $ cd xenial
-
Run
sudo snapcraft. -
Create a file called
pc-model.jsonwith the following contents:{ "type": "model", "authority-id": "$account_id", "brand-id": "$account_id", "series": "16", "model": "pc", "architecture": "amd64", "gadget": "pc", "kernel": "$kernel_snap_path", "timestamp": "$date" }
-
Replace
$account_idwith the value from https://myapps.developer.ubuntu.com/dev/account/ -
Replace
$kernel_snap_pathwith the path to the snap you just created. -
Replace
$datewith the output of the commanddate -Iseconds --utc. -
If you haven't created a key, run the following command, replacing
$key_namewith a name for your key:$ snap create-key $key_name $ snapcraft register-key
-
Sign the model:
$ cat pc-model.json | snap sign -k $key_name > pc.model
-
Install ubuntu-image:
$ sudo apt install ubuntu-image
-
Create the image:
$ sudo ubuntu-image --image-size 3G -O ubuntu-core-16 pc.model --extra-snaps $kernel_snap_path
-
Start the image in kvm:
$ kvm -smp 2 -m 1500 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -drive file=ubuntu-core-16/pc.img,format=raw
- Check that the user can be created.
- Check that it's possible to ssh into the vm.
- Check that it's possible to install a snap.
Test the dragonboard 410c kernel.
-
Download https://developer.qualcomm.com/download/db410c/linux-board-support-package-v1.2.zip
-
Extract it and copy the file
firmware.tarto the directorydemos/96boards-kernel. -
Run
snapcraft snap --target-arch arm64in thedemos/96boards-kerneldirectory. -
Create a file called
dragonboard-model.jsonwith the following contents:{ "type": "model", "authority-id": "$account_id", "brand-id": "$account_id", "series": "16", "model": "dragonboard", "architecture": "arm64", "gadget": "dragonboard", "kernel": "$kernel_snap_path", "timestamp": "$date" }
-
Replace
$account_idwith the value from https://myapps.developer.ubuntu.com/dev/account/ -
Replace
$kernel_snap_pathwith the path to the snap you just created. -
Replace
$datewith the output of the commanddate -Iseconds --utc. -
If you haven't created a key, run the following command, replacing
$key_namewith a name for your key:$ snap create-key $key_name $ snapcraft register-key
-
Sign the model:
$ cat dragonboard-model.json | snap sign -k $key_name > dragonboard.model
-
Install ubuntu-image:
$ sudo apt install ubuntu-image
-
Create the image:
$ sudo ubuntu-image -O ubuntu-core-16 dragonboard.model --extra-snaps $kernel_snap_path
-
Insert an sdcard into the host PC.
-
Umount the sdcard partitions.
-
Flash the image, replacing sdX with the path to the sdcard:
$ sudo dd if=ubuntu-core-16/dragonboard.img of=/dev/sdX bs=32M $ sync
-
Insert the sdcard into the dragonboard, and turn it on.
- Check that the user can be created.
- Check that it's possible to ssh into the board.
- Check that it's possible to install a snap.
Test installing with pip
- Follow HACKING.md to install using
pipwithout using --editable. - Make sure Snapcraft works by running
snapcraft initfollowed bysnapcraft. - Follow HACKING.md to install using
pipwhile using --editable. - Repeat step 2.
Test push metadata with conflicts
-
'snapcraft snap' a simple snap
-
Do a simple 'snapcraft push SNAP'
-
Go to the Web and change snap's description
-
Change the snap's description in the YAML file to something different than you put in the Web
-
Try to update snap's metadata doing
snapcraft push-metadata SNAP- Check that it should error with "conflict" on the description field
-
Force the update doing
snapcraft push-metadata SNAP --force- Check that it should end ok
- Check in the Web that the description is now what the YAML says
Test push binary metadata with conflicts
-
'snapcraft snap' a simple snap
-
Do a simple 'snapcraft push SNAP'
-
Go to the Web and change snap's icon
-
Change the snap's icon in the YAML file to something different than you put in the Web
-
Try to update snap's metadata using
snapcraft push-metadata SNAP- Check that it should error with "conflict" on the icon field
-
Force the update doing
snapcraft push-metadata SNAP --force- Check that it should end ok
- Check in the Web that the icon is now what the YAML says