3
Provides unit tests and examples for the <LVM> lens.
9
A full configuration file *)
10
let conf = "# Generated by LVM2: date
12
contents = \"Text Format Volume Group\"
15
description = \"Created *after* executing 'eek'\"
17
creation_host = \"eek\" # Linux eek
18
creation_time = 6666666666 # eeeek
21
id = \"uuid-uuid-uuid-uuid\"
23
status = [\"RESIZEABLE\", \"READ\", \"WRITE\"]
24
extent_size = 8192 # 4 Megabytes
27
process_priority = -18
31
id = \"uuid-uuid-uuid-uuid\"
32
device = \"/dev/sda6\" # Hint only
34
status = [\"ALLOCATABLE\"]
36
pe_count = 123456 # many Gigabytes
42
id = \"uuid-uuid-uuid-uuid\"
43
status = [\"READ\", \"WRITE\", \"VISIBLE\"]
48
extent_count = 123456 # beaucoup Gigabytes
51
stripe_count = 1 # linear
62
test LVM.int get "5" = { "int" = "5" }
63
test LVM.str get "\"abc\"" = { "str" = "abc"}
64
test LVM.lns get "\n" = {}
65
test LVM.lns get "#foo\n" = { "#comment" = "foo"}
67
test LVM.lns get "# Generated by LVM2: date
69
contents = \"Text Format Volume Group\"
72
description = \"Created *after* executing 'eek'\"
74
creation_host = \"eek\" # Linux eek
75
creation_time = 6666666666 # eeeek\n" =
76
{ "#comment" = "Generated by LVM2: date" }
79
{ "str" = "Text Format Volume Group" }
86
{ "str" = "Created *after* executing 'eek'" }
91
{ "#comment" = "Linux eek" }
94
{ "int" = "6666666666" }
95
{ "#comment" = "eeeek" }
99
Test the full <conf> *)
100
test LVM.lns get conf =
101
{ "#comment" = "Generated by LVM2: date" }
104
{ "str" = "Text Format Volume Group" }
111
{ "str" = "Created *after* executing 'eek'" }
116
{ "#comment" = "Linux eek" }
119
{ "int" = "6666666666" }
120
{ "#comment" = "eeeek" }
126
{ "str" = "uuid-uuid-uuid-uuid" }
134
{ "str" = "RESIZEABLE" }
146
{ "#comment" = "4 Megabytes" }
163
{ "str" = "uuid-uuid-uuid-uuid" }
166
{ "str" = "/dev/sda6" }
167
{ "#comment" = "Hint only" }
173
{ "str" = "ALLOCATABLE" }
182
{ "#comment" = "many Gigabytes" }
194
{ "str" = "uuid-uuid-uuid-uuid" }
205
{ "str" = "VISIBLE" }
220
{ "#comment" = "beaucoup Gigabytes" }
224
{ "str" = "striped" }
228
{ "#comment" = "linear" }
250
(* Parse description from RHEL 6 *)
251
let descr="\"Created *before* executing '/sbin/vgs --noheadings -o name --config 'log{command_names=0 prefix=\\\" \\\"}''\""
252
test LVM.str get descr =
253
{ "str" = "Created *before* executing '/sbin/vgs --noheadings -o name --config 'log{command_names=0 prefix=\\\" \\\"}''" }