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; Thu, 29 Aug 2024 07:53:47 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f192.google.com (mail-lj1-f192.google.com [209.85.208.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 47T5rluG032746 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 29 Aug 2024 07:53:47 +0200 Received: by mail-lj1-f192.google.com with SMTP id 38308e7fff4ca-2f4f26b3977sf2088261fa.1 for ; Wed, 28 Aug 2024 22:53:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724910821; cv=pass; d=google.com; s=arc-20240605; b=D7fA32hnemrF3jgbD0dIffL9VGrHYDCPScp07EavLsZkXV5e0v+a4lAcX57iTjwL3N Fmo0TsdWYBIdOORsuCuhWgRA4msYlvXKYWzU9+ayUNyy68fdeEndcSXf3OjVbVUrnJks iVdh7MfBPqxuqiZSOshpITQSttVRChJFcbYbNrxIM3pQIwyin89eNc9BXrUze5nCs8re O2cECp0jnxlut+DUiL451IeY88D/RhtHFo0jGaDZGaY0b3NVuIZJ/qz6tYi0lnGw5/I2 NyLv7vUaV5pXb9xHJyVWoTvPPhDw+EEYSihbAQHVV8BC3XunMpJ+VXM+Gezk3Reg173/ yqPA== 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:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:sender:dkim-signature; bh=bK7vvlScCxz/mgKoEYW9eQ/FHVLCARlt52ixdV1yaQ0=; fh=Fpb2y4/edcIiYdgM/vHlmqAJU3eabClR2sG2TMhlnys=; b=FwONJq0HvXGJTQo/0lO7ocE0nRS0FfT4hd/iMb7j+UScfIBK5wU837RYol0LPgiPN1 qaXjKO9BiNNRKFaQzPeOgRvf0QbD5qMhfYSwk4SS9tN18OXoOU/DQwGh5lmpozCVExXK TC56vS8uBcKxh4+WeywOiK0qz1uR2P8G6RHBnwPoI7La/h+hXL0jgEP+M39UQJr6ZKsH iWgQvvadEhazm2fqJLk8fX0IbCkAtAoV3kr1sdxsUhtbSwjfmc07L+lhNT+o1vw8g63A 1ffe/QkUxva2waRu28nOTWW1Icg5VvoMKkkUAPZkPOlw28EIrWWhcG5BnzgyiIO/7Q3k l4+Q==; darn=ilbers.de ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1724910821; x=1725515621; 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:mime-version:user-agent:content-transfer-encoding :references:in-reply-to:date:to:from:subject:message-id:sender:from :to:cc:subject:date:message-id:reply-to; bh=bK7vvlScCxz/mgKoEYW9eQ/FHVLCARlt52ixdV1yaQ0=; b=hAaf4NLrgaQwjSjV+QsXtRYHaWoAk5KN+RiH3xEG6dHAn4nCVUr+pEhfANFmgr3BGo 52Mt/kKBiyFHY/6MGK4PuF0o+cOCi2f3taf9gzRaPbMgXcBrWahFra4NsqXyLZkt6EMr EAEAR2gRZ8GOObiSWSRn9gqyGYcIGSvWiu2BbsIa+URQeLAxhCg7tknMxVbaTNEnxad+ hr9yMFl7/ERkgLE4gp84sWH91SrC5CzHM0V6fbBAQkwv8s6hHlQzVUiTVvnYkHab9WsF 09+yICNCkGiBCpnwU/jfigwfVDaljQdx2C1vmu6/bxHBPqPteqN5ELbebxA27NCExBQX kuYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724910821; x=1725515621; 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:mime-version :user-agent:content-transfer-encoding:references:in-reply-to:date:to :from:subject:message-id:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=bK7vvlScCxz/mgKoEYW9eQ/FHVLCARlt52ixdV1yaQ0=; b=I4nHkoiRbywmd/vaye6WlbL1YsGH5VJdxz6eNBScGpzXCkcoADy6smToaQXTAqYvk2 zcv/LZQaNy1Raa2mCLa3imVNmltPRYwfvilnHOkcT8QaXflVxSn7S5wCGvEJLFV7bier FvZYv7iBbV1QVo5GAcG0+7zu7ZN2rN9vZbP8Di3/ZWSdFS/F3wx/bGLW1nj0zlsKYg68 I8tQ/qG7UvfCd+MLQ8lJsCYCsa/ZpezT94t4eARbHX9OdNuOp12AZFw3BpmJoMsq9GIf mS+iQ4+IgDZ8Ej4EcdR9KEQc6DfhsuI3pcFp8ZMUC+p1LeCy1Zt66h7iXDqncS3Cs5KR yV/w== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWdxtdcflTxQq3Z+u+hlVRcWPRwKbBFoxv2IN82ka949lyrGIpsGuH2nAym3A3rRIBzibQu@ilbers.de X-Gm-Message-State: AOJu0Ywsrf++J8mnpo0fBsbkTUNSIXJZrAMonJNQzMo3rGepTh6wJ1D/ GyBBVHa12DmmyZYUg55DZ5EtNJSqvkqhhHWaF7fHOwDM+Zo9GSwp X-Google-Smtp-Source: AGHT+IHZeoS4BhBaYAgmQp/xsnh3hpsAh7fDXDty02vvW1hO7IgYiz/TzFMXd1wXtHBbFXaoEh8fmA== X-Received: by 2002:a05:651c:1991:b0:2ef:2c40:dd67 with SMTP id 38308e7fff4ca-2f6167d62e1mr1973841fa.3.1724910820555; Wed, 28 Aug 2024 22:53:40 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:2202:0:b0:2ef:2b5b:5a6f with SMTP id 38308e7fff4ca-2f6108bed75ls1025771fa.0.-pod-prod-00-eu; Wed, 28 Aug 2024 22:53:37 -0700 (PDT) X-Received: by 2002:a2e:be05:0:b0:2ef:2bea:69a with SMTP id 38308e7fff4ca-2f6167d6269mr1627761fa.2.1724910817459; Wed, 28 Aug 2024 22:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724910817; cv=none; d=google.com; s=arc-20240605; b=iSVc9Xw8pb6eBrLpY+oE9zLDIxN3bvNAjYqLqNuRtinbTPBPWobUger4FBezTOTTln c4zbaOxPF29XSuk1+7hGroD4CSJAivljFn9wUBxRHrPL/tgNv1zHtzoAkMbQfOJTMK9/ ihlqTrGiQ6SHkpXtq9tgHOAlvPQjDTAWvwP/yoI18BaMxD2cvlrePhHyh0cqrDG+rkmh ssF8/PhxzjHnMThqcbDmhbQdX2xjeQ6jLFK67IYB4FB8j1k//yb8fXs7ayJM4Oz1demd CHwZm5NR8cmIjiBCvP0yy5/RtLGGCtSSoUmBcxdHAuliCpTmlq7Soo1yod4maSqo8c/x RusQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=wt/qEtl7rtpX+7iMBsztVXLY9Y0z30oYln/e2jxh4Vk=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=M19qFlq0LDy/YKMQweXcYaUZM4iTZKswetUPjgFLoEvZFcypv0bAoWLox6GUtCjQCM khSgNJifCJVOiNGU9hrSY7o/Tqrd+CUFaj5QLpPXPEELOv3hO2hMsK9WUxD2Er1LHjVs 5P21kKyPD77WVZZqrj7NQbSSadNOF7hqcfTr+ShJ08tzgn1teK4bl2Gi87UB8MzMIT/9 dHsejY6gZGpj8812AyRLGjn9L6m2AzzvP//+bx33JJDLZjLEgq3xIlY0Xu3EW7Gbvk4r vVqyp2TxouFRqo8sSIxS406Z7+xiSlRoYLhXMzq+imZW0bQJSjWs6+TQVqHBVQshNhLO SauQ==; dara=google.com 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 Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-2f6151885a2si113351fa.7.2024.08.28.22.53.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2024 22:53:37 -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; Received: from [127.0.0.1] (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 47T5rYHY032739 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 29 Aug 2024 07:53:36 +0200 Message-ID: <240adbc842d8c0d32fecab15c7c3c31b3cfc61fa.camel@ilbers.de> Subject: Re: [PATCH v2] testsuite: cleanup qemu machines left running From: Uladzimir Bely To: isar-users@googlegroups.com Date: Thu, 29 Aug 2024 08:53:33 +0300 In-Reply-To: <20240826051741.624-1-ubely@ilbers.de> References: <20240826051741.624-1-ubely@ilbers.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3 (by Flathub.org) MIME-Version: 1.0 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_MSPIKE_H2,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: ubely@ilbers.de X-Original-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 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: fgzRiq7SuAC3 On Mon, 2024-08-26 at 08:15 +0300, Uladzimir Bely wrote: > Parameter "keep=3DTrue" in `vm_start` function allows to share the same > qemu process between different tests. >=20 > In case the machine is forgotten to be closed by the last test or in > case avocado skips some tests (due to internal error or other reason) > such qemu processes stay running after the testsuite completed. >=20 > This change allows to terminate these processes. >=20 > Signed-off-by: Uladzimir Bely > --- > =C2=A0scripts/ci_build.sh=C2=A0 |=C2=A0 9 ++++++++- > =C2=A0testsuite/cleanup.py | 26 ++++++++++++++++++++++++++ > =C2=A02 files changed, 34 insertions(+), 1 deletion(-) > =C2=A0create mode 100755 testsuite/cleanup.py >=20 > Changes since v1: > - Preserve avocado return code on exiting ci_build.sh. >=20 > diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh > index 0aa2403d..338557ad 100755 > --- a/scripts/ci_build.sh > +++ b/scripts/ci_build.sh > @@ -142,9 +142,16 @@ logs_dir =3D $(realpath "${BASE_DIR}")/job-results > =C2=A0EOF > =C2=A0export VIRTUAL_ENV=3D"./" > =C2=A0 > +ret=3D0 > + > =C2=A0# the real stuff starts here, trace commands from now on > =C2=A0set -x > =C2=A0 > =C2=A0avocado ${VERBOSE} run "${TESTSUITE_DIR}/citest.py" \ > =C2=A0=C2=A0=C2=A0=C2=A0 -t "${TAGS}" --max-parallel-tasks=3D1 --disable-= sysinfo \ > -=C2=A0=C2=A0=C2=A0 ${SSTATE} ${TIMEOUT} > +=C2=A0=C2=A0=C2=A0 ${SSTATE} ${TIMEOUT} \ > +=C2=A0=C2=A0=C2=A0 || ret=3D$? > + > +python3 ${TESTSUITE_DIR}/cleanup.py > + > +exit ${ret} > diff --git a/testsuite/cleanup.py b/testsuite/cleanup.py > new file mode 100755 > index 00000000..c81397d2 > --- /dev/null > +++ b/testsuite/cleanup.py > @@ -0,0 +1,26 @@ > +#!/usr/bin/env python3 > + > +import os > +import pickle > +import signal > + > +build_dir =3D os.path.join(os.path.dirname(__file__), '..', 'build') > + > +vm_dict_file =3D f"{build_dir}/vm_dict_file" > +vm_dict =3D {} > + > +if os.path.isfile(vm_dict_file): > +=C2=A0=C2=A0=C2=A0 with open(vm_dict_file, 'rb') as f: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 data =3D f.read() > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if data: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vm_di= ct =3D pickle.loads(data) > + > +for vm in vm_dict: > +=C2=A0=C2=A0=C2=A0 pid =3D vm_dict[vm][0] > +=C2=A0=C2=A0=C2=A0 name =3D vm_dict[vm][1][0] > +=C2=A0=C2=A0=C2=A0 print(f"Killing {name} process with pid {pid}", end = =3D"... ") > +=C2=A0=C2=A0=C2=A0 try: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 os.kill(pid, signal.SIGKILL) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print("OK") > +=C2=A0=C2=A0=C2=A0 except ProcessLookupError: > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print("Not found") > --=20 > 2.44.2 >=20 Applied to next. --=20 Best regards, Uladzimir. --=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 on the web visit https://groups.google.com/d/msgid/= isar-users/240adbc842d8c0d32fecab15c7c3c31b3cfc61fa.camel%40ilbers.de.