1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

o Test program for the config unit. Just reads a config and then writes it

out again.
This commit is contained in:
Joe Thornber 2002-08-01 08:18:54 +00:00
parent 7a0ed4a40c
commit ffb070297a
4 changed files with 213 additions and 0 deletions

View File

@ -0,0 +1,5 @@
config_t: config_t.c
gcc -g -I../../include config_t.c -L../../lib -llvm -o config_t
clean:
rm config_t

View File

@ -0,0 +1,38 @@
/*
* Test program that reads, then writes a config file.
*/
#include <stdio.h>
#include "dbg_malloc.h"
#include "config.h"
int main(int argc, char **argv)
{
struct config_file *cf;
if (argc != 2) {
fprintf(stderr, "Usage: %s <config_file>\n", argv[0]);
exit(1);
}
cf = create_config_file();
if (cf == NULL) {
fprintf(stderr, "Couldn't create config_file object.\n");
exit(1);
}
if (!read_config(cf, argv[1])) {
fprintf(stderr, "Couldn't read config file '%s'\n", argv[0]);
exit(1);
}
if (!write_config(cf, "out")) {
fprintf(stderr, "Couldn't write config file 'out'\n");
exit(1);
}
destroy_config_file(cf);
dump_memory();
return 0;
}

View File

@ -0,0 +1 @@
foo = []

169
old-tests/config/vg0 Normal file
View File

@ -0,0 +1,169 @@
# This file was originally generated by the LVM2 library
# Generated: Wed Jul 17 22:41:37 2002
description = "Created *after* executing 'lvcreate --quiet -s -n snap -c 512k -L200M vg0/origin /dev/hda8'"
creation_time = 1026942097
vg0 {
id = "Qmd96y-771S-Esbb-Zp6u-8xo9-Cfmt-YvndHY"
seqno = 2
status = ["RESIZEABLE", "READ", "WRITE"]
system_id = "reti1014805292"
extent_size = 8192 # 4 Megabytes
max_lv = 255
max_pv = 255
physical_volumes {
pv0 {
id = "8nRQub-EquY-VR1C-Ipdv-6hEO-FuFT-wnlN5R"
device = "/dev/discs/disc0/part8" # Hint only
status = ["ALLOCATABLE"]
pe_start = 256
pe_count = 501 # 1.95703 Gigabytes
}
pv1 {
id = "mRU6Mf-z1Sv-Kuqw-Ct1v-eC42-mnqs-YD1RrL"
device = "/dev/discs/disc1/part2" # Hint only
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 7269 # 28.3945 Gigabytes
}
}
logical_volumes {
music {
id = "000000-0000-0000-0000-0000-0000-000000"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 2
segment1 {
start_extent = 0
extent_count = 1024 # 4 Gigabytes
stripes = 1
areas = [
"pv1", 0
]
}
segment2 {
start_extent = 1024
extent_count = 2560 # 10 Gigabytes
stripes = 1
areas = [
"pv1", 3584
]
}
}
photos {
id = "000000-0000-0000-0000-0000-0000-000002"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 1
segment1 {
start_extent = 0
extent_count = 1024 # 4 Gigabytes
stripes = 1
areas = [
"pv1", 2048
]
}
}
repositories {
id = "000000-0000-0000-0000-0000-0000-000003"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 1
segment1 {
start_extent = 0
extent_count = 512 # 2 Gigabytes
stripes = 1
areas = [
"pv1", 3072
]
}
}
origin {
id = "000000-0000-0000-0000-0000-0000-000004"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 1
segment1 {
start_extent = 0
extent_count = 50 # 200 Megabytes
stripes = 1
areas = [
"pv1", 6144
]
}
}
packages {
id = "000000-0000-0000-0000-0000-0000-000006"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 2
segment1 {
start_extent = 0
extent_count = 451 # 1.76172 Gigabytes
stripes = 1
areas = [
"pv0", 50
]
}
segment2 {
start_extent = 451
extent_count = 573 # 2.23828 Gigabytes
stripes = 1
areas = [
"pv1", 6194
]
}
}
snap {
id = "000000-0000-0000-0000-0000-0000-000001"
status = ["READ", "WRITE", "ALLOC_SIMPLE"]
read_ahead = 0
segment_count = 1
segment1 {
start_extent = 0
extent_count = 50 # 200 Megabytes
stripes = 1
areas = [
"pv0", 0
]
}
}
}
snapshots {
snapshot0 {
chunk_size = 1024
origin = "origin"
cow_store = "snap"
}
}
}