public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] Refactor setresgit01 test
Date: Fri, 3 Jan 2025 12:01:56 +0100	[thread overview]
Message-ID: <20250103110156.GA199182@pevik> (raw)
In-Reply-To: <20241113-setresgid_refactoring-v1-1-b6d07400e374@suse.com>

Hi Andrea,

> Simplify general structure, using struct passwd only when it's strictly
> needed and use new LTP API.

Rewrite LGTM, but there is a problem with 16-bit version.

Old version when compiled for 64bit it quits with TCONF:

# ./setresgid01_16
...
TCONF  :  utils/compat_16.h:146: 16-bit version of setresgid() is not supported on your platform
TCONF  :  utils/compat_16.h:146: Remaining cases not appropriate for configuration

But when running your patchset it runs the test:
# ./setresgid01_16
...
setresgid01.c:67: TPASS: *tc->exp_rgid == cur_rgid (0)

This was caused by using SAFE_SETRESGID(...) instead of original SETRESGID(),
which is needed to employ the check for 16-bit support.

Therefore I merged with this change:

-       SAFE_SETRESGID(*tc->rgid, *tc->egid, *tc->sgid);
+       TST_EXP_PASS(SETRESGID(*tc->rgid, *tc->egid, *tc->sgid));
+       if (!TST_PASS)
+               return;

Besides using SAFE_SETRESGID() would in failure resulted in TBROK instead of
TFAIL (usually subject of testing should result in TFAIL, not TBROK).

Thanks for your work!

Kind regards,
Petr

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

  reply	other threads:[~2025-01-03 11:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 13:02 [LTP] [PATCH 0/2] setresgit testing suite refactoring Andrea Cervesato
2024-11-13 13:02 ` [LTP] [PATCH 1/2] Refactor setresgit01 test Andrea Cervesato
2025-01-03 11:01   ` Petr Vorel [this message]
2024-11-13 13:02 ` [LTP] [PATCH 2/2] Refactor setresgit04 test Andrea Cervesato
2025-01-03 11:02   ` Petr Vorel

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=20250103110156.GA199182@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox