public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: yogi <anantyog@linux.vnet.ibm.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST PATCH 3/5] KVM test: Support for Parallel install of guest OS
Date: Wed, 10 Feb 2010 11:09:27 -0600	[thread overview]
Message-ID: <20100210170927.GT6083@us.ibm.com> (raw)
In-Reply-To: <1265819372.6747.29.camel@yogi-laptop>

* Yogananth Subramanian <anantyog@linux.vnet.ibm.com> [2010-02-10 10:30]:
> >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.
> 
> 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"
> 
>          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)

Rather than hard-coding these locations, I think the test config file
should have a variable for the location of the kernel and initrd and 
have us read this from the config.

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

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

  reply	other threads:[~2010-02-10 17:09 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 [this message]
2010-02-10 17:22   ` [Autotest] " Lucas Meneghel Rodrigues
2010-02-10 17:45     ` 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=20100210170927.GT6083@us.ibm.com \
    --to=ryanh@us.ibm.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