summaryrefslogtreecommitdiffstats
path: root/tests/vm/basevm.py
diff options
context:
space:
mode:
authorFam Zheng2018-07-12 03:28:26 +0200
committerFam Zheng2018-08-15 04:12:35 +0200
commit983c2a777beba7b17e057810d94e380e05a74294 (patch)
treefd15a119eb7551468b8286588ef6930608e2f4f5 /tests/vm/basevm.py
parentdocker: Install more packages in centos7 (diff)
downloadqemu-983c2a777beba7b17e057810d94e380e05a74294.tar.gz
qemu-983c2a777beba7b17e057810d94e380e05a74294.tar.xz
qemu-983c2a777beba7b17e057810d94e380e05a74294.zip
tests: Add an option for snapshot (default: off)
Not using snapshot has the benefit of automatically persisting useful test harnesses, such as docker images and ccache database. Although it will lose some cleanness, it is imaginably useful for patchew. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20180712012829.20231-2-famz@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'tests/vm/basevm.py')
-rwxr-xr-xtests/vm/basevm.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index d80cc8ab85..1f1579dc9a 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -217,6 +217,8 @@ def parse_args(vm_name):
help="build QEMU from source in guest")
parser.add_option("--interactive", "-I", action="store_true",
help="Interactively run command")
+ parser.add_option("--snapshot", "-s", action="store_true",
+ help="run tests with a snapshot")
parser.disable_interspersed_args()
return parser.parse_args()
@@ -242,7 +244,10 @@ def main(vmcls):
jobs=args.jobs)]
else:
cmd = argv
- vm.boot(args.image + ",snapshot=on")
+ img = args.image
+ if args.snapshot:
+ img += ",snapshot=on"
+ vm.boot(img)
vm.wait_ssh()
except Exception as e:
if isinstance(e, SystemExit) and e.code == 0: