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 04E99A0C45; Wed, 20 Oct 2021 09:32:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EE7441182; Wed, 20 Oct 2021 09:32:29 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2052.outbound.protection.outlook.com [40.107.101.52]) by mails.dpdk.org (Postfix) with ESMTP id AF30A4117B for ; Wed, 20 Oct 2021 09:32:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3CWnU137xmbiA7+OiR7I/JjqF4r8VwHuG4FdfBWtIuid4EpQCzQIe59al9B2cApuyiu0Oz0ygNPOsGIw0VD9D2FR6GcT9MBKia8kxwsYXTew4a3IVAycgtJEVVdKeyoPJpAAAtvdxXJ7PakOhe3XB76OMqm44E0gwmok0zCS2Pey3JYr27mszPBt9CFnMi37F6bHVkkwCVO+6IICFxEZV7sh18iGAmXt7w+fdSTEpS8yaZUcJt61SlPXcLs8tUB2WmAbddHOsBSKR/mLiArBDcnecYH86mmap25HBxjZWKmOQtWlXD5GjNjwWebX6lrKHfMx9X7v0aHS4oVbUIazQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5h65FyPoGGqt+ZO2zf6v7Jd+eTpDH3U2bKTNJkmhSsU=; b=a78RJDIHfBTJOhHRrwv2hg2PZjb2WBHpQqU+KAL1PQyP/ji1JJ8MfpRj8BuVJy/mRQE1o9wp5+LPJRyR3d0ig3IphVBtW1D2XwYrbW0odxsBRgoHZpwu4lWp5pvkExrM96+FQJ5SjykLbth03rSQo+dDt9efwMLHwSCZP5pjlf3KZ//Y0wBg+FQSug31WSW1pTx4XFuDXniNd+kQAD9VDqG8bgEc7intNZs2sG6P/nln6tGxe+KPQ8pvqAt5ea4P7JNAgAOEKZ0jW1NXLtTX8th8j6sLP2J3xdbxrUYUtpQ9SynWHp5tPDDSYxKvEnGG98YpKr2cerkpsG4yeZy/Mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5h65FyPoGGqt+ZO2zf6v7Jd+eTpDH3U2bKTNJkmhSsU=; b=PWQV3wqCcC4bnY55mpPQY2EL2s8EAeDV6ds+ieNzU1ExvKO0Z8UTOFXCljdV2lP7xb6LIZOBLXxZFPCRshbRelgApd5MPPFPR/bK7qrB+TmRDf9PotJ4fHPn6up3Zx6iLCWCFGLmnDf7nksDJKu/P3i4l65Owe1JhgAJAZS4O4HZZyTjcfAiTDuctvjK/SUQWjqcxwBDVp5ysoIJikUDqtd0ep0l0L/e6cgxxiIxvT9KLR6UuGbZFFUAM7cLtpQdkxcEZHS1K7xUX3d34X+DdN7Ll2kw81MfFUlpbb1tumkM41H8vJiGb2GQSm9YfAJ8RP9RmikKcXV+L3VEZBYMpA== Received: from DM6PR06CA0004.namprd06.prod.outlook.com (2603:10b6:5:120::17) by BN8PR12MB3217.namprd12.prod.outlook.com (2603:10b6:408:6e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Wed, 20 Oct 2021 07:32:19 +0000 Received: from DM6NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::a5) by DM6PR06CA0004.outlook.office365.com (2603:10b6:5:120::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Wed, 20 Oct 2021 07:32:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT008.mail.protection.outlook.com (10.13.172.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Wed, 20 Oct 2021 07:32:18 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 20 Oct 2021 07:32:15 +0000 From: Xueming Li To: , Gaetan Rivet CC: , Thomas Monjalon , "Lior Margalit" Date: Wed, 20 Oct 2021 15:31:51 +0800 Message-ID: <20211020073151.2374674-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211020073151.2374674-1-xuemingl@nvidia.com> References: <20211005155435.279043-1-xuemingl@nvidia.com> <20211020073151.2374674-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c3f9a42-3970-48e2-cc36-08d9939bbf61 X-MS-TrafficTypeDiagnostic: BN8PR12MB3217: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:94; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VXiDHb6dWwjQg4O94cM6bzV/K7sq2ICFja5sYV/VE6bpEwPSbysm9ChQrr3w8iyL99i5N3vUOdsWJKFu8QUj3kUNjjfAxEQWLaWJIJr4s2q+v6B7zByrhEwnAaEgplz87UYpnYP6dGubeXhB9l1beQaL63Mz+U0VcwiQzZaYzLWpY9bOI7YxwFc001bzcHmQojY67AMVbkgL91h+vLdV4xPCN9VH32fsdkvOxSpdQC9psjBedQYLgeR458yPmt1vXGGFJ9dbIZjUYFssV6cWaTmMtzgYwGujca8PMKTHFh7HhwfYNCIsFBABk38HwBmH+J/zBk2LVuQdoYhAsczHnLpqaRON4eCH/0X/8hvoBK7sZf43ypSHhPQ5uQZ3D3LVjU7Fwp+PuDT6aY8Co3sZuwlp3qoa7Ao7HmJYOGS4ahScOSxHS/q9tG/jx7CM3dElXLpAen9FD4eA5CwG7sB0/lieR2VI0LTJfOEYoVlqz9nRyD4am7I9BGk5FobnXUyg++TFjZT4+PIX/dn7miG/I2WtxHaFwOolaOp1E9HjFhx0WqCrxFwVKU5jLggU8iccnf42aOPhaWUYBGJvNU5FoUyN7hpe0QjTR8adsziEihcltairMH5fTgIpTXnRbaMlg46F04WIJ0wL4JT7SVc8ig79k1c5nIwoyTa2ran4eyXp9ViAuBp7J3bepkM53QTOnUJMm0LzBXJY35Ub3jCyZw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(6286002)(30864003)(26005)(47076005)(36756003)(1076003)(8936002)(70206006)(316002)(2616005)(5660300002)(110136005)(336012)(508600001)(8676002)(7696005)(426003)(70586007)(4326008)(36860700001)(2906002)(82310400003)(54906003)(86362001)(83380400001)(55016002)(356005)(7636003)(107886003)(6666004)(186003)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2021 07:32:18.7778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c3f9a42-3970-48e2-cc36-08d9939bbf61 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3217 Subject: [dpdk-dev] [PATCH v2 3/3] test/devargs: add devargs test cases 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" Initial version to test Global devargs syntax. Signed-off-by: Xueming Li --- app/test/autotest_data.py | 803 ++++++++++++++++++++++++++++++++++++++ app/test/meson.build | 2 + app/test/test_devargs.c | 184 +++++++++ 3 files changed, 989 insertions(+) create mode 100644 app/test/autotest_data.py create mode 100644 app/test/test_devargs.c diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py new file mode 100644 index 00000000000..3b841e71918 --- /dev/null +++ b/app/test/autotest_data.py @@ -0,0 +1,803 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2010-2014 Intel Corporation + +# Test data for autotests + +from autotest_test_funcs import * + +# groups of tests that can be run in parallel +# the grouping has been found largely empirically +parallel_test_list = [ + { + "Name": "Timer autotest", + "Command": "timer_autotest", + "Func": timer_autotest, + "Report": None, + }, + { + "Name": "Debug autotest", + "Command": "debug_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Errno autotest", + "Command": "errno_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Meter autotest", + "Command": "meter_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Common autotest", + "Command": "common_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Resource autotest", + "Command": "resource_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Memory autotest", + "Command": "memory_autotest", + "Func": memory_autotest, + "Report": None, + }, + { + "Name": "Read/write lock autotest", + "Command": "rwlock_autotest", + "Func": rwlock_autotest, + "Report": None, + }, + { + "Name": "Lcores autotest", + "Command": "lcores_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Logs autotest", + "Command": "logs_autotest", + "Func": logs_autotest, + "Report": None, + }, + { + "Name": "CPU flags autotest", + "Command": "cpuflags_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Version autotest", + "Command": "version_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "EAL filesystem autotest", + "Command": "eal_fs_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "EAL flags autotest", + "Command": "eal_flags_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash autotest", + "Command": "hash_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "LPM autotest", + "Command": "lpm_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "LPM6 autotest", + "Command": "lpm6_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RIB autotest", + "Command": "rib_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RIB slow autotest", + "Command": "rib_slow_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RIB6 autotest", + "Command": "rib6_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RIB6 slow autotest", + "Command": "rib6_slow_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB autotest", + "Command": "fib_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB slow autotest", + "Command": "fib_slow_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB6 autotest", + "Command": "fib6_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB6 slow autotest", + "Command": "fib6_slow_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Memcpy autotest", + "Command": "memcpy_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Memzone autotest", + "Command": "memzone_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "String autotest", + "Command": "string_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Malloc autotest", + "Command": "malloc_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Multi-process autotest", + "Command": "multiprocess_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Mbuf autotest", + "Command": "mbuf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Per-lcore autotest", + "Command": "per_lcore_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Ring autotest", + "Command": "ring_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Spinlock autotest", + "Command": "spinlock_autotest", + "Func": spinlock_autotest, + "Report": None, + }, + { + "Name": "Ticketlock autotest", + "Command": "ticketlock_autotest", + "Func": ticketlock_autotest, + "Report": None, + }, + { + "Name": "MCSlock autotest", + "Command": "mcslock_autotest", + "Func": mcslock_autotest, + "Report": None, + }, + { + "Name": "Byte order autotest", + "Command": "byteorder_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "TAILQ autotest", + "Command": "tailq_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Command-line autotest", + "Command": "cmdline_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Interrupts autotest", + "Command": "interrupt_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Function reentrancy autotest", + "Command": "func_reentrancy_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Mempool autotest", + "Command": "mempool_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Atomics autotest", + "Command": "atomic_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Prefetch autotest", + "Command": "prefetch_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Red autotest", + "Command": "red_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "PMD ring autotest", + "Command": "ring_pmd_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Access list control autotest", + "Command": "acl_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Sched autotest", + "Command": "sched_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Eventdev selftest octeontx", + "Command": "eventdev_selftest_octeontx", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Event ring autotest", + "Command": "event_ring_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Table autotest", + "Command": "table_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Flow classify autotest", + "Command": "flow_classify_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Event eth rx adapter autotest", + "Command": "event_eth_rx_adapter_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "User delay", + "Command": "user_delay_us", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Rawdev autotest", + "Command": "rawdev_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Kvargs autotest", + "Command": "kvargs_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Link bonding autotest", + "Command": "link_bonding_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Link bonding mode4 autotest", + "Command": "link_bonding_mode4_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Link bonding rssconf autotest", + "Command": "link_bonding_rssconf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Crc autotest", + "Command": "crc_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Distributor autotest", + "Command": "distributor_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Reorder autotest", + "Command": "reorder_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Barrier autotest", + "Command": "barrier_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Bitmap test", + "Command": "bitmap_test", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Bitops test", + "Command": "bitops_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash multiwriter autotest", + "Command": "hash_multiwriter_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Service autotest", + "Command": "service_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Timer racecond autotest", + "Command": "timer_racecond_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Member autotest", + "Command": "member_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Efd_autotest", + "Command": "efd_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Thash autotest", + "Command": "thash_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash function autotest", + "Command": "hash_functions_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev sw mvsam autotest", + "Command": "cryptodev_sw_mvsam_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev dpaa2 sec autotest", + "Command": "cryptodev_dpaa2_sec_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev dpaa sec autotest", + "Command": "cryptodev_dpaa_sec_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev qat autotest", + "Command": "cryptodev_qat_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev aesni mb autotest", + "Command": "cryptodev_aesni_mb_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev openssl autotest", + "Command": "cryptodev_openssl_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev scheduler autotest", + "Command": "cryptodev_scheduler_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev aesni gcm autotest", + "Command": "cryptodev_aesni_gcm_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev null autotest", + "Command": "cryptodev_null_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev sw snow3g autotest", + "Command": "cryptodev_sw_snow3g_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev sw kasumi autotest", + "Command": "cryptodev_sw_kasumi_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Cryptodev_sw_zuc_autotest", + "Command": "cryptodev_sw_zuc_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Reciprocal division", + "Command": "reciprocal_division", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Red all", + "Command": "red_all", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Fbarray autotest", + "Command": "fbarray_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "External memory autotest", + "Command": "external_mem_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Metrics autotest", + "Command": "metrics_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Bitratestats autotest", + "Command": "bitratestats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Latencystats autotest", + "Command": "latencystats_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Pdump autotest", + "Command": "pdump_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "IPsec_SAD", + "Command": "ipsec_sad_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Checksum autotest", + "Command": "cksum_autotest", + "Func": default_autotest, + "Report": None, + }, + # + #Please always keep all dump tests at the end and together! + # + { + "Name": "Dump physmem", + "Command": "dump_physmem", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump memzone", + "Command": "dump_memzone", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump struct sizes", + "Command": "dump_struct_sizes", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump mempool", + "Command": "dump_mempool", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump malloc stats", + "Command": "dump_malloc_stats", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump devargs", + "Command": "dump_devargs", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump log types", + "Command": "dump_log_types", + "Func": dump_autotest, + "Report": None, + }, + { + "Name": "Dump_ring", + "Command": "dump_ring", + "Func": dump_autotest, + "Report": None, + }, +] + +# tests that should not be run when any other tests are running +non_parallel_test_list = [ + { + "Name": "Eventdev common autotest", + "Command": "eventdev_common_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Eventdev selftest sw", + "Command": "eventdev_selftest_sw", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "KNI autotest", + "Command": "kni_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Mempool performance autotest", + "Command": "mempool_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Memcpy performance autotest", + "Command": "memcpy_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash performance autotest", + "Command": "hash_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash read-write concurrency functional autotest", + "Command": "hash_readwrite_func_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash read-write concurrency perf autotest", + "Command": "hash_readwrite_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Hash read-write lock-free concurrency perf autotest", + "Command": "hash_readwrite_lf_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Power autotest", + "Command": "power_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Power cpufreq autotest", + "Command": "power_cpufreq_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Power KVM VM autotest", + "Command": "power_kvm_vm_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Timer performance autotest", + "Command": "timer_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + + "Name": "Pmd perf autotest", + "Command": "pmd_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Ring pmd perf autotest", + "Command": "ring_pmd_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Distributor perf autotest", + "Command": "distributor_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Red_perf", + "Command": "red_perf", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Lpm6 perf autotest", + "Command": "lpm6_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Lpm perf autotest", + "Command": "lpm_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB perf autotest", + "Command": "fib_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "FIB6 perf autotest", + "Command": "fib6_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Efd perf autotest", + "Command": "efd_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Member perf autotest", + "Command": "member_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Reciprocal division perf", + "Command": "reciprocal_division_perf", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RCU QSBR autotest", + "Command": "rcu_qsbr_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "RCU QSBR performance autotest", + "Command": "rcu_qsbr_perf_autotest", + "Func": default_autotest, + "Report": None, + }, + { + "Name": "Devargs autotest", + "Command": "devargs_autotest", + "Func": default_autotest, + "Report": None, + }, + # + # Please always make sure that ring_perf is the last test! + # + { + "Name": "Ring performance autotest", + "Command": "ring_perf_autotest", + "Func": default_autotest, + "Report": None, + }, +] diff --git a/app/test/meson.build b/app/test/meson.build index a16374b7a10..842388b0d32 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -42,6 +42,7 @@ test_sources = files( 'test_cryptodev_security_pdcp.c', 'test_cycles.c', 'test_debug.c', + 'test_devargs.c', 'test_distributor.c', 'test_distributor_perf.c', 'test_dmadev.c', @@ -204,6 +205,7 @@ fast_tests = [ ['common_autotest', true], ['cpuflags_autotest', true], ['debug_autotest', true], + ['devargs_autotest', true], ['eal_flags_c_opt_autotest', false], ['eal_flags_main_opt_autotest', false], ['eal_flags_n_opt_autotest', false], diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c new file mode 100644 index 00000000000..13e95f052b0 --- /dev/null +++ b/app/test/test_devargs.c @@ -0,0 +1,184 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 NVIDIA Corporation & Affiliates + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "test.h" + +/* Check layer arguments. */ +static int +test_args(const char *devargs, const char *layer, const char *args, const int n) +{ + struct rte_kvargs *kvlist; + + if (n == 0) { + if (args != NULL && strlen(args) > 0) { + printf("rte_devargs_parse(%s) %s args parsed (not expected)\n", + devargs, layer); + return -1; + } else { + return 0; + } + } + if (args == NULL) { + printf("rte_devargs_parse(%s) %s args not parsed\n", + devargs, layer); + return -1; + } + kvlist = rte_kvargs_parse(args, NULL); + if (kvlist == NULL) { + printf("rte_devargs_parse(%s) %s_str: %s not parsed\n", + devargs, layer, args); + return -1; + } + if ((int)kvlist->count != n) { + printf("rte_devargs_parse(%s) %s_str: %s kv number %u, not %d\n", + devargs, layer, args, kvlist->count, n); + return -1; + } + return 0; +} + +/* Test several valid cases */ +static int +test_valid_devargs(void) +{ + static const struct { + const char *devargs; + int bus_kv; + int class_kv; + int driver_kv; + const char *bus; + const char *name; + const char *class; + } list[] = { + /* Global devargs syntax: */ + { "bus=pci", + 1, 0, 0, "pci", NULL, NULL}, + { "class=eth", + 0, 1, 0, NULL, NULL, "eth" }, + { "bus=pci,addr=1:2.3/class=eth/driver=abc,k0=v0", + 2, 1, 2, "pci", "0000:01:02.3", "eth" }, + { "bus=vdev,name=/dev/file/name/class=eth", + 2, 1, 0, "vdev", "/dev/file/name", "eth" }, + { "bus=vdev,name=/class/bus/path/class=eth", + 2, 1, 0, "vdev", "/class/bus/path", "eth" }, + { "bus=vdev,name=///dblslsh/class=eth", + 2, 1, 0, "vdev", "///dblslsh", "eth" }, + /* Legacy devargs syntax: */ + { "1:2.3", 0, 0, 0, + "pci", "1:2.3", NULL }, + { "pci:1:2.3,k0=v0", + 0, 0, 1, "pci", "1:2.3", NULL }, + { "net_virtio_user0,iface=test,path=/dev/vhost-net,queues=1", + 0, 0, 3, "vdev", "net_virtio_user0", NULL }, + { "net_virtio_user0,iface=test,path=/class/bus/,queues=1", + 0, 0, 3, "vdev", "net_virtio_user0", NULL }, + }; + struct rte_devargs da; + uint32_t i; + int ret; + int fail = 0; + + for (i = 0; i < RTE_DIM(list); i++) { + memset(&da, 0, sizeof(da)); + ret = rte_devargs_parse(&da, list[i].devargs); + if (ret < 0) { + printf("rte_devargs_parse(%s) returned %d (but should not)\n", + list[i].devargs, ret); + goto fail; + } + if ((list[i].bus_kv > 0 || list[i].bus != NULL) && + da.bus == NULL) { + printf("rte_devargs_parse(%s) bus not parsed\n", + list[i].devargs); + goto fail; + } + if (test_args(list[i].devargs, "bus", da.bus_str, + list[i].bus_kv) != 0) + goto fail; + if (list[i].bus != NULL && + strcmp(da.bus->name, list[i].bus) != 0) { + printf("rte_devargs_parse(%s) bus name (%s) not expected (%s)\n", + list[i].devargs, da.bus->name, list[i].bus); + goto fail; + } + if ((list[i].class_kv > 0 || list[i].class != NULL) && + da.cls == NULL) { + printf("rte_devargs_parse(%s) class not parsed\n", + list[i].devargs); + goto fail; + } + if (test_args(list[i].devargs, "class", da.cls_str, + list[i].class_kv) != 0) + goto fail; + if (list[i].class != NULL && + strcmp(da.cls->name, list[i].class) != 0) { + printf("rte_devargs_parse(%s) class name (%s) not expected (%s)\n", + list[i].devargs, da.cls->name, list[i].class); + goto fail; + } + if (test_args(list[i].devargs, "driver", da.drv_str, + list[i].driver_kv) != 0) + goto fail; + if (list[i].name != NULL && + strcmp(da.name, list[i].name) != 0) { + printf("rte_devargs_parse(%s) device name (%s) not expected (%s)\n", + list[i].devargs, da.name, list[i].name); + goto fail; + } + goto cleanup; +fail: + fail = -1; +cleanup: + rte_devargs_reset(&da); + } + return fail; +} + +/* Test several invalid cases */ +static int +test_invalid_devargs(void) +{ + static const char * const list[] = { + "bus=wrong-bus", + "class=wrong-class"}; + struct rte_devargs da; + uint32_t i; + int ret; + int fail = 0; + + for (i = 0; i < RTE_DIM(list); i++) { + ret = rte_devargs_parse(&da, list[i]); + if (ret >= 0) { + printf("rte_devargs_parse(%s) returned %d (but should not)\n", + list[i], ret); + fail = ret; + } + rte_devargs_reset(&da); + } + return fail; +} + +static int +test_devargs(void) +{ + printf("== test valid case ==\n"); + if (test_valid_devargs() < 0) + return -1; + printf("== test invalid case ==\n"); + if (test_invalid_devargs() < 0) + return -1; + return 0; +} + +REGISTER_TEST_COMMAND(devargs_autotest, test_devargs); -- 2.33.0