From: Christian Brauner Date: Mon, 8 Oct 2018 20:53:16 +0000 (+0200) Subject: test: test invalid config keys X-Git-Tag: lxc-3.1.0~56^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646e6c8b465fafde9447c87ca967da9e82f50f7b;p=thirdparty%2Flxc.git test: test invalid config keys Signed-off-by: Christian Brauner --- diff --git a/src/tests/get_item.c b/src/tests/get_item.c index f4c8d9228..f2757c29d 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -600,6 +600,12 @@ int main(int argc, char *argv[]) goto out; } + if (c->set_config_item(c, "lxc.notaconfigkey", "invalid")) { + fprintf(stderr, "%d: Managed to set \"lxc.notaconfigkey\"\n", __LINE__); + goto out; + } + + printf("All get_item tests passed\n"); fret = EXIT_SUCCESS; diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index b13982d30..b8b71c8e1 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -778,6 +778,11 @@ int main(int argc, char *argv[]) goto non_test_error; } + if (c->set_config_item(c, "lxc.notaconfigkey", "invalid")) { + lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.notaconfigkey\" to \"invalid\""); + return -1; + } + fret = EXIT_SUCCESS; non_test_error: