summaryrefslogtreecommitdiff
path: root/old-tests
diff options
context:
space:
mode:
authorJoe Thornber <joe@fib011235813.fsnet.co.uk>2001-10-08 08:47:27 +0000
committerJoe Thornber <joe@fib011235813.fsnet.co.uk>2001-10-08 08:47:27 +0000
commit46fda6281c39756f3324d671b0666c640d2f880f (patch)
tree48ba44baf662422b72b94c98f3375a75aa76c53d /old-tests
parenta14dbe1ea672b1595d0ea77a2423f3d207751ecb (diff)
downloadlvm2-46fda6281c39756f3324d671b0666c640d2f880f.tar.gz
o test program for reading a vg
Diffstat (limited to 'old-tests')
-rw-r--r--old-tests/format1/read_vg_t.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/old-tests/format1/read_vg_t.c b/old-tests/format1/read_vg_t.c
new file mode 100644
index 000000000..cbe89c8af
--- /dev/null
+++ b/old-tests/format1/read_vg_t.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2001 Sistina Software (UK) Limited.
+ *
+ * This file is released under the GPL.
+ */
+
+#include "log.h"
+#include "format1.h"
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ struct io_space *ios;
+ struct volume_group *vg;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: read_vg_t <vg_name>\n");
+ exit(1);
+ }
+
+ init_log(stderr);
+ init_debug(_LOG_DEBUG);
+
+ if (!dev_cache_init()) {
+ fprintf(stderr, "init of dev-cache failed\n");
+ exit(1);
+ }
+
+ if (!dev_cache_add_dir("/dev")) {
+ fprintf(stderr, "couldn't add /dev to dir-cache\n");
+ exit(1);
+ }
+
+ ios = create_lvm_v1_format(NULL);
+ vg = ios->vg_read(ios, argv[1]);
+
+ if (!vg) {
+ fprintf(stderr, "couldn't read vg %s\n", argv[1]);
+ exit(1);
+ }
+
+ ios->destroy(ios);
+
+ dump_memory();
+ fin_log();
+ return 0;
+}