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 4C6DFC4332F for ; Thu, 13 Oct 2022 12:33:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 076A684F66; Thu, 13 Oct 2022 14:31:24 +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="WrWqmSeR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1E2D784F26; Thu, 13 Oct 2022 14:30:40 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 BB1D984F33 for ; Thu, 13 Oct 2022 14:30:22 +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-io1-xd2a.google.com with SMTP id r142so1156545iod.11 for ; Thu, 13 Oct 2022 05:30:22 -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 :message-id:reply-to; bh=XZRS3a1jzXxsczqQtwTlzsFaFX/c0jrazEVgnkWpPi8=; b=WrWqmSeRinxON7t3WQRBCu7zgzU9zTuz7peDFoL29+LJTny1k9jTREptzluXxJkgZQ 1hFJA+J8AYwg73zkAa+aj0kDCyuD2wiP89ciVkcaw8UzXb4ZhtjnmQOoDFvNfowENaAj seSri3/w06kHhwtbji1X5EOI6bfVPlGQy1RVw= 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:message-id:reply-to; bh=XZRS3a1jzXxsczqQtwTlzsFaFX/c0jrazEVgnkWpPi8=; b=zg31etxEAa4EgB4Cuytlgjkt6yLjRZ+jLNsq45/N+FmZunoKzjprc80RqIPyxdduSm PpE0mAaFv8KSvGRNjWQHYb02xq+TycWWtJkjgcEl4O9M0QE7RUah7e00Z5gClg1CizVy fiT/NIAvnWQm+C5eRU/nRCTI8/iGU0OK3849/BrArFIN92HHahV1G0GvHWq2eBcRKVa/ ZwHTSBPgAOP8KUIfLpGZmSLwCTZXJDbQnlOG8TZ6phl+kZnlw8LGpSzuioNaog3HA+6A RCj3yzydGS1u0vRjzZgP+ZNj7ktLwI5xVPzwA9QuWARms2ErpLzgW9GMpT59vTusW3ld DMmw== X-Gm-Message-State: ACrzQf15XVAbRZGEKQ31gwppoXaH69Zm8oDQdloyQKLpEKJdATg+34DN eHh5ZTVquatVr76LsmlRNdepSl6trv4GjQ== X-Google-Smtp-Source: AMsMyM4gJnQuNRI0KlVAvinDkrfpFX3vCpGkdWeYTuOiMKVnZAqJdPEw7ZTbYniPTmfh1JXC2QcHcA== X-Received: by 2002:a02:c054:0:b0:363:839d:3e2a with SMTP id u20-20020a02c054000000b00363839d3e2amr17792460jam.121.1665664220513; Thu, 13 Oct 2022 05:30:20 -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 a9-20020a027a09000000b003635ab4a7b7sm7321626jac.3.2022.10.13.05.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 05:30:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 13/45] test: Update tests to use the skip feature Date: Thu, 13 Oct 2022 06:28:55 -0600 Message-Id: <20221013122927.636867-14-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221013122927.636867-1-sjg@chromium.org> References: <20221013122927.636867-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 --- (no changes since v1) 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.38.0.rc1.362.ged0d419d3c-goog