summaryrefslogtreecommitdiffstats
path: root/old-tests
diff options
context:
space:
mode:
authorJoe Thornber <thornber@redhat.com>2002-08-01 08:18:54 +0000
committerJoe Thornber <thornber@redhat.com>2002-08-01 08:18:54 +0000
commitffb070297aad8385d5960cb1a7fa2af70d5f61b4 (patch)
tree9dde636ce0086c80cd1174aa326a151199b9059f /old-tests
parent7a0ed4a40c038cd031fadaf2fb93c7383679cf11 (diff)
downloadlvm2-ffb070297aad8385d5960cb1a7fa2af70d5f61b4.tar.gz
lvm2-ffb070297aad8385d5960cb1a7fa2af70d5f61b4.tar.xz
lvm2-ffb070297aad8385d5960cb1a7fa2af70d5f61b4.zip
o Test program for the config unit. Just reads a config and then writes it
out again.
Diffstat (limited to 'old-tests')
-rw-r--r--old-tests/config/Makefile5
-rw-r--r--old-tests/config/config_t.c38
-rw-r--r--old-tests/config/empty_array.conf1
-rw-r--r--old-tests/config/vg0169
4 files changed, 213 insertions, 0 deletions
diff --git a/old-tests/config/Makefile b/old-tests/config/Makefile
new file mode 100644
index 00000000..d753b646
--- /dev/null
+++ b/old-tests/config/Makefile
@@ -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 \ No newline at end of file
diff --git a/old-tests/config/config_t.c b/old-tests/config/config_t.c
new file mode 100644
index 00000000..f0d68196
--- /dev/null
+++ b/old-tests/config/config_t.c
@@ -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;
+}
diff --git a/old-tests/config/empty_array.conf b/old-tests/config/empty_array.conf
new file mode 100644
index 00000000..0cc2f283
--- /dev/null
+++ b/old-tests/config/empty_array.conf
@@ -0,0 +1 @@
+foo = [] \ No newline at end of file
diff --git a/old-tests/config/vg0 b/old-tests/config/vg0
new file mode 100644
index 00000000..bfa95678
--- /dev/null
+++ b/old-tests/config/vg0
@@ -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"
+ }
+ }
+}