tests: add basic lxd test #3372

Merged
merged 28 commits into from Aug 29, 2017

Conversation

Projects
None yet
8 participants
Collaborator

mvo5 commented May 22, 2017

This adds a test to ensure that the basic lxd functionality is available. It covers that lxd as a snap is functional and that snaps inside an lxd container can be used.

NICE. Thank you for doing this! Just one nitipick

tests/main/lxd/task.yaml
+
+ # FIXME: workaround for missing squashfuse
+ lxd.lxc exec my-ubuntu apt update
+ lxd.lxc exec my-ubuntu apt install squashfuse
@zyga

zyga May 22, 2017

Contributor

Do we need apt install -y here?

@mvo5

mvo5 May 22, 2017

Collaborator

Well, maybe, it is only needed if more dependencies pulled in but still a good idea, so +1

Supernice, thanks for this! Just a question about big downloads

tests/main/lxd/task.yaml
+ echo "Create a trivial container using the lxd snap"
+ wait_for_lxd
+ lxd init --auto
+ lxd.lxc launch ubuntu:16.04 my-ubuntu
@fgimenez

fgimenez May 22, 2017

Contributor

Pardon my ignorance but, will this pull the container? If so and the download is big we could modify the images to include it from the beginning.

@mvo5

mvo5 May 22, 2017

Collaborator

Yes, it will download an image and the image is big(ish). So I'm happy about any suggestions that can improve the speed here :)

@fgimenez

fgimenez May 31, 2017

Contributor

@mvo5 sorry for the very late response, IMO it's tricky because, given that we use lxd from the snap, if we initialize the linode image with it and put a container image in place, when the suite is initialized all the previous state would be whipped.

One possible solution could be to make the container image available at some well-known location in the linode image and, after the lxd snap is installed during the test, move the container image files to /var/snap/lxd/common/lxd/images, so that we don't need to download it during the test, do you think that would be a good approach?

mvo5 added some commits May 23, 2017

tests/main/lxd/task.yaml
+
+# only run this on ubuntu, we need a reasonable new kernel
+systems: [-debian-*]
+
@sergiocazzolato

sergiocazzolato May 31, 2017

Contributor

Should you need to run on restore stop and delete for the container?

Contributor

pedronis commented Jun 1, 2017

@mvo5 what's the state of this? it seems lxd doesn't work in the autopkgtests, the spread ones seems unrelated but not sure

mvo5 added some commits Jun 2, 2017

codecov-io commented Jun 6, 2017

Codecov Report

Merging #3372 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3372      +/-   ##
==========================================
+ Coverage   75.63%   75.64%   +<.01%     
==========================================
  Files         407      407              
  Lines       35034    35034              
==========================================
+ Hits        26499    26502       +3     
+ Misses       6654     6652       -2     
+ Partials     1881     1880       -1
Impacted Files Coverage Δ
interfaces/sorting.go 98.71% <0%> (-1.29%) ⬇️
cmd/snap/cmd_aliases.go 95% <0%> (+1.66%) ⬆️
wrappers/binaries.go 79.54% <0%> (+6.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55c86cb...d1c1673. Read the comment docs.

mvo5 added some commits Jun 6, 2017

+1, some comments to fix perhaps

tests/main/lxd/task.yaml
+summary: Ensure that lxd works
+
+# only run this on ubuntu, we need a reasonable new kernel
+systems: [-debian-*]
@zyga

zyga Jun 8, 2017

Contributor

You need to tweak this to exclude fedora and openSUSE though ideally only after checking it really doesn't work there

Member

chipaca commented Jul 10, 2017

The test failures (in travis and xenial-i386 at least) are germane.
What's the status of this PR?

@chipaca chipaca added Decaying and removed Decaying labels Jul 10, 2017

mvo5 added some commits Jul 25, 2017

Contributor

sergiocazzolato commented Aug 18, 2017

This is a huge download if I need to run the whole suite locally on qemu, it will take hours, perhaps this kind of tests could be just executed on linode or nightly.

Collaborator

mvo5 commented Aug 24, 2017

Closing for now until I find time to actually make the test work everywhere.

@mvo5 mvo5 closed this Aug 24, 2017

@mvo5 mvo5 reopened this Aug 25, 2017

Collaborator

mvo5 commented Aug 25, 2017

Reopening to get another full spread run after tweaking the test slightly. It should indeed go to the night suite as @sergiocazzolato suggested.

mvo5 added some commits Aug 25, 2017

use "minix" module in interfaces-kernel-module-control
The currently used binfmt_misc is used by lxd so we cannot unload
it in the test.
Collaborator

mvo5 commented Aug 28, 2017

This should work now #3815 is merged and we can install snaps that have bash completion files on core again.

mvo5 added some commits Aug 29, 2017

LGTM, but it's worth noticing that the new tests takes 2 to 3 minutes to run. We're back at 30+ minutes.

@niemeyer niemeyer merged commit f366f32 into snapcore:master Aug 29, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment