From: Cyril Hrubis <chrubis@suse.cz>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net, jbeckenbach@lancope.com
Subject: Re: [LTP] [PATCH v2] cpuset_syscall_testset.sh: check TCONF for test 15, 16
Date: Thu, 30 Oct 2014 14:16:21 +0100 [thread overview]
Message-ID: <20141030131621.GC14847@rei.suse.de> (raw)
In-Reply-To: <3b5ef63b19fe7ac52dc6d3454760f2de344d62e8.1413538123.git.jstancek@redhat.com>
Hi!
> If HAVE_DECL_MPOL_F_MEMS_ALLOWED is not defined, test 15 and 16,
> returns -1, which is evaluted as failure.
>
> Treat it as TCONF, but don't break the execution, cpuset_syscall_testset.sh
> script is expecting to handle stopping/waiting for children by itself.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> .../cpuset_syscall_test/cpuset_syscall_test.c | 6 +++---
> .../cpuset_syscall_test/cpuset_syscall_testset.sh | 14 ++++++++++++--
> 2 files changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
> index e202295..407b8c9 100644
> --- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
> +++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
> @@ -128,7 +128,7 @@ void sigint_handler(int __attribute__ ((unused)) signo)
> void test_setaffinity(void)
> {
> cpu_set_t tmask;
> - int i;
> + unsigned int i;
> CPU_ZERO(&tmask);
> for (i = 0; i < 8 * sizeof(mask); i++) {
> if ((1 << i) & mask)
> @@ -140,7 +140,7 @@ void test_setaffinity(void)
> void test_getaffinity(void)
> {
> cpu_set_t tmask;
> - int i;
> + unsigned int i;
> CPU_ZERO(&tmask);
> ret = sched_getaffinity(0, sizeof(tmask), &tmask);
> for (i = 0; i < 8 * sizeof(mask); i++) {
> @@ -190,7 +190,7 @@ void test_get_mempolicy(void)
> ret = get_mempolicy(NULL, bitmask_mask(nmask), bitmask_nbits(nmask), 0,
> MPOL_F_MEMS_ALLOWED);
> #else
> - ret = -1;
> + tst_resm(TCONF, "don't have MPOL_F_MEMS_ALLOWED");
> #endif
>
> bitmask_displaylist(str, 256, nmask);
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
> index 561c3b9..bf1ec6c 100755
> --- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
> +++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
> @@ -299,7 +299,12 @@ test14()
>
> test15()
> {
> - do_syscall_test 0 0 --get_mempolicy 0 || return 1
> + do_syscall_test 0 0 --get_mempolicy 0
> + ret=$?
> +
> + grep "TCONF" "$TEST_OUTPUT" && return 0
> + [ $ret -ne 0 ] && return 1
> +
> allowed_list="$(awk '/Mems_allowed_list:/{print $2}' $TEST_PROCSTATUS )"
> test "$(cat "$TEST_OUTPUT")" = "0"
> if [ $? -ne 0 ]; then
> @@ -316,7 +321,12 @@ test15()
>
> test16()
> {
> - do_syscall_test 0 0-1 --get_mempolicy 0 || return 1
> + do_syscall_test 0 0-1 --get_mempolicy 0
> + ret=$?
> +
> + grep "TCONF" "$TEST_OUTPUT" && return 0
I do not like much that we grep the test output for TCONF when we can
simply set ret to TCONF in the test and check the return value here...
Otherwise it's fine.
> + [ $ret -ne 0 ] && return 1
> +
> allowed_list="$(awk '/Mems_allowed_list:/{print $2}' $TEST_PROCSTATUS )"
> test "$(cat "$TEST_OUTPUT")" = "0-1"
> if [ $? -ne 0 ]; then
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2014-10-30 13:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 9:29 [LTP] [PATCH v2] cpuset_syscall_testset.sh: check TCONF for test 15, 16 Jan Stancek
2014-10-30 13:16 ` Cyril Hrubis [this message]
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=20141030131621.GC14847@rei.suse.de \
--to=chrubis@suse.cz \
--cc=jbeckenbach@lancope.com \
--cc=jstancek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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