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 734CEC433F5 for ; Sun, 19 Sep 2021 21:15:37 +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 BE5D360FED for ; Sun, 19 Sep 2021 21:15:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE5D360FED 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 5504283223; Sun, 19 Sep 2021 23:15: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="DszpolAw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A72D8322E; Sun, 19 Sep 2021 23:15:11 +0200 (CEST) Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) (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 7EAE782DA1 for ; Sun, 19 Sep 2021 23:14:58 +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-ot1-x334.google.com with SMTP id 97-20020a9d006a000000b00545420bff9eso13950684ota.8 for ; Sun, 19 Sep 2021 14:14:58 -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=3RMuou2z54ncgVGP1YZ/uRSQR0wTi/F9Vl9JMiqNElQ=; b=DszpolAwBAyDGcxbFYUgMZtz66+yDhjhlUtr1eUh4yGccF6D3DeAH1gf2e09+X6iu2 rzNoUe8k6F3V3Q8BCOtg6QoCxC1yqt1a92vL4jwGfmDbC7c0SzJamxh76j1c4P1+2muF hvV5ZPCkePp9nUrxOjTMRpyT1w3kPA3P3UbwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3RMuou2z54ncgVGP1YZ/uRSQR0wTi/F9Vl9JMiqNElQ=; b=HHTmGNy33dLVgBLAAt9aQ9PConSiDbZ+72e7auupXNkNDfLNUd9r4+mNxIvKQnsT61 wpGWUqCIbihYymwx/ejfquT9PtYl9YqsO42wu5/rcG46xmnbK6aHvasGKipti+jNON5J CKWNpv5aEpcxthe8oqBBeT73WXxsSOd5+E0CsgpBhSdaD+LHKJp+00jLrD5FYdasuuFN Juf3BIgVisuWcq2XpGH3PmaVDDKVsIsCKIFdqbc/mWMaQySnEaRKZr/2au+sRQI/WqTE WARGLkqV3ahDi4IM3vZEH4PHZ54ILL3CXYK9sqVEPEDoAA7iepfC9AL9sdxppQ/PrJ9e nLFA== X-Gm-Message-State: AOAM532hdzYL8voMc2nIvTVsTdq5ycOGM13u2DJvoK9W2oIxtfGd6u+f S4T749+I2tg+r29c7xwiBJNnl5+IcwSoqQ== X-Google-Smtp-Source: ABdhPJynNHz5pWxex5n28TEsMLiZwaYdyMLvKPBvsIHdFfmA7SqB1KKS2djwQ+U2NxlnH1KhpG3h8A== X-Received: by 2002:a05:6830:3113:: with SMTP id b19mr15442217ots.189.1632086096844; Sun, 19 Sep 2021 14:14:56 -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 b11sm3082118ooi.0.2021.09.19.14.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 14:14:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Stephen Warren , Stephen Warren , Simon Glass Subject: [RESEND PATCH v2 2/4] test: Allow hush tests to run in parallel Date: Sun, 19 Sep 2021 15:14:49 -0600 Message-Id: <20210919211451.3825645-3-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog In-Reply-To: <20210919211451.3825645-1-sjg@chromium.org> References: <20210919211451.3825645-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.33.0.464.g1972c5931b-goog