From 896e1e191a93c849ea6cbaf602be98834275896c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 17 Jun 2016 12:15:20 +0100 Subject: [PATCH] p2v: Add run-virt-p2v-non-gui-conversion target. This simulates doing a non-GUI conversion with virt-p2v being downloaded over PXE. Conveniently we already had a test that was doing this, and this rule just runs the same test. --- .gitignore | 1 + docs/guestfs-hacking.pod | 7 +++++++ p2v/Makefile.am | 12 ++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b537231c9..c781ba0e5 100644 --- a/.gitignore +++ b/.gitignore @@ -322,6 +322,7 @@ Makefile.in /p2v/dependencies.redhat /p2v/dependencies.suse /p2v/launch-virt-p2v +/p2v/stamp-test-virt-p2v-pxe-data-files /p2v/stamp-test-virt-p2v-pxe-hostkey /p2v/stamp-test-virt-p2v-pxe-kernel /p2v/stamp-test-virt-p2v-pxe-userkey diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod index f2b8e779f..69714e1e2 100644 --- a/docs/guestfs-hacking.pod +++ b/docs/guestfs-hacking.pod @@ -841,6 +841,13 @@ version of qemu) quickly after the boot and select the second (USB) drive, since it's not possible to force qemu/seabios to boot automatically from the USB drive containing virt-p2v. +A third way to run virt-p2v simulates fairly accurately the program +being downloaded over PXE and then doing an automatic conversion of +the source physical machine (the non-GUI path -- see next section +below): + + make -C p2v run-virt-p2v-non-gui-conversion + =head2 Understanding the virt-p2v code I L diff --git a/p2v/Makefile.am b/p2v/Makefile.am index f76142a7d..49d653ba7 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -36,6 +36,7 @@ EXTRA_DIST = \ # consume system entropy to regenerate. CLEANFILES = \ $(dependencies_files) \ + stamp-test-virt-p2v-pxe-data-files \ stamp-test-virt-p2v-pxe-kernel \ stamp-virt-p2v.pod \ stamp-virt-p2v-make-disk.pod \ @@ -194,6 +195,9 @@ run-virt-p2v-in-a-vm: virt-p2v.img $(PHYSICAL_MACHINE) -device e1000,netdev=net2 \ & +run-virt-p2v-non-gui-conversion: stamp-test-virt-p2v-pxe-data-files + SLOW=1 $(top_builddir)/run ./test-virt-p2v-pxe.sh + $(top_builddir)/test-data/phony-guests/windows.img: $(MAKE) -C $(top_builddir)/test-data/phony-guests windows.img @@ -216,13 +220,17 @@ endif ENABLE_APPLIANCE SLOW_TESTS = \ test-virt-p2v-pxe.sh -check-slow: test-virt-p2v-pxe.img \ +check-slow: stamp-test-virt-p2v-pxe-data-files + $(MAKE) check TESTS="$(SLOW_TESTS)" SLOW=1 + +stamp-test-virt-p2v-pxe-data-files: \ + test-virt-p2v-pxe.img \ test-virt-p2v-pxe.vmlinuz test-virt-p2v-pxe.initramfs \ test-virt-p2v-pxe.sshd_config \ test-virt-p2v-pxe.ssh_host_rsa_key \ test-virt-p2v-pxe.ssh_host_rsa_key.pub \ test-virt-p2v-pxe.id_rsa test-virt-p2v-pxe.id_rsa.pub - $(MAKE) check TESTS="$(SLOW_TESTS)" SLOW=1 + touch $@ test-virt-p2v-pxe.img: virt-p2v-make-disk \ virt-p2v \