Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh.babulal@oracle.com>
To: Breno Leitao <leitao@debian.org>,
	tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	shuah@kernel.org, cgroups@vger.kernel.org
Cc: leit@meta.com, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kselftest/cgroup: Fix gathering number of CPUs
Date: Mon, 14 Nov 2022 15:16:28 +0530	[thread overview]
Message-ID: <96eeeb5e-9fe9-ebf6-cc91-d49c86ec615d@oracle.com> (raw)
In-Reply-To: <20221113114449.18693-1-leitao@debian.org>



On 11/13/22 17:14, Breno Leitao wrote:
> test_cpuset_prs.sh is failing with the following error:
> 
> 	test_cpuset_prs.sh: line 29: [[: 8
> 	57%: syntax error in expression (error token is "57%")
> 
> This is happening because `lscpu | grep "^CPU(s)"` returns two lines in
> some systems (such as Debian unstable):
> 
> 	# lscpu | grep "^CPU(s)"
> 	CPU(s):                          8
> 	CPU(s) scaling MHz:              55%
> 
> This is a simple fix that discard the second line.
> 
> Signed-off-by: Breno Leitao <leitao@debian.org>

Tested with util-linux v2.38

Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>

> ---
>  tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> index 526d2c42d870..564ca8c33035 100755
> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> @@ -25,7 +25,7 @@ WAIT_INOTIFY=$(cd $(dirname $0); pwd)/wait_inotify
>  CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}')
>  [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!"
>  
> -CPUS=$(lscpu | grep "^CPU(s)" | sed -e "s/.*:[[:space:]]*//")
> +CPUS=$(lscpu | grep "^CPU(s):" | sed -e "s/.*:[[:space:]]*//")
>  [[ $CPUS -lt 8 ]] && skip_test "Test needs at least 8 cpus available!"
>  
>  # Set verbose flag and delay factor

-- 
Thanks,
Kamalesh

  reply	other threads:[~2022-11-14  9:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13 11:44 [PATCH] kselftest/cgroup: Fix gathering number of CPUs Breno Leitao
2022-11-14  9:46 ` Kamalesh Babulal [this message]
2022-11-14 21:38 ` Tejun Heo

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=96eeeb5e-9fe9-ebf6-cc91-d49c86ec615d@oracle.com \
    --to=kamalesh.babulal@oracle.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=leit@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=shuah@kernel.org \
    --cc=tj@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