From patchwork Fri Dec 22 13:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1879682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JpknUMed; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SxTK44KJtz1ypX for ; Sat, 23 Dec 2023 00:53:12 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JpknUMed; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SxTK41sZSz3cVr for ; Sat, 23 Dec 2023 00:53:12 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JpknUMed; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::52f; helo=mail-pg1-x52f.google.com; envelope-from=npiggin@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SxTGy75czz3cW8 for ; Sat, 23 Dec 2023 00:51:22 +1100 (AEDT) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5c66b093b86so2170009a12.0 for ; Fri, 22 Dec 2023 05:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703253080; x=1703857880; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aeVnbjWEi5yI3wZCxJZ+3TFl6uPEJpXO65IAKcNUOWw=; b=JpknUMed0ucyYxrfD3HEZMvClY1EuUG6CUvzPHMAAeU3jOp7mqqa6J4Haj9NWt+cKP JM/oyuHv9Ad3TJBMaEbRJ/XBK+G4sdGdNzEDLiXe7GKJ6hKY9e9vb4e17qkqYRgjOWjS pkswXU4aafn0ANzJhJmXdSEVKFeGD8bXc3FuzxoIP5+MVewDhZS+YOCipe0s3I4R+9Nt sH5o87kKGvQooeSwlGZUBwDxM9M3skSnSOEILuWy8cJJBBb064wHw+MEP2o3cMRC+fKs jHgOnYF7UUXwUrGyI5Ddh2UFIig+giOEngimSi9m7qIj+RLHS187wvE/sC6gEjY8P5ft iVAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703253080; x=1703857880; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aeVnbjWEi5yI3wZCxJZ+3TFl6uPEJpXO65IAKcNUOWw=; b=UW7mw6Ru3mtq7s8ESyf6I0jewK49VjJf4nZsyYpA6Ri2A2d0LW6RWAu/rJDOE4OCio 9JjMYluuBUYGa6s6dVJhdGNaltPTMrxCROJrjKKl+t6ppfNNbhPujOYwHFXJUHL0aZ1M Bb0Fuzg7i0mCsdMmFI+qU5MVJTnYjZJ291XzzbhXLZ2stk+zr47IeuB0j4ENsD9xvLnh 4E3yHWHrIl/f6DSi60025HcA3NF+5AlMAKnvvQmQCkmDFoXsLdsYcVa1BcsmmNnbaCDn Bip6aqq6uNzjg7NR61DjA6N5xuy7caN5x0sLnOyJaf7bS2a28/M6mZVmEqaQOl4Sr+mA jiZg== X-Gm-Message-State: AOJu0YzaFdOux9ZW9dua2gPuJez3OcDxke6JtjmTcmUpZvMHVsfWwNa4 RzLvxaLMU3Obwz6D2Vtvbdf+Gw47CxA= X-Google-Smtp-Source: AGHT+IHqnb2JvkeLOq0Zyx6dkuBTdsnQ/G+82at1GcM1w/Cj+jE+jQEH5a3pKGr37WxpE4SIFDqkjg== X-Received: by 2002:a17:90b:1945:b0:28c:191:132a with SMTP id nk5-20020a17090b194500b0028c0191132amr1657944pjb.7.1703253079864; Fri, 22 Dec 2023 05:51:19 -0800 (PST) Received: from wheely.local0.net ([203.220.145.68]) by smtp.gmail.com with ESMTPSA id n12-20020a17090ac68c00b0028ae54d988esm3629280pjt.48.2023.12.22.05.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 05:51:19 -0800 (PST) From: Nicholas Piggin To: Thomas Huth Subject: [kvm-unit-tests PATCH 2/9] arch-run: Clean up temporary files properly Date: Fri, 22 Dec 2023 23:50:41 +1000 Message-ID: <20231222135048.1924672-3-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231222135048.1924672-1-npiggin@gmail.com> References: <20231222135048.1924672-1-npiggin@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , linux-s390@vger.kernel.org, Nico Boehr , Janosch Frank , kvm@vger.kernel.org, David Hildenbrand , linuxppc-dev@lists.ozlabs.org, Shaoqin Huang , Nicholas Piggin , Andrew Jones , Eric Auger , kvmarm@lists.linux.dev, Paolo Bonzini , Claudio Imbrenda , Alexandru Elisei Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Migration files weren't being removed when tests were interrupted. This improves the situation. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index d0864360..f22ead6f 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -134,12 +134,14 @@ run_migration () qmp1=$(mktemp -u -t mig-helper-qmp1.XXXXXXXXXX) qmp2=$(mktemp -u -t mig-helper-qmp2.XXXXXXXXXX) fifo=$(mktemp -u -t mig-helper-fifo.XXXXXXXXXX) + + # race here between file creation and trap + trap "trap - TERM ; kill 0 ; exit 2" INT TERM + trap "rm -f ${migout1} ${migsock} ${qmp1} ${qmp2} ${fifo}" RETURN EXIT + qmpout1=/dev/null qmpout2=/dev/null - trap 'kill 0; exit 2' INT TERM - trap 'rm -f ${migout1} ${migsock} ${qmp1} ${qmp2} ${fifo}' RETURN EXIT - eval "$@" -chardev socket,id=mon1,path=${qmp1},server=on,wait=off \ -mon chardev=mon1,mode=control | tee ${migout1} & live_pid=`jobs -l %+ | grep "eval" | awk '{print$2}'` @@ -211,8 +213,8 @@ run_panic () qmp=$(mktemp -u -t panic-qmp.XXXXXXXXXX) - trap 'kill 0; exit 2' INT TERM - trap 'rm -f ${qmp}' RETURN EXIT + trap "trap - TERM ; kill 0 ; exit 2" INT TERM + trap "rm -f ${qmp}" RETURN EXIT # start VM stopped so we don't miss any events eval "$@" -chardev socket,id=mon1,path=${qmp},server=on,wait=off \