linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
To: Fenghua Yu <fenghua.yu@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Shuah Khan <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	tan.shaopeng@jp.fujitsu.com
Subject: [PATCH 1/3] selftests/resctrl: Make resctrl_tests run using kselftest framework
Date: Wed, 10 Nov 2021 18:33:13 +0900	[thread overview]
Message-ID: <20211110093315.3219191-2-tan.shaopeng@jp.fujitsu.com> (raw)
In-Reply-To: <20211110093315.3219191-1-tan.shaopeng@jp.fujitsu.com>

From: "Tan, Shaopeng" <tan.shaopeng@jp.fujitsu.com>

This commit enables kselftest to be built/run in resctrl framework.
Build/run resctrl_tests by build/run all tests of kselftest, or by using
the "TARGETS" variable on the make command line to specify resctrl_tests.
To make resctrl_tests run using kselftest framework, this commit modified
the Makefile of kernel kselftest set and the Makefile of resctrl_tests.
To ensure the resctrl_tests finish in limited time, this commit changed
the default limited time(45s) to 120 seconds for resctrl_tests by adding
"setting" file.

Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
---
 tools/testing/selftests/Makefile         |  1 +
 tools/testing/selftests/resctrl/Makefile | 21 +++++++++------------
 tools/testing/selftests/resctrl/settings |  1 +
 3 files changed, 11 insertions(+), 12 deletions(-)
 create mode 100644 tools/testing/selftests/resctrl/settings

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index c852eb4..7df397c 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -51,6 +51,7 @@ TARGETS += proc
 TARGETS += pstore
 TARGETS += ptrace
 TARGETS += openat2
+TARGETS += resctrl
 TARGETS += rlimits
 TARGETS += rseq
 TARGETS += rtc
diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile
index 6bcee2e..3786cbb 100644
--- a/tools/testing/selftests/resctrl/Makefile
+++ b/tools/testing/selftests/resctrl/Makefile
@@ -1,17 +1,14 @@
-CC = $(CROSS_COMPILE)gcc
-CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2
-SRCS=$(wildcard *.c)
-OBJS=$(SRCS:.c=.o)
+# SPDX-License-Identifier: GPL-2.0
+# Makefile for resctrl selftests
 
-all: resctrl_tests
+CFLAGS += -g -Wall -O2 -D_FORTIFY_SOURCE=2
+LDLIBS += -lnuma
 
-$(OBJS): $(SRCS)
-	$(CC) $(CFLAGS) -c $(SRCS)
+TEST_GEN_PROGS := resctrl_tests
+EXTRA_SOURCES := $(wildcard *.c)
 
-resctrl_tests: $(OBJS)
-	$(CC) $(CFLAGS) -o $@ $^
+all: $(TEST_GEN_PROGS)
 
-.PHONY: clean
+$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
 
-clean:
-	$(RM) $(OBJS) resctrl_tests
+include ../lib.mk
diff --git a/tools/testing/selftests/resctrl/settings b/tools/testing/selftests/resctrl/settings
new file mode 100644
index 0000000..6091b45
--- /dev/null
+++ b/tools/testing/selftests/resctrl/settings
@@ -0,0 +1 @@
+timeout=120
-- 
1.8.3.1


  reply	other threads:[~2021-11-10  9:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  9:33 [PATCH 0/3] selftests/resctrl: Add resctrl_tests into kselftest set Shaopeng Tan
2021-11-10  9:33 ` Shaopeng Tan [this message]
2021-11-29 19:27   ` [PATCH 1/3] selftests/resctrl: Make resctrl_tests run using kselftest framework Reinette Chatre
2021-12-01  2:36     ` tan.shaopeng
2021-12-02  0:18       ` Reinette Chatre
2021-12-03  7:21         ` tan.shaopeng
2021-12-03 23:08           ` Reinette Chatre
2021-12-06  6:57             ` tan.shaopeng
2021-12-06 15:23               ` Reinette Chatre
2021-11-10  9:33 ` [PATCH 2/3] selftests/resctrl: Return KSFT_SKIP(4) if resctrl filessystem is not supported or resctrl is not run as root Shaopeng Tan
2021-11-29 19:27   ` Reinette Chatre
2021-12-01  2:36     ` tan.shaopeng
2021-12-02  0:39       ` Reinette Chatre
2021-11-10  9:33 ` [PATCH 3/3] selftests/resctrl: Kill the child process created by fork() when the SIGTERM signal comes Shaopeng Tan
2021-11-24 11:00 ` [PATCH 0/3] selftests/resctrl: Add resctrl_tests into kselftest set tan.shaopeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211110093315.3219191-2-tan.shaopeng@jp.fujitsu.com \
    --to=tan.shaopeng@jp.fujitsu.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).