From 45a091bf404b641b7d3570fd72dd1582689a1f7d Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 4 Jul 2013 15:27:01 +0800 Subject: [PATCH] test/parser: Add test_set_conf_source() For non-local parsers (ie, PXE), we need to have the conf_url set. This change adds a function to provide the originating URL. Signed-off-by: Jeremy Kerr --- test/parser/parser-test.h | 1 + test/parser/utils.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test/parser/parser-test.h b/test/parser/parser-test.h index ab37443..9d9ec7e 100644 --- a/test/parser/parser-test.h +++ b/test/parser/parser-test.h @@ -28,6 +28,7 @@ struct discover_device *test_create_device(struct discover_context *ctx, void __test_read_conf_data(struct parser_test *test, const char *buf, size_t len); void test_read_conf_file(struct parser_test *test, const char *filename); +void test_set_conf_source(struct parser_test *test, const char *url); int test_run_parser(struct parser_test *test, const char *parser_name); diff --git a/test/parser/utils.c b/test/parser/utils.c index 70a40bb..f1604e0 100644 --- a/test/parser/utils.c +++ b/test/parser/utils.c @@ -133,6 +133,12 @@ void test_read_conf_file(struct parser_test *test, const char *filename) talloc_free(path); } +void test_set_conf_source(struct parser_test *test, const char *url) +{ + test->ctx->conf_url = pb_url_parse(test, url); + assert(test->ctx->conf_url); +} + int test_run_parser(struct parser_test *test, const char *parser_name) { struct p_item* i; -- 2.39.2