From patchwork Wed Jul 13 21:24:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 14826 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7D7B54A65; Wed, 13 Jul 2016 23:24:22 +0200 (CEST) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id AEBA637A4 for ; Wed, 13 Jul 2016 23:24:18 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id f65so44611633wmi.0 for ; Wed, 13 Jul 2016 14:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=lgdKBOvICPjfhwM/m2Sd/tfKplCymL5PEIJBNF71RAM=; b=mgeSufBY+zbUetgOodA3PYcznXuZDoTxLX3cjkzcvV+K0O8sjfvghdLYCsTe1Bfk6O G0DAeh6a/TexZiRpn5TzPmi44ERQNJ6ivQp4I0cWrGjzSob5DkMiK0+Ug0pNhz7SmafC Js1NWR56pJKT6ND1zlwcagBIy/Kmp4wgpVleUTwV1XRsq3MAk6l6S/1Ye4r+vPMZXp7z 4XaAASEe9GOUGOeYdQGaVyR+a2fEZWrfvnJmfoaCT7E9L6z2B3tt3B6bVTqVtjLx2Enx u7mGOBPFOyQc714Lbfu75SJsaTReavYmzvPYbgfKYVTryeDsaBiKpSQZZ/x27+kdIqyK FrGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lgdKBOvICPjfhwM/m2Sd/tfKplCymL5PEIJBNF71RAM=; b=M2p5bd95YKcu8kZT5Gisa0P1y8AsB8N6LTKiXgy8H/uG3rElS6oaEhYyvo5EfNLIpS Up8GPtdsoN+J7Rvf0BU/SESAsqbPkBPgurJJ4jSNL9fVJn5ZtKqcCj66hpkEFFocwuOk gELb44ZtXZob+njdFVDfTTxwv+rcR7JayecK7bDtmQrAZGn26dyNuDrC1TsYWY89Nqic UyWLbXNShE86Wswd2kwemlGP6mlCPstatNDOWbUAlJGGPnoVn7mjQF7wJfrzSGXtP6Ee 2XD3TudbsM3HK/q8oS/2hEKi40x3ad4h+xyaUSzXIaujEsMLWBXx1ryHDn6bn8Nhz14J Iviw== X-Gm-Message-State: ALyK8tKvZWpDGp5f/Q4McOvPRksM+q4FnNy7LxrUt/lAOlYRcNnXDLEe8ICQ6XzYwvBD8Yd2 X-Received: by 10.28.46.22 with SMTP id u22mr11779618wmu.85.1468445058297; Wed, 13 Jul 2016 14:24:18 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id dq2sm2704119wjb.16.2016.07.13.14.24.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jul 2016 14:24:17 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 13 Jul 2016 23:24:10 +0200 Message-Id: <1468445050-1081-2-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1468445050-1081-1-git-send-email-thomas.monjalon@6wind.com> References: <1468445050-1081-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH 2/2] app/test: filter out unavailable tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some tests can fail to run because they are not compiled. It has been more visible recently when the PCI test became disabled in the default configuration because of dependency on libarchive: PCI autotest: Fail [Not found] The autotest script catch them and do not count them as an error anymore: PCI autotest: Skipped [Not Available] The commands dump_ring and dump_mempool are removed from the autotest list because they are some internal commands but not some registered tests. Thus they cannot be parsed as available test commands. Signed-off-by: Thomas Monjalon --- app/test/autotest_data.py | 12 ------------ app/test/autotest_runner.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index 1e6b422..c69705e 100644 --- a/app/test/autotest_data.py +++ b/app/test/autotest_data.py @@ -99,18 +99,6 @@ parallel_test_group_list = [ "Func" : default_autotest, "Report" : None, }, - { - "Name" : "Dump rings", - "Command" : "dump_ring", - "Func" : dump_autotest, - "Report" : None, - }, - { - "Name" : "Dump mempools", - "Command" : "dump_mempool", - "Func" : dump_autotest, - "Report" : None, - }, ] }, { diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index 291a821..bd99e19 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -33,7 +33,7 @@ # The main logic behind running autotests in parallel -import multiprocessing, sys, pexpect, time, os, StringIO, csv +import multiprocessing, subprocess, sys, pexpect, re, time, os, StringIO, csv # wait for prompt def wait_prompt(child): @@ -105,6 +105,11 @@ def run_test_group(cmdline, test_group): results.append((0, "Success", "Start %s" % test_group["Prefix"], time.time() - start_time, startuplog.getvalue(), None)) + # parse the binary for available test commands + binary = cmdline.split()[0] + symbols = subprocess.check_output(['nm', binary]).decode('utf-8') + avail_cmds = re.findall('test_register_(\w+)', symbols) + # run all tests in test group for test in test_group["Tests"]: @@ -124,7 +129,10 @@ def run_test_group(cmdline, test_group): print >>logfile, "\n%s %s\n" % ("-"*20, test["Name"]) # run test function associated with the test - result = test["Func"](child, test["Command"]) + if test["Command"] in avail_cmds: + result = test["Func"](child, test["Command"]) + else: + result = (0, "Skipped [Not Available]") # make a note when the test was finished end_time = time.time()