From patchwork Sun Jun 23 20:31:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1951330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=BpLrDd92; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W6jTn5hnjz1ydW for ; Mon, 24 Jun 2024 06:33:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 45870883B1; Sun, 23 Jun 2024 22:32:23 +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="BpLrDd92"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 73CEA8837A; Sun, 23 Jun 2024 22:32:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 E26F1884BE for ; Sun, 23 Jun 2024 22:32:19 +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-x141.google.com with SMTP id e9e14a558f8ab-375daa47685so16517835ab.0 for ; Sun, 23 Jun 2024 13:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1719174738; x=1719779538; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5QXyZWkpsl3TboluHjT4040WFeVkOKOb0Wj/c1dKvCc=; b=BpLrDd92uKQnU1p5N4htxq1dDyZhNuMS2ViuxqRjf+pM6FMaBVX8nM0o/HO9JWr2BU X6ZuCNhx0yui2scqcT8Wkrm4qtrfIkp4XQZgsj8WhkxjSFDnetvX7/c6CJ3jiA8YfXX8 mXCswEkAj0MHubaipVsFKXa/H/TGteoXuuOww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719174738; x=1719779538; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5QXyZWkpsl3TboluHjT4040WFeVkOKOb0Wj/c1dKvCc=; b=tifHFbRCtPKlBpcb9/pv9WKsMRvc6VxggQkgfJ4PBRn3TR8OTWNhRKlxrxmSW9cDJg fhb2Af+sMn6VR1rx8B7Y7om8U/mI3saGXsMmWBOyjUdUkl59bi7YZ2utw7JiIFFM4Jb/ gtfi7SELh3BcCsBxpE/+89IayEH+ZSwp8lB1rXhKa5UN4AH9idorFCVsb8wTZTV0abEM sX4GpSQF+uh3ch+gQSGG643mU58yWVLks2FiUlWjdyjaRcWR/G8qRuoBzE+Ps0KE/HdZ L5D8Bz8Ei0sBYBcLLeHrEnVk5DaoWJciFvB9rJxxh0gCo/WpoZjJau9wsXHXbVxPFwyg tOJA== X-Gm-Message-State: AOJu0Yzi3ZpKcwTqDunLpEe6XiqnuYLRyJO2I9dHyPHzO25NhqgePcoa N4FVpQ8aNL3GP3O1chzjb9qQKWJcX3ELV1C1di4C6wVGgpw8LjdPy6dqmsXiZP03w5aEjZ7Bikg wtYqB X-Google-Smtp-Source: AGHT+IFTSVj52jxVI86Wd5OxP+8lb+1Dn6LdlZ8ZatedDVfAMn2dei3DJn1DvuGve6Y3uoyhBDetug== X-Received: by 2002:a05:6e02:1a28:b0:375:a50d:7f45 with SMTP id e9e14a558f8ab-3763f5ae01fmr34741215ab.1.1719174738489; Sun, 23 Jun 2024 13:32:18 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3763374634asm12016765ab.52.2024.06.23.13.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jun 2024 13:32:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andrejs Cainikovs , Bin Meng , Leo Yu-Chi Liang , Love Kumar , Marek Vasut , Sean Anderson Subject: [PATCH v3 00/19] labgrid: Provide an integration with Labgrid Date: Sun, 23 Jun 2024 14:31:54 -0600 Message-Id: <20240623203213.1571666-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Labgrid provides access to a hardware lab in an automated way. It is possible to boot U-Boot on boards in the lab without physically touching them. It relies on relays, USB UARTs and SD muxes, among other things. By way of background, about 4 years ago I wrong a thing called Labman[1] which allowed my lab of about 30 devices to be operated remotely, using tbot for the console and build integration. While it worked OK and I used it for many bisects, I didn't take it any further. It turns out that there was already an existing program, called Labgrid, which I did not know about at time (thank you Tom for telling me). It is more rounded than Labman and has a number of advantages: - does not need udev rules, mostly - has several existing users who rely on it - supports multiple machines exporting their devices It lacks a 'lab check' feature and a few other things, but these can be remedied. On and off over the past several weeks I have been experimenting with Labgrid. I have managed to create an initial U-Boot integration (this series) by adding various features to Labgrid[2] and the U-Boot test hooks. I hope that this might inspire others to set up boards and run tests automatically, rather than relying on infrequent, manual test. Perhaps it may even be possible to have a number of labs available. Included in the integration are a number of simple scripts which make it easy to connect to boards and run tests: ub-int Build and boot on a target, starting an interactive session ub-cli Build and boot on a target, ensure U-Boot starts and provide an interactive session from there ub-smoke Smoke test U-Boot to check that it boots to a prompt on a target ub-bisect Bisect a git tree to locate a failure on a particular target ub-pyt Run U-Boot pytests on a target Some of these help to provide the same tbot[4] workflow which I have relied on for several years, albeit much simpler versions. The goal here is to create some sort of script which can collect patches from the mailing list, apply them and test them on a selection of boards. I suspect that script already exists, so please let me know what you suggest. I hope you find this interesting and take a look! [1] https://github.com/sjg20/u-boot/tree/lab6a [2] https://github.com/labgrid-project/labgrid/pull/1411 [3] https://github.com/sjg20/uboot-test-hooks/tree/labgrid [4] https://tbot.tools/index.html Changes in v3: - Split out most patches into two new series and update cover letter Changes in v2: - Only disable echo if a terminal is detected - Avoid running a docker image for skipped lab tests Simon Glass (19): test: Allow signaling that U-Boot is ready test: Use a constant for the test timeout test: Pass stderr to stdout test: Release board after tests complete test: Allow connecting to a running board test: Avoid failing skipped tests test: Create a common function to get the config test: Introduce the concept of a role test: Move the receive code into a function test: Separate out the exception handling test: Detect dead connections test: Tidy up remaining exceptions test: Introduce lab mode test: Improve handling of sending commands test: Fix mulptiplex_log typo test: Avoid double echo when starting up test: Try to shut down the lab console gracefully test: Add a section for closing the connection CI: Allow running tests on sjg lab .gitlab-ci.yml | 153 +++++++++++++++++++++++++ test/py/conftest.py | 86 +++++++++++--- test/py/u_boot_console_base.py | 154 ++++++++++++++++++-------- test/py/u_boot_console_exec_attach.py | 31 ++++-- test/py/u_boot_spawn.py | 120 +++++++++++++++++--- test/test-main.c | 16 ++- 6 files changed, 470 insertions(+), 90 deletions(-)