From patchwork Fri Jul 21 11:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 129687 X-Patchwork-Delegate: thomas@monjalon.net 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 AF01B42ED9; Fri, 21 Jul 2023 13:52:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CE4542D36; Fri, 21 Jul 2023 13:51:49 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 78ECB42D3C for ; Fri, 21 Jul 2023 13:51:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689940307; x=1721476307; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JXZ2G/VvBDgi6SyO2DDx+W9HNJa+rIVLUZwW05s8GkI=; b=SKeQAv60rs6tH8r2ODbzouxMrN1Ni5Owni9QMSIxaqSriMviWogP4hUr OqBt1053cQMMw1kOx4Ns93VjuouYwGsZ9UGR09G2NHPB6DDD1+bRD6UuH oIuFm66Avo+SFA2g0XpplAPmU8lQBoSd6vSUq1dtwDaxgQhBjB99l7WOX l9Xix3NUHE4vx+5798E6P7Mwo1un8erFXSVBhh/iwOsiCmyDJ9/kptPUR dERrq//dleSNhMlFIv40GGrbfGo3rDg+WkS7uMT9zwwHEHuzbPfcYMmPo yWgzpDRkZt+Mo5aKVzawqRYFAcbsCYf+/ABAMd9Z4vg12ZhQdfG02uRea w==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="346599205" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="346599205" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 04:51:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="971420618" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="971420618" Received: from silpixa00401385.ir.intel.com ([10.237.214.156]) by fmsmga006.fm.intel.com with ESMTP; 21 Jul 2023 04:51:46 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [RFC PATCH 5/5] app/test: add fast test suite to new build infrastructure Date: Fri, 21 Jul 2023 12:51:25 +0100 Message-Id: <20230721115125.55137-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230721115125.55137-1-bruce.richardson@intel.com> References: <20230721115125.55137-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 The fast-tests are special in that they have additional parameters associated with them. This requires script changes and meson.build changes to take account of these parameters. Signed-off-by: Bruce Richardson --- app/test/suites/meson.build | 56 +++++++++++++++++-- buildtools/get-test-suites.py | 9 +++ .../has-hugepages.py | 0 buildtools/meson.build | 1 + 4 files changed, 61 insertions(+), 5 deletions(-) rename app/test/has_hugepage.py => buildtools/has-hugepages.py (100%) diff --git a/app/test/suites/meson.build b/app/test/suites/meson.build index 135620578c..720b43eb62 100644 --- a/app/test/suites/meson.build +++ b/app/test/suites/meson.build @@ -4,20 +4,24 @@ # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 +timeout_seconds_fast = 10 + +test_no_huge_args = ['--no-huge', '-m', '2048'] +has_hugepage = run_command(has_hugepages_cmd, check: true).stdout().strip() != '0' +message('hugepage availability: @0@'.format(has_hugepage)) # process source files to determine the different unit test suites # - fast_tests # - perf_tests # - driver_tests -test_suites = run_command(get_test_suites_cmd, autotest_sources).stdout().strip().split() +test_suites = run_command(get_test_suites_cmd, autotest_sources, + check: true).stdout().strip().split() foreach suite:test_suites suite = suite.split('=') suite_name = suite[0] suite_tests = suite[1].split(',') - if suite_name == 'fast-tests' - # special fast-test handling here - - else + if suite_name != 'fast-tests' + # simple cases - tests without parameters or special handling foreach t: suite_tests test(t, dpdk_test, args: ['--', t], @@ -25,5 +29,47 @@ foreach suite:test_suites is_parallel: false, suite: suite_name) endforeach + else + # special fast-test handling here + foreach t: suite_tests + params = t.split(':') + test_name = params[0] + nohuge = params[1] == 'true' + asan = params[2] == 'true' + + test_args = [] + if nohuge + test_args += test_no_huge_args + elif not has_hugepage + continue #skip this tests + endif + if not asan and (get_option('b_sanitize') == 'address' + or get_option('b_sanitize') == 'address,undefined') + continue # skip this test + endif + + if (get_option('default_library') == 'shared' + and test_name == 'event_eth_tx_adapter_autotest') + test_args += ['-d', dpdk_drivers_build_dir] + endif + if is_linux + test_args += ['--file-prefix=@0@'.format(arg[0])] + endif + + test(test_name, dpdk_test, + args : test_args + ['--', test_name], + timeout : timeout_seconds_fast, + is_parallel : false, + suite : 'fast-tests') + if not is_windows and test_name == 'trace_autotest' + test_args += ['--trace=.*'] + test_args += ['--trace-dir=@0@'.format(meson.current_build_dir())] + test(test_name + '_with_traces', dpdk_test, + args : test_args + ['--', test_name], + timeout : timeout_seconds_fast, + is_parallel : false, + suite : 'fast-tests') + endif + endforeach endif endforeach diff --git a/buildtools/get-test-suites.py b/buildtools/get-test-suites.py index 43cde80970..95a9cad4c8 100644 --- a/buildtools/get-test-suites.py +++ b/buildtools/get-test-suites.py @@ -9,6 +9,13 @@ test_def_regex = re.compile("REGISTER_([A-Z]+)_TEST\s*\(\s*([a-z0-9_]+)") test_suites = {} +def get_fast_test_params(test_name, ln): + "Extract the extra fast-test parameters from the line" + #print(f"ln: {ln.rstrip()}, test_name: {test_name}, split: {ln.split(test_name, 1)}") + (_, rest_of_line) = ln.split(test_name, 1) + (_, nohuge, asan, _func) = rest_of_line.split(',', 3) + return f":{nohuge.strip().lower()}:{asan.strip().lower()}" + for fname in input_list: with open(fname) as f: contents = [ln for ln in f.readlines() if test_def_regex.match(ln.strip())] @@ -19,6 +26,8 @@ test_suites[suite_name].append(test_name) else: test_suites[suite_name] = [test_name] + if suite_name == "fast-tests": + test_suites["fast-tests"][-1] += get_fast_test_params(test_name, ln) for suite in test_suites.keys(): print(f"{suite}={','.join(test_suites[suite])}") diff --git a/app/test/has_hugepage.py b/buildtools/has-hugepages.py similarity index 100% rename from app/test/has_hugepage.py rename to buildtools/has-hugepages.py diff --git a/buildtools/meson.build b/buildtools/meson.build index 12e4b36165..ac5e4dcf08 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -19,6 +19,7 @@ sphinx_wrapper = py3 + files('call-sphinx-build.py') get_cpu_count_cmd = py3 + files('get-cpu-count.py') get_numa_count_cmd = py3 + files('get-numa-count.py') get_test_suites_cmd = py3 + files('get-test-suites.py') +has_hugepages_cmd = py3 + files('has-hugepages.py') binutils_avx512_check = (py3 + files('binutils-avx512-check.py') + [objdump] + cc.cmd_array())