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 6CA6AA00C2; Wed, 17 Mar 2021 15:44:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 874D6140E8E; Wed, 17 Mar 2021 15:44:42 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 191E34014D for ; Wed, 17 Mar 2021 15:44:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615992280; 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=3F6n1QHb9ypQrJIFl7YZqFF3sbZ2OMPyrT9Fmj7Q5ko=; b=KGte5QXr5K8FC5pmgcYXHYNerX2PQyvBEnbzVaOr3tJ4Uby5k3wza56wZ6j2Fu1kNQTrON S+ZYv5QtDvx78n2HHXRJqGSDOWEO1ueq7EZj2MxtqbvFzb1PQTNEO+/vzgohjwu72LbZm0 Nrl/zMqKKRpV8Ch7rgK2AFfUDHtymyo= 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-326-chGwupKbMY6V_lgMfFAboQ-1; Wed, 17 Mar 2021 10:44:37 -0400 X-MC-Unique: chGwupKbMY6V_lgMfFAboQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46360108BD06; Wed, 17 Mar 2021 14:44:36 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-117-240.rdu2.redhat.com [10.10.117.240]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74E575D6CF; Wed, 17 Mar 2021 14:44:32 +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: Wed, 17 Mar 2021 10:44:31 -0400 In-Reply-To: (David Marchand's message of "Thu, 11 Mar 2021 22:25:47 +0100") 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.15 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" David Marchand writes: > On Tue, Mar 9, 2021 at 5:14 PM Aaron Conole 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 :-) Sent :) > So +1 for a patch. > Thanks Aaron!