Skip to content
Permalink
Browse files

integration test: resize disk

  • Loading branch information...
bradfitz committed Aug 26, 2018
1 parent 07fe91d commit 9ecb8f7de45748723c4388ff9908b33babc91b2d
Showing with 13 additions and 1 deletion.
  1. +13 −1 integration_test.go
@@ -292,6 +292,14 @@ func (mc *monClient) addDisk(t *testing.T, diskBase string) {
}
}

func (mc *monClient) resizeDisk(t *testing.T, diskBase, newSize string) {
out, err := monc.run("block_resize " + diskBase + " " + newSize)
if err != nil {
t.Fatalf("block_resize %s %s: %v", diskBase, newSize, err)
}
t.Logf("output of block_resize: %q", out)
}

func (mc *monClient) removeDisk(t *testing.T, diskBase string) {
out, err := monc.run("device_del " + diskBase)
if err != nil {
@@ -345,7 +353,11 @@ func (QemuTest) Mke2fs(t *testing.T) {
t.Fatalf("mount: %v", err)
}

t.Logf("Final state: %s", lsblk(t))
t.Logf("post-mount state: %s", lsblk(t))

monc.resizeDisk(t, "foo", "200G")

t.Logf("post-resize state: %s", lsblk(t))

if err := unix.Unmount("/mnt/a/", 0); err != nil {
t.Fatalf("unmount: %v", err)

0 comments on commit 9ecb8f7

Please sign in to comment.
You can’t perform that action at this time.