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

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 656
Merged at revision: 668
Proposed branch: lp:~elopio/snappy/parted_script
Merge into: lp:~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 21 lines (+2/-1)
2 files modified
_integration-tests/tests/get_unpartitioned_space (+1/-1)
_integration-tests/tests/initramfs_test.go (+1/-0)
To merge this branch: bzr merge lp:~elopio/snappy/parted_script
Reviewer Review Type Date Requested Status
Oliver Grawert Approve
Review via email: mp+270421@code.launchpad.net

Commit message

On the free space integration test, pass the script flag to parted so it's not interactive.

To post a comment you must log in.
lp:~elopio/snappy/parted_script updated
656. By Leo Arias

Added a missing error check.

Revision history for this message
Oliver Grawert (ogra) wrote :

looks fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '_integration-tests/tests/get_unpartitioned_space'
2--- _integration-tests/tests/get_unpartitioned_space 2015-09-04 06:05:56 +0000
3+++ _integration-tests/tests/get_unpartitioned_space 2015-09-08 18:45:32 +0000
4@@ -5,4 +5,4 @@
5 writable_part="$(findfs LABEL=writable)"
6 syspath="$(dirname $(realpath /sys/class/block/$(basename $writable_part)))"
7 device="$(realpath /dev/block/$(cat $syspath/dev))"
8-sudo parted $device unit % print free | grep 'Free Space' | tail -n1 | awk '{print $3}'
9+sudo parted -s $device unit % print free | grep 'Free Space' | tail -n1 | awk '{print $3}'
10
11=== modified file '_integration-tests/tests/initramfs_test.go'
12--- _integration-tests/tests/initramfs_test.go 2015-09-04 13:48:32 +0000
13+++ _integration-tests/tests/initramfs_test.go 2015-09-08 18:45:32 +0000
14@@ -38,6 +38,7 @@
15 func (s *initRAMFSSuite) TestFreeSpace(c *check.C) {
16 cmd := exec.Command("sh", "_integration-tests/tests/get_unpartitioned_space")
17 free, err := cmd.Output()
18+ c.Assert(err, check.IsNil, check.Commentf("Error running the script to get the free space: %s", err))
19 freePercent := strings.TrimRight(strings.TrimSpace(string(free)), "%")
20 freePercentFloat, err := strconv.ParseFloat(freePercent, 32)
21 c.Assert(err, check.IsNil,

Subscribers

People subscribed via source and target branches