From patchwork Mon Feb 25 12:32:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 159176 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1972345jad; Mon, 25 Feb 2019 04:33:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZhc3UO+9Bv1YP5B87pBx506gVBkEFyeMvjPA+jwMisG22Q3o8TKE4q8cfHU81f80rrSXJW X-Received: by 2002:a1c:c60b:: with SMTP id w11mr10394157wmf.39.1551098009728; Mon, 25 Feb 2019 04:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551098009; cv=none; d=google.com; s=arc-20160816; b=E/mW1OcqKVscbBRLbK+7pc5vITTMO0ZVqMg/7cuUht0iq8a0+u1I1slsBJUyq0V/aL 8148tkSXucNbT+SLBdme7OV2CoJKgiy7fF7/WXH5wIQf4YDqkvI8AV1FhtCBC57msN8R v+9klKgO9v7pBNyK/HdMhh7AfCFwMEwTyDFWZw4d+Z6Jo0pCyMAh59upsRPkXN15wsCi evePucCKgu7oyum4VX4ALIynSBAY56GFPxxxqML5YH3pTBKIQ3DuxBCyjN0E3Di07MB5 tFh34K87MaiiNQ1UPY+AsTRBOVfnCfKHLZ+yiQfs8OJQ/2j+4bOt9mE9KMYX1w3Y/Ll3 Yr5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to; bh=Cj+IVbhzgt7KseygSTfjIR6H1A2gt1ZphqfOHYMmQhY=; b=cMR2RwS/ZR5S4WLpdKc8c5ua2QXjEz8iUOI1xZOFkfftNd6vGXgx67vpajAdwA4+eP vNUahy1WC5ZYp//ckfXHijtMcHSvhygbymkejHGc6LP3xo7iQ8P+nhF98+CkbH+S2mxY IIms023LLjcZm87sUnXJQCMorHO/jZaxvEA2a6ZKG1+52421TWOr26oE65LY2BEqpNCc /OMcOkVrk9EHK9IQ+iSCyKTunNx2DBicN+3lMowsqlS0qR+hqkEUiU70N6tj9pAArafY rycGAByRvwXZOpiNGW5cbMfRnBPL7ST0Fh0ELXyFJVIO2olnMAJYgX5veyQEDIde+fg7 S1+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BdHXe9rN; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it" Return-Path: Received: from picard.linux.it (picard.linux.it. [213.254.12.146]) by mx.google.com with ESMTPS id l6si5151974wmc.190.2019.02.25.04.33.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 04:33:29 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) client-ip=213.254.12.146; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BdHXe9rN; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it" Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4885F3EA43B for ; Mon, 25 Feb 2019 13:33:29 +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 [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 0799E3EA2D4 for ; Mon, 25 Feb 2019 13:33:24 +0100 (CET) Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (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 C546E10011D0 for ; Mon, 25 Feb 2019 13:33:22 +0100 (CET) Received: by mail-pg1-x542.google.com with SMTP id u9so4436382pgo.7 for ; Mon, 25 Feb 2019 04:33:23 -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; bh=xSYB59h8Rl5n3Oq/re6ZC+skDNvQPU2zu9hoXmK6qgA=; b=BdHXe9rNeID+ZweJPXog3qHx7pknuUb+/cmRBL28A8PSaMsPmiFfU8rzjCxeY8wlCE 9yhxbX0eA+lVyfubRCBi340GD7cO+bSEsp6cz74JNw+NpW1T3WKnc3WepEBOF1Kdw2Qo BoIXZcMCMS6SYEfDm1uuSj9n/roZv85opD9nV97cibfpKdjc8q/xezLsijmTwsLc/L4W XbiljGSr9ICGe/cu9K8N7upubKcU7x165CIvRmKF1KfcHOyTiOYg6CQhpO6gly8EOatQ n37swma1R0CEm26heoWkpGXvPjgDC8jrPzEzr6K38pms3CDPLRLY8zaHfqf9Ahz0YPuq x0KQ== 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; bh=xSYB59h8Rl5n3Oq/re6ZC+skDNvQPU2zu9hoXmK6qgA=; b=Q5XRs1Z3vdFfqaJGg8Agrh8ZxixH1OY/bmEF8ZooPK+3mnXznjwnvwwKTwFeMC9A1J cbXgBnDeS4SpgLrXoAtfv4IVRwqitmFh0J54i87MT5Jbgv3ecnd7YM1FC/QlNDzWPu+j K8kgdKKt1aZyZIO2KgT/XdlUxj2JXsKyRdexkud2H9Yp0qFfXuusjIcw65SroWQ3H5N2 sY9GF9gHpRt1FjCWeK0rUncCa0ELmibF84/o92v8Tp6GvCK/n1HEDQKYNszs1ibWAoht csnOtx6oSKusBpOTNoUexvs4kAWVPFoDC0O31ESi+bvh+F/6olsftsIQltfmR/WU0j5F FWLg== X-Gm-Message-State: AHQUAubgMnbgWXXPO6j9TqAlXylqKARgOTyXY/6XkG8UfzvRg13yZKcz H545Y8E6/CRLqb60cd3J8/WIzW89ZQIvhQ== X-Received: by 2002:a63:6984:: with SMTP id e126mr19219977pgc.143.1551098002132; Mon, 25 Feb 2019 04:33:22 -0800 (PST) Received: from localhost.localdomain ([117.252.69.94]) by smtp.gmail.com with ESMTPSA id g69sm24390043pfd.168.2019.02.25.04.33.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 04:33:21 -0800 (PST) From: Sumit Garg To: ltp@lists.linux.it Date: Mon, 25 Feb 2019 18:02:11 +0530 Message-Id: <1551097931-18320-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 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 Cc: daniel.thompson@linaro.org Subject: [LTP] [PATCH] syscalls: add rt_tgsigqueueinfo() test-case 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: , MIME-Version: 1.0 Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" This tests the rt_tgsigqueueinfo() syscall used to queue a signal and data to the single thread specified by the combination of tgid, a thread group ID, and tid, a thread in that thread group. Signed-off-by: Sumit Garg --- runtest/syscalls | 1 + .../kernel/syscalls/rt_tgsigqueueinfo/.gitignore | 1 + .../kernel/syscalls/rt_tgsigqueueinfo/Makefile | 10 ++++ .../rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c | 53 ++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore create mode 100644 testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile create mode 100644 testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c diff --git a/runtest/syscalls b/runtest/syscalls index 70d3561..861c0a6 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -996,6 +996,7 @@ rt_sigprocmask01 rt_sigprocmask01 rt_sigprocmask02 rt_sigprocmask02 rt_sigqueueinfo01 rt_sigqueueinfo01 rt_sigsuspend01 rt_sigsuspend01 +rt_tgsigqueueinfo01 rt_tgsigqueueinfo01 sbrk01 sbrk01 sbrk02 sbrk02 diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore b/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore new file mode 100644 index 0000000..f9ffa58 --- /dev/null +++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore @@ -0,0 +1 @@ +rt_tgsigqueueinfo01 diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile b/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile new file mode 100644 index 0000000..035ca64 --- /dev/null +++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile @@ -0,0 +1,10 @@ +# Copyright (c) 2019 - Linaro Limited. All rights reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +top_srcdir ?= ../../../.. + +rt_tgsigqueueinfo01: CFLAGS+=-pthread + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c new file mode 100644 index 0000000..336b968 --- /dev/null +++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2019 Linaro Limited. All rights reserved. + * Author: Sumit Garg + */ + +/* + * Test rt_tgsigqueueinfo + * + * This tests the rt_tgsigqueueinfo() syscall. It sends the signal and data + * to the single thread specified by the combination of tgid, a thread group + * ID, and tid, a thread in that thread group. + */ + +#define _GNU_SOURCE +#include +#include +#include "tst_test.h" +#include "lapi/syscalls.h" + +void *tfunc(void *arg LTP_ATTRIBUTE_UNUSED) +{ + siginfo_t uinfo; + + uinfo.si_errno = 0; + uinfo.si_code = SI_QUEUE; + + TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(), + syscall(__NR_gettid), SIGCHLD, &uinfo)); + if (TST_RET) + tst_res(TFAIL, "Test Failed"); + else + tst_res(TPASS, "Test Succeeded"); + + return NULL; +} + +static void verify_rt_tgsigqueueinfo(void) +{ + pthread_t pt; + + TEST(pthread_create(&pt, NULL, tfunc, NULL)); + if (TST_RET) + tst_brk(TFAIL | TTERRNO, "pthread_create failed"); + + TEST(pthread_join(pt, NULL)); + if (TST_RET) + tst_brk(TFAIL | TTERRNO, "pthread_join failed"); +} + +static struct tst_test test = { + .test_all = verify_rt_tgsigqueueinfo, +};