Merge lp:~elopio/snappy/go-tests2 into lp:~fgimenez/snappy/go-functional-tests

Proposed by Leo Arias
Status: Merged
Approved by: Federico Gimenez
Approved revision: 494
Merged at revision: 493
Proposed branch: lp:~elopio/snappy/go-tests2
Merge into: lp:~fgimenez/snappy/go-functional-tests
Diff against target: 164 lines (+9/-78)
5 files modified
_integration-tests/snappy-selftest (+5/-5)
debian/integration-tests/control (+3/-2)
debian/rules (+1/-1)
integration-tests/run-in-image/debian/tests/control (+0/-2)
integration-tests/selftest (+0/-68)
To merge this branch: bzr merge lp:~elopio/snappy/go-tests2
Reviewer Review Type Date Requested Status
Federico Gimenez Approve
Review via email: mp+261982@code.launchpad.net

Commit message

Reorganization of the test files.
Run the go tests and the bash tests.

To post a comment you must log in.
Revision history for this message
Federico Gimenez (fgimenez) wrote :

Thanks! :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed directory 'integration-tests' => '_integration-tests'
2=== renamed file 'integration-tests/run-in-image/README' => '_integration-tests/README'
3=== renamed file 'debian/integration-tests/main.go' => '_integration-tests/main.go'
4=== renamed file 'integration-tests/run-in-image/snappy-selftest' => '_integration-tests/snappy-selftest'
5--- integration-tests/run-in-image/snappy-selftest 2015-05-22 12:44:41 +0000
6+++ _integration-tests/snappy-selftest 2015-06-15 15:37:42 +0000
7@@ -2,12 +2,12 @@
8
9 set -e
10
11-. tests/framework
12+MYDIR=$(dirname $0)
13+
14+. $MYDIR/tests/framework
15
16 SNAPPY=snappy
17
18-MYDIR=$(dirname $0)
19-
20 if [ "$1" != "--yes-really" ]; then
21 echo "The selftest may be destructive, please run with:"
22 echo " --yes-really"
23@@ -15,9 +15,9 @@
24 exit 1
25 fi
26
27-. tests/settings
28+. $MYDIR/tests/settings
29
30-. tests/common.sh
31+. $MYDIR/tests/common.sh
32
33 # prepare the environment
34 if [ -z "$ADT_REBOOT_MARK" ]; then
35
36=== added directory '_integration-tests/tests'
37=== renamed file 'integration-tests/run-in-image/tests/01_test_info' => '_integration-tests/tests/01_test_info'
38=== renamed file 'integration-tests/run-in-image/tests/02_test_versions' => '_integration-tests/tests/02_test_versions'
39=== renamed file 'integration-tests/run-in-image/tests/03_test_apt' => '_integration-tests/tests/03_test_apt'
40=== renamed file 'integration-tests/run-in-image/tests/04_test_install_hello' => '_integration-tests/tests/04_test_install_hello'
41=== renamed file 'integration-tests/run-in-image/tests/05_test_install_nonexistant' => '_integration-tests/tests/05_test_install_nonexistant'
42=== renamed file 'integration-tests/run-in-image/tests/06_test_search_framework' => '_integration-tests/tests/06_test_search_framework'
43=== renamed file 'integration-tests/run-in-image/tests/07_test_install_framework' => '_integration-tests/tests/07_test_install_framework'
44=== renamed file 'integration-tests/run-in-image/tests/08_test_versions_has_framework' => '_integration-tests/tests/08_test_versions_has_framework'
45=== renamed file 'integration-tests/run-in-image/tests/10_test_info_has_stuff' => '_integration-tests/tests/10_test_info_has_stuff'
46=== renamed file 'integration-tests/run-in-image/tests/11_test_xkcd_listens' => '_integration-tests/tests/11_test_xkcd_listens'
47=== renamed file 'integration-tests/run-in-image/tests/80_test_failover' => '_integration-tests/tests/80_test_failover'
48=== renamed file 'integration-tests/run-in-image/tests/90_test_upgrade' => '_integration-tests/tests/90_test_upgrade'
49=== renamed file 'integration-tests/run-in-image/tests/91_test_upgrade_from_stable_image' => '_integration-tests/tests/91_test_upgrade_from_stable_image'
50=== renamed file 'integration-tests/run-in-image/tests/common.sh' => '_integration-tests/tests/common.sh'
51=== renamed file 'integration-tests/run-in-image/tests/framework' => '_integration-tests/tests/framework'
52=== renamed file 'integration-tests/run-in-image/tests/settings' => '_integration-tests/tests/settings'
53=== renamed file 'debian/integration-tests/snappy_test.go' => '_integration-tests/tests/snappy_test.go'
54=== modified file 'debian/integration-tests/control'
55--- debian/integration-tests/control 2015-06-13 19:00:55 +0000
56+++ debian/integration-tests/control 2015-06-15 15:37:42 +0000
57@@ -1,5 +1,6 @@
58 Test-Command: snappy.test
59+Restrictions: allow-stderr
60 Depends: ubuntu-snappy-tests
61
62-#Test-Command: ./snappy-selftest --yes-really
63-#Depends:
64+Test-Command: ./_integration-tests/snappy-selftest --yes-really
65+Depends:
66
67=== modified file 'debian/rules'
68--- debian/rules 2015-06-13 19:00:55 +0000
69+++ debian/rules 2015-06-15 15:37:42 +0000
70@@ -53,7 +53,7 @@
71
72 override_dh_auto_build:
73 dh_auto_build
74- GOPATH=$$PWD/$(DH_BUILDDIR) go test -c debian/integration-tests/snappy_test.go
75+ GOPATH=$$PWD/$(DH_BUILDDIR) go test -c _integration-tests/tests/snappy_test.go
76 mv snappy.test $$PWD/$(DH_BUILDDIR)/bin
77
78 override_dh_auto_install:
79
80=== removed directory 'integration-tests/debs'
81=== removed directory 'integration-tests/image'
82=== removed directory 'integration-tests/run-in-image'
83=== removed directory 'integration-tests/run-in-image/debian'
84=== removed directory 'integration-tests/run-in-image/debian/tests'
85=== removed file 'integration-tests/run-in-image/debian/tests/control'
86--- integration-tests/run-in-image/debian/tests/control 2015-05-20 10:23:39 +0000
87+++ integration-tests/run-in-image/debian/tests/control 1970-01-01 00:00:00 +0000
88@@ -1,2 +0,0 @@
89-Test-Command: ./snappy-selftest --yes-really
90-Depends:
91
92=== removed directory 'integration-tests/run-in-image/tests'
93=== removed file 'integration-tests/selftest'
94--- integration-tests/selftest 2015-06-09 15:41:02 +0000
95+++ integration-tests/selftest 1970-01-01 00:00:00 +0000
96@@ -1,68 +0,0 @@
97-#!/bin/sh
98-
99-set -ex
100-
101-HERE="$(dirname $0)"
102-
103-# build the updated deb packages for the image
104-rm -f "$HERE/debs/*"
105-# the "-us -uc " flags tell it not to sign it
106-bzr-buildpackage --result-dir="$HERE/debs" "$HERE/.." -- -us -uc
107-
108-# build a base image
109-IMAGE="$HERE/image/snappy.img"
110-rm -f "$IMAGE/*"
111-# FIXME: hrm, hrm, needs sudo to work on testbed
112-#
113-# FIXME2: use wget here instead and just get the latest image from
114-# cdimage
115-sudo ubuntu-device-flash core -o "$IMAGE" rolling --channel edge --enable-ssh --developer-mode
116-
117-# base cmd
118-QEMU_CMD="qemu-system-$(uname -m) -enable-kvm -m 768 -localtime -nographic -net user -net nic,model=virtio"
119-
120-# fire it up
121-port=11022
122-SERIAL=stdio
123-$QEMU_CMD -drive file="$IMAGE",if=virtio -redir tcp:$port::22 -monitor none -serial $SERIAL &
124-QEMU_PID=$!
125-trap "kill $QEMU_PID" INT QUIT
126-
127-# wait until the image is ready
128-SSH="ssh -oStrictHostKeyChecking=no -o UserKnownHostsFile=\"$HERE/image/known_hosts\" -p $port ubuntu@localhost"
129-SCP="scp -oStrictHostKeyChecking=no -o UserKnownHostsFile=\"$HERE/image/known_hosts\" -P $port"
130-for i in $(seq 100); do
131- if $SSH true; then
132- break
133- fi
134- sleep 1
135-done
136-if [ $i = 100 ]; then
137- echo "Failed to setup qemu"
138- exit 1
139-fi
140-
141-# install debs
142-$SSH rm -rf /tmp/debs
143-$SSH mkdir /tmp/debs
144-$SCP "$HERE"/debs/*.deb ubuntu@localhost:/tmp/debs
145-$SSH sudo mount -o remount,rw /
146-$SSH sudo dpkg -i /tmp/debs/*.deb
147-
148-# shut it down
149-$SSH sudo halt --poweroff || true
150-
151-# wait for qemu pid
152-for i in $(seq 100); do
153- if [ ! -e /proc/$QEMU_PID/exe ]; then
154- break
155- fi
156- i=$((i+1))
157- sleep 1
158-done
159-
160-# now run the tests against the image
161-(cd "$HERE";
162- adt-run run-in-image/ --- ssh -s snappy -- -i image/snappy.img;
163-)
164-

Subscribers

People subscribed via source and target branches

to all changes: