Skip to content

Commit

Permalink
Test case for sjbronner's striped LV parsing work
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmer committed Feb 24, 2015
1 parent 349e806 commit 0e2d218
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
84 changes: 84 additions & 0 deletions spec/fixtures/striped
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
contents = "Text Format Volume Group"
version = 1

description = "vgcfgbackup -f /tmp/faffen2"

striped {
id = "zAPMOi-5QlD-fp1M-FMgz-biha-TQIP-X9TfqX"
seqno = 436
format = "lvm2" # informational
status = ["RESIZEABLE", "READ", "WRITE"]
flags = []
extent_size = 8192 # 4 Megabytes
max_lv = 0
max_pv = 0
metadata_copies = 0

physical_volumes {

pv0 {
id = "j7ZiWs-1fHB-aAwq-yL29-pBOk-H4hR-AOIe0P"
device = "/dev/dm-0" # Hint only

status = ["ALLOCATABLE"]
flags = []
dev_size = 1952545832 # 931.046 Gigabytes
pe_start = 384
pe_count = 238347 # 931.043 Gigabytes
}

pv1 {
id = "afl7D7-Rpy1-Is3H-SFxo-d03x-s8dE-lEgZWU"
device = "/dev/dm-1" # Hint only

status = ["ALLOCATABLE"]
flags = []
dev_size = 1952545832 # 931.046 Gigabytes
pe_start = 384
pe_count = 238347 # 931.043 Gigabytes
}
}

logical_volumes {

swap {
id = "BOfqkb-V4jw-7cBX-UR3D-SN3f-wWvd-NwysSj"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
segment_count = 1

segment1 {
start_extent = 0
extent_count = 2048 # 8 Gigabytes

type = "striped"
stripe_count = 1 # linear

stripes = [
"pv0", 0
]
}
}

root {
id = "8sbW3s-qB1u-6IlS-ABSj-PAMU-UxRk-I18ECh"
status = ["READ", "WRITE", "VISIBLE"]
flags = []
segment_count = 1

segment1 {
start_extent = 0
extent_count = 3840 # 15 Gigabytes

type = "striped"
stripe_count = 2
stripe_size = 128 # 64 Kilobytes

stripes = [
"pv0", 21504,
"pv1", 21504
]
}
}
}
}
14 changes: 14 additions & 0 deletions spec/vg_cfg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,18 @@
end
end
end

context "striped config" do
let(:vg_name) { "striped" }

it "parses successfully" do
expect { vgcfg }.to_not raise_error
end

it "contains logical volumes" do
expect(vgcfg.logical_volumes).to be_a(Hash)

vgcfg.logical_volumes.values.each { |lv| expect(lv).to be_an(LVM::LVConfig) }
end
end
end

0 comments on commit 0e2d218

Please sign in to comment.