From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 12 Dec 2025 16:43:07 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ej1-f57.google.com (mail-ej1-f57.google.com [209.85.218.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5BCFh6CP028427 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 12 Dec 2025 16:43:06 +0100 Received: by mail-ej1-f57.google.com with SMTP id a640c23a62f3a-b79ff23157fsf150293166b.2 for ; Fri, 12 Dec 2025 07:43:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1765554181; cv=pass; d=google.com; s=arc-20240605; b=hK05Q5i8aaQtkiHyl8h0XS0EO5gI5SnNocKBYLmJhe1s63eFc6psOSwvRskF9Rc60L 4au7E8tLqSQUPBf+/KWKbSDQOd9pUZurhzddaGnUQNep1LRVVrl216FDwpcnUk4oARxK TFA7p2u8TIGy3d0s/dX9hsUZtad8BVFv5tJl5/rkCWG6ORBBMcDZ4dIgcqCFRE7ZrW7S yCCwrrnLLX1T5bzp5jpno8+0hxeJBB/99rIj3qrX/UyioG274knG24DXsUoyx99W3IaF PyjFUr/ILnd3p/39PY4olKNeb1BThR3N2TvI39APN1qP1yx4BM6DvQGfQMMQf1vGwunV 4Qdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:sender:dkim-signature; bh=vV8SjmlNmhec/DxBcq/klVwlQLbXRsXf4npSWDbI8yc=; fh=cfhMeRpohVlhZ+akzDWENgwV4XjUwyJG9QardM3iZb4=; b=ZxKO0BqOUQB9pNw87zBRsp1W1HmUbaevLe5QN918ctTWSWKdkmxSOPe/x7rYqMR/3+ jwHvZ6llW9l2ANPv9oK4tl/4Im2RKuChRb7M0UDPUs4uTxTeBAfF5CRltTtyYjJHIy8C 1Q8JXQ+t0ZOF3eUal+8IOq2Ov914SSGg95YjY4gX6DHPpWzQFtieOkAoedwGSs7dyOxB 0kkPadkXfrA1ioiRbexBpvNLKMJ5a6JFr2F2fxWWhr/Z0kvUx7PfD5msGkTQiEMcd3sj Y7xDCnh/0tk3QHCPqhevjALabJvMDKXhqiGtxIvnoud10qCe7pILTz2FkRaCdGFaJqsI xi6g==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1765554181; x=1766158981; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=vV8SjmlNmhec/DxBcq/klVwlQLbXRsXf4npSWDbI8yc=; b=JqdWvj65EzB5reIS7lMMlCs+UwTmL6VP+WKZsw5eBNfPqcyn4WXC0gFM+O3pYGoBjF ezZvta0a8+6GgyIvJnlWAlNTr8C3UzHe2jjzrft5JpPasZ1u99aNT3DAgK12ZwsZUqf/ hM0MuJt/AXXW95zUKzQLrSYL+IFmtuQtFE3/886wGU7/o3rt0+KHuY5XTzACbKzTKeUZ 5nunFDn+XkZ/VeDqcJT3Wl20f0bFPh16kdBFFA7xuc/rw8VLeqNeGzUatG6fTpMV1icv qz98y+as6EP9QOFm7Fa+4RcNHp7BTD4G+KWSUFnP4qMD0Jr9ptGV/1EOnXh5DkSv8pFe 9wmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765554181; x=1766158981; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=vV8SjmlNmhec/DxBcq/klVwlQLbXRsXf4npSWDbI8yc=; b=sDm+XnozMgRbgopF2SqhTpnvFVTDcrURERvh7mRIRCguBRfGjP6Moa8p2A/vma3G6F LC5ZJf9WqycvUgNfwM4hQFRmLMuy53btQMi0eBIxCudNfNF/WUj7RP7zUrIrDQCLrs7M PlHBAZudPW5OMGhk/RpZYixMiXHMEz/4G2enWTyl2Puz+nKYreYnaeHzaJBdDdwOmiUD Cm/xOFQnIsPIuLSHXbURrhYCneMirXV0WunvNSbOxRqx2kjjCzs5IXqyT/SZ1gQysgO7 VphEWFp859ZejShiddeFXxwZW9tXjjuerwoOWHLtnJYEe+wTgqZlZCWkVDYRBJ5j4KZM ceVQ== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVKTanYOdzsqE2U7mol3doZqV95CL3PyMsgehcnC+gIqbwJNXVNglVwTgNcpdDkbR1St2XV@ilbers.de X-Gm-Message-State: AOJu0YxuOP0O1dIqta++/V2z2tCVkU0gFfPiPg7ZpxPMUr8XGqYFdeZw 1nb1cpkXf56pxy3YS+WRDVLGHL5GseG2hlDZR5a9MxD9YFC1RlLOP2tL X-Google-Smtp-Source: AGHT+IGER40vWIeQhi/8t/QruODBn/OzbnSnI4dMzqa6clJSewPfnPrlt3RkaDY30EQ2tAGivlg9uw== X-Received: by 2002:a17:907:2d08:b0:b72:aaae:1b22 with SMTP id a640c23a62f3a-b7d235c7ed4mr289398366b.12.1765554180540; Fri, 12 Dec 2025 07:43:00 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="AWVwgWa6sgZn6v2jnbFgmgO6gVb0v3ZPRwTzPYm40GDV9hgO8w==" Received: by 2002:a05:6402:3042:10b0:647:9380:1e4c with SMTP id 4fb4d7f45d1cf-6499a38f073ls848741a12.0.-pod-prod-01-eu; Fri, 12 Dec 2025 07:42:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSttZnVNG75J5RpjWZDxiv/tAESoL6LGmD4PkIgvzMxZ/gRwp0uHnB+xqctbn3vf+iiTBnKw9RxLrF@googlegroups.com X-Received: by 2002:a05:6402:2747:b0:640:abd5:863d with SMTP id 4fb4d7f45d1cf-6499b1c2a09mr2671332a12.20.1765554177626; Fri, 12 Dec 2025 07:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1765554177; cv=none; d=google.com; s=arc-20240605; b=gS8xBqdFOMHIu5WPKYnGhSoL4MpfSJigN7orucDB27t7kpJ437WyD2WkWGexxeC/va 5mKMCRhA1rvvaE7oxsbsVvUQIKoyOWabT6eJmTC9J12YJ2wI72pLiOEtAGnPfZ7IYNuv yvKlkbLShA4XJf70x17fjGMNRlwPvcKp3nQlNBAbSMFIIlhZOLKfRXTKEqGTnn7OlMg0 +kNMzrIfabuYWHu6e+342FFDrqyO6C2+74Db/h4jn3PCcF3awTg4ARruX3WXBj1HnIRg 9iZxxIKhPizEH6gyyTudkpppsq9fR/b2Cwbx/ay0Y+TjoLT0mbJSmORTtOuF6QcUCR5l 07kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=v9balYipvt9g8rwGKXl3RAzgwLdSJVF2NmMYrQHAxOA=; fh=ZyNzz1tGI+1RSY2WQ08XJOKby7fpa/rEKnLTtO4a77Q=; b=jE58yJm0u96pljNBBQ1sDk7Hoy9kQlLC1J2rlVOS6E7kal4AoT0lCcHo/+82xX49Kr Vc68LsfkWzHSPGZPQp+KfrmcGhZcFfGqrkVC0SzdX4c8qrPvcPoQMEHVzVS+YmAQdelo 0l8OOOpSQS+RKoCYLLk3f4cyYOSezz9xTeJHmgTv0wG99dtsCGXezD9fk+Vz78embkc1 k5M11QA8FuMMnvuIPpFCPCligD27cEroEJvizQTcCoCAX5vFNPRrTahqZ0OMJXQuzYvK SQa0HU608z1GXhUXgghyeZCJBzzcDFfKAI/TeiNBoqY4/3l4syuqlt1mky+Oq3GKU2FS yi6Q==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-649820df22csi48013a12.6.2025.12.12.07.42.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Dec 2025 07:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [192.168.178.117] ([88.130.203.42]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 5BCFgt8d028418 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Dec 2025 16:42:56 +0100 Message-ID: <9ace9b20-6b5a-4407-ac12-8ea81a21cb20@ilbers.de> Date: Fri, 12 Dec 2025 16:42:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC][PATCH v3 1/1] test: provide ci_shell as a convenience wrapper To: Felix Moessbauer , isar-users@googlegroups.com, Anton Mikanovich Cc: jan.kiszka@siemens.com, Cedric Hombourger References: <20251212150124.1424230-1-felix.moessbauer@siemens.com> Content-Language: en-US From: Zhihang Wei In-Reply-To: <20251212150124.1424230-1-felix.moessbauer@siemens.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE, SPF_PASS 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-Original-Sender: wzh@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: o6OySMnjAbTo On 12/12/25 16:01, 'Felix Moessbauer' via isar-users wrote: > From: Cedric Hombourger' via isar-users > > Ease use of the container environment that may be used to run > tests from this project by adding a `scripts/ci_shell` script > to invoke `kas-container` for you. The script uses the existing > kas/isar.yml kas file to use your existing checkout of the Isar > code: this makes it easier to test your work-in-progress changes. > > Lastly, `ci_setup.sh` will produce less output (e.g. when > installing dependencies) and will print a few hints to remind > users with useful commands. > > [Felix] > - fix pyhashtables cleanup > - speedup installation by skipping recommends > - add more helper commands > - always run with sstate cache > - run everything in tmux to access logs while test is running > - provide pycache path to speedup python startup > - add builtin (memory only) squid cache > - use host network instead of container network (allows use of federated = proxies) > > Signed-off-by: Cedric Hombourger > Signed-off-by: Felix Moessbauer > --- > @Cedric: This is RFC is based on your patchset and tries to further > simplify and speedup the testsuite invocation. Feel free to integrate > whatever you think makes sense. With your patch and my additions, > I finally found a way to efficiently execute single tests. However, > there is still much room for improvement in the testsuite itself. > > Best regards, > Felix > > CONTRIBUTING.md | 52 ++++++++++---------------------------------- > scripts/ci_setup.sh | 53 ++++++++++++++++++++++++++++++++++++++++----- > scripts/ci_shell | 36 ++++++++++++++++++++++++++++++ > 3 files changed, 95 insertions(+), 46 deletions(-) > create mode 100755 scripts/ci_shell > > diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md > index 07621232..6970477b 100644 > --- a/CONTRIBUTING.md > +++ b/CONTRIBUTING.md > @@ -81,54 +81,26 @@ Plan merges to `master` so that both fit the two-week= window; short extensions s > by launching CI tests scripts. The procedure is described below: > =20 > ``` > - git clone https://github.com/siemens/kas > - cat > kas.yml < - header: > - version: 14 > - build_system: isar > - defaults: > - repos: > - patches: > - repo: isar > - repos: > - isar: > - url: "http://github.com:/ilbers/isar" > - branch: next > - layers: > - meta: > - meta-isar: > - EOF > - kas/kas-container shell --command /work/isar/scripts/ci_setup.sh kas= .yml > + ./scripts/ci_shell > ``` > =20 > - In kas shell: > + This will spawn a shell where you may just run: > =20 > ``` > - cd /work/isar/testsuite > - avocado run citest.py -t dev --max-parallel-tasks=3D1 > + trun citest.py -t dev --max-parallel-tasks=3D1 > ``` > =20 > - Your git-formatpatches may be listed in the `kas.yml` file as illust= rated below: > + Note: (`trun` is an alias for `avocado run`). > =20 > - ``` > - ... > - repos: > - isar: > - url: "http://github.com:/ilbers/isar" > - branch: next > - patches: > - 0001: > - path: /work/0001-my-contribution-to-isar.patch > - layers: > - meta: > - meta-isar: > - ``` > - > - Perform the above steps from a clean directory for your CI run to be= as close as > - possible to the environment that our project maintainers will be usi= ng. That > - directory would contain: *.patch isar/ kas/ kas.yml > + The container has `/work` bind-mounted to your local copy of the Isa= r code > + base (and therefore with your changes). Make sure to track upstream = changes > + and regularly rebase your tree: your patches shall be sent against t= he latest > + HEAD available when submitting. Keep an eye on changes while your se= ries are > + under review: you may need to send a refreshed version if contributi= ons from > + others were accepted and touch the same areas (make sure to re-run t= he test > + suite after rebasing). > =20 > - Be also mindful of community-provided resources such as deb.debian.o= rg or > + Be mindful of community-provided resources such as deb.debian.org or > snapshot.debian.org and consider using a caching proxy in your setu= p to > reduce traffic as much as possible. > =20 > diff --git a/scripts/ci_setup.sh b/scripts/ci_setup.sh > index f373d1c0..bbca4ab8 100755 > --- a/scripts/ci_setup.sh > +++ b/scripts/ci_setup.sh > @@ -5,28 +5,69 @@ > # Copyright (c) Siemens AG, 2025 > # SPDX-License-Identifier: MIT > =20 > +# start a squid http proxy in the container > +with_squid=3D"1" > + > gpg_key=3D/etc/apt/trusted.gpg.d/debian-isar.gpg > [ -f "${gpg_key}" ] || { > wget -q http://deb.isar-build.org/debian-isar.key -O- \ > | gpg --dearmor \ > - | sudo dd of=3D"${gpg_key}" > + | sudo dd of=3D"${gpg_key}" status=3Dnone > } > =20 > list=3D/etc/apt/sources.list.d/10-isar_build.list > [ -f "${list}" ] || { > echo "deb [signed-by=3D/etc/apt/trusted.gpg.d/debian-isar.gpg] \ > http://deb.isar-build.org/debian-isar bookworm-isar main" \ > - | sudo tee /etc/apt/sources.list.d/10-isar_build.list > + | sudo tee /etc/apt/sources.list.d/10-isar_build.list >/dev/null > } > =20 > -tools=3D"avocado qemu-system-aarch64 qemu-system-arm qemu-system-i386 qe= mu-system-x86_64" > +echo "=F0=9F=94=8D Checking dependencies..." > +tools=3D"avocado qemu-system-aarch64 qemu-system-arm qemu-system-i386 qe= mu-system-x86_64 htop" > +if [ "${with_squid}" =3D "1" ]; then > + tools=3D"${tools} squid" > + squid_pkg=3D"squid" > + start_squid=3D"sudo /usr/sbin/squid;" > + echo "export http_proxy=3Dhttp://localhost:3128" \ > + | sudo tee -a /etc/profile.d/squid.sh >/dev/null > +fi > + > need_install=3D0 > for tool in ${tools}; do > which "${tool}" || need_install=3D1 > done > [ "${need_install}" =3D "0" ] || { > - sudo apt-get update > - sudo apt-get install -y avocado qemu-system-arm qemu-system-x86 > + echo "=E2=8F=B3 Installing missing dependencies..." > + ( > + sudo apt-get update > + sudo apt-get install -y --no-install-recommends \ > + avocado qemu-system-arm qemu-system-x86 ovmf htop $squid_pkg > + ) > } > =20 > -exec /container-entrypoint ${*} > +( > + cat <<' EOF' > + alias tlist=3D"avocado list" > + alias trun=3D"avocado run -p sstate=3D1 --max-parallel-tasks=3D1 --f= ailfast" > + alias trun-fg=3D"avocado --show avocado.test run -p sstate=3D1 --max= -parallel-tasks=3D1 --failfast" > + alias tquit=3D"tmux kill-session -t isar_ci" > + alias thelp=3D"cat ~/.trun-help" > + export PYTHONPYCACHEPREFIX=3D/work/build/pycache > + mkdir -p ${PYTHONPYCACHEPREFIX} > + cd /work/testsuite > + EOF > +) | sudo tee -a /etc/profile.d/ci.sh >/dev/null > + > +cat <<'EOF' > ~/.trun-help > + > +=F0=9F=92=A1 Use "tlist citest.py" to list existing test cases > +=F0=9F=92=A1 Use "trun citest.py:TestClass.test_method" to run a specifi= c test > +=F0=9F=92=A1 Use "trun-fg to run a specific test and emit the log= s > +=F0=9F=92=A1 Use "tquit" to leave the testing environment > +=F0=9F=92=A1 Use "thelp" to show this help message > + > +=E2=9C=85 Test environment ready for use! > + > +EOF > + > +exec /container-entrypoint tmux new-session -A -s isar_ci "$start_squid = cat ~/.trun-help && bash -l" > diff --git a/scripts/ci_shell b/scripts/ci_shell > new file mode 100755 > index 00000000..917d1272 > --- /dev/null > +++ b/scripts/ci_shell > @@ -0,0 +1,36 @@ > +#!/bin/bash > +# A simple wrapper to run a container to run CI tests > +# > +# Cedric Hombourger > +# Copyright (c) Siemens AG, 2025 > +# SPDX-License-Identifier: MIT > +# > +# Usage: ci_shell [kas-container-version] > + > +self=3D${0} > +topdir=3D$(readlink -f $(dirname ${self})/..) > + > +export KAS_BUILD_DIR=3D$(mktemp -d) > + > +if [[ -n "$1" ]]; then > + export KAS_IMAGE_VERSION=3D"$1" > +fi > + > +drop_pyhashtables() { > + # Remove possibly outdated pyhashtables.py file that is generated on= -the-fly. > + # The file is owned by the (bitbake) calling user, hence it's lifeti= me needs > + # to be bound to the container's lifetime. > + rm -f bitbake/lib/bb/pysh/pyshtables.py > +} > +cleanup() { > + rm -rf --one-file-system ${KAS_BUILD_DIR} > + drop_pyhashtables > +} > +trap "cleanup" EXIT > + > +cd ${topdir} > +drop_pyhashtables > +kas/kas-container \ > + --runtime-args "--network=3Dhost" \ > + shell --command "rm -rf /work/build/conf && /work/scripts/ci_setup.s= h" \ > + kas/isar.yaml I would suggest to add some instructions on using avocado, like the ones=20 mentioned in [1], but that can be a separate patch. [1]=20 https://lists.isar-build.org/isar-users/c3db73d0-5753-41cd-a300-21bec09a0c9= 6@ilbers.de Zhihang --=20 You received this message because you are subscribed to the Google Groups "= isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/= 9ace9b20-6b5a-4407-ac12-8ea81a21cb20%40ilbers.de.