qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 14/15] docker: Support interactive shell for debu


From: Fam Zheng
Subject: [Qemu-devel] [PATCH v2 14/15] docker: Support interactive shell for debugging
Date: Tue, 16 Feb 2016 20:39:58 +0800

Specify "PAUSE=1" when invoking make docker-%, and a shell prompt will
show up before the test runs.

Signed-off-by: Fam Zheng <address@hidden>
---
 tests/docker/Makefile.include | 5 ++++-
 tests/docker/run              | 8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index d8c55c3..aaf7d23 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -60,6 +60,8 @@ docker:
        @echo '    TESTS="x y z .."     Filters which tests to run (for 
docker-test).'
        @echo '    J=[0..9]*            Overrides the -jN parameter for make 
commands'
        @echo '                         (default is 1)'
+       @echo '    PAUSE=1              Stop and drop to shell in the created 
container'
+       @echo '                         before running the command.'
 
 docker-image-%:
        @if test -z "$(IMAGE)"; then echo "Invalid target"; exit 1; fi
@@ -79,9 +81,10 @@ docker-run-%:
                $(call quiet-command,\
                        $(SRC_PATH)/tests/docker/docker_run $(if $(KEEP),,--rm) 
\
                                --privileged -t --net=none \
+                               $(if $(PAUSE),-i) \
                                -v $$(realpath $(SRC_PATH)):/var/tmp/qemu \
                                -e QEMU_SRC=/var/tmp/qemu \
-                               -e V=$V -e J=$J \
+                               -e V=$V -e J=$J -e PAUSE=$(PAUSE)\
                                -v /var/tmp/qemu-docker-ccache:/var/tmp/ccache \
                                -e CCACHE_DIR=/var/tmp/ccache \
                                qemu:$(IMAGE) \
diff --git a/tests/docker/run b/tests/docker/run
index 55b2737..cc8d246 100755
--- a/tests/docker/run
+++ b/tests/docker/run
@@ -23,4 +23,12 @@ if test -n "$J"; then
 fi
 
 cd $QEMU_SRC/tests/docker
+
+if test -n "$PAUSE"; then
+    echo "* Prepared to run command:"
+    echo "  $@"
+    echo "* Hit Ctrl-D to continue, or type 'exit 1' to quit"
+    echo
+    $SHELL
+fi
 "$@"
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]