[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 26/29] tests/vm: allow interactive login as root
From: |
Alex Bennée |
Subject: |
[PATCH v3 26/29] tests/vm: allow interactive login as root |
Date: |
Tue, 7 Jan 2025 16:52:04 +0000 |
This is useful when debugging and you want to add packages to an
image.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/vm/Makefile.include | 3 ++-
tests/vm/basevm.py | 9 +++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index d80ca79a28..14188bba1c 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -66,6 +66,7 @@ endif
@echo "Special variables:"
@echo " BUILD_TARGET=foo - Override the build target"
@echo " DEBUG=1 - Enable verbose output on
host and interactive debugging"
+ @echo " ROOT_USER=1 - Login as root user for
interactive shell"
@echo ' EXTRA_CONFIGURE_OPTS="..." - Pass to configure step'
@echo " J=[0..9]* - Override the -jN parameter
for make commands"
@echo " LOG_CONSOLE=1 - Log console to file in:
~/.cache/qemu-vm "
@@ -141,6 +142,6 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(VM_VENV)
$(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \
$(if $(LOG_CONSOLE),--log-console) \
--image "$<" \
- --interactive \
+ $(if $(ROOT_USER),--interactive-root,-interactive) \
false, \
" VM-BOOT-SSH $*") || true
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 6f3f2e76df..6d41ac7574 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -612,8 +612,11 @@ def get_default_jobs():
parser.add_argument("--source-path", default=None,
help="Path of source directory, "\
"for finding additional files. ")
- parser.add_argument("--interactive", "-I", action="store_true",
- help="Interactively run command")
+ int_ops = parser.add_mutually_exclusive_group()
+ int_ops.add_argument("--interactive", "-I", action="store_true",
+ help="Interactively run command")
+ int_ops.add_argument("--interactive-root", action="store_true",
+ help="Interactively run command as root")
parser.add_argument("--snapshot", "-s", action="store_true",
help="run tests with a snapshot")
parser.add_argument("--genisoimage", default="genisoimage",
@@ -675,6 +678,8 @@ def main(vmcls, config=None):
exitcode = 3
if args.interactive:
vm.ssh()
+ elif args.interactive_root:
+ vm.ssh_root()
if not args.snapshot:
vm.graceful_shutdown()
--
2.39.5
- [PATCH v3 02/29] tests/functional: update the i386 tuxrun tests, (continued)
- [PATCH v3 02/29] tests/functional: update the i386 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 01/29] tests/functional: update the arm tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 03/29] tests/functional: add a m68k tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 04/29] tests/functional: update the mips32 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 05/29] tests/functional: update the mips32el tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 08/29] tests/functional: update the ppc32 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 07/29] tests/functional: update the mips64el tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 10/29] tests/functional: update the riscv32 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 06/29] tests/functional: update the mips64 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 09/29] tests/functional: update the ppc64 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 26/29] tests/vm: allow interactive login as root,
Alex Bennée <=
- [PATCH v3 12/29] tests/functional: update the s390x tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 13/29] tests/functional: update the sparc64 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 11/29] tests/functional: update the riscv64 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 16/29] tests/qtest: remove clock_steps from virtio tests, Alex Bennée, 2025/01/07
- [PATCH v3 15/29] tests/functional/aarch64: add tests for FEAT_RME, Alex Bennée, 2025/01/07
- [PATCH v3 27/29] pc-bios: ensure keymaps dependencies set vnc tests, Alex Bennée, 2025/01/07
- [PATCH v3 14/29] tests/functional: update the x86_64 tuxrun tests, Alex Bennée, 2025/01/07
- [PATCH v3 25/29] tests/vm: partially un-tabify help output, Alex Bennée, 2025/01/07
- [PATCH v3 22/29] tests/docker: move riscv64 cross container from sid to trixie, Alex Bennée, 2025/01/07