From: Alexander Mikhalitsyn Date: Tue, 2 Apr 2024 09:13:21 +0000 (+0200) Subject: tests/parse_config_file: add tests for lxc.time.offset.* X-Git-Tag: v6.0.0~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fea674291b985baac026dc60e2e10f219587d00;p=thirdparty%2Flxc.git tests/parse_config_file: add tests for lxc.time.offset.* Signed-off-by: Alexander Mikhalitsyn --- diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index d0a285c1d..efca0ae8d 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -940,6 +940,31 @@ int main(int argc, char *argv[]) goto non_test_error; } + if (set_get_compare_clear_save_load(c, "lxc.time.offset.boot", "-1234s", tmpf, true) < 0) { + lxc_error("%s\n", "lxc.time.offset.boot"); + goto non_test_error; + } + + if (!c->set_config_item(c, "lxc.time.offset.boot", "1000000000000000us")) { + lxc_error("%s\n", "Failed to set a valid value (1000000000000000us) to config item \"lxc.time.offset.boot\""); + goto non_test_error; + } + + if (!c->set_config_item(c, "lxc.time.offset.boot", "-1000000000000000us")) { + lxc_error("%s\n", "Failed to set a valid (-1000000000000000us) value to config item \"lxc.time.offset.boot\""); + goto non_test_error; + } + + if (c->set_config_item(c, "lxc.time.offset.boot", "10000000000000000us")) { + lxc_error("%s\n", "Managed to set overflowed value to config item \"lxc.time.offset.boot\""); + goto non_test_error; + } + + if (set_get_compare_clear_save_load(c, "lxc.time.offset.monotonic", "4321s", tmpf, true) < 0) { + lxc_error("%s\n", "lxc.time.offset.monotonic"); + goto non_test_error; + } + fret = EXIT_SUCCESS; non_test_error: