Merge lp:~fgimenez/snappy/1504_validation into lp:~snappy-dev/snappy/snappy-moved-to-github

Proposed by Federico Gimenez on 2015-09-21
Status: Rejected
Rejected by: Federico Gimenez on 2015-09-28
Proposed branch: lp:~fgimenez/snappy/1504_validation
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Prerequisite: lp:~elopio/snappy/resize_test
Diff against target: 201 lines (+50/-43)
5 files modified
_integration-tests/tests/failover_zero_size_file_test.go (+22/-35)
_integration-tests/tests/installApp_test.go (+1/-1)
_integration-tests/tests/ubuntuFan_test.go (+8/-1)
_integration-tests/tests/update_test.go (+6/-1)
_integration-tests/testutils/common/common.go (+13/-5)
To merge this branch: bzr merge lp:~fgimenez/snappy/1504_validation
Reviewer Review Type Date Requested Status
Snappy Developers 2015-09-21 Pending
Review via email: mp+271777@code.launchpad.net

This proposal supersedes a proposal from 2015-09-16.

Commit Message

15.04 validation changes

Description of the Change

15.04 validation changes, compatible with rolling too

To post a comment you must log in.
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

I made these extra changes and could run successfully on 15.04 alpha #11.

http://paste.ubuntu.com/12432357/

Leo Arias (elopio) wrote : Posted in a previous version of this proposal

One more patch, to allow the execution on --update:
http://paste.ubuntu.com/12433452/

lp:~fgimenez/snappy/1504_validation updated on 2015-09-21
686. By Federico Gimenez on 2015-09-21

removed change to script in prerequesite

Leo Arias (elopio) wrote :

The prerequisite is proving harder than expected. So, we should merge the changes we can without that one.

Leo Arias (elopio) wrote :

Here's five https://code.launchpad.net/~elopio/snappy/fix_integration_cfg/+merge/272332

And I think we are done. The only remaining problem is the rollback.
The new kernel file branch needs some more stressing, because I think I saw it happening again at some point today. But I've touched too many branches, not sure about what I saw.

Federico Gimenez (fgimenez) wrote :

Thanks for bringing order to this mess :) I'll try the rollback now.

Unmerged revisions

686. By Federico Gimenez on 2015-09-21

removed change to script in prerequesite

685. By Federico Gimenez on 2015-09-18

merged trunk

684. By Federico Gimenez on 2015-09-18

no need for taking into account for old kernel files after the unified approach

683. By Federico Gimenez on 2015-09-17

Added patches from elopio

682. By Federico Gimenez on 2015-09-16

fixed try mode

681. By Federico Gimenez on 2015-09-16

more fixes

680. By Federico Gimenez on 2015-09-16

merged trunk

679. By Federico Gimenez on 2015-09-16

unified boot file paths for grub and uboot

678. By Federico Gimenez on 2015-09-15

merged resize_test2

677. By Federico Gimenez on 2015-09-15

merged elopio's resize_test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '_integration-tests/tests/failover_zero_size_file_test.go'
2--- _integration-tests/tests/failover_zero_size_file_test.go 2015-09-13 02:52:52 +0000
3+++ _integration-tests/tests/failover_zero_size_file_test.go 2015-09-21 08:34:11 +0000
4@@ -53,29 +53,23 @@
5 }
6
7 func (zeroSizeInitrd) set(c *check.C) {
8- if classicKernelFiles(c) {
9- commonSet(c, BaseAltPartitionPath, origBootFilenamePattern, initrdFilename)
10- } else {
11- boot, err := partition.BootSystem()
12- c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
13- dir := partition.BootDir(boot)
14-
15- bootFileNamePattern := newKernelFilenamePattern(c, boot, true)
16- commonSet(c, dir, bootFileNamePattern, initrdFilename)
17- }
18+ boot, err := partition.BootSystem()
19+ c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
20+ dir := partition.BootDir(boot)
21+
22+ bootFileNamePattern := newKernelFilenamePattern(c, boot, true)
23+ commonSet(c, dir, bootFileNamePattern, initrdFilename)
24+
25 }
26
27 func (zeroSizeInitrd) unset(c *check.C) {
28- if classicKernelFiles(c) {
29- commonUnset(c, BaseAltPartitionPath, origBootFilenamePattern, initrdFilename)
30- } else {
31- boot, err := partition.BootSystem()
32- c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
33- dir := partition.BootDir(boot)
34-
35- bootFileNamePattern := newKernelFilenamePattern(c, boot, false)
36- commonUnset(c, dir, bootFileNamePattern, initrdFilename)
37- }
38+ boot, err := partition.BootSystem()
39+ c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
40+ dir := partition.BootDir(boot)
41+
42+ bootFileNamePattern := newKernelFilenamePattern(c, boot, false)
43+ commonUnset(c, dir, bootFileNamePattern, initrdFilename)
44+
45 }
46
47 func (zeroSizeSystemd) set(c *check.C) {
48@@ -144,15 +138,6 @@
49 return matches[0]
50 }
51
52-func classicKernelFiles(c *check.C) bool {
53- initrdClassicFilenamePattern := fmt.Sprintf("/boot/%s*-generic", initrdFilename)
54- matches, err := filepath.Glob(initrdClassicFilenamePattern)
55-
56- c.Assert(err, check.IsNil, check.Commentf("Error: %v", err))
57-
58- return len(matches) == 1
59-}
60-
61 // newKernelFilenamePattern returns the filename pattern to modify files
62 // in the partition declared in the boot config file.
63 //
64@@ -162,15 +147,17 @@
65 // If we are not in an update process (ie. we are unsetting the failover conditions)
66 // we want to change the files in the other partition
67 func newKernelFilenamePattern(c *check.C, bootSystem string, afterUpdate bool) string {
68- var actualPartition string
69- part, err := partition.NextBootPartition()
70- c.Assert(err, check.IsNil, check.Commentf("Error getting the current partition: %s", err))
71+ var part string
72+ var err error
73 if afterUpdate {
74- actualPartition = part
75+ part, err = partition.NextBootPartition()
76+ c.Assert(err, check.IsNil, check.Commentf("Error getting the next boot partition: %s", err))
77 } else {
78- actualPartition = partition.OtherPartition(part)
79+ part, err = partition.CurrentPartition()
80+ c.Assert(err, check.IsNil, check.Commentf("Error getting the current partition: %s", err))
81+ part = partition.OtherPartition(part)
82 }
83- return filepath.Join(actualPartition, "%s%s*")
84+ return filepath.Join(part, "%s%s*")
85 }
86
87 /*
88
89=== modified file '_integration-tests/tests/installApp_test.go'
90--- _integration-tests/tests/installApp_test.go 2015-09-04 07:41:30 +0000
91+++ _integration-tests/tests/installApp_test.go 2015-09-21 08:34:11 +0000
92@@ -119,5 +119,5 @@
93 c.Assert(err, check.NotNil)
94 c.Assert(string(output), check.Equals,
95 "Installing unexisting.canonical\n"+
96- "unexisting.canonical failed to install: snappy package not found\n")
97+ "unexisting failed to install: snappy package not found\n")
98 }
99
100=== modified file '_integration-tests/tests/ubuntuFan_test.go'
101--- _integration-tests/tests/ubuntuFan_test.go 2015-09-10 10:15:43 +0000
102+++ _integration-tests/tests/ubuntuFan_test.go 2015-09-21 08:34:11 +0000
103@@ -26,6 +26,7 @@
104 "strings"
105
106 "launchpad.net/snappy/_integration-tests/testutils/common"
107+ "launchpad.net/snappy/_integration-tests/testutils/config"
108 "launchpad.net/snappy/_integration-tests/testutils/wait"
109
110 "gopkg.in/check.v1"
111@@ -45,8 +46,14 @@
112 }
113
114 func (s *fanTestSuite) SetUpTest(c *check.C) {
115+ var err error
116+ Cfg, err := config.ReadConfig(
117+ "_integration-tests/data/output/testconfig.json")
118+ if Cfg.Release == "15.04" {
119+ c.Skip("Ubuntu Fan not available in 15.04")
120+ }
121+
122 s.SnappySuite.SetUpTest(c)
123- var err error
124 s.subjectIP, err = getIPAddr(c)
125 c.Assert(err, check.IsNil)
126
127
128=== modified file '_integration-tests/tests/update_test.go'
129--- _integration-tests/tests/update_test.go 2015-09-10 15:55:23 +0000
130+++ _integration-tests/tests/update_test.go 2015-09-21 08:34:11 +0000
131@@ -24,6 +24,7 @@
132 "path"
133
134 . "launchpad.net/snappy/_integration-tests/testutils/common"
135+ "launchpad.net/snappy/_integration-tests/testutils/config"
136 "launchpad.net/snappy/_integration-tests/testutils/partition"
137
138 "gopkg.in/check.v1"
139@@ -68,7 +69,11 @@
140 ".*" +
141 "^Reboot to use .*ubuntu-core.\n"
142 c.Assert(updateOutput, check.Matches, expected)
143- s.assertBootDirContents(c)
144+ cfg, err := config.ReadConfig("_integration-tests/data/output/testconfig.json")
145+ c.Assert(err, check.IsNil)
146+ if cfg.Release != "15.04" {
147+ s.assertBootDirContents(c)
148+ }
149 Reboot(c)
150 } else if AfterReboot(c) {
151 RemoveRebootMark(c)
152
153=== modified file '_integration-tests/testutils/common/common.go'
154--- _integration-tests/testutils/common/common.go 2015-09-03 10:46:21 +0000
155+++ _integration-tests/testutils/common/common.go 2015-09-21 08:34:11 +0000
156@@ -56,11 +56,12 @@
157 func (s *SnappySuite) SetUpSuite(c *check.C) {
158 ExecCommand(c, "sudo", "systemctl", "stop", "snappy-autopilot.timer")
159 ExecCommand(c, "sudo", "systemctl", "disable", "snappy-autopilot.timer")
160+ var err error
161+ Cfg, err = config.ReadConfig(
162+ "_integration-tests/data/output/testconfig.json")
163+ c.Assert(err, check.IsNil, check.Commentf("Error reading config: %v", err))
164+
165 if !isInRebootProcess() {
166- var err error
167- Cfg, err = config.ReadConfig(
168- "_integration-tests/data/output/testconfig.json")
169- c.Assert(err, check.IsNil, check.Commentf("Error reading config: %v", err))
170 if Cfg.Update || Cfg.Rollback {
171 switchSystemImageConf(c, Cfg.TargetRelease, Cfg.TargetChannel, "0")
172 // Always use the installed snappy because we are updating from an old
173@@ -72,12 +73,16 @@
174 }
175 } else if CheckRebootMark("setupsuite-update") {
176 RemoveRebootMark(c)
177+ Cfg.Update = false
178+ Cfg.Write()
179 if Cfg.Rollback {
180 ExecCommand(c, "sudo", "snappy", "rollback", "ubuntu-core")
181 RebootWithMark(c, "setupsuite-rollback")
182 }
183 } else if CheckRebootMark("setupsuite-rollback") {
184 RemoveRebootMark(c)
185+ Cfg.Rollback = false
186+ Cfg.Write()
187 }
188 }
189
190@@ -230,7 +235,10 @@
191 func CallFakeUpdate(c *check.C) string {
192 c.Log("Preparing fake and calling update.")
193 fakeAvailableUpdate(c)
194- return ExecCommand(c, "sudo", "snappy", "update")
195+ // Discarding the error until https://bugs.launchpad.net/snappy/+bug/1477657
196+ // is fixed (fgimenez 20150916)
197+ out, _ := exec.Command("sudo", "snappy", "update").Output()
198+ return string(out)
199 }
200
201 func fakeAvailableUpdate(c *check.C) {

Subscribers

People subscribed via source and target branches