diff options
author | Martin Willi <martin@revosec.ch> | 2010-12-20 15:49:00 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-01-05 16:46:04 +0100 |
commit | 98ef286580bbd27bfd62b857098ee8c5d8acb2dc (patch) | |
tree | b5fa552e70237c20029b6da4691ae9fdc1d143c7 /src | |
parent | de8521f6f2d046ecb8cc71d722836e0dc0e2e194 (diff) | |
download | strongswan-98ef286580bbd27bfd62b857098ee8c5d8acb2dc.tar.bz2 strongswan-98ef286580bbd27bfd62b857098ee8c5d8acb2dc.tar.xz |
Merge test config into suite config, instead of having two distinct configs
Diffstat (limited to 'src')
-rw-r--r-- | src/conftest/conftest.c | 18 | ||||
-rw-r--r-- | src/conftest/conftest.h | 12 |
2 files changed, 6 insertions, 24 deletions
diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c index f06ff152e..3ba2313e5 100644 --- a/src/conftest/conftest.c +++ b/src/conftest/conftest.c @@ -77,12 +77,9 @@ static bool load_configs(char *suite_file, char *test_file) test_file, strerror(errno)); return FALSE; } - conftest->suite = settings_create(suite_file); - conftest->test = settings_create(test_file); - suite_file = dirname(suite_file); - test_file = dirname(test_file); - conftest->suite_dir = strdup(suite_file); - conftest->test_dir = strdup(test_file); + conftest->test = settings_create(suite_file); + conftest->test->load_files(conftest->test, test_file); + conftest->suite_dir = strdup(dirname(suite_file)); return TRUE; } @@ -274,7 +271,6 @@ static void cleanup() { hook_t *hook; - DESTROY_IF(conftest->suite); DESTROY_IF(conftest->test); lib->credmgr->remove_set(lib->credmgr, &conftest->creds->set); conftest->creds->destroy(conftest->creds); @@ -296,7 +292,6 @@ static void cleanup() conftest->config->destroy(conftest->config); } free(conftest->suite_dir); - free(conftest->test_dir); free(conftest); libcharon_deinit(); libhydra_deinit(); @@ -393,13 +388,11 @@ int main(int argc, char *argv[]) { return 1; } - if (!load_certs(conftest->suite, conftest->suite_dir) || - !load_certs(conftest->test, conftest->test_dir)) + if (!load_certs(conftest->test, conftest->suite_dir)) { return 1; } - if (!load_keys(conftest->suite, conftest->suite_dir) || - !load_keys(conftest->test, conftest->test_dir)) + if (!load_keys(conftest->test, conftest->suite_dir)) { return 1; } @@ -409,7 +402,6 @@ int main(int argc, char *argv[]) } charon->backends->add_backend(charon->backends, &conftest->config->backend); conftest->config->load(conftest->config, conftest->test); - conftest->config->load(conftest->config, conftest->suite); conftest->actions = actions_create(); /* set up thread specific handlers */ diff --git a/src/conftest/conftest.h b/src/conftest/conftest.h index 2d32e6ce3..2caf9b3ce 100644 --- a/src/conftest/conftest.h +++ b/src/conftest/conftest.h @@ -36,12 +36,7 @@ typedef struct conftest_t conftest_t; struct conftest_t { /** - * Global testsuite configuration - */ - settings_t *suite; - - /** - * Test specific configuration + * Merged suite/test configuration */ settings_t *test; @@ -51,11 +46,6 @@ struct conftest_t { char *suite_dir; /** - * Directory containing test files - */ - char *test_dir; - - /** * Credentials loaded from configuration */ mem_cred_t *creds; |