From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EAE1CA0567; Tue, 9 Mar 2021 17:14:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B06AD4069D; Tue, 9 Mar 2021 17:14:16 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 797E34068A for ; Tue, 9 Mar 2021 17:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615306454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JSDXi394M8CalGw/bFplEgo9sBk3Sd358MUGZCY/rO0=; b=HougLT1kTQvofh1mtrGAFqNGr0Ibl/kkF/25QHdxE2scQwKKAeuG3tDDxdchmttiiiqoSE IOpdzzIBnvrWXlbPcFnjoOW4u0bFU4UrxG9oz8IAZ5LfBGakQ1SBGbG4dmCJaZUF9Au7eB GBvaLLDu293UV9+f9kgOv15mJePVlFo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-112-GtR9Js7hOSeoZWqK6sN6OA-1; Tue, 09 Mar 2021 11:14:11 -0500 X-MC-Unique: GtR9Js7hOSeoZWqK6sN6OA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9FF1180432D; Tue, 9 Mar 2021 16:14:10 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-115-237.rdu2.redhat.com [10.10.115.237]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6460E5D9DE; Tue, 9 Mar 2021 16:14:06 +0000 (UTC) From: Aaron Conole To: David Marchand Cc: Bruce Richardson , dev , Ray Kinsella References: <20210208165234.319578-1-aconole@redhat.com> <20210210145559.4090684-1-aconole@redhat.com> <20210302100401.GA1396@bricha3-MOBL.ger.corp.intel.com> Date: Tue, 09 Mar 2021 11:14:05 -0500 In-Reply-To: (Aaron Conole's message of "Tue, 02 Mar 2021 10:26:59 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=aconole@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [dpdk-dev] [PATCH v2] guides: add a testing guide for developing tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Aaron Conole writes: > Bruce Richardson writes: > >> On Tue, Mar 02, 2021 at 10:07:26AM +0100, David Marchand wrote: >>> On Wed, Feb 10, 2021 at 3:56 PM Aaron Conole wrote: >>> > diff --git a/doc/guides/contributing/testing.rst b/doc/guides/contributing/testing.rst >>> > new file mode 100644 >>> > index 0000000000..86ca24ce43 >>> > --- /dev/null >>> > +++ b/doc/guides/contributing/testing.rst >>> > @@ -0,0 +1,245 @@ >>> > +.. SPDX-License-Identifier: BSD-3-Clause >>> > + Copyright 2018 The DPDK contributors >>> >>> 2021? > > Whoops, I forgot to update my time machine. > >>> > + >>> > +.. _testing_guidelines: >>> >>> I can't find a call to the testing_guidelines reference, so this can be removed. > > done. > >>> >>> [snip] >>> >>> > +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 ---