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
=== modified file '_integration-tests/tests/get_unpartitioned_space'
--- _integration-tests/tests/get_unpartitioned_space 2015-09-04 06:05:56 +0000
+++ _integration-tests/tests/get_unpartitioned_space 2015-09-08 18:45:32 +0000
@@ -5,4 +5,4 @@
5writable_part="$(findfs LABEL=writable)"5writable_part="$(findfs LABEL=writable)"
6syspath="$(dirname $(realpath /sys/class/block/$(basename $writable_part)))"6syspath="$(dirname $(realpath /sys/class/block/$(basename $writable_part)))"
7device="$(realpath /dev/block/$(cat $syspath/dev))"7device="$(realpath /dev/block/$(cat $syspath/dev))"
8sudo parted $device unit % print free | grep 'Free Space' | tail -n1 | awk '{print $3}'8sudo parted -s $device unit % print free | grep 'Free Space' | tail -n1 | awk '{print $3}'
99
=== modified file '_integration-tests/tests/initramfs_test.go'
--- _integration-tests/tests/initramfs_test.go 2015-09-04 13:48:32 +0000
+++ _integration-tests/tests/initramfs_test.go 2015-09-08 18:45:32 +0000
@@ -38,6 +38,7 @@
38func (s *initRAMFSSuite) TestFreeSpace(c *check.C) {38func (s *initRAMFSSuite) TestFreeSpace(c *check.C) {
39 cmd := exec.Command("sh", "_integration-tests/tests/get_unpartitioned_space")39 cmd := exec.Command("sh", "_integration-tests/tests/get_unpartitioned_space")
40 free, err := cmd.Output()40 free, err := cmd.Output()
41 c.Assert(err, check.IsNil, check.Commentf("Error running the script to get the free space: %s", err))
41 freePercent := strings.TrimRight(strings.TrimSpace(string(free)), "%")42 freePercent := strings.TrimRight(strings.TrimSpace(string(free)), "%")
42 freePercentFloat, err := strconv.ParseFloat(freePercent, 32)43 freePercentFloat, err := strconv.ParseFloat(freePercent, 32)
43 c.Assert(err, check.IsNil,44 c.Assert(err, check.IsNil,

Subscribers

People subscribed via source and target branches