Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v5 2/2] firmware/fw_load: add fw_load02 for custom firmware path
Date: Thu, 11 Jun 2026 11:26:34 +0200	[thread overview]
Message-ID: <aip_SuymPZMvUAvo@yuki.lan> (raw)
In-Reply-To: <20260611-fw_load-v5-2-7e21d40ae54a@suse.com>

Hi!
> +static void setup(void)
> +{
> +	char fw_size_param[32];
> +	char *tmpdir = tst_tmpdir_path();
> +	struct tst_path_val fw_path = {
> +		.path = FW_PATH,
> +		.val = tmpdir,
> +		.flags = TST_SR_TCONF,
> +	};
> +
> +	tst_requires_module_signature_disabled();
> +
> +	/*
> +	 * Point the kernel firmware loader at our writable tmpdir so the
> +	 * test does not depend on a writable /lib/firmware. The previous
> +	 * value is restored automatically during cleanup.
> +	 */
> +	tst_sys_conf_save(&fw_path);

I would say that it's cleaner to add the save_restore to the tst_test
structure without the tmpdir value and use
SAFE_FILE_PRINTF(FW_PATH, "%s", tmpdir) in the test setup. Since if the
test crashes the test library will still restore the FW_PATH

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2026-06-11  9:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  7:57 [LTP] [PATCH v5 0/2] Rewrite fw_load test using new API Andrea Cervesato
2026-06-11  7:57 ` [LTP] [PATCH v5 1/2] firmware/fw_load: rewrite firmware loading test using new LTP API Andrea Cervesato
2026-06-11  9:23   ` Cyril Hrubis
2026-06-11  9:43     ` Andrea Cervesato via ltp
2026-06-11 10:08       ` Cyril Hrubis
2026-06-11  7:57 ` [LTP] [PATCH v5 2/2] firmware/fw_load: add fw_load02 for custom firmware path Andrea Cervesato
2026-06-11  9:26   ` Cyril Hrubis [this message]
2026-06-11  9:36     ` Andrea Cervesato via ltp
2026-06-11 10:07       ` Cyril Hrubis

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=aip_SuymPZMvUAvo@yuki.lan \
    --to=chrubis@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