mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
8158ed48bb
commit
983c2a777b
|
@ -217,6 +217,8 @@ def parse_args(vm_name):
|
||||||
help="build QEMU from source in guest")
|
help="build QEMU from source in guest")
|
||||||
parser.add_option("--interactive", "-I", action="store_true",
|
parser.add_option("--interactive", "-I", action="store_true",
|
||||||
help="Interactively run command")
|
help="Interactively run command")
|
||||||
|
parser.add_option("--snapshot", "-s", action="store_true",
|
||||||
|
help="run tests with a snapshot")
|
||||||
parser.disable_interspersed_args()
|
parser.disable_interspersed_args()
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
@ -242,7 +244,10 @@ def main(vmcls):
|
||||||
jobs=args.jobs)]
|
jobs=args.jobs)]
|
||||||
else:
|
else:
|
||||||
cmd = argv
|
cmd = argv
|
||||||
vm.boot(args.image + ",snapshot=on")
|
img = args.image
|
||||||
|
if args.snapshot:
|
||||||
|
img += ",snapshot=on"
|
||||||
|
vm.boot(img)
|
||||||
vm.wait_ssh()
|
vm.wait_ssh()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if isinstance(e, SystemExit) and e.code == 0:
|
if isinstance(e, SystemExit) and e.code == 0:
|
||||||
|
|
Loading…
Reference in New Issue