From patchwork Tue Oct 15 11:34:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13836228 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8C181EABAB for ; Tue, 15 Oct 2024 11:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728992110; cv=none; b=eYWsP3xDvJtuvI+7mpJhPoIRbPC0+8kb9kdaDMHH50nsiiTHjoSU4LCNSOX7FhbTo2TvQ29F3sEdoYz2z83r26oXa6XyCCZ9bOIyY4yGvbL2UK4Y5/OqJqJjHQfxqN8lXAFURZnmP0bVuRHy+Nu+eSFwUX3S85wgyDFNrAVxM68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728992110; c=relaxed/simple; bh=beIA6sxyPtDDEt1OujY0XfJVP59rqeokjZXB98MAFS8=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=d0lr6VU8ZY/aVu47D6sNnFW2lR907Sx+7rBwHLjORNzDIaq7+/DJYjw0wGL54i5N1BZWjcslPMnW0kO6GzC5FNb+RnS5/wvuSJYpyOd77ArCIEbnZv3UIMP5CWa0TmXFl7w9GxE3wFoyTG+kV265euf/Wk7ZjVVuTbq2Rhx8zIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bOY202Mb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bOY202Mb" Received: by smtp.kernel.org (Postfix) with ESMTPS id 72B67C4CECE; Tue, 15 Oct 2024 11:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728992110; bh=beIA6sxyPtDDEt1OujY0XfJVP59rqeokjZXB98MAFS8=; h=From:Subject:Date:To:Cc:Reply-To:From; b=bOY202MbmRxUzKFBGEKhuUkYRWnx6f/pQLvltQG9ceVsLgIEaosFJblgzEPQ3Kc7u MmmP3A/nvBLJ8GVyc9TZ8ZTfZQgtwnYd+1b/ahLblOn1jxYEADiszFQS0WMGhtyt8s lD165tI+hMcvOo9Ksi5vCJgpy7VrYvj8L9S58OmchVFHgzU+DOELOUpl9rQwHF5+0N 5EMtMQRnULMCZ9JiR0aRrX3J9g27tFXcSjKRh71qFKLmctwJ5Z9wSq3Ws9CDDvINvn SM6FS2AX2ZS/qgtLwynieBXkSHcKK5QBapj8VPSujdg1ujkqLCLgk4ppS8PZ0H12HU PizbI/oNfYSiA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C01BCFC292; Tue, 15 Oct 2024 11:35:10 +0000 (UTC) From: Daniel Gomez via B4 Relay Subject: [PATCH 0/5] guestfs: bringup: add debug mode Date: Tue, 15 Oct 2024 13:34:50 +0200 Message-Id: <20241015-bringup-guestfs-debug-v1-0-bd74c0c31412@samsung.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAFpTDmcC/x3MQQqAIBBA0avErBvQKKyuEi0yR5uNhZMRRHdPW r7F/w8IJSaBsXog0cXCeyzQdQXrtsRAyK4YGtW0WukObeIY8oEhk5xe0JHNAY3pfOusG/pVQ2m PRJ7v/zvN7/sB5N1AYmcAAAA= X-Change-ID: 20241015-bringup-guestfs-debug-775f4dbd98c1 To: kdevops@lists.linux.dev, Luis Chamberlain Cc: "Daniel Gomez (Samsung)" , Daniel Gomez X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728992109; l=1461; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=beIA6sxyPtDDEt1OujY0XfJVP59rqeokjZXB98MAFS8=; b=dWZhSP0WT3I+tpydK7ruqWc8WEbeDPC3YKoPEqg3BQSj6LrprF9T3/fwtlc3u1ULFuiu9r26U q5Qw3RLzHisDCrNYfB+BfK6InEkRXp8BAHwO5cQxz+DfNEeou6XfVmB X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com Adding debug option in bash bringup_guestfs.sh allows to check for commands executions (virsh, chmod, cp, virt-sysprep, etc) and variables. Add 3 levels of debug: - Disabled: This is the current behaviour and is the default. - set -x (debug mode 0): Allows to print the executed commands but if they fail, the script continues. - set -euxo pipefail (debug mode 1): mode 0 + variables are printed + script fails if a command does not succeed. While debugging, I noticed about small bash errors that we ignore, such as unbound variables. So, this also fixes the issues found while debug mode 1 was enabled. To: kdevops@lists.linux.dev To: Luis Chamberlain Cc: Daniel Gomez (Samsung) Signed-off-by: Daniel Gomez --- Daniel Gomez (5): scripts: lib: rename KDEVOPS_WORKFLOW_FSTESTS guestfs: bringup: check if domain exists guestfs: bringup: fix unbound variable when debug guestfs: bringup: fix user check when debug guestfs: bringup: add debug mode kconfigs/Kconfig.guestfs | 21 +++++++++++++++++++++ scripts/bringup_guestfs.sh | 31 ++++++++++++++++++++----------- scripts/lib.sh | 2 +- 3 files changed, 42 insertions(+), 12 deletions(-) --- base-commit: 5b4d19d8e8ed606c3e64e0679f3792504cc31207 change-id: 20241015-bringup-guestfs-debug-775f4dbd98c1 Best regards,