From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7236574603632443392 X-Received: by 2002:a25:b989:0:b0:ba8:58c8:38f7 with SMTP id r9-20020a25b989000000b00ba858c838f7mr9684906ybg.11.1684896323854; Tue, 23 May 2023 19:45:23 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:6043:0:b0:bab:e249:d2a0 with SMTP id u64-20020a256043000000b00babe249d2a0ls5268820ybb.0.-pod-prod-02-us; Tue, 23 May 2023 19:45:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6OoSOV3jbCyyCWvHVRR5LvabBBY29Xui53LQq0sfhFu3aib4Pbq45C4Ko+UR2X0eAXIuJ5 X-Received: by 2002:a25:ea03:0:b0:ba7:7664:916b with SMTP id p3-20020a25ea03000000b00ba77664916bmr15035654ybd.20.1684896322764; Tue, 23 May 2023 19:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684896322; cv=none; d=google.com; s=arc-20160816; b=XmOU6gApfXrt/hA/GVom8EQXlGs/YQhoHctjg6O3fEqFNyKY0tKHFqy2FCJH15XvOy XzaHVyn24PtRqn6r6hqYiS0EpBV3HAFH41vjAdNsI3wHzY/BpTY38wTffIkDbWSrKmDd jzJG1DJLV6sHpdmNiLXOlS+bDJnyEpeJ1ENKgYu3ZHN+TyVIa28w805RI7t6Bb1KYM/L iwhnPofsClKdcgb0XyGHnlMYa8IDspsphPcnAHIEhwhz1048oxTXqTSPsOuA99r3Tmcb GjrHzN3CbsxQ5Ogpg68lg4aKq9ve0Gr3chMguO9w/IM6WtDZfWaTU3DoWvSDI8gFvelu t51g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=dGzlkquyZH6QNioAHV+Zq63sUGWDtGf2iqir5iKra+8=; b=dpkwvCQW5UVBOuf64KLfHAvHWw6wIcHBwS9ByXrSCsZi1HyIpMWrjzyCbZtZAh4JVs ZIZCHcLh4d4gRF1mygpbQ/0QhgtNBw1WCGkw+RS5YoFiw7TeOCvDQkzHQNHJWo1HNHn1 VBtowdEeb67CjK4x7YUZmn4PY1MRZ/2XXNG51WqhLuHEMb8kFIKX+88LSTJX2B3rseFX ukjwWS+8oZ2T4FT6IN0YSXhL4Rj1/OynLYhrgSsbBJb17gbyp3Ys9p4H/GqU9oReiKcH 6TUOqCY9FBLvg2+Ygfq5YS/ybUJVOaEEDTbCWe3MC1wpwiKM3BhOEV64qpZrXOtwPI/3 CWFA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id f186-20020a251fc3000000b00ba6a57f8334si731280ybf.1.2023.05.23.19.45.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 19:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 34O2jEc8032413 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 24 May 2023 04:45:16 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH 4/4] testsute: Provide an example of hardware test Date: Wed, 24 May 2023 04:45:14 +0200 Message-Id: <20230524024514.17042-5-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230524024514.17042-1-ubely@ilbers.de> References: <20230524024514.17042-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: T0MR6Fm6fk0C The example is tested with Raspberry Pi 3 B+. Signed-off-by: Uladzimir Bely --- meta-isar/test/README.md | 24 ++++++++++++++++--- meta-isar/test/run_test_hw.sh | 10 ++++++++ meta-isar/test/sample_kas_config_hw.yml | 32 +++++++++++++++++++++++++ meta-isar/test/sample_test_hw.py | 13 ++++++++++ 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100755 meta-isar/test/run_test_hw.sh create mode 100644 meta-isar/test/sample_kas_config_hw.yml create mode 100755 meta-isar/test/sample_test_hw.py diff --git a/meta-isar/test/README.md b/meta-isar/test/README.md index f8c6338c..4619aaae 100644 --- a/meta-isar/test/README.md +++ b/meta-isar/test/README.md @@ -1,16 +1,34 @@ -# Example of the downstream testcase +# Common requirements Use `meta-isar/test/` as working directory. Make sure `kas-container` is available in $PATH (look at https://github.com/siemens/kas for it). -Build an image: +# Example of the downstream qemu-based testcase + +1. Build an image: ``` kas-container build sample_kas_config.yml ``` -Run testcase: +2. Run testcase: ``` kas-container shell sample_kas_config.yml -c '/work/run_test.sh' ``` + +# Example of the downstream hardware testcase (example for RPi 3b+) + +1. Build an image: + +``` +kas-container build sample_kas_config.yml +``` + +2. Flash resulted wic image to SD-card and boot the board + +3. Run testcase (adjust `host` to RPi's IP address): + +``` +kas-container shell sample_kas_config_hw.yml -c "/work/run_test_hw.sh -p host=192.168.100.117" +``` diff --git a/meta-isar/test/run_test_hw.sh b/meta-isar/test/run_test_hw.sh new file mode 100755 index 00000000..a72c0204 --- /dev/null +++ b/meta-isar/test/run_test_hw.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +test_dir=$(dirname $(realpath $0)) + +. ${test_dir}/common.sh + +# Run SSH tests +avocado run --max-parallel-tasks=1 /work/sample_test_hw.py -p test_script_dir=${test_dir} -p host=rpi $@ diff --git a/meta-isar/test/sample_kas_config_hw.yml b/meta-isar/test/sample_kas_config_hw.yml new file mode 100644 index 00000000..69afc9c3 --- /dev/null +++ b/meta-isar/test/sample_kas_config_hw.yml @@ -0,0 +1,32 @@ +header: + version: 11 + +build_system: isar + +distro: raspios-bullseye +machine: rpi-arm-v7 +target: mc:rpi-arm-v7-bullseye:isar-image-ci +repos: + isar: + url: "https://github.com/ilbers/isar.git" + refspec: next + layers: + meta: + meta-isar: + +bblayers_conf_header: + standard: | + BBPATH = "${TOPDIR}" + BBFILES ?= "" + +local_conf_header: + standard: | + DISTRO_ARCH ??= "armhf" + PATCHRESOLVE = "noop" + + USERS += "root" + USER_root[password] ??= "$6$rounds=10000$RXeWrnFmkY$DtuS/OmsAS2cCEDo0BF5qQsizIrq6jPgXnwv3PHqREJeKd1sXdHX/ayQtuQWVDHe0KIO0/sVH8dvQm1KthF0d/" + crossbuild: | + ISAR_CROSS_COMPILE = "1" + ccache: | + USE_CCACHE = "1" diff --git a/meta-isar/test/sample_test_hw.py b/meta-isar/test/sample_test_hw.py new file mode 100755 index 00000000..47735823 --- /dev/null +++ b/meta-isar/test/sample_test_hw.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +from cibase import CIBaseTest + +class SampleHwTest(CIBaseTest): + def test_sample_script(self): + self.init("/build") + + host = self.params.get('host', default='raspberry') + port = self.params.get('port', default='22') + + self.ssh_start(user='ci', host=host, port=port, + script='sample_script.sh') -- 2.20.1