Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 299A1C4338F for ; Fri, 23 Jul 2021 02:07:51 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60C2760E9C for ; Fri, 23 Jul 2021 02:07:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60C2760E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1CEA382C83; Fri, 23 Jul 2021 04:07:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TCVR3y63"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5D4182C5E; Fri, 23 Jul 2021 04:07:16 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 822B682BED for ; Fri, 23 Jul 2021 04:07:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x22a.google.com with SMTP id u10so332752oiw.4 for ; Thu, 22 Jul 2021 19:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/d+QqXwflmuCWjMHvfxEgMViJTVeU+MdppSXN0fgZ5s=; b=TCVR3y630RGJyXVCqJEUT/p+0pEunV65ePorP5/ciJaLKvuvuEBA00L25awT1yNeho Y2kzFaIHAPKb4TRikXskqKaIAs7QqJTD1/5IwVERRdsbqq9KyXAjEKUlMyRNyyArFgB6 Dg2hpb07yw3OXiA5Rox0Q+WrhGXKkI60XuaLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/d+QqXwflmuCWjMHvfxEgMViJTVeU+MdppSXN0fgZ5s=; b=OFQMun9DWqF7YLJ8IfB8DHmj0JQFDbPHWuU34k3Ei2LxigyFjkYhkMD1UbB7SvGbHZ l7InvqCbaofcijO8+Ximo57XPIHLuNtfWQvbLjzZ5p7RQt7gFMKAjAJBk0todB+YYIiN Hkch6w6kH48j1O7RQiudIAouTk+KgOgX+whSb3qvKevMFaoyzr2ZBn4eKzgyrPFgWAsi QveEMA1unNuUjdGzohNqN9blkG//vDD/3M9hOVv5Jpi2rTiougqEnWI5qzXmEKSIR/WC ixHa5xRKypcYTenZgYMQXWqZd3brV/JBoxOVhYvAzqNj1yCuxGqFi1I2alBqLSGycr1g 6Avg== X-Gm-Message-State: AOAM531UYjXUBEAFAAZD7dvSKd9tjyVdStmIlqpUboEsJeZHMLRMerPo ft98NVrCQAj4ckrCmfwBsTAOae3FfbJs2QCp X-Google-Smtp-Source: ABdhPJxMHYaXd4y1sh3pQL+LSyXq5CtsBoMpP5Mb7pj6x1z3ORBMTHtrV7BlqLrDe6B0ILtVb5smAQ== X-Received: by 2002:aca:bf84:: with SMTP id p126mr1725216oif.154.1627006029858; Thu, 22 Jul 2021 19:07:09 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id c18sm2665633ots.81.2021.07.22.19.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 19:07:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v2 2/4] test: Allow hush tests to run in parallel Date: Thu, 22 Jul 2021 20:07:02 -0600 Message-Id: <20210723020704.1932476-3-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog In-Reply-To: <20210723020704.1932476-1-sjg@chromium.org> References: <20210723020704.1932476-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The -z tests don't really need to be part of the main set. Separate them out so we can drop the test setup/cleans functions and thus run all tests in parallel. Signed-off-by: Simon Glass --- (no changes since v1) test/py/tests/test_hush_if_test.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/test/py/tests/test_hush_if_test.py b/test/py/tests/test_hush_if_test.py index d117921a6ac..37c1608bb22 100644 --- a/test/py/tests/test_hush_if_test.py +++ b/test/py/tests/test_hush_if_test.py @@ -119,11 +119,6 @@ subtests = ( ('test ! ! aaa != aaa -o ! ! bbb = bbb', True), ('test ! ! aaa = aaa -o ! ! bbb != bbb', True), ('test ! ! aaa = aaa -o ! ! bbb = bbb', True), - - # -z operator. - - ('test -z "$ut_var_nonexistent"', True), - ('test -z "$ut_var_exists"', False), ) def exec_hush_if(u_boot_console, expr, result): @@ -141,12 +136,6 @@ def exec_hush_if(u_boot_console, expr, result): response = u_boot_console.run_command(cmd) assert response.strip() == str(result).lower() -def test_hush_if_test_setup(u_boot_console): - """Set up environment variables used during the "if" tests.""" - - u_boot_console.run_command('setenv ut_var_nonexistent') - u_boot_console.run_command('setenv ut_var_exists 1') - @pytest.mark.buildconfigspec('cmd_echo') @pytest.mark.parametrize('expr,result', subtests) def test_hush_if_test(u_boot_console, expr, result): @@ -154,9 +143,12 @@ def test_hush_if_test(u_boot_console, expr, result): exec_hush_if(u_boot_console, expr, result) -def test_hush_if_test_teardown(u_boot_console): - """Clean up environment variables used during the "if" tests.""" - +def test_hush_z(u_boot_console): + """Test the -z operator""" + u_boot_console.run_command('setenv ut_var_nonexistent') + u_boot_console.run_command('setenv ut_var_exists 1') + exec_hush_if(u_boot_console, 'test -z "$ut_var_nonexistent"', True) + exec_hush_if(u_boot_console, 'test -z "$ut_var_exists"', False) u_boot_console.run_command('setenv ut_var_exists') # We might test this on real filesystems via UMS, DFU, 'save', etc. -- 2.32.0.432.gabb21c7263-goog