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, 23 Aug 2024 07:27:24 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f190.google.com (mail-lj1-f190.google.com [209.85.208.190]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 47N5RNTL001850 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 23 Aug 2024 07:27:23 +0200 Received: by mail-lj1-f190.google.com with SMTP id 38308e7fff4ca-2f4062343desf11517141fa.1 for ; Thu, 22 Aug 2024 22:27:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724390838; cv=pass; d=google.com; s=arc-20240605; b=V/APeLaxGPnHBn4OkPzXKrOUpvx8nwDooMKO9Rhs+vRxjgsdpmpolvPUhM99Tw/2EU Cxle5RFYrrFXS33+MNw45yCBywBZcZMLFfz3X/rgEuRKqegHeCV6t/IsgT8qB6sIhcul P93AawaIatCDi/VLkRyErJ8aYm/CNq9ECj+lXczSBx4o33M6nIeyvyncknXDIOwwgZ9c Mg8TxuU07UU85QyBCWoXhdb8DtzKsBkzKUcLhsWJwnDYqAdleQYPFuKlbkMJzfdPh+Ks tf/FaCIP9IJS0ke8MLIQpN81QLfisZmREM7FgN7g5rI9zvYfghL+opv70viqt88R1aQl 8KKw== 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:message-id:date :subject:to:from:sender:dkim-signature; bh=J1oUrR9MAhTujllvmaX/EDhxj0GLyLKWCS2OJysgE30=; fh=mHn2UV+zcZLQEkNI9LM4J+UFffk2xZnpdXdd3W6CKX8=; b=Oy15UROc0V3dh5Qn821uceVT5GrftCEVFE8aQAUypUu+hTwdwsfkAJFcLS+cfuNqXX iPT0TA+S9NWSIaE8qtPG89kh0TWwyuk+uO9VseO2F02+p2nddNNRXsc6io+T1gJ9cOG+ LCofIvDu7iMQ9EYaJJv7ATwnZkMo72Ztw9NmjAHX1XFMiNHGO8mwGr1zsslI9px5dl1g oAh0D34SIQs9GvM5/jXP2MPaURztFpAmFhl+DxhHlx4onTo2Y0hGjLkPWWBTWYawDDzq WXcXHDl2JthyqvVC88irLCrUehATiBoIbpMVy1yzgSz5chOVthBGwoUSdH7uetySPd9V 0VHw==; 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=1724390838; x=1724995638; 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:message-id:date:subject:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=J1oUrR9MAhTujllvmaX/EDhxj0GLyLKWCS2OJysgE30=; b=Uy7Ub5OQh8KPZmSX9vKKnK3kFe3ltznRS1FRiKOkroXQnW0umzvTRROmt3yaaW4UIC MF19GEMrgx5wFWA3VK5VtSETvIwXAUOD52G31rhw4i/rl5HugRgadVTFIHxHcl07TF3N jkZcfqY7Y6u12stAVWSiGnSj1WHH84rwYcXggereeyG1VfqmfGpGQ/iOTyt3bp+3T+5/ MVcCt986jhp2p+WT908VpzVLwa8NY7/PYIlzKVjhj+MN6LkhNdfRTMePFsLldg34rvqM DzWrqtCCiaK1PoNCLc6veFJE2ySDX9alM48xD/7JAbGUytNcwBcowuE/77NnyEjASg7t iYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724390838; x=1724995638; 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 :message-id:date:subject:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=J1oUrR9MAhTujllvmaX/EDhxj0GLyLKWCS2OJysgE30=; b=RpGwLmwQdOz7NbWqqmfWIGAFUm4XtRIDWGwR+qcFE2eTNeZ02aW1dkQ4IVJFrN9HJu 08FKVC8u13HdU4I4aamy5FA0s+ay1NzDuupzqAy33OIKzRxP5UtBV65+fOZxgPE7F9/C nIft+rPSa0nhikbVxGin0Gib43TgxSvOPfhGbEFb9ruXh7d66rbBiu7oVh/KxeDW4KDd tG2Y+QZ2NndxlRLJxUJuvJBhQlkzVyno22EfbjycKoHBTwvn+vNahlS0k7xlprzJXqgL c+lHIu8/FzQGTOLYvJuoPuYdayMXiyQh0/U+hcrA5EJPitSAxwT047jMy0cZMAvppdvu nNgQ== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCX8e0u2UuInKH9jMS0qtQfN0lWXkPvBQ15iWSsW2UXZKzr1pi2iwmOoBVoDJIz5VkKFATGc@ilbers.de X-Gm-Message-State: AOJu0Yzt8pr2tePBSJkiR/T2+n67QtMwohJuA5saHi04UnHe64F6jIME iCVI6meTWdq9wQ/H5KhAhGcz1BDAdiFR7fCfIRGt2avWuxX+8F6B X-Google-Smtp-Source: AGHT+IHjnl5hJXVrsm+XUBGG+STdD9m4z9VMNkCXXRtVXe65M3s3LcSEvJOxgqRRu3hEIelS9ToNgQ== X-Received: by 2002:a2e:be21:0:b0:2ef:28d2:39cc with SMTP id 38308e7fff4ca-2f4f48d66camr5641711fa.3.1724390837014; Thu, 22 Aug 2024 22:27:17 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:6d02:0:b0:2f3:ee66:7c5 with SMTP id 38308e7fff4ca-2f402fa7517ls296641fa.0.-pod-prod-02-eu; Thu, 22 Aug 2024 22:27:14 -0700 (PDT) X-Received: by 2002:a05:6512:1256:b0:530:abec:9a1b with SMTP id 2adb3069b0e04-5343877343fmr565022e87.13.1724390834460; Thu, 22 Aug 2024 22:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724390834; cv=none; d=google.com; s=arc-20240605; b=Tdl3afcbmF39u9MnQOuPpDh0mD/gTUw16rRp0F0n6+yij/bZwjaryS0irvVI+btbiY 4BjUdnW9UI5MS3e5gw04PO60ZGpJc8E/pnFI228i7t+dEVBQN+ckGR9Ht+FiKJrSq2Vq pt9H7a73A5cFGksfL4jRNnNb/jp4ufARiwpN+93U9Tjz4tqGudcpgSWNLPu44suRoOmJ EKddiiWHnHnL6EeOVmbgqrnyEskervkCuVSxRdxrGJ2xPCOwt2qgm7AkR/Ih/teALkee 57UPDH4Y/A3TghjG9g5TCfbQvWXN3QJHA119NbRLYqJjbXn6y4B8K/a6MrdoVMtmpVNs W65A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=VysiwQHYIxqON+IL5anC9LT5NEEPRbkfOFUeIjKVYU0=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=L0F5nESPmcBGWc5ZSjPZnxZTXLAVwA0ttMsY8ShA0+gytYstZpTpMYDg7mBEH7GuWg NJy3PKddWiySxoksexmyW8yJhFrcAY6mX04BYhzp7qyS9RBAE6meqjQlEdL/CRq0qitu qzWMart5OxH+jmuCcmJDwVBOJK35QfpvqIDjT3Bjwr7hjnQ2Rd+zy7fhBWquTZbfdXDC QUqvDTeypjvF4qSPPjNGq+7XfD+/7roI9AYYjgNFezFoJhwIDOHeK24U30FJ/mGo9oUk dTFlh59LonfT77Lb/WiYehSUWI7NoVPMUQ1QaRBWjh1JoR10MhuWJjVeYSAvpb8F9w8S +jXg==; 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 2adb3069b0e04-5334ea265d1si64028e87.1.2024.08.22.22.27.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2024 22:27:14 -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 hp15.localdomain (mm-8-3-121-178.gomel.dynamic.pppoe.byfly.by [178.121.3.8]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 47N5RCgf001837 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 23 Aug 2024 07:27:13 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH] testsuite: cleanup qemu machines left running Date: Fri, 23 Aug 2024 08:26:35 +0300 Message-ID: <20240823052706.25962-1-ubely@ilbers.de> X-Mailer: git-send-email 2.44.2 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 Content-Type: text/plain; charset="UTF-8" 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: fGjgekuTP3m1 Parameter "keep=True" in `vm_start` function allows to share the same qemu process between different tests. 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. This change allows to terminate these processes. Signed-off-by: Uladzimir Bely --- scripts/ci_build.sh | 5 ++++- testsuite/cleanup.py | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 testsuite/cleanup.py diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index 0aa2403d..b643b5a6 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -147,4 +147,7 @@ set -x avocado ${VERBOSE} run "${TESTSUITE_DIR}/citest.py" \ -t "${TAGS}" --max-parallel-tasks=1 --disable-sysinfo \ - ${SSTATE} ${TIMEOUT} + ${SSTATE} ${TIMEOUT} \ + || true + +python3 ${TESTSUITE_DIR}/cleanup.py 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 = os.path.join(os.path.dirname(__file__), '..', 'build') + +vm_dict_file = f"{build_dir}/vm_dict_file" +vm_dict = {} + +if os.path.isfile(vm_dict_file): + with open(vm_dict_file, 'rb') as f: + data = f.read() + if data: + vm_dict = pickle.loads(data) + +for vm in vm_dict: + pid = vm_dict[vm][0] + name = vm_dict[vm][1][0] + print(f"Killing {name} process with pid {pid}", end ="... ") + try: + os.kill(pid, signal.SIGKILL) + print("OK") + except ProcessLookupError: + print("Not found") -- 2.44.2 -- 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 email to isar-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240823052706.25962-1-ubely%40ilbers.de.