From patchwork Tue Jan 29 17:36:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 157008 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4936224jaa; Tue, 29 Jan 2019 09:38:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN5xgZPMqDdNNMu9ZvBlPPRUWdsGcyDimAhJQU64I1eutk4/3AINnryFCp4XZbYIRbvADISg X-Received: by 2002:adf:8264:: with SMTP id 91mr25802383wrb.312.1548783496939; Tue, 29 Jan 2019 09:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548783496; cv=none; d=google.com; s=arc-20160816; b=AWhawX3guBQtf0AdK4jrVaq2rwElU1XPvDYZk9/QID5xpqmDhAbq6aGsY/HBQ6y/BY JwGBCVcYoh+IVMJmMq3jNJ5o7TVptQFdzYjz55W2BzvYiHJuXx4zVxlvki7weOUu+YMb LAi5CAUdQSr4XdDzFya3qjBhWjUZmWIPC7BfuaWTJwERnriWzaPJy8A49Bb8x4oawuOk ueievDIP7YdtFLR+Vh9Ld+zTQEqHiSsSvW2pG5QSLrbx0V/0IIdL/vUoP/1J0tEQFd1p 0Zj0P/5chDIayab+ggVmo1FwrHEstY24DMctFfF9q44Gub/7TbP2CekwjPwn8MnGhY4C KdyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=eeyVdp/LdP4qwznjZYgo9QRT1x0yh0LfoKkcQqXXUwE=; b=KxobeDYjM7uR7k/wUE5ljFBZ52WUoRHnrTpFP+oJ2ZZF62QuFyb3XxoHCiU9gNs4M5 xR+YsBm57juY6MmRcUHILiF40hL/v3/suJauLYktyGa9abaNocvPgf1srHKdkTKiGRWo pmWil9T9n7li/FkUVT3kqJM30qjkPeNsOWoxnDKEqGRmyg9WU94PISm92g1dDo9ApAjP inPZZRjJwPwC2eZxmXWSPus1nKPCNaTlKjbucNjjuSnh6ROpmCI0udjY+OJlaQQVTgXd GaIfDtAJV6yEXS5Yu4Lq4c8e9Y15Z8qWFq2DzleQI68VyiQOcJZf0tFk6CzZ2hdrqEFd Pl6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cbD2KDZV; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from picard.linux.it (picard.linux.it. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id n25si89186579wra.167.2019.01.29.09.38.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 09:38:16 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cbD2KDZV; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6808C3EAD16 for ; Tue, 29 Jan 2019 18:38:16 +0100 (CET) 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]) by picard.linux.it (Postfix) with ESMTP id 65D1B3EAD67 for ; Tue, 29 Jan 2019 18:37:19 +0100 (CET) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 942011000373 for ; Tue, 29 Jan 2019 18:37:17 +0100 (CET) Received: by mail-qt1-x844.google.com with SMTP id p17so23172567qtl.5 for ; Tue, 29 Jan 2019 09:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HF4PbO0abmXkMrlepd+9g54+SoBSirSFnGTjzyJ0BW8=; b=cbD2KDZVVOEJFEVH+QfGLSsW+eKJCnDsLlBgXXImUFTECjDVCGQJ5jTUsmQRFt/ilD QSh4ZJkDH/R6bf3o9I0CojW1YuqaR20963PsL/BceMTDRJyLf5jy+imD4VoeGyM76c5n 5riSVmKgKgleEfEGGMsR6OuKGUofSjYJp/Bes= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HF4PbO0abmXkMrlepd+9g54+SoBSirSFnGTjzyJ0BW8=; b=CHcjGy6Ut0YCTSdj+Zao5QMgdIZltR+2esVC27ld5hpvAFz7Gulq3sF3ncRq/VDWwz ugXlE8Jgl41t2dja+cND9HP6p2L5h6habbrXINb6Y5I7YFcM7RGg8D2xyaZOw8dA2+WE ccWwdJ/iriTE8qfbBjT7lWEI5tbKfY4rTgN/2UlEdeOTmqK+z9TMuj9rJjLXqOC423qa gY1o5PiQ0UBEPLSNZDYfziJZLP3Sqbji+YrCyOmJIAnIMcFc25WfuaGDaTeDw229EODx BsOVXPaWigIEw70x9+cNfN3/n9NGAabrcmfTzWrvGnhqhs5rxmji8cQfceIoWVRgaqUC kZzw== X-Gm-Message-State: AJcUuke++IGDDOIiMumzT1FYJ3TA1WZYxjy5PtHiHtd7WZGmPoVSz5i+ gnG4YfXgfEEWt81P0vqY1eLGe1vxjmo= X-Received: by 2002:ac8:6949:: with SMTP id n9mr26754995qtr.308.1548783436753; Tue, 29 Jan 2019 09:37:16 -0800 (PST) Received: from workstation.celeiro.br. ([168.194.163.64]) by smtp.gmail.com with ESMTPSA id a20sm56890855qkj.28.2019.01.29.09.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 09:37:16 -0800 (PST) From: Rafael David Tinoco To: ltp@lists.linux.it Date: Tue, 29 Jan 2019 15:36:59 -0200 Message-Id: <20190129173659.27901-8-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129173659.27901-1-rafael.tinoco@linaro.org> References: <20190124161159.GC16804@rei.lan> <20190129173659.27901-1-rafael.tinoco@linaro.org> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 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,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v4 8/8] timers/clock_settime: remove clock_settime tests X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" clock_settime{01,02} syscall tests were created, using the new API, based on existing and older kernel/timers/clock_settime{02,03} tests. This commit deletes older timers/clock_settime/* tests. Signed-off-by: Rafael David Tinoco --- runtest/timers | 2 - .../kernel/timers/clock_settime/.gitignore | 2 - .../kernel/timers/clock_settime/Makefile | 27 --- .../timers/clock_settime/clock_settime02.c | 128 ------------- .../timers/clock_settime/clock_settime03.c | 173 ------------------ 5 files changed, 332 deletions(-) delete mode 100644 testcases/kernel/timers/clock_settime/.gitignore delete mode 100644 testcases/kernel/timers/clock_settime/Makefile delete mode 100644 testcases/kernel/timers/clock_settime/clock_settime02.c delete mode 100644 testcases/kernel/timers/clock_settime/clock_settime03.c diff --git a/runtest/timers b/runtest/timers index a58ac57fc..618d2cb0c 100644 --- a/runtest/timers +++ b/runtest/timers @@ -1,8 +1,6 @@ #DESCRIPTION:Posix Timer Tests clock_gettime02 clock_gettime02 clock_gettime03 clock_gettime03 -clock_settime02 clock_settime02 -clock_settime03 clock_settime03 timer_create02 timer_create02 timer_create03 timer_create03 timer_create04 timer_create04 diff --git a/testcases/kernel/timers/clock_settime/.gitignore b/testcases/kernel/timers/clock_settime/.gitignore deleted file mode 100644 index 957c5ac26..000000000 --- a/testcases/kernel/timers/clock_settime/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/clock_settime02 -/clock_settime03 diff --git a/testcases/kernel/timers/clock_settime/Makefile b/testcases/kernel/timers/clock_settime/Makefile deleted file mode 100644 index 8de247075..000000000 --- a/testcases/kernel/timers/clock_settime/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright (c) International Business Machines Corp., 2001 -# -# 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 St, Fifth Floor, Boston, MA 02110-1301 USA -# - -top_srcdir ?= ../../../.. - -include $(top_srcdir)/include/mk/testcases.mk - -CPPFLAGS += -D_GNU_SOURCE -I$(abs_srcdir)/../include - -LDLIBS += -lpthread -lrt - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/timers/clock_settime/clock_settime02.c b/testcases/kernel/timers/clock_settime/clock_settime02.c deleted file mode 100644 index 65721c1ae..000000000 --- a/testcases/kernel/timers/clock_settime/clock_settime02.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) Wipro Technologies Ltd, 2003. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/************************************************************************** - * - * TEST IDENTIFIER : clock_settime02 - * - * EXECUTED BY : root / superuser - * - * TEST TITLE : Basic test for clock_settime(2) - * - * TEST CASE TOTAL : 1 - * - * AUTHOR : Aniruddha Marathe - * - * SIGNALS - * Uses SIGUSR1 to pause before test if option set. - * (See the parse_opts(3) man page). - * - * DESCRIPTION - * This is a Phase I test for the clock_settime(2) system call. - * It is intended to provide a limited exposure of the system call. - * - * Setup: - * Setup signal handling. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Set the parameters of timespec struct - * Execute system call - * Check return code, if system call failed (return=-1) - * Log the errno and Issue a FAIL message. - * Otherwise, Issue a PASS message. - * - * Cleanup: - * Print errno log and/or timing stats if options given - * - * USAGE: - * clock_settime02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-p] - * where: - * -c n : Run n copies simultaneously. - * -e : Turn on errno logging. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -p : Pause for SIGUSR1 before starting - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - *RESTRICTIONS: - * None - *****************************************************************************/ - -#include -#include -#include -#include - -#include "test.h" -#include "common_timers.h" - -static void setup(void); -static void cleanup(void); - -char *TCID = "clock_settime02"; -int TST_TOTAL = 1; -static struct timespec saved; - -int main(int ac, char **av) -{ - int lc; - struct timespec spec; - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - - tst_count = 0; - - spec.tv_sec = saved.tv_sec + 1; - spec.tv_nsec = 0; - - TEST(ltp_syscall(__NR_clock_settime, CLOCK_REALTIME, &spec)); - tst_resm((TEST_RETURN < 0 ? TFAIL | TTERRNO : TPASS), - "clock_settime %s", - (TEST_RETURN == 0 ? "passed" : "failed")); - } - - cleanup(); - tst_exit(); -} - -static void setup(void) -{ - tst_sig(NOFORK, DEF_HANDLER, cleanup); - - tst_require_root(); - - /* Save the current time specifications */ - if (ltp_syscall(__NR_clock_gettime, CLOCK_REALTIME, &saved) < 0) - tst_brkm(TBROK, NULL, "Could not save the current time"); - - TEST_PAUSE; -} - -static void cleanup(void) -{ - /* Set the saved time */ - if (clock_settime(CLOCK_REALTIME, &saved) < 0) { - tst_resm(TWARN, "FATAL COULD NOT RESET THE CLOCK"); - tst_resm(TFAIL, "Error Setting Time, errno=%d", errno); - } -} diff --git a/testcases/kernel/timers/clock_settime/clock_settime03.c b/testcases/kernel/timers/clock_settime/clock_settime03.c deleted file mode 100644 index 38b41d025..000000000 --- a/testcases/kernel/timers/clock_settime/clock_settime03.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) Wipro Technologies Ltd, 2003. All Rights Reserved. - * Copyright (c) 2011 Cyril Hrubis - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#include -#include -#include -#include - -#include "test.h" -#include "safe_macros.h" -#include "common_timers.h" - -static void setup(void); -static void cleanup(void); -static int setup_test(int option); - -clockid_t clocks[] = { - CLOCK_REALTIME, - CLOCK_MONOTONIC, - MAX_CLOCKS, - MAX_CLOCKS + 1, - CLOCK_REALTIME, - CLOCK_REALTIME, - CLOCK_REALTIME, - CLOCK_PROCESS_CPUTIME_ID, - CLOCK_THREAD_CPUTIME_ID -}; - -int testcases[] = { - EFAULT, /* tp bad */ - EINVAL, /* CLOCK_MONOTONIC */ - EINVAL, /* MAX_CLOCKS */ - EINVAL, /* MAX_CLOCKS + 1 */ - EINVAL, /* Invalid timespec */ - EINVAL, /* NSEC_PER_SEC + 1 */ - EPERM, /* non-root user */ - EINVAL, /* PROCESS_CPUTIME_ID */ - EINVAL, /* THREAD_CPUTIME_ID */ -}; - -char *TCID = "clock_settime03"; -int TST_TOTAL = ARRAY_SIZE(testcases); - -char nobody_uid[] = "nobody"; -struct passwd *ltpuser; -static struct timespec spec, *temp, saved; - -int main(int ac, char **av) -{ - int lc, i; - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - - tst_count = 0; - - for (i = 0; i < TST_TOTAL; i++) { - - if (setup_test(i) < 0) - continue; - - TEST(ltp_syscall(__NR_clock_settime, clocks[i], temp)); - - /* Change the UID back to root */ - if (i == TST_TOTAL - 1) { - SAFE_SETEUID(cleanup, 0); - } - - /* check return code */ - if (TEST_RETURN == -1 && TEST_ERRNO == testcases[i]) { - tst_resm(TPASS | TTERRNO, - "clock_settime(2) got expected " - "failure."); - } else { - tst_resm(TFAIL | TTERRNO, - "clock_settime(2) failed to produce " - "expected error (return code = %ld)", - TEST_RETURN); - /* Restore the clock to its previous state. */ - if (TEST_RETURN == 0) { - if (ltp_syscall(__NR_clock_settime, - CLOCK_REALTIME, - &saved) < 0) { - tst_resm(TWARN | TERRNO, - "FATAL: could not set " - "the clock!"); - } - } - } - - } - - } - - cleanup(); - tst_exit(); -} - -static int setup_test(int option) -{ - /* valid timespec */ - spec = saved; - temp = &spec; - - /* error sceanrios */ - switch (option) { - case 0: - /* Make tp argument bad pointer */ - temp = (struct timespec *)-1; - break; - case 4: - /* Make the parameter of timespec invalid */ - spec.tv_nsec = -1; - break; - case 5: - /* Make the parameter of timespec invalid */ - spec.tv_nsec = NSEC_PER_SEC + 1; - break; - case 6: - /* change the User to non-root */ - spec.tv_nsec = 0; - if ((ltpuser = getpwnam(nobody_uid)) == NULL) { - tst_resm(TWARN, "user \"nobody\" not present; " - "skipping test"); - return -1; - } - if (seteuid(ltpuser->pw_uid) == -1) { - tst_resm(TWARN | TERRNO, - "seteuid failed to set the effective " - "uid to %d (nobody)", ltpuser->pw_uid); - return -1; - } - break; - } - return 0; -} - -static void setup(void) -{ - tst_sig(NOFORK, DEF_HANDLER, cleanup); - - tst_require_root(); - - if (ltp_syscall(__NR_clock_gettime, CLOCK_REALTIME, &saved) < 0) - tst_brkm(TBROK, NULL, "Clock gettime failed"); - - spec.tv_sec = 1; - spec.tv_nsec = 0; - - TEST_PAUSE; -} - -static void cleanup(void) -{ -}