From: linuxtestproject.agent@gmail.com
To: Jinseok Kim <always.starving0@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] power_management: rewrite runpwtests04.sh in C
Date: Tue, 7 Jul 2026 16:36:48 +0000 [thread overview]
Message-ID: <20260707163648.4043-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260707150920.6489-1-always.starving0@gmail.com>
Hi Jinseok,
On Wed, 8 Jul 2026, Jinseok Kim wrote:
> power_management: rewrite runpwtests04.sh in C
> The new implementation preserves the original test semantics while
> removing shell dependencies.
The original shell test only checked current_governor_ro and
current_driver for readability. The new test also covers
available_governors, current_governor (read), and adds a write
rejection check against current_governor. That is an extension,
not a preservation of semantics. Please update the commit message
body to reflect what is actually added.
> +static void verify_cpuidle(unsigned int i)
> +{
> + int ret;
> + char path[PATH_MAX];
> + char buf[32];
> +
> + snprintf(path, sizeof(path), "%s/%s", CPUIDLE_PATH, tcases[i].name);
> +
> + if (tcases[i].is_writable)
> + fd = open(path, O_RDWR);
> + else
> + fd = open(path, O_RDONLY);
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.
> + 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.
> + if (tcases[i].is_writable) {
> + if (write(fd, "invalid_governor", 16) < 0) {
Same for write().
> +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
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-07-07 16:37 UTC|newest]
Thread overview: 9+ 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 ` linuxtestproject.agent [this message]
2026-07-13 11:48 ` [LTP] " Andrea Cervesato via ltp
2026-07-10 14:20 ` [LTP] [PATCH v6] " Cyril Hrubis
-- strict thread matches above, loose matches on Subject: below --
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=20260707163648.4043-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=always.starving0@gmail.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.