From patchwork Fri Jul 29 12:42:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 114445 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65F8BA04FD; Fri, 29 Jul 2022 14:43:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F11584069C; Fri, 29 Jul 2022 14:43:35 +0200 (CEST) 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 6EB8A40151 for ; Fri, 29 Jul 2022 14:43:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659098613; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LnZXaOKoB6aFwc2JckOEWyob6HVvp0Qs27HaP34RNco=; b=QZTuZRH3Lw/uitktJBKEOSRgurigt177G3sHGLpBK8Z/12kBqR/nYL6Jj2ycqkMdWbbtlV LIzg3X9vFTHVpwLskQGimtKok6/uo4lfJZm7QkY7/WWaASvwp9ZpgIaBW1E/c9gJKIZ+Em shJm9zmT3ziNeo8gQykcSmRxoVZIaSo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-pj38uJXEM9uDU_LfOsSbgA-1; Fri, 29 Jul 2022 08:43:31 -0400 X-MC-Unique: pj38uJXEM9uDU_LfOsSbgA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 038948853D9; Fri, 29 Jul 2022 12:43:30 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.195.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AA1D40C1288; Fri, 29 Jul 2022 12:43:29 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 1/2] app/test: load drivers using build directory Date: Fri, 29 Jul 2022 14:42:55 +0200 Message-Id: <20220729124256.1384838-1-david.marchand@redhat.com> In-Reply-To: <20220729095400.774303-1-david.marchand@redhat.com> References: <20220729095400.774303-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Since commit 49b536fc3060 ("eal: load only shared libs from driver ...), we can specify a build directory to the -d option. Suggested-by: Bruce Richardson Signed-off-by: David Marchand Acked-by: Bruce Richardson --- app/test/meson.build | 4 +--- drivers/meson.build | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 431c5bd318..861dd92ebd 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -492,9 +492,7 @@ foreach arg : fast_tests if (get_option('default_library') == 'shared' and arg[0] == 'event_eth_tx_adapter_autotest') - foreach drv:dpdk_drivers - test_args += ['-d', drv.full_path().split('.a')[0] + '.so'] - endforeach + test_args += ['-d', dpdk_drivers_build_dir] endif if is_linux test_args += ['--file-prefix=@0@'.format(arg[0])] diff --git a/drivers/meson.build b/drivers/meson.build index b22c2adda7..376a64f4da 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -52,6 +52,8 @@ if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif +dpdk_drivers_build_dir = meson.current_build_dir() + foreach subpath:subdirs drivers = [] std_deps = [] From patchwork Fri Jul 29 12:42:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 114446 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CC31A04FD; Fri, 29 Jul 2022 14:43:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BC2E42C39; Fri, 29 Jul 2022 14:43:38 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4BEF042C28 for ; Fri, 29 Jul 2022 14:43:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659098615; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mf4M5IfSUBLxxg1fQbpI271QPFtF0TbDORu7Xaj/jrs=; b=bFNtA/dELEE2HSw69bKLOfk1H9Vdq2pyIpby36Qv+YyQkCvvR3yHGNExw+ItY/S/4f15BY KGVmmUvXc+IIr1QoX2P2+VttsLYB4V0f3vumtdqpqtXGvPhd7xmn7o8oNJqXRMS3J5IUTc LVxIn98OgPwajobo3OEX4eNxOZkXjXc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-261-1XMgIyLQOAWvRGSAy8io0w-1; Fri, 29 Jul 2022 08:43:34 -0400 X-MC-Unique: 1XMgIyLQOAWvRGSAy8io0w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80E1280602B; Fri, 29 Jul 2022 12:43:32 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.195.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54D4440C1288; Fri, 29 Jul 2022 12:43:31 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Chengwen Feng , Aaron Conole , Michael Santana , Ciara Power Subject: [PATCH v2 2/2] app/test: invoke all telemetry commands Date: Fri, 29 Jul 2022 14:42:56 +0200 Message-Id: <20220729124256.1384838-2-david.marchand@redhat.com> In-Reply-To: <20220729124256.1384838-1-david.marchand@redhat.com> References: <20220729095400.774303-1-david.marchand@redhat.com> <20220729124256.1384838-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Try and call all possible telemetry commands. Each commands is tested with no argument, 0 (for command that accepts a single integer like for a port identifier) and z (to catch commands not properly validating input). Fake cryptodev, dmadev, ethdev, eventdev and rawdev devices are created using dummy drivers. Output of the commands is not checked, the point of this test is mainly to catch simple issues and leaks (when coupled with ASan in the CI). Signed-off-by: David Marchand Acked-by: Chengwen Feng Acked-by: Aaron Conole Acked-by: Ciara Power Acked-by: Aaron Conole --- .github/workflows/build.yml | 2 +- app/test/meson.build | 33 ++++++++++++++++++++++++++++++++- app/test/test_telemetry.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100755 app/test/test_telemetry.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f04e7071c..bf17d2b278 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,7 +140,7 @@ jobs: run: sudo apt install -y crossbuild-essential-riscv64 - name: Install test tools packages if: env.AARCH64 != 'true' || env.PPC64LE != 'true' || env.RISCV64 != 'true' || env.RUN_TESTS == 'true' - run: sudo apt install -y gdb + run: sudo apt install -y gdb jq - name: Install doc generation packages if: env.BUILD_DOCS == 'true' run: sudo apt install -y doxygen graphviz python3-sphinx diff --git a/app/test/meson.build b/app/test/meson.build index 861dd92ebd..bf1d81f84a 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -473,12 +473,14 @@ message('hugepage availability: @0@'.format(has_hugepage)) timeout_seconds = 600 timeout_seconds_fast = 10 +test_no_huge_args = ['--no-huge', '-m', '2048'] + foreach arg : fast_tests test_args = [] run_test = true if not has_hugepage if arg[1] - test_args += ['--no-huge', '-m', '2048'] + test_args += test_no_huge_args else run_test = false endif @@ -518,6 +520,35 @@ foreach arg : fast_tests endif endforeach +if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY') + test_args = [dpdk_test] + test_args += test_no_huge_args + if get_option('default_library') == 'shared' + test_args += ['-d', dpdk_drivers_build_dir] + endif + if dpdk_conf.has('RTE_CRYPTO_NULL') + test_args += ['--vdev=crypto_null0'] + endif + if dpdk_conf.has('RTE_DMA_SKELETON') + test_args += ['--vdev=dma_skeleton0'] + endif + if dpdk_conf.has('RTE_EVENT_SKELETON') + test_args += ['--vdev=event_skeleton0'] + endif + if dpdk_conf.has('RTE_NET_NULL') + test_args += ['--vdev=net_null0'] + endif + if dpdk_conf.has('RTE_RAW_SKELETON') + test_args += ['--vdev=rawdev_skeleton0'] + endif + test_args += ['-a', '0000:00:00.0'] + test('telemetry_all', find_program('test_telemetry.sh'), + args: test_args, + timeout : timeout_seconds_fast, + is_parallel : false, + suite : 'fast-tests') +endif + foreach arg : perf_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], diff --git a/app/test/test_telemetry.sh b/app/test/test_telemetry.sh new file mode 100755 index 0000000000..ca6abe266e --- /dev/null +++ b/app/test/test_telemetry.sh @@ -0,0 +1,28 @@ +#!/bin/sh -e +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2022 Red Hat, Inc. + +which jq || { + echo "No jq available, skipping test." + exit 77 +} + +rootdir=$(readlink -f $(dirname $(readlink -f $0))/../..) +tmpoutput=$(mktemp -t dpdk.test_telemetry.XXXXXX) +trap "cat $tmpoutput; rm -f $tmpoutput" EXIT + +call_all_telemetry() { + telemetry_script=$rootdir/usertools/dpdk-telemetry.py + echo >$tmpoutput + echo "Telemetry commands log:" >>$tmpoutput + for cmd in $(echo / | $telemetry_script | jq -r '.["/"][]') + do + for input in $cmd $cmd,0 $cmd,z + do + echo Calling $input >> $tmpoutput + echo $input | $telemetry_script >> $tmpoutput 2>&1 + done + done +} + +(sleep 1 && call_all_telemetry && echo quit) | $@