Merge lp:~elopio/snappy/bbb_integration into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 538
Merged at revision: 571
Proposed branch: lp:~elopio/snappy/bbb_integration
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 160 lines (+80/-30)
5 files modified
_integration-tests/README.md (+69/-21)
_integration-tests/main.go (+3/-2)
_integration-tests/tests/latest/build_test.go (+2/-2)
_integration-tests/tests/latest/install_test.go (+5/-5)
_integration-tests/tests/update/update_test.go (+1/-0)
To merge this branch: bzr merge lp:~elopio/snappy/bbb_integration
Reviewer Review Type Date Requested Status
Federico Gimenez (community) Approve
Review via email: mp+264090@code.launchpad.net

Commit message

Integration tests in the latest package working on beaglebone black.
Integration tests README updated.

Description of the change

following branches with shell, update and failover.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

There seems to be a problem when running the update twice on beagle. The second time, after the reboot, this happens: http://paste.ubuntu.com/11839856/

Revision history for this message
Federico Gimenez (fgimenez) wrote :

Same here after the second update (both via fake), working fine on kvm.

Otherwise, the changes look good and don't seem to be the cause of this.

review: Approve
Revision history for this message
Leo Arias (elopio) wrote :

Let me remove the update for now. Then this would be progress, as we will have the latest tests passing on beagle.

lp:~elopio/snappy/bbb_integration updated
537. By Leo Arias

Removed the update for now.

538. By Leo Arias

Updated the comment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed file '_integration-tests/README' => '_integration-tests/README.md'
--- _integration-tests/README 2015-06-25 18:44:08 +0000
+++ _integration-tests/README.md 2015-07-08 16:08:32 +0000
@@ -1,21 +1,69 @@
1# Automatic testing for snappy1# Integration testing for snappy
22
3## qemu based x86 testing3## Requirements
44
5Run locally with:5 * autopkgtest (>= 3.15.1)
6$ adt-run $(pwd)/ --- ssh -s snappy -- -i /path/to/snappy.img6
77 Get the latest autopkgtest deb from
88 https://packages.debian.org/sid/all/autopkgtest/download
9## BeagleBoneBlack real HW testing9
1010 * Internet access in the test bed.
11With autopkgtest 3.14 it can also drive a BBB directly, this requires11
12that the bbb contains a clean image. Then run:12## Testing a virtual machine
1313
14$ adt-run $(pwd)/ --- ssh --reboot -l ubuntu -P ubuntu --reboot -H webdm.local14You can execute the full integration suite in a local virtual machine with:
1515
16## Native Go tests16 go run _integration-test/main.go
1717
18Having golang installed, you can execute the full suite (including both go and18The test runner will create the snappy images with `ubuntu-device-flash`, so it
19shell tests) with:19will ask for your password to run this command with `sudo`.
2020
21$ go run _integration-test/main.go21## Testing snappy from a branch
22
23With the --snappy-from-branch flag, the snappy CLI command will be compiled
24from the current branch, copied to the test bed and used during the integration
25tests:
26
27 go run _integration-tests/main.go --snappy-from-branch
28
29You can use this flag to test in a remote machine too.
30
31## Filtering the tests to run
32
33With the --filter flag you can select the tests to run. For instance you can
34pass MyTestSuite, MyTestSuite.FirstCustomTest or MyTestSuite.*CustomTest:
35
36 go run _integration-tests/main.go --filter MyTestSuite.FirstCustomTest
37
38## Testing a remote machine
39
40You can execute the integration suite in a remote snappy machine with:
41
42 go run _integration-test/main.go --ip {testbed-ip} --port {testbed-port} \
43 --arch {testbed-arch}
44
45The test runner will use `ssh-copy-id` to send your identity file to the
46testbed, so it will ask for the password of the ubuntu user in the test bed.
47
48When running in a remote machine, the test runner assumes the test bed is in
49the latest rolling edge version, and it will skip all the tests that
50require a different version. See the following section for instructions for
51setting up a BeagleBone Black as the test bed.
52
53## Testing a BeagleBone Black
54
55First flash the latest rolling edge version into the sd card
56(replacing /dev/sdX with the path to your card):
57
58 sudo ubuntu-device-flash core rolling --channel edge --oem beagleblack \
59 --developer-mode --enable-ssh -o ubuntu-rolling-edge-armhf-bbb.img
60
61 sudo dd if=ubuntu-rolling-edge-armhf-bbb.img of=/dev/sdX bs=32M
62 sync
63
64Then boot the board with the sd card, make sure that it is connected to the
65same network as the test runner host, and find the {beaglebone-ip}.
66
67Run the tests with:
68
69 go run _integration-tests/main.go --ip {beaglebone-ip} --arch arm
2270
=== modified file '_integration-tests/main.go'
--- _integration-tests/main.go 2015-07-07 04:20:01 +0000
+++ _integration-tests/main.go 2015-07-08 16:08:32 +0000
@@ -80,8 +80,9 @@
80 } else {80 } else {
81 execCommand("ssh-copy-id", "-p", strconv.Itoa(testbedPort),81 execCommand("ssh-copy-id", "-p", strconv.Itoa(testbedPort),
82 "ubuntu@"+testbedIP)82 "ubuntu@"+testbedIP)
83 // Run the shell tests. TODO: Also run the other tests.83 // TODO: Also run the other tests.
84 adtRun(rootPath, "", []string{}, remoteTestbedSSHOptions(testbedIP, testbedPort), true)84 adtRun(rootPath, testFilter, []string{"latest"},
85 remoteTestbedSSHOptions(testbedIP, testbedPort), false)
85 }86 }
86}87}
8788
8889
=== modified file '_integration-tests/tests/latest/build_test.go'
--- _integration-tests/tests/latest/build_test.go 2015-07-04 05:49:13 +0000
+++ _integration-tests/tests/latest/build_test.go 2015-07-08 16:08:32 +0000
@@ -61,9 +61,9 @@
61 expected = "" +61 expected = "" +
62 "Installing " + snapName + "\n" +62 "Installing " + snapName + "\n" +
63 ".*Signature check failed, but installing anyway as requested\n" +63 ".*Signature check failed, but installing anyway as requested\n" +
64 "Name Date Version Developer \n" +64 "Name +Date +Version +Developer \n" +
65 ".*\n" +65 ".*\n" +
66 basicSnapName + " .* .* sideload \n" +66 basicSnapName + " +.* +.* +sideload \n" +
67 ".*\n"67 ".*\n"
6868
69 c.Check(installOutput, Matches, expected)69 c.Check(installOutput, Matches, expected)
7070
=== modified file '_integration-tests/tests/latest/install_test.go'
--- _integration-tests/tests/latest/install_test.go 2015-07-08 08:49:22 +0000
+++ _integration-tests/tests/latest/install_test.go 2015-07-08 16:08:32 +0000
@@ -42,12 +42,12 @@
42func (s *installSuite) TestInstallSnapMustPrintPackageInformation(c *C) {42func (s *installSuite) TestInstallSnapMustPrintPackageInformation(c *C) {
43 installOutput := InstallSnap(c, "hello-world")43 installOutput := InstallSnap(c, "hello-world")
4444
45 expected := "" +45 expected := "(?ms)" +
46 "Installing hello-world\n" +46 "Installing hello-world\n" +
47 "Name Date Version Developer \n" +47 "Name +Date +Version +Developer \n" +
48 ".*\n" +48 ".*" +
49 "hello-world .* .* canonical \n" +49 "^hello-world +.* +.* +canonical \n" +
50 ".*\n"50 ".*"
5151
52 c.Assert(installOutput, Matches, expected)52 c.Assert(installOutput, Matches, expected)
53}53}
5454
=== modified file '_integration-tests/tests/update/update_test.go'
--- _integration-tests/tests/update/update_test.go 2015-07-06 22:27:42 +0000
+++ _integration-tests/tests/update/update_test.go 2015-07-08 16:08:32 +0000
@@ -44,6 +44,7 @@
44 CallUpdate(c)44 CallUpdate(c)
45 Reboot(c)45 Reboot(c)
46 } else if AfterReboot(c) {46 } else if AfterReboot(c) {
47 RemoveRebootMark(c)
47 c.Assert(GetCurrentVersion(c) > GetSavedVersion(c), Equals, true)48 c.Assert(GetCurrentVersion(c) > GetSavedVersion(c), Equals, true)
48 }49 }
49}50}

Subscribers

People subscribed via source and target branches