From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8F783C54EE9 for ; Sun, 25 Sep 2022 15:08:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3BF9484D8F; Sun, 25 Sep 2022 17:04:40 +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="NVP6U/5L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63A2A84C4B; Sun, 25 Sep 2022 17:03:50 +0200 (CEST) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 1DA2F84C38 for ; Sun, 25 Sep 2022 17:03:46 +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-il1-x130.google.com with SMTP id d14so2426098ilf.2 for ; Sun, 25 Sep 2022 08:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=94Qykj49SiAb2BbHCZmYGVayazWr3Q/KV5TNjgWvJgg=; b=NVP6U/5LOAaUkg5ff0mQNqaEQSzdb7GnFq1O/TCUit+7CvKdOgguXm0eudyvXh9k/U 6Qf+6zLvvvrXido9g2jh22HykhYT1vc578Rd2U3tTy/HB3CQLKDj7W4bzTNgPd0HQXzJ BHMFV82MJ+vQCd/Frs0beOzy7GEtpYdkH5dKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=94Qykj49SiAb2BbHCZmYGVayazWr3Q/KV5TNjgWvJgg=; b=xdGaZ3Dol+hxHrPSKBj7LK04bRQPV/6j+eYJpM6T3rr9SsfmzRX0oPC7mlX7m5EqlY B5MRdxi15DVXn9IMc89EfIyA8Vgruhe2hu/nKjPTSVAqWNCaDDaT+kC3bMCP+Iv/hXKA Ab6UCasFQqbcDoj2zaBT/kO8J/NomG1pe6NVvliYSdjpM9qWfbZZzpTFM6a3lMMZ39VO rGECDtb8HKIDy1TiG3y/JpgLATqecSFkJeC4lr/yiDIO2p+ru5Xspo+t2j8l9wzqncaV ZqaHsCSyJMbjmpzu8DpTwSpma0d77wRGFmoOkZmPsf9NGa/fDfwVWWb5Bl2LO474Mtlz 3MGQ== X-Gm-Message-State: ACrzQf2isz6YOQzJQhXlZmDSKfpLq/7HLuFKNN27NmRTZG/NtYCl9CQe wm0K+eBUiId8euF37eNtLiNkIqpBRE4Q9Q== X-Google-Smtp-Source: AMsMyM4KQ6ssr/EdVmDlvBGGL2fwJWig6nsy4l44ngjbD+xIXv3BvzfWWJv8E4Exfzv2U7sj+ZEIVw== X-Received: by 2002:a05:6e02:1522:b0:2f5:d59c:8639 with SMTP id i2-20020a056e02152200b002f5d59c8639mr8260410ilu.311.1664118215495; Sun, 25 Sep 2022 08:03:35 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id u19-20020a926013000000b002f19d9838c6sm5360578ilb.25.2022.09.25.08.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 08:03:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 24/45] test: Update tests to use the skip feature Date: Sun, 25 Sep 2022 09:02:27 -0600 Message-Id: <20220925150248.2524421-25-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog In-Reply-To: <20220925150248.2524421-1-sjg@chromium.org> References: <20220925150248.2524421-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Some tests currently return 0 when they want to be skipped. Update them to return -EAGAIN instead, so they are counted as skipped. A few tests are in two parts, with the latter part being skipped in certain situations. Split these into two and use the correct condition for the second part. Signed-off-by: Simon Glass --- test/boot/bootflow.c | 4 ++-- test/boot/bootmeth.c | 13 ++++++++++--- test/boot/vbe_fixup.c | 2 +- test/dm/of_platdata.c | 2 +- test/dm/ofnode.c | 25 +++++++++++++++---------- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 1e8ea754bcd..e1e07082105 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -330,7 +330,7 @@ static int bootflow_system(struct unit_test_state *uts) struct udevice *dev; if (!IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR)) - return 0; + return -EAGAIN; ut_assertok(uclass_get_device_by_name(UCLASS_BOOTMETH, "efi_mgr", &dev)); sandbox_set_fake_efi_mgr_dev(dev, true); @@ -395,7 +395,7 @@ BOOTSTD_TEST(bootflow_iter_disable, UT_TESTF_DM | UT_TESTF_SCAN_FDT); static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts) { if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) - return 0; + return -EAGAIN; ut_assertok(bootstd_test_drop_bootdev_order(uts)); diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c index fb627313396..f2d3a5f3cc4 100644 --- a/test/boot/bootmeth.c +++ b/test/boot/bootmeth.c @@ -103,10 +103,17 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) ut_asserteq_str("efi syslinux", env_get("bootmeths")); ut_assert_console_end(); - /* Try with global bootmeths */ + return 0; +} +BOOTSTD_TEST(bootmeth_cmd_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootmeth order' command with global bootmeths */ +static int bootmeth_cmd_order_glob(struct unit_test_state *uts) +{ if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) - return 0; + return -EAGAIN; + console_record_reset_enable(); ut_assertok(run_command("bootmeth order \"efi firmware0\"", 0)); ut_assert_console_end(); ut_assertok(run_command("bootmeth list", 0)); @@ -122,7 +129,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_cmd_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_cmd_order_glob, UT_TESTF_DM | UT_TESTF_SCAN_FDT); /* Check 'bootmeths' env var */ static int bootmeth_env(struct unit_test_state *uts) diff --git a/test/boot/vbe_fixup.c b/test/boot/vbe_fixup.c index 1b488e25ab6..7f0f809499a 100644 --- a/test/boot/vbe_fixup.c +++ b/test/boot/vbe_fixup.c @@ -26,7 +26,7 @@ static int vbe_test_fixup(struct unit_test_state *uts) * flat tree, since device tree fix-ups do not yet support live tree. */ if (!working_fdt) - return 0; + return -EAGAIN; tree = oftree_from_fdt(working_fdt); ut_assert(oftree_valid(tree)); diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c index 7af798b8d35..a241c427936 100644 --- a/test/dm/of_platdata.c +++ b/test/dm/of_platdata.c @@ -150,7 +150,7 @@ static int dm_test_of_plat_dev(struct unit_test_state *uts) /* Skip this test if there is no platform data */ if (!CONFIG_IS_ENABLED(OF_PLATDATA_DRIVER_RT)) - return 0; + return -EAGAIN; /* Record the indexes that are found */ memset(found, '\0', sizeof(found)); diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index 41811ec3bb5..8077affabb7 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -753,10 +753,7 @@ static int make_ofnode_fdt(struct unit_test_state *uts, void *fdt, int size, static int dm_test_ofnode_root(struct unit_test_state *uts) { - char fdt[256]; - oftree tree; ofnode node; - int ret; /* Check that aliases work on the control FDT */ node = ofnode_get_aliases_node("ethernet3"); @@ -765,14 +762,22 @@ static int dm_test_ofnode_root(struct unit_test_state *uts) ut_assert(!oftree_valid(oftree_null())); - ut_assertok(make_ofnode_fdt(uts, fdt, sizeof(fdt), 0)); - ret = get_oftree(uts, fdt, &tree); + return 0; +} +DM_TEST(dm_test_ofnode_root, UT_TESTF_SCAN_FDT); - /* skip the rest of this test if multiple FDTs are not supported */ - if (ret == -EOVERFLOW) - return 0; +static int dm_test_ofnode_root_mult(struct unit_test_state *uts) +{ + char fdt[256]; + oftree tree; + ofnode node; - ut_assertok(ret); + /* skip this test if multiple FDTs are not supported */ + if (!IS_ENABLED(CONFIG_OFNODE_MULTI_TREE)) + return -EAGAIN; + + ut_assertok(make_ofnode_fdt(uts, fdt, sizeof(fdt), 0)); + ut_assertok(get_oftree(uts, fdt, &tree)); ut_assert(oftree_valid(tree)); /* Make sure they don't work on this new tree */ @@ -791,7 +796,7 @@ static int dm_test_ofnode_root(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_root, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_root_mult, UT_TESTF_SCAN_FDT); static int dm_test_ofnode_livetree_writing(struct unit_test_state *uts) { -- 2.37.3.998.g577e59143f-goog