X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Ftest%2Ftest-ns.c;h=cbc41b7a385ef57a115f46207effc0dbb17d60f7;hb=d4d55b0d13e9326fccd566789cadf41308c5ddb8;hp=3ab3c1ab95be71a6e7f069f2277af1b20fbb48eb;hpb=2abd4e388a73bfca28eb7d0b63d2aa4f981d9ee2;p=thirdparty%2Fsystemd.git diff --git a/src/test/test-ns.c b/src/test/test-ns.c index 3ab3c1ab95b..cbc41b7a385 100644 --- a/src/test/test-ns.c +++ b/src/test/test-ns.c @@ -1,22 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -/*** - This file is part of systemd. - - Copyright 2010 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ #include #include @@ -24,6 +6,7 @@ #include "log.h" #include "namespace.h" +#include "tests.h" int main(int argc, char *argv[]) { const char * const writable[] = { @@ -61,7 +44,7 @@ int main(int argc, char *argv[]) { char tmp_dir[] = "/tmp/systemd-private-XXXXXX", var_tmp_dir[] = "/var/tmp/systemd-private-XXXXXX"; - log_set_max_level(LOG_DEBUG); + test_setup_logging(LOG_DEBUG); assert_se(mkdtemp(tmp_dir)); assert_se(mkdtemp(var_tmp_dir)); @@ -89,12 +72,21 @@ int main(int argc, char *argv[]) { &(TemporaryFileSystem) { .path = (char*) "/var", .options = (char*) "ro" }, 1, tmp_dir, var_tmp_dir, + NULL, PROTECT_HOME_NO, PROTECT_SYSTEM_NO, 0, - 0); + NULL, + 0, + NULL, + NULL, + 0, + NULL, + NULL, + 0, + NULL); if (r < 0) { - log_error_errno(r, "Failed to setup namespace: %m"); + log_error_errno(r, "Failed to set up namespace: %m"); log_info("Usage:\n" " sudo TEST_NS_PROJECTS=/home/lennart/projects ./test-ns\n"