From patchwork Wed Sep 13 14:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1833613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kD2IKDR1; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=11jtwDeo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rm3FZ25kkz1yhZ for ; Thu, 14 Sep 2023 00:47:14 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 0F7F23CE76F for ; Wed, 13 Sep 2023 16:47:12 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E8DE83CB2FB for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id C93B06017D9 for ; Wed, 13 Sep 2023 16:47:08 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 498D721862; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GTDeZ60tm4mF87LuSPeeK5DXDhWNxONYt19bDZMMIQg=; b=kD2IKDR15e29j/RjOpWd7xO4Gmbc5cyLiCu+60yxPr9/kodDQlAaHfseQ3ONgRoYF2a2iv oXvCIiPKh0RkB8XBakbkRDEbS78oJsLsyNr53brBEeG+XJhTOzxypuP+iBZPPC5M1x6IvJ H6lyjQbK6SIRMakPFgvEWO9T1xl5Ufs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GTDeZ60tm4mF87LuSPeeK5DXDhWNxONYt19bDZMMIQg=; b=11jtwDeoFFhYJ8oEoCLoExy3MSi1pUKD5BAka/b8NC+MyS0HwX0R89BZSMNGu1Rej7NEQj TyG++tUJfFJoGNBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 30E9013440; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ePK8CmzLAWWXbAAAMHmgww (envelope-from ); Wed, 13 Sep 2023 14:47:08 +0000 From: Andrea Cervesato To: ltp@lists.linux.it Date: Wed, 13 Sep 2023 16:47:03 +0200 Message-Id: <20230913144706.7126-2-andrea.cervesato@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230913144706.7126-1-andrea.cervesato@suse.de> References: <20230913144706.7126-1-andrea.cervesato@suse.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH v9 1/4] Refactor mqns_03 using new LTP API X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Signed-off-by: Andrea Cervesato --- Removed absolute path testcases/kernel/containers/mqns/mqns_03.c | 309 +++++++++------------ 1 file changed, 132 insertions(+), 177 deletions(-) diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c index a7452b970..469959ed8 100644 --- a/testcases/kernel/containers/mqns/mqns_03.c +++ b/testcases/kernel/containers/mqns/mqns_03.c @@ -1,207 +1,162 @@ +// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (c) International Business Machines Corp., 2009 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program 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 General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Author: Serge Hallyn -* -* Check ipcns+sb longevity -* -* Mount mqueue fs -* unshare -* In unshared process: -* Create "/mq1" with mq_open() -* Mount mqueuefs -* Check that /mq1 exists -* Create /dev/mqueue/mq2 through vfs (create(2)) -* Umount /dev/mqueue -* Remount /dev/mqueue -* Check that both /mq1 and /mq2 exist - -***************************************************************************/ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mqns.h" -#include "mqns_helper.h" - -char *TCID = "posixmq_namespace_03"; -int TST_TOTAL = 1; - -int p1[2]; -int p2[2]; - -#define FNAM1 DEV_MQUEUE2 SLASH_MQ1 -#define FNAM2 DEV_MQUEUE2 SLASH_MQ2 - -int check_mqueue(void *vtest) + * Copyright (c) International Business Machines Corp., 2009 + * Copyright (c) Serge Hallyn + * Copyright (C) 2023 SUSE LLC Andrea Cervesato + */ + +/*\ + * [Description] + * + * Test mqueuefs from an isolated/forked process namespace. + * + * [Algorithm] + * + * - create /MQ1 + * - mount mqueue inside the temporary folder + * - check for /MQ1 existance + * - create /MQ2 inside the temporary folder + * - umount + * - mount mqueue inside the temporary folder + * - check /MQ1 existance + * - check /MQ2 existance + * - umount + */ + +#include "tst_test.h" +#include "lapi/sched.h" +#include "tst_safe_posix_ipc.h" +#include "tst_safe_stdio.h" +#include "tst_safe_macros.h" + +#define CHECK_MQ_OPEN_RET(x) ((x) >= 0 || ((x) == -1 && errno != EMFILE)) + +#define DEVDIR "ltp_mqueue" +#define MQNAME1 "/MQ1" +#define MQNAME2 "/MQ2" + +static char *str_op; +static char *mqueue1; +static char *mqueue2; +static volatile int *mq_freed; + +static void check_mqueue(void) { - char buf[30]; - mqd_t mqd; int rc; + mqd_t mqd; struct stat statbuf; - (void) vtest; + tst_res(TINFO, "Creating %s mqueue from within child process", MQNAME1); - close(p1[1]); - close(p2[0]); + mqd = TST_RETRY_FUNC( + mq_open(MQNAME1, O_RDWR | O_CREAT | O_EXCL, 0777, NULL), + CHECK_MQ_OPEN_RET); + if (mqd == -1) + tst_brk(TBROK | TERRNO, "mq_open failed"); - if (read(p1[0], buf, 3) != 3) { /* go */ - perror("read failed"); - exit(1); - } + SAFE_MQ_CLOSE(mqd); + mq_freed[0] = 1; - mqd = tst_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, - 0755, NULL); - if (mqd == -1) { - write(p2[1], "mqfail", 7); - exit(1); - } + tst_res(TINFO, "Mount %s from within child process", DEVDIR); - mq_close(mqd); + SAFE_MOUNT("mqueue", DEVDIR, "mqueue", 0, NULL); - rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL); - if (rc == -1) { - write(p2[1], "mount1", 7); - exit(1); - } + SAFE_STAT(mqueue1, &statbuf); + tst_res(TPASS, "%s exists at first mount", mqueue1); - rc = stat(FNAM1, &statbuf); - if (rc == -1) { - write(p2[1], "stat1", 6); - exit(1); - } + tst_res(TINFO, "Creating %s from within child process", mqueue2); - rc = creat(FNAM2, 0755); - if (rc == -1) { - write(p2[1], "creat", 6); - exit(1); - } + rc = SAFE_CREAT(mqueue2, 0755); + SAFE_CLOSE(rc); + mq_freed[1] = 1; - close(rc); + tst_res(TINFO, "Mount %s from within child process a second time", DEVDIR); - rc = umount(DEV_MQUEUE2); - if (rc == -1) { - write(p2[1], "umount", 7); - exit(1); - } + SAFE_UMOUNT(DEVDIR); + SAFE_MOUNT("mqueue", DEVDIR, "mqueue", 0, NULL); - rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL); - if (rc == -1) { - write(p2[1], "mount2", 7); - exit(1); - } + SAFE_STAT(mqueue1, &statbuf); + tst_res(TPASS, "%s exists at second mount", mqueue1); - rc = stat(FNAM1, &statbuf); - if (rc == -1) { - write(p2[1], "stat2", 7); - exit(1); - } + SAFE_STAT(mqueue2, &statbuf); + tst_res(TPASS, "%s exists at second mount", mqueue2); - rc = stat(FNAM2, &statbuf); - if (rc == -1) { - write(p2[1], "stat3", 7); - exit(1); - } + SAFE_UMOUNT(DEVDIR); - write(p2[1], "done", 5); + SAFE_MQ_UNLINK(MQNAME1); + mq_freed[0] = 0; - exit(0); + SAFE_MQ_UNLINK(MQNAME2); + mq_freed[1] = 0; +} + +static void run(void) +{ + const struct tst_clone_args clone_args = { CLONE_NEWIPC, SIGCHLD }; + + if (str_op && !strcmp(str_op, "clone")) { + tst_res(TINFO, "Spawning isolated process"); + + if (!SAFE_CLONE(&clone_args)) { + check_mqueue(); + return; + } + } else if (str_op && !strcmp(str_op, "unshare")) { + tst_res(TINFO, "Spawning unshared process"); + + if (!SAFE_FORK()) { + SAFE_UNSHARE(CLONE_NEWIPC); + check_mqueue(); + return; + } + } } static void setup(void) { - tst_require_root(); - check_mqns(); + if (!str_op || (strcmp(str_op, "clone") && strcmp(str_op, "unshare"))) + tst_brk(TCONF, "Please specify clone|unshare child isolation"); + + SAFE_MKDIR(DEVDIR, 0755); + + SAFE_ASPRINTF(&mqueue1, "%s" MQNAME1, DEVDIR); + SAFE_ASPRINTF(&mqueue2, "%s" MQNAME2, DEVDIR); + + mq_freed = SAFE_MMAP(NULL, + 2 * sizeof(int), + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, + -1, 0); } -int main(int argc, char *argv[]) +static void cleanup(void) { - int r; - char buf[30]; - int use_clone = T_UNSHARE; - - setup(); - - if (argc == 2 && strcmp(argv[1], "-clone") == 0) { - tst_resm(TINFO, "Testing posix mq namespaces through clone(2)"); - use_clone = T_CLONE; - } else - tst_resm(TINFO, - "Testing posix mq namespaces through unshare(2)"); - - if (pipe(p1) == -1 || pipe(p2) == -1) - tst_brkm(TBROK | TERRNO, NULL, "pipe failed"); - - /* fire off the test */ - r = do_clone_unshare_test(use_clone, CLONE_NEWIPC, check_mqueue, NULL); - if (r < 0) { - tst_brkm(TBROK | TERRNO, NULL, "failed clone/unshare"); - } + if (!access(mqueue1, F_OK)) + SAFE_MQ_UNLINK(MQNAME1); - tst_resm(TINFO, "Checking correct umount+remount of mqueuefs"); - - mkdir(DEV_MQUEUE2, 0755); - - close(p1[0]); - close(p2[1]); - write(p1[1], "go", 3); - - read(p2[0], buf, 7); - r = TFAIL; - if (!strcmp(buf, "mqfail")) { - tst_resm(TFAIL, "child process could not create mqueue"); - goto fail; - } else if (!strcmp(buf, "mount1")) { - tst_resm(TFAIL, "child process could not mount mqueue"); - goto fail; - } else if (!strcmp(buf, "stat1x")) { - tst_resm(TFAIL, "mq created by child is not in mqueuefs"); - goto fail; - } else if (!strcmp(buf, "creat")) { - tst_resm(TFAIL, "child couldn't creat mq through mqueuefs"); - goto fail; - } else if (!strcmp(buf, "umount")) { - tst_resm(TFAIL, "child couldn't umount mqueuefs"); - goto fail; - } else if (!strcmp(buf, "mount2")) { - tst_resm(TFAIL, "child couldn't remount mqueuefs"); - goto fail; - } else if (!strcmp(buf, "stat2")) { - tst_resm(TFAIL, - "mq_open()d file gone after remount of mqueuefs"); - goto fail; - } else if (!strcmp(buf, "stat3")) { - tst_resm(TFAIL, - "creat(2)'d file gone after remount of mqueuefs"); - goto fail; - } + if (!access(mqueue2, F_OK)) + SAFE_MQ_UNLINK(MQNAME2); - tst_resm(TPASS, "umount+remount of mqueuefs remounted the right fs"); + if (tst_is_mounted(DEVDIR)) + SAFE_UMOUNT(DEVDIR); - r = 0; -fail: - umount(DEV_MQUEUE2); - rmdir(DEV_MQUEUE2); - tst_exit(); + if (*mq_freed) + SAFE_MUNMAP((void *)mq_freed, 2 * sizeof(int)); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_root = 1, + .forks_child = 1, + .needs_tmpdir = 1, + .options = (struct tst_option[]) { + { "m:", &str_op, "Child process isolation " }, + {}, + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + NULL + }, +}; From patchwork Wed Sep 13 14:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1833615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pN01+4H2; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=zdKnFTgt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rm3G32F1bz1yhZ for ; Thu, 14 Sep 2023 00:47:39 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 601253CE772 for ; Wed, 13 Sep 2023 16:47:37 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id AA3763CB2FB for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 0C6FF20014C for ; Wed, 13 Sep 2023 16:47:08 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8BCD4218E4; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pD9L/gY/bh17gMAx5ULwVGvKOmMBGLJ5ZPa5wm4CXGg=; b=pN01+4H2yPPi5Ked/SgqfD5d1PbbqO070dIX5j6d+PuRIteH9K9PGYXYzoE4bYLuxVuyv1 3jaMWg7A+dRD0OPMhsXFLPz5hy5edliJV6rA+XZRrTVqeeeU2oHTNKEh8C7wTOW5nUU84A NyxBtHYcn6BVQvkBokNPHAL3Ncki1kw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pD9L/gY/bh17gMAx5ULwVGvKOmMBGLJ5ZPa5wm4CXGg=; b=zdKnFTgt0qCoU1ylLrHJc39mW6CTkWDfDu6zDyBbx5LuGydiOaYZoXeJotcdt8NTW74LyR vYcjiv2a6ZUasxBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5593713440; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2PxeEmzLAWWXbAAAMHmgww (envelope-from ); Wed, 13 Sep 2023 14:47:08 +0000 From: Andrea Cervesato To: ltp@lists.linux.it Date: Wed, 13 Sep 2023 16:47:04 +0200 Message-Id: <20230913144706.7126-3-andrea.cervesato@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230913144706.7126-1-andrea.cervesato@suse.de> References: <20230913144706.7126-1-andrea.cervesato@suse.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH v9 2/4] Refactor mqns_04 using new LTP API X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Signed-off-by: Andrea Cervesato --- Removed absolute path testcases/kernel/containers/mqns/mqns_04.c | 280 ++++++++++----------- 1 file changed, 126 insertions(+), 154 deletions(-) diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c index d07a85c04..196e116f0 100644 --- a/testcases/kernel/containers/mqns/mqns_04.c +++ b/testcases/kernel/containers/mqns/mqns_04.c @@ -1,187 +1,159 @@ +// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (c) International Business Machines Corp., 2009 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program 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 General Public License for more details. -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Author: Serge Hallyn -* -* Check mqueuefs lifetime -* . parent creates /dev/mqueue2 -* . child mounts mqueue there -* . child does mq_open("/ab") -* . parent checks for /dev/mqueue2 -* . child exits -* . parent checks for /dev/mqueue2 -* . parent tries 'touch /dev/mqueue2/dd' -> should fail -* . parent umounts /dev/mqueue2 - -***************************************************************************/ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include -#include + * Copyright (c) International Business Machines Corp., 2009 + * Copyright (c) Serge Hallyn + * Copyright (C) 2023 SUSE LLC Andrea Cervesato + */ + +/*\ + * [Description] + * + * Test mqueuefs manipulation from child/parent namespaces. + * + * [Algorithm] + * + * - parent creates mqueue folder in + * - child mounts mqueue there + * - child creates /MQ1 mqueue + * - parent checks for /mqueue/MQ1 existence + * - child exits + * - parent checks for /mqueue/MQ1 existence + * - parent tries 'touch /mqueue/MQ2' -> should fail + * - parent umount mqueuefs + */ + #include -#include -#include -#include -#include -#include -#include -#include "mqns.h" -#include "mqns_helper.h" +#include "tst_test.h" +#include "lapi/sched.h" +#include "tst_safe_posix_ipc.h" +#include "tst_safe_stdio.h" +#include "tst_safe_macros.h" -char *TCID = "posixmq_namespace_04"; -int TST_TOTAL = 1; +#define CHECK_MQ_OPEN_RET(x) ((x) >= 0 || ((x) == -1 && errno != EMFILE)) -int p1[2]; -int p2[2]; +#define DEVDIR "ltp_mqueue" +#define MQNAME1 "/MQ1" +#define MQNAME2 "/MQ2" -#define FNAM1 DEV_MQUEUE2 SLASH_MQ1 -#define FNAM2 DEV_MQUEUE2 SLASH_MQ2 +static char *str_op; +static char *mqueue1; +static char *mqueue2; +static volatile int *mq_freed; -int check_mqueue(void *vtest) +static void check_mqueue(void) { - char buf[30]; mqd_t mqd; - int rc; - (void) vtest; + tst_res(TINFO, "Creating %s mqueue from within child process", MQNAME1); - close(p1[1]); - close(p2[0]); + mqd = TST_RETRY_FUNC( + mq_open(MQNAME1, O_RDWR | O_CREAT | O_EXCL, 0755, NULL), + CHECK_MQ_OPEN_RET); + if (mqd == -1) + tst_brk(TBROK | TERRNO, "mq_open failed"); - read(p1[0], buf, 3); /* go */ + SAFE_MQ_CLOSE(mqd); + mq_freed[0] = 1; - mqd = tst_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, - 0755, NULL); - if (mqd == -1) { - write(p2[1], "mqfail", 7); - tst_exit(); - } + tst_res(TINFO, "Mount %s from within child process", DEVDIR); - mq_close(mqd); + SAFE_MOUNT("mqueue", DEVDIR, "mqueue", 0, NULL); + + TST_CHECKPOINT_WAKE_AND_WAIT(0); +} + +static void run(void) +{ + const struct tst_clone_args clone_args = { CLONE_NEWIPC, SIGCHLD }; + struct stat statbuf; - rc = mount("mqueue", DEV_MQUEUE2, "mqueue", 0, NULL); - if (rc == -1) { - perror("mount"); - write(p2[1], "mount", 6); - tst_exit(); + if (str_op && !strcmp(str_op, "clone")) { + tst_res(TINFO, "Spawning isolated process"); + + if (!SAFE_CLONE(&clone_args)) { + check_mqueue(); + return; + } + } else if (str_op && !strcmp(str_op, "unshare")) { + tst_res(TINFO, "Spawning unshared process"); + + if (!SAFE_FORK()) { + SAFE_UNSHARE(CLONE_NEWIPC); + check_mqueue(); + return; + } } - write(p2[1], "go", 3); - read(p1[0], buf, 3); + TST_CHECKPOINT_WAIT(0); - tst_exit(); -} + SAFE_STAT(mqueue1, &statbuf); + tst_res(TPASS, "%s child's mqueue can be accessed from parent", mqueue1); -static void setup(void) -{ - tst_require_root(); - check_mqns(); -} + TST_CHECKPOINT_WAKE(0); -int main(int argc, char *argv[]) -{ - int rc; - int status; - char buf[30]; - struct stat statbuf; - int use_clone = T_UNSHARE; + tst_res(TINFO, "Waiting child to exit"); - setup(); + tst_reap_children(); + mq_freed[0] = 0; - if (argc == 2 && strcmp(argv[1], "-clone") == 0) { - tst_resm(TINFO, - "Testing posix mq namespaces through clone(2)."); - use_clone = T_CLONE; - } else - tst_resm(TINFO, - "Testing posix mq namespaces through unshare(2)."); + SAFE_STAT(mqueue1, &statbuf); + tst_res(TPASS, "%s child's mqueue can be accessed from parent after child's dead", mqueue1); - if (pipe(p1) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } - if (pipe(p2) == -1) { - perror("pipe"); - exit(EXIT_FAILURE); - } + tst_res(TINFO, "Try to create %s from parent", mqueue2); - mkdir(DEV_MQUEUE2, 0755); + TST_EXP_FAIL(creat(mqueue2, 0755), EACCES); + if (!TST_PASS) + mq_freed[1] = 1; - tst_resm(TINFO, "Checking mqueue filesystem lifetime"); + SAFE_UMOUNT(DEVDIR); +} - /* fire off the test */ - rc = do_clone_unshare_test(use_clone, CLONE_NEWIPC, check_mqueue, NULL); - if (rc < 0) { - tst_resm(TFAIL, "failed clone/unshare"); - goto fail; - } +static void setup(void) +{ + if (!str_op || (strcmp(str_op, "clone") && strcmp(str_op, "unshare"))) + tst_brk(TCONF, "Please specify clone|unshare child isolation"); - close(p1[0]); - close(p2[1]); - write(p1[1], "go", 3); - - read(p2[0], buf, 7); - if (!strcmp(buf, "mqfail")) { - tst_resm(TFAIL, "child process could not create mqueue"); - goto fail; - } else if (!strcmp(buf, "mount")) { - tst_resm(TFAIL, "child process could not mount mqueue"); - goto fail; - } + SAFE_MKDIR(DEVDIR, 0755); - rc = stat(FNAM1, &statbuf); - if (rc == -1) { - perror("stat"); - write(p1[1], "go", 3); - tst_resm(TFAIL, "parent could not see child's created mq"); - goto fail; - } - write(p1[1], "go", 3); + SAFE_ASPRINTF(&mqueue1, "%s" MQNAME1, DEVDIR); + SAFE_ASPRINTF(&mqueue2, "%s" MQNAME2, DEVDIR); - rc = wait(&status); - if (rc == -1) { - perror("wait"); - tst_resm(TFAIL, "error while parent waited on child to exit"); - goto fail; - } - if (!WIFEXITED(status)) { - tst_resm(TFAIL, "Child did not exit normally (status %d)", - status); - goto fail; - } - rc = stat(FNAM1, &statbuf); - if (rc == -1) { - tst_resm(TFAIL, - "parent's view of child's mq died with child"); - goto fail; - } + mq_freed = SAFE_MMAP(NULL, + 2 * sizeof(int), + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, + -1, 0); +} - rc = creat(FNAM2, 0755); - if (rc != -1) { - tst_resm(TFAIL, - "parent was able to create a file in dead child's mqfs"); - goto fail; - } +static void cleanup(void) +{ + if (!access(mqueue1, F_OK)) + SAFE_MQ_UNLINK(MQNAME1); - tst_resm(TPASS, "Child mqueue fs still visible for parent"); + if (!access(mqueue2, F_OK)) + SAFE_MQ_UNLINK(MQNAME2); -fail: - umount(DEV_MQUEUE2); - rmdir(DEV_MQUEUE2); + if (tst_is_mounted(DEVDIR)) + SAFE_UMOUNT(DEVDIR); - tst_exit(); + if (*mq_freed) + SAFE_MUNMAP((void *)mq_freed, 2 * sizeof(int)); } + +static struct tst_test test = { + .test_all = run, + .setup = setup, + .cleanup = cleanup, + .needs_root = 1, + .forks_child = 1, + .needs_tmpdir = 1, + .needs_checkpoints = 1, + .options = (struct tst_option[]) { + { "m:", &str_op, "Child process isolation " }, + {}, + }, + .needs_kconfigs = (const char *[]) { + "CONFIG_USER_NS", + NULL + }, +}; From patchwork Wed Sep 13 14:47:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1833614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bL9LUxGW; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=L25/dBqm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rm3Fn0sKGz1yhZ for ; Thu, 14 Sep 2023 00:47:25 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2C8333CE773 for ; Wed, 13 Sep 2023 16:47:23 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 153083CE75E for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 6DBAF1001173 for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B46651F45E; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4UqNzOAar56wS6eBeDG1FqLjlIMzfY9Do0lazBGFV0=; b=bL9LUxGWwkIZbO+C9l2QeHwR8cBZWomkBtDy2Y04PioD2PHgpP3yVzzlQCKJqrbi3gXgkO 0YHLTIOJaZqaw1HREGs2vaZma0aljYl/92yrgLmArOIn0zIpyhV59L9kGLYrrHidDx/GNe fe9DtlJp1Lk/uJi9tL3Z6Flh7lp0d/k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694616428; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V4UqNzOAar56wS6eBeDG1FqLjlIMzfY9Do0lazBGFV0=; b=L25/dBqmCZlRm313TUyeunGry3uirBtEctcOxbSezWHfXG9UUJydaj+enFN4c7xaImZy69 17w+ehj/SiKQvdDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 91C9C13440; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4MBpImzLAWWXbAAAMHmgww (envelope-from ); Wed, 13 Sep 2023 14:47:08 +0000 From: Andrea Cervesato To: ltp@lists.linux.it Date: Wed, 13 Sep 2023 16:47:05 +0200 Message-Id: <20230913144706.7126-4-andrea.cervesato@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230913144706.7126-1-andrea.cervesato@suse.de> References: <20230913144706.7126-1-andrea.cervesato@suse.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v9 3/4] Remove deprecated header files from mqns suite X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Signed-off-by: Andrea Cervesato --- testcases/kernel/containers/mqns/mqns.h | 11 ---- .../kernel/containers/mqns/mqns_helper.h | 53 ------------------- 2 files changed, 64 deletions(-) delete mode 100644 testcases/kernel/containers/mqns/mqns.h delete mode 100644 testcases/kernel/containers/mqns/mqns_helper.h diff --git a/testcases/kernel/containers/mqns/mqns.h b/testcases/kernel/containers/mqns/mqns.h deleted file mode 100644 index 5a9056838..000000000 --- a/testcases/kernel/containers/mqns/mqns.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __MQNS_H -#define __MQNS_H - -#define DEV_MQUEUE "/dev/mqueue" -#define DEV_MQUEUE2 "/dev/mqueue2" -#define SLASH_MQ1 "/MQ1" -#define NOSLASH_MQ1 "MQ1" -#define SLASH_MQ2 "/MQ2" -#define NOSLASH_MQ2 "MQ2" - -#endif /* __MQNS_H */ diff --git a/testcases/kernel/containers/mqns/mqns_helper.h b/testcases/kernel/containers/mqns/mqns_helper.h deleted file mode 100644 index 03f50aa36..000000000 --- a/testcases/kernel/containers/mqns/mqns_helper.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) International Business Machines Corp., 2009 - * Copyright (c) Nadia Derbey, 2009 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: Serge Hallyn - ***************************************************************************/ -#include -#include -#include -#include -#include "../libclone/libclone.h" -#include "lapi/syscalls.h" -#include "safe_macros.h" -#include "test.h" - -static int dummy_child(void *v) -{ - (void) v; - return 0; -} - -static void check_mqns(void) -{ - int pid, status; - mqd_t mqd; - - mq_unlink("/checkmqnsenabled"); - mqd = - mq_open("/checkmqnsenabled", O_RDWR | O_CREAT | O_EXCL, 0777, NULL); - if (mqd == -1) - tst_brkm(TCONF, NULL, "mq_open check failed"); - - mq_close(mqd); - mq_unlink("/checkmqnsenabled"); - - pid = do_clone_unshare_test(T_CLONE, CLONE_NEWIPC, dummy_child, NULL); - if (pid == -1) - tst_brkm(TCONF | TERRNO, NULL, "CLONE_NEWIPC not supported"); - - SAFE_WAIT(NULL, &status); -} From patchwork Wed Sep 13 14:47:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1833617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=rpd0KT/8; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=gJ4+JhNk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rm3GT2rsCz1yhZ for ; Thu, 14 Sep 2023 00:48:01 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 3AD093CE769 for ; Wed, 13 Sep 2023 16:47:59 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 0466A3CB2FB for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 6B9001001167 for ; Wed, 13 Sep 2023 16:47:09 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 39137218E5; Wed, 13 Sep 2023 14:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694616429; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cpRaRaCa5USar1crot1rQ+Dou5i+DnNRNXVqA6vP4Cc=; b=rpd0KT/8Fzhjab60syFkY0Az9mcXdgsVt5Y+reF6PEUQBTZeN1NsoCbrcTyj9PEMs2TdRB 8GKeriRkE18JUb9po1vghtyUhlAG621Ij5jgFgXGXjLY/3PX7ghLi6Wpit4E/Qor3ydSRl iYkVmdcfLy8HgKbac9Ve9EuN2WEFJUc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694616429; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cpRaRaCa5USar1crot1rQ+Dou5i+DnNRNXVqA6vP4Cc=; b=gJ4+JhNkROig+7NC55qd0tTStgihKx6U7i2qhIz5vsihjZr3yEGrPkXBigtrQIilo5hf5h uafVwM2bmjM3RdBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EBD9E13440; Wed, 13 Sep 2023 14:47:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KHuKLGzLAWWXbAAAMHmgww (envelope-from ); Wed, 13 Sep 2023 14:47:08 +0000 From: Andrea Cervesato To: ltp@lists.linux.it Date: Wed, 13 Sep 2023 16:47:06 +0200 Message-Id: <20230913144706.7126-5-andrea.cervesato@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230913144706.7126-1-andrea.cervesato@suse.de> References: <20230913144706.7126-1-andrea.cervesato@suse.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v9 4/4] Remove libclone dependency from mqns suite X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato Signed-off-by: Andrea Cervesato --- testcases/kernel/containers/mqns/Makefile | 27 +++++------------------ 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/testcases/kernel/containers/mqns/Makefile b/testcases/kernel/containers/mqns/Makefile index 64c3763ee..eb0f97c2b 100644 --- a/testcases/kernel/containers/mqns/Makefile +++ b/testcases/kernel/containers/mqns/Makefile @@ -1,29 +1,12 @@ -################################################################################ -## ## -## Copyright (c) International Business Machines Corp., 2009 ## -## Copyright (c) Nadia Derbey, 2009 ## -## ## -## This program is free software; you can redistribute it and#or modify ## -## it under the terms of the GNU General Public License as published by ## -## the Free Software Foundation; either version 2 of the License, or ## -## (at your option) any later version. ## -## ## -## This program 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 General Public License ## -## for more details. ## -## ## -## You should have received a copy of the GNU General Public License ## -## along with this program; if not, write to the Free Software ## -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## ## -################################################################################ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) International Business Machines Corp., 2009 +# Copyright (c) Nadia Derbey, 2009 +# Copyright (C) 2021 SUSE LLC Andrea Cervesato top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -include $(abs_srcdir)/../Makefile.inc -LDLIBS := -lpthread -lrt -lclone $(LDLIBS) +LDLIBS := -lpthread -lrt $(LDLIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk