diff options
author | Daniel Veillard <veillard@redhat.com> | 2006-08-29 22:27:07 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2006-08-29 22:27:07 +0000 |
commit | 3bbac7cdb670fb7e8b8fad25cfe4b23a8bf4a056 (patch) | |
tree | 900d74e5d8418835cfcfa949222e2ad7819da351 /tests/conftest.c | |
parent | 55bf73848398c01e6b54bdd71cda824fb73eb1df (diff) | |
download | libvirt-3bbac7cdb670fb7e8b8fad25cfe4b23a8bf4a056.tar.gz |
* TODO libvirt.spec.in: update
* configure.in include/libvirt/virterror.h src/Makefile.am
src/conf.c src/conf.h src/virterror.c src/xen_internal.c:
adding a subset of Xen config file parser, and serializer
* tests/Makefile.am tests/conftest.c tests/test_conf.sh
tests/confdata/Makefile.am tests/confdata/fc4.conf
tests/confdata/fc4.out: adding test program for config in and out
Daniel
Diffstat (limited to 'tests/conftest.c')
-rw-r--r-- | tests/conftest.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/conftest.c b/tests/conftest.c new file mode 100644 index 0000000000..16346a49b2 --- /dev/null +++ b/tests/conftest.c @@ -0,0 +1,30 @@ +#include <unistd.h> +#include <stdlib.h> +#include <stdio.h> +#include "conf.h" + +int main(int argc, char **argv) { + int ret; + virConfPtr conf; + int len = 10000; + char buffer[10000]; + + if (argc != 2) { + fprintf(stderr, "Usage: %s conf_file\n", argv[0]); + exit(1); + } + + conf = virConfReadFile(argv[1]); + if (conf == NULL) { + fprintf(stderr, "Failed to process %s\n", argv[1]); + exit(2); + } + ret = virConfWriteMem(&buffer[0], &len, conf); + if (ret < 0) { + fprintf(stderr, "Failed to serialize %s back\n", argv[1]); + exit(3); + } + printf("%s", buffer); + virConfFree(conf); + exit(0); +} |