mbox series

[0/5] guestfs: bringup: add debug mode

Message ID 20241015-bringup-guestfs-debug-v1-0-bd74c0c31412@samsung.com (mailing list archive)
Headers show
Series guestfs: bringup: add debug mode | expand

Message

Daniel Gomez via B4 Relay Oct. 15, 2024, 11:34 a.m. UTC
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 <mcgrof@kernel.com>
Cc: Daniel Gomez (Samsung) <d+samsung@kruces.com>

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
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,