From patchwork Wed Sep 25 14:55:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1167365 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JipakcuO"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46dhPL5WSzz9sP3 for ; Thu, 26 Sep 2019 01:12:22 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5D0D6C2204C; Wed, 25 Sep 2019 15:09:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 15741C220ED; Wed, 25 Sep 2019 14:59:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D37C8C21FE3; Wed, 25 Sep 2019 14:59:23 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id B1801C22003 for ; Wed, 25 Sep 2019 14:58:14 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id h144so14589980iof.7 for ; Wed, 25 Sep 2019 07:58:14 -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=/yt6esa16+pfXq7v18/eX6THLo9pmxNNWkg0ysPmdZ0=; b=JipakcuOhASRnn8z/pQdIlvT7KDt1gk0243Fd9n74EBKJdKgD8tOgsUzIZhIufNWnx DnUn2bV/xXZcfD0ydHKJ/Qfj5Ts3QwiTVK6l5/Kkd7miPZa4T4eto35F5faK0Mfs52Ds v6SNezi64pLk2HWivKdzOAB6NSDROQUryRAWI= 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=/yt6esa16+pfXq7v18/eX6THLo9pmxNNWkg0ysPmdZ0=; b=G/IahchBbdZ6cDYSmj2zxdEmkBpwg9MthRZDMvMzR02Si+lDmpFSKrWqzyvb/RoFg3 F8ssLSPFaC6vilITMXfuRhC7xXmA7pURJAJpFrmgAnCQ6vuq0ah94vVglB0YKLZ053BL Tuiiy30iJB7rUJG0ATpQb/MeO4q+Ip/2qo1LXO7B7s6d3kURKc3BKbCKR7QBombKDE32 7nXxdUSXw+DlsKzbsQpsctKsw223IOBoLa1iYWpCPxjlcp2YO/Zdg3PtZvv2CoXLmKHn zm0RfBMyg6caRxQvwN1FuHiCnNduKJTQ9K1IImPGAu8IdfiMMVO9wJm7QvsP4dDGYnKH I9vg== X-Gm-Message-State: APjAAAX70j9HSfn2++b0GlxocpLHy+rtqzO7QvaZ1XY6h5Bl98emlh4J Cgf0N1KZmaBWP92U4a4bWiQ2jP0S01k= X-Google-Smtp-Source: APXvYqwKbEdr/g+mPpa7QDLYpLuABG5B9osX5ZNlhKncGwatsCxEOfMlENET56I+Q9sz//KGfs+g+Q== X-Received: by 2002:a05:6638:928:: with SMTP id 8mr5456178jak.124.1569423493340; Wed, 25 Sep 2019 07:58:13 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id d9sm4254964ioq.9.2019.09.25.07.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 07:58:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 25 Sep 2019 08:55:51 -0600 Message-Id: <20190925145750.200592-8-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog In-Reply-To: <20190925145750.200592-1-sjg@chromium.org> References: <20190925145750.200592-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Pavel Herrmann Subject: [U-Boot] [PATCH 007/126] dm: test: Fix running of multiple test from command line X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" At present when multiple 'ut dm' commands are executed, all but the first is run with a flat tree, even if live tree is enabled. This is because the live tree node pointer is set to NULL and never restored. This does not affect normal test running, which just runs all the test in one go, but can be confusing when several individual tests are run during the same U-Boot run. Correct this by restoring the pointer. Fixes: c166c47ba3 (dm: test: Add support for running tests with livetree) Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- test/dm/test-main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 5d79ce641d7..487d8b96275 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -188,8 +188,12 @@ static int dm_test_main(const char *test_name) else printf("Failures: %d\n", uts->fail_count); + /* Put everything back to normal so that sandbox works as expected */ +#ifdef CONFIG_OF_LIVE + gd->of_root = uts->of_root; +#endif gd->dm_root = NULL; - ut_assertok(dm_init(false)); + ut_assertok(dm_init(IS_ENABLED(CONFIG_OF_LIVE))); dm_scan_platdata(false); dm_scan_fdt(gd->fdt_blob, false);