All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/4] lib/tst_test.c: add 'needs_drivers' option with tst_check_drivers cmd
Date: Wed, 22 Aug 2018 17:41:37 +0200	[thread overview]
Message-ID: <20180822154137.GA18305@dell5510> (raw)
In-Reply-To: <1534764229-26993-1-git-send-email-alexey.kodanev@oracle.com>

Hi Alexey,

> The drivers are checked with modprobe. If modprobe is not available
> on the system, the checks are silently skipped.

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>

> ---
> v2: * moved tst_check_driver() from tst_test.h to tst_kernel.h
>     * added the new option description to the doc and comment to tst_kernel.h
>     * iterating over the driver list moved out from tst_check_drivers(), the
>       function renamed accordingly.

...
> +2.2.26 Checking kernel for the driver support
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> + Someties test needs certain drivers to be available in the kernel and must
Typo Sometimes

> +end with TCONF if any are missing. For this task there is the '.needs_drivers'
> +option which accepts NULL-terminated array of the drivers names.
> +
> +Since it relies on modprobe command, the check will be skipped if the command
> +itself is not available on the system.


> +++ b/testcases/lib/tst_check_drivers.c
...
> +	if (argc < 2) {
> +		fprintf(stderr, "Please provide kernel driver list\n");
> +		return 1;
> +	}
> +
> +	for (i = 1; (name = argv[i]); ++i)
> +		if (tst_check_driver(name)) {
> +			fprintf(stderr, "%s", name);
> +			return 1;
> +		}
> +
> +	return 0;
> +}
It'd be handy to be able to load module with parameters. E.g.:
tcrypt sec=1 mode=200

We have 2 options: to name strig by spaces to b:
./tst_check_drivers "tcrypt sec=1 mode=200" other_module

Or handle in tst_check_drivers.c just one module and call it several times.

None of them is elegant.

Otherwise LGTM.


Kind regards,
Petr

  parent reply	other threads:[~2018-08-22 15:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 11:23 [LTP] [PATCH v2 1/4] lib/tst_test.c: add 'needs_drivers' option with tst_check_drivers cmd Alexey Kodanev
2018-08-20 11:23 ` [LTP] [PATCH v2 2/4] lib/tst_test.sh: add TST_NEEDS_DRIVERS parameter Alexey Kodanev
2018-08-22 15:42   ` Petr Vorel
2018-09-13 12:35   ` Cyril Hrubis
2018-09-14 11:54     ` Alexey Kodanev
2018-08-20 11:23 ` [LTP] [PATCH v2 3/4] lib/tst_test.sh: add TST_RTNL_CHK() helper function Alexey Kodanev
2018-09-13 13:00   ` Petr Vorel
2018-08-20 11:23 ` [LTP] [PATCH v2 4/4] network/ipsec: replace ipsec_try() with TST_RTNL_CHK() Alexey Kodanev
2018-08-22 15:45   ` Petr Vorel
2018-09-13 13:02   ` Petr Vorel
2018-08-22 15:41 ` Petr Vorel [this message]
2018-08-27 10:44   ` [LTP] [PATCH v2 1/4] lib/tst_test.c: add 'needs_drivers' option with tst_check_drivers cmd Alexey Kodanev
2018-09-06 17:53 ` Petr Vorel
2018-09-13 12:27 ` Cyril Hrubis
2018-09-14 11:41   ` Alexey Kodanev

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=20180822154137.GA18305@dell5510 \
    --to=pvorel@suse.cz \
    --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.