[v2,1/4] tests: Add an option for snapshot (default: off)
diff mbox series

Message ID 20180711141829.17406-2-famz@redhat.com
State New
Headers show
  • Add a CentOS test image to run docker tests
Related show

Commit Message

Fam Zheng July 11, 2018, 2:18 p.m. UTC
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>
 tests/vm/basevm.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 3643117816..e5d6a328d5 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -216,6 +216,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")
     return parser.parse_args()
@@ -241,7 +243,10 @@  def main(vmcls):
             cmd = argv
-        vm.boot(args.image + ",snapshot=on")
+        img = args.image
+        if args.snapshot:
+            img += ",snapshot=on"
+        vm.boot(img)
     except Exception as e:
         if isinstance(e, SystemExit) and e.code == 0: