public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: yogi <anantyog@linux.vnet.ibm.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [Autotest] [KVM-AUTOTEST PATCH 3/5] KVM test: Support for Parallel install of guest OS
Date: Wed, 10 Feb 2010 15:22:04 -0200	[thread overview]
Message-ID: <1265822524.2273.23.camel@localhost.localdomain> (raw)
In-Reply-To: <1265819372.6747.29.camel@yogi-laptop>

On Wed, 2010-02-10 at 21:59 +0530, yogi wrote:
> >From 0aa8ed40de86eb8ad5b324177b2e0986e1c32c77 Mon Sep 17 00:00:00 2001
> From: yogananth subramanian <anantyog@linux.vnet.ibm.com>
> 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.

Just some quick comments on this one, because those are important to
complete what I asked, which is split the patchsets in 2.

> 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@linux.vnet.ibm.com>
> ---
>  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"

Perhaps .suse as a file extension should be avoided, as having the XML
extension will help people with their source code editors, let's keep it
an .xml file and take advantage of the fact that windows unattended
install does not use TFTP setup at all, so we can just verify if
self.tftp_root contains a non-empty string to tell apart windows files
and SUSE files.

>          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)

As Ryan pointed out, on the above block we could just make use of the
configuration system and put the locations for kernel and initrd there,
making the code generic.

> +        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()



  parent reply	other threads:[~2010-02-10 17:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 16:23 [Autotest] [KVM-AUTOTEST PATCH 0/5] KVM test: Support for Parallel install of guest OS yogi
2010-02-10 16:28 ` [KVM-AUTOTEST PATCH 1/5] " yogi
2010-02-10 16:29 ` [KVM-AUTOTEST PATCH 2/5] " yogi
2010-02-10 16:29 ` [KVM-AUTOTEST PATCH 3/5] " yogi
2010-02-10 17:09   ` Ryan Harper
2010-02-10 17:22   ` Lucas Meneghel Rodrigues [this message]
2010-02-10 17:45     ` [Autotest] " yogi
2010-02-10 16:30 ` [Autotest] [KVM-AUTOTEST PATCH 4/5] " yogi
2010-02-10 16:30 ` [KVM-AUTOTEST PATCH 5/5] " yogi
2010-02-10 17:13 ` [Autotest] [KVM-AUTOTEST PATCH 0/5] " Lucas Meneghel Rodrigues
2010-02-10 17:54   ` Ryan Harper
2010-02-10 19:41     ` Lucas Meneghel Rodrigues
2010-02-10 18:00   ` [Autotest] " yogi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265822524.2273.23.camel@localhost.localdomain \
    --to=lmr@redhat.com \
    --cc=anantyog@linux.vnet.ibm.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox