Linux Test Project
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: linuxtestproject.agent@gmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] power_management: rewrite runpwtests04.sh in C
Date: Mon, 13 Jul 2026 11:48:29 +0000	[thread overview]
Message-ID: <6a54d08e.ebbd881c.1eb8f6.3e6e@mx.google.com> (raw)
In-Reply-To: <20260707163648.4043-1-linuxtestproject.agent@gmail.com>

Hi Jinseok,

> 
> open() is a tested subject here -- its return code drives the
> TCONF/TFAIL decision. Bare syscalls that are the subject of the
> test must be wrapped in TEST(), not called directly. The same
> applies to read() and write() below.

This is a false positive.

> 
> > +	ret = read(fd, buf, sizeof(buf));
> > +
> > +	if (ret < 0)
> > +		tst_res(TFAIL | TERRNO, "%s read() failed", path);
> > +	else if (ret == 0)
> > +		tst_res(TFAIL, "%s read() returned 0", path);
> > +	else
> > +		tst_res(TPASS, "%s read() successfully", path);
> 
> read() is the primary subject of this test and must be wrapped in
> TEST() so that TST_RET and TST_ERR are populated.

This is false positive.

> 
> > +	if (tcases[i].is_writable) {
> > +		if (write(fd, "invalid_governor", 16) < 0) {
> 
> Same for write().

This is false poitive.

> 
> > +static struct tst_test test = {
> > +	.cleanup = cleanup,
> > +	.needs_root = 1,
> 
> The doc comment only mentions readability. It does not explain why
> root is required. Ground Rule 4 requires the reason to appear in
> the /*\ ... */ block. Root is needed here for writing to
> current_governor and for the save_restore of that path; please
> document that.
> 
> > + * Verify that selected cpuidle sysfs files are readable.
> 
> The test also verifies that writing an invalid governor name to
> current_governor is rejected with EINVAL. The description should
> cover both aspects.
> 
> Verdict - Needs revision

The rest is correct.

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-07-13 11:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 15:09 [LTP] [PATCH v6] power_management: rewrite runpwtests04.sh in C Jinseok Kim
2026-07-07 16:36 ` [LTP] " linuxtestproject.agent
2026-07-13 11:48   ` Andrea Cervesato via ltp [this message]
2026-07-10 14:20 ` [LTP] [PATCH v6] " Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2026-07-29 11:29 [LTP] [PATCH v7] " Jinseok Kim
2026-07-30 13:02 ` [LTP] " linuxtestproject.agent
2026-06-12 17:13 [LTP] [PATCH v5] " Jinseok Kim
2026-06-12 19:09 ` [LTP] " linuxtestproject.agent
2026-06-12 12:20 [LTP] [PATCH v4] " Jinseok Kim
2026-06-12 16:22 ` [LTP] " linuxtestproject.agent
2026-05-24 15:42 [LTP] [PATCH v2] " Jinseok Kim
2026-05-24 17:05 ` [LTP] " linuxtestproject.agent
2026-06-09  8:02 ` linuxtestproject.agent
2026-05-16 20:00 [LTP] [PATCH] " Jinseok Kim
2026-05-17 17:13 ` [LTP] " linuxtestproject.agent

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=6a54d08e.ebbd881c.1eb8f6.3e6e@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=linuxtestproject.agent@gmail.com \
    /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