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
1=== renamed file '_integration-tests/README' => '_integration-tests/README.md'
2--- _integration-tests/README 2015-06-25 18:44:08 +0000
3+++ _integration-tests/README.md 2015-07-08 16:08:32 +0000
4@@ -1,21 +1,69 @@
5-# Automatic testing for snappy
6-
7-## qemu based x86 testing
8-
9-Run locally with:
10-$ adt-run $(pwd)/ --- ssh -s snappy -- -i /path/to/snappy.img
11-
12-
13-## BeagleBoneBlack real HW testing
14-
15-With autopkgtest 3.14 it can also drive a BBB directly, this requires
16-that the bbb contains a clean image. Then run:
17-
18-$ adt-run $(pwd)/ --- ssh --reboot -l ubuntu -P ubuntu --reboot -H webdm.local
19-
20-## Native Go tests
21-
22-Having golang installed, you can execute the full suite (including both go and
23-shell tests) with:
24-
25-$ go run _integration-test/main.go
26+# Integration testing for snappy
27+
28+## Requirements
29+
30+ * autopkgtest (>= 3.15.1)
31+
32+ Get the latest autopkgtest deb from
33+ https://packages.debian.org/sid/all/autopkgtest/download
34+
35+ * Internet access in the test bed.
36+
37+## Testing a virtual machine
38+
39+You can execute the full integration suite in a local virtual machine with:
40+
41+ go run _integration-test/main.go
42+
43+The test runner will create the snappy images with `ubuntu-device-flash`, so it
44+will ask for your password to run this command with `sudo`.
45+
46+## Testing snappy from a branch
47+
48+With the --snappy-from-branch flag, the snappy CLI command will be compiled
49+from the current branch, copied to the test bed and used during the integration
50+tests:
51+
52+ go run _integration-tests/main.go --snappy-from-branch
53+
54+You can use this flag to test in a remote machine too.
55+
56+## Filtering the tests to run
57+
58+With the --filter flag you can select the tests to run. For instance you can
59+pass MyTestSuite, MyTestSuite.FirstCustomTest or MyTestSuite.*CustomTest:
60+
61+ go run _integration-tests/main.go --filter MyTestSuite.FirstCustomTest
62+
63+## Testing a remote machine
64+
65+You can execute the integration suite in a remote snappy machine with:
66+
67+ go run _integration-test/main.go --ip {testbed-ip} --port {testbed-port} \
68+ --arch {testbed-arch}
69+
70+The test runner will use `ssh-copy-id` to send your identity file to the
71+testbed, so it will ask for the password of the ubuntu user in the test bed.
72+
73+When running in a remote machine, the test runner assumes the test bed is in
74+the latest rolling edge version, and it will skip all the tests that
75+require a different version. See the following section for instructions for
76+setting up a BeagleBone Black as the test bed.
77+
78+## Testing a BeagleBone Black
79+
80+First flash the latest rolling edge version into the sd card
81+(replacing /dev/sdX with the path to your card):
82+
83+ sudo ubuntu-device-flash core rolling --channel edge --oem beagleblack \
84+ --developer-mode --enable-ssh -o ubuntu-rolling-edge-armhf-bbb.img
85+
86+ sudo dd if=ubuntu-rolling-edge-armhf-bbb.img of=/dev/sdX bs=32M
87+ sync
88+
89+Then boot the board with the sd card, make sure that it is connected to the
90+same network as the test runner host, and find the {beaglebone-ip}.
91+
92+Run the tests with:
93+
94+ go run _integration-tests/main.go --ip {beaglebone-ip} --arch arm
95
96=== modified file '_integration-tests/main.go'
97--- _integration-tests/main.go 2015-07-07 04:20:01 +0000
98+++ _integration-tests/main.go 2015-07-08 16:08:32 +0000
99@@ -80,8 +80,9 @@
100 } else {
101 execCommand("ssh-copy-id", "-p", strconv.Itoa(testbedPort),
102 "ubuntu@"+testbedIP)
103- // Run the shell tests. TODO: Also run the other tests.
104- adtRun(rootPath, "", []string{}, remoteTestbedSSHOptions(testbedIP, testbedPort), true)
105+ // TODO: Also run the other tests.
106+ adtRun(rootPath, testFilter, []string{"latest"},
107+ remoteTestbedSSHOptions(testbedIP, testbedPort), false)
108 }
109 }
110
111
112=== modified file '_integration-tests/tests/latest/build_test.go'
113--- _integration-tests/tests/latest/build_test.go 2015-07-04 05:49:13 +0000
114+++ _integration-tests/tests/latest/build_test.go 2015-07-08 16:08:32 +0000
115@@ -61,9 +61,9 @@
116 expected = "" +
117 "Installing " + snapName + "\n" +
118 ".*Signature check failed, but installing anyway as requested\n" +
119- "Name Date Version Developer \n" +
120+ "Name +Date +Version +Developer \n" +
121 ".*\n" +
122- basicSnapName + " .* .* sideload \n" +
123+ basicSnapName + " +.* +.* +sideload \n" +
124 ".*\n"
125
126 c.Check(installOutput, Matches, expected)
127
128=== modified file '_integration-tests/tests/latest/install_test.go'
129--- _integration-tests/tests/latest/install_test.go 2015-07-08 08:49:22 +0000
130+++ _integration-tests/tests/latest/install_test.go 2015-07-08 16:08:32 +0000
131@@ -42,12 +42,12 @@
132 func (s *installSuite) TestInstallSnapMustPrintPackageInformation(c *C) {
133 installOutput := InstallSnap(c, "hello-world")
134
135- expected := "" +
136+ expected := "(?ms)" +
137 "Installing hello-world\n" +
138- "Name Date Version Developer \n" +
139- ".*\n" +
140- "hello-world .* .* canonical \n" +
141- ".*\n"
142+ "Name +Date +Version +Developer \n" +
143+ ".*" +
144+ "^hello-world +.* +.* +canonical \n" +
145+ ".*"
146
147 c.Assert(installOutput, Matches, expected)
148 }
149
150=== modified file '_integration-tests/tests/update/update_test.go'
151--- _integration-tests/tests/update/update_test.go 2015-07-06 22:27:42 +0000
152+++ _integration-tests/tests/update/update_test.go 2015-07-08 16:08:32 +0000
153@@ -44,6 +44,7 @@
154 CallUpdate(c)
155 Reboot(c)
156 } else if AfterReboot(c) {
157+ RemoveRebootMark(c)
158 c.Assert(GetCurrentVersion(c) > GetSavedVersion(c), Equals, true)
159 }
160 }

Subscribers

People subscribed via source and target branches