From: David Marchand <david.marchand@redhat.com>
To: Aaron Conole <aconole@redhat.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>, dev <dev@dpdk.org>,
Ray Kinsella <mdr@ashroe.eu>
Subject: Re: [dpdk-dev] [PATCH v2] guides: add a testing guide for developing tests
Date: Thu, 11 Mar 2021 22:25:47 +0100 [thread overview]
Message-ID: <CAJFAV8zRzUU-Vb-V=SN5cto4d2BOCBNfCmroAsysjd38sA3L0w@mail.gmail.com> (raw)
In-Reply-To: <f7tpn08gv8y.fsf@dhcp-25.97.bos.redhat.com>
On Tue, Mar 9, 2021 at 5:14 PM Aaron Conole <aconole@redhat.com> wrote:
> >>> > +The suites can be selected by adding the ``--suite`` option to the
> >>> > +``meson test`` command. Ex: ``meson test --suite fast-tests``::
> >>> > +
> >>> > + $ meson test -C build --suite fast-tests
> >>> > + ninja: Entering directory `/home/aconole/git/dpdk/build'
> >>> > + [2543/2543] Linking target app/test/dpdk-test.
> >>> > + 1/60 DPDK:fast-tests / acl_autotest OK 3.17 s
> >>> > + 2/60 DPDK:fast-tests / bitops_autotest OK 0.22 s
> >>> > + 3/60 DPDK:fast-tests / byteorder_autotest OK 0.22 s
> >>> > + 4/60 DPDK:fast-tests / cmdline_autotest OK 0.28 s
> >>> > + 5/60 DPDK:fast-tests / common_autotest OK 0.57 s
> >>> > + 6/60 DPDK:fast-tests / cpuflags_autotest OK 0.27 s
> >>> > + ...
> >>>
> >>> Trying this in my build env, I get all tests failing.
> >>> This is because I run this as a normal user, but the system has
> >>> hugepages configured.
> >>> I figured this out quickly since I know the test framework (simply
> >>> added a echo 0; exit at the top of has-hugepages.sh).
> >>> But I am not sure a reader of this doc would be able to troubleshoot this.
> >>>
> >>> Not sure if this is worth explaining here, or if we can enhance the
> >>> hugepage check (permissions maybe?).
> >
> > I prefer to fix the hugepage check to make the tests SKIP when we don't
> > have hugepages accessible (so we need some kind of permission check in
> > there). I will submit it separately.
> >
>
> Here is my PoC for this - if you think it's good enough, I'll submit as
> formal PATCH.
>
> ---
> index d600fad319..1c3cfb665a 100755
> --- a/app/test/has-hugepage.sh
> +++ b/app/test/has-hugepage.sh
> @@ -3,7 +3,17 @@
> # Copyright 2020 Mellanox Technologies, Ltd
>
> if [ "$(uname)" = "Linux" ] ; then
> - cat /proc/sys/vm/nr_hugepages || echo 0
> + nr_hugepages=$(cat /proc/sys/vm/nr_hugepages)
> + # Need to check if we have permissions to access hugepages
> + perm=""
> + for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do
> + test ! -w $mount/. || perm="$mount"
> + done
> + if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then
> + echo 0
> + else
> + echo $nr_hugepages
> + fi
> elif [ "$(uname)" = "FreeBSD" ] ; then
> echo 1 # assume FreeBSD always has hugepages
> else
> ---
>
I need to think more about the multiple mountpoints case (but I may be
imagining too much twisted setups..).
At least, this works in my env.
We need tests in travis/GHA, and sending a non-RFC patch is the best
way to know :-)
So +1 for a patch.
Thanks Aaron!
--
David Marchand
next prev parent reply other threads:[~2021-03-11 21:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 16:52 [dpdk-dev] [PATCH] " Aaron Conole
2021-02-08 18:03 ` Kinsella, Ray
2021-02-09 20:02 ` Aaron Conole
2021-02-10 14:55 ` [dpdk-dev] [PATCH v2] " Aaron Conole
2021-03-02 9:07 ` David Marchand
2021-03-02 10:04 ` Bruce Richardson
2021-03-02 15:26 ` Aaron Conole
2021-03-02 16:00 ` Bruce Richardson
2021-03-09 16:14 ` Aaron Conole
2021-03-11 21:25 ` David Marchand [this message]
2021-03-17 14:44 ` Aaron Conole
2021-03-09 15:57 ` [dpdk-dev] [PATCH v3] guides: add a guide for developing unit tests Aaron Conole
2021-05-31 15:17 ` Ferruh Yigit
2021-06-01 13:11 ` Aaron Conole
2021-07-14 16:40 ` [dpdk-dev] [PATCH v4] " Aaron Conole
2021-08-04 16:25 ` Power, Ciara
2021-08-06 9:27 ` Zhang, Roy Fan
2021-08-06 9:53 ` Mcnamara, John
2021-10-15 17:06 ` [dpdk-dev] [PATCH v5] " Aaron Conole
2021-11-26 16:20 ` Thomas Monjalon
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='CAJFAV8zRzUU-Vb-V=SN5cto4d2BOCBNfCmroAsysjd38sA3L0w@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=aconole@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=mdr@ashroe.eu \
/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;
as well as URLs for NNTP newsgroup(s).