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

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 716
Merged at revision: 717
Proposed branch: lp:~elopio/snappy/new_kernel_file_name
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 85 lines (+20/-33)
1 file modified
_integration-tests/tests/failover_zero_size_file_test.go (+20/-33)
To merge this branch: bzr merge lp:~elopio/snappy/new_kernel_file_name
Reviewer Review Type Date Requested Status
Federico Gimenez (community) Approve
Review via email: mp+271901@code.launchpad.net

Commit message

On integration tests, fixed newKernelFilenamePattern.

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

Thanks for this, Leo, hopefully we'll get this make this work soon with the new kernel files layout.

I'm getting an error in an installApp test not related to these changes, probably we haven't merged the branch that fixes this yet, let me know if it's an issue for you too:

/home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/installApp_test.go:122:
    ...open /home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/installApp_test.go: no such file or directory
... obtained string = "" +
... "Installing unexisting.canonical\n" +
... "unexisting failed to install: snappy package not found\n"
... expected string = "" +
... "Installing unexisting.canonical\n" +
... "unexisting.canonical failed to install: snappy package not found\n"

After fixing it I get this one that may be actually related to the changes:

****** Resuming failoverSuite.TestZeroSizeInitrd after reboot
PASS: <autogenerated>:15: failoverSuite.SetUpTest 0.000s

snappy list
Name Date Version Developer
ubuntu-core 2015-09-22 180 ubuntu
generic-amd64 2015-09-22 1.4 canonical
/home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/failover_zero_size_file_test.go:197:
    ...open /home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/failover_zero_size_file_test.go: no such file or directory
/home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/failover_zero_size_file_test.go:142:
    ...open /home/fgimenez/workspace/snappy/new_kernel_file_name/_integration-tests/tests/failover_zero_size_file_test.go: no such file or directory
... obtained int = 0
... expected int = 1
... 0 files matching /boot/grub/a/snappy-selftest-initrd*, 1 expected

It seems that after the failover it boots correctly but when tries to revert the changes it tries to do find the modified files in the a partition. If things went good during the setup of the failure this should be the b partition, can you please confirm?

Revision history for this message
Federico Gimenez (fgimenez) :
review: Needs Information
Revision history for this message
Leo Arias (elopio) wrote :

I removed the classic kernel files stuff, and now it's passing in 15.04 and rolling. Please confirm.

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

Worked 5 times in a row, approving

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~elopio/snappy/new_kernel_file_name into lp:snappy failed. Below is the output from the failed tests.

Checking docs
Checking formatting
Formatting wrong in following files
_integration-tests/tests/failover_zero_size_file_test.go

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/snappy
cp -a . $GOPATH/src/launchpad.net/snappy/
cd $GOPATH/src/launchpad.net/snappy

sh -v ./run-checks
#!/bin/sh

set -eu

if which goctest >/dev/null; then
    goctest="goctest"
else
    goctest="go test"
fi

QUICK=""
if [ "${1:-}" = "--quick" ]; then
    QUICK=yes
fi

echo Checking docs
./mdlint.py docs/*.md

echo Checking formatting
fmt=$(gofmt -l .)

if [ -n "$fmt" ]; then
    echo "Formatting wrong in following files"
    echo "$fmt"
    exit 1
fi

716. By Leo Arias

Fixed fmt.

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-25 14:35:42 +0000
4@@ -53,29 +53,21 @@
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+ boot, err := partition.BootSystem()
15+ c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
16+ dir := partition.BootDir(boot)
17
18- bootFileNamePattern := newKernelFilenamePattern(c, boot, true)
19- commonSet(c, dir, bootFileNamePattern, initrdFilename)
20- }
21+ bootFileNamePattern := newKernelFilenamePattern(c, boot, true)
22+ commonSet(c, dir, bootFileNamePattern, initrdFilename)
23 }
24
25 func (zeroSizeInitrd) unset(c *check.C) {
26- if classicKernelFiles(c) {
27- commonUnset(c, BaseAltPartitionPath, origBootFilenamePattern, initrdFilename)
28- } else {
29- boot, err := partition.BootSystem()
30- c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
31- dir := partition.BootDir(boot)
32+ boot, err := partition.BootSystem()
33+ c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
34+ dir := partition.BootDir(boot)
35
36- bootFileNamePattern := newKernelFilenamePattern(c, boot, false)
37- commonUnset(c, dir, bootFileNamePattern, initrdFilename)
38- }
39+ bootFileNamePattern := newKernelFilenamePattern(c, boot, false)
40+ commonUnset(c, dir, bootFileNamePattern, initrdFilename)
41 }
42
43 func (zeroSizeSystemd) set(c *check.C) {
44@@ -144,15 +136,6 @@
45 return matches[0]
46 }
47
48-func classicKernelFiles(c *check.C) bool {
49- initrdClassicFilenamePattern := fmt.Sprintf("/boot/%s*-generic", initrdFilename)
50- matches, err := filepath.Glob(initrdClassicFilenamePattern)
51-
52- c.Assert(err, check.IsNil, check.Commentf("Error: %v", err))
53-
54- return len(matches) == 1
55-}
56-
57 // newKernelFilenamePattern returns the filename pattern to modify files
58 // in the partition declared in the boot config file.
59 //
60@@ -162,15 +145,19 @@
61 // If we are not in an update process (ie. we are unsetting the failover conditions)
62 // we want to change the files in the other partition
63 func newKernelFilenamePattern(c *check.C, bootSystem string, afterUpdate bool) string {
64- var actualPartition string
65- part, err := partition.NextBootPartition()
66- c.Assert(err, check.IsNil, check.Commentf("Error getting the current partition: %s", err))
67+ var part string
68+ var err error
69 if afterUpdate {
70- actualPartition = part
71+ part, err = partition.NextBootPartition()
72+ c.Assert(err, check.IsNil,
73+ check.Commentf("Error getting the next boot partition: %s", err))
74 } else {
75- actualPartition = partition.OtherPartition(part)
76+ part, err = partition.CurrentPartition()
77+ c.Assert(err, check.IsNil,
78+ check.Commentf("Error getting the current partition: %s", err))
79+ part = partition.OtherPartition(part)
80 }
81- return filepath.Join(actualPartition, "%s%s*")
82+ return filepath.Join(part, "%s%s*")
83 }
84
85 /*

Subscribers

People subscribed via source and target branches