[Autotest] [KVM-AUTOTEST PATCH 3/5] KVM test: Support for Parallel install of guest OS

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

 



>From 0aa8ed40de86eb8ad5b324177b2e0986e1c32c77 Mon Sep 17 00:00:00 2001
From: yogananth subramanian <anantyog@xxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Feb 2010 09:45:58 -0500
Subject: [PATCH 3/5] kvm test: unattended: add support for parallel
install of suse and other guest OS

File extension of the unattended file ".suse", in case of Sles is
used to identify the guest OS.
Since the netboot image path and the kernel name differs for
both sles and Rhel, its important to identify the type of
guest being installed.

The funtion "create_boot_floppy()" is called during initialization
ranther from the funtion "setup", since its important to indentify
the OS type being installed duiring initializatoin.

Signed-off-by: yogananth subramanian <anantyog@xxxxxxxxxxxxxxxxxx>
---
 client/tests/kvm/scripts/unattended.py |   30
+++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/client/tests/kvm/scripts/unattended.py
b/client/tests/kvm/scripts/unattended.py
index 87a8973..2257abf 100755
--- a/client/tests/kvm/scripts/unattended.py
+++ b/client/tests/kvm/scripts/unattended.py
@@ -59,8 +59,9 @@ class UnattendedInstall(object):
         self.cdrom_iso = os.path.join(kvm_test_dir, cdrom_iso)
         self.floppy_mount = tempfile.mkdtemp(prefix='floppy_',
dir='/tmp')
         self.cdrom_mount = tempfile.mkdtemp(prefix='cdrom_',
dir='/tmp')
-        self.floppy_img = os.path.join(images_dir, 'floppy.img')
-
+        flopy_name = os.path.basename(os.environ['KVM_TEST_floppy'])
+        self.floppy_img = os.path.join(images_dir, flopy_name)
+        self.create_boot_floppy()
 
     def create_boot_floppy(self):
         """
@@ -93,8 +94,12 @@ class UnattendedInstall(object):
             shutil.copyfile(setup_file_path, setup_file_dest)
         elif self.unattended_file.endswith('.ks'):
             dest_fname = 'ks.cfg'
+            self.os = "redhat"
         elif self.unattended_file.endswith('.xml'):
             dest_fname = "autounattend.xml"
+        elif self.unattended_file.endswith('.suse'):
+            dest_fname = "autoinst.xml"
+            self.os = "suse"
 
         dest = os.path.join(self.floppy_mount, dest_fname)
 
@@ -160,10 +165,22 @@ class UnattendedInstall(object):
         if os.system(m_cmd):
             raise SetupError('Could not mount CD image %s.' %
self.cdrom_iso)
 
-        p = os.path.join('images', 'pxeboot')
-        pxe_dir = os.path.join(self.cdrom_mount, p)
-        pxe_image = os.path.join(pxe_dir, 'vmlinuz')
-        pxe_initrd = os.path.join(pxe_dir, 'initrd.img')
+        if self.os == "redhat":
+            kernel = 'vmlinuz'
+            initrd = 'initrd.img'
+            p = os.path.join('images', 'pxeboot')
+            pxe_dir = os.path.join(self.cdrom_mount, p)
+        else :
+            kernel = 'linux'
+            initrd = 'initrd'
+            p = os.path.join('boot/x86_64', 'loader')
+            pxe_dir = os.path.join(self.cdrom_mount, p)
+            if not os.path.isdir(pxe_dir):
+                p = os.path.join('boot/i386', 'loader')
+                pxe_dir = os.path.join(self.cdrom_mount, p)
+
+        pxe_image = os.path.join(pxe_dir, kernel)
+        pxe_initrd = os.path.join(pxe_dir, initrd)
 
         if not os.path.isdir(pxe_dir):
             raise SetupError('The ISO image does not have a %s dir. The
script '
@@ -229,7 +246,6 @@ class UnattendedInstall(object):
         print "    floppy_img: " + str(self.floppy_img)
         print "    finish_program: " + str(self.finish_program)
 
-        self.create_boot_floppy()
         if self.tftp_root:
             self.setup_pxe_boot()
         self.cleanup()
-- 
1.6.2.5



--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux