* [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm
@ 2010-05-19 9:20 Jason Wang
2010-05-19 9:20 ` [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation Jason Wang
2010-05-19 9:20 ` [PATCH 3/3] KVM test: Add implementation of network based " Jason Wang
0 siblings, 2 replies; 7+ messages in thread
From: Jason Wang @ 2010-05-19 9:20 UTC (permalink / raw)
To: lmr, autotest; +Cc: kvm
"-kernel" option is useful for both unattended installation and the
unittest in /kvm/user/test.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
client/tests/kvm/kvm_vm.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index c203e14..2515859 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -288,6 +288,16 @@ class VM:
tftp = kvm_utils.get_path(root_dir, tftp)
qemu_cmd += " -tftp %s" % tftp
+ kernel = params.get("kernel")
+ if kernel:
+ kernel = kvm_utils.get_path(root_dir, kernel)
+ qemu_cmd += " -kernel %s" % kernel
+
+ initrd = params.get("initrd")
+ if initrd:
+ initrd = kvm_utils.get_path(root_dir, initrd)
+ qemu_cmd += " -initrd %s" % initrd
+
extra_params = params.get("extra_params")
if extra_params:
qemu_cmd += " %s" % extra_params
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation
2010-05-19 9:20 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
@ 2010-05-19 9:20 ` Jason Wang
2010-05-26 13:58 ` Lucas Meneghel Rodrigues
2010-05-19 9:20 ` [PATCH 3/3] KVM test: Add implementation of network based " Jason Wang
1 sibling, 1 reply; 7+ messages in thread
From: Jason Wang @ 2010-05-19 9:20 UTC (permalink / raw)
To: lmr, autotest; +Cc: kvm
When we do the unattended installation in tap mode, we should use
vm.get_address() instead of the 'localhost' in order the connect to
the finish program running in the guest.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
client/tests/kvm/tests/unattended_install.py | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py
index e2cec8e..e71f993 100644
--- a/client/tests/kvm/tests/unattended_install.py
+++ b/client/tests/kvm/tests/unattended_install.py
@@ -17,7 +17,6 @@ def run_unattended_install(test, params, env):
vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
port = vm.get_port(int(params.get("guest_port_unattended_install")))
- addr = ('localhost', port)
if params.get("post_install_delay"):
post_install_delay = int(params.get("post_install_delay"))
else:
@@ -31,17 +30,19 @@ def run_unattended_install(test, params, env):
time_elapsed = 0
while time_elapsed < install_timeout:
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- client.connect(addr)
- msg = client.recv(1024)
- if msg == 'done':
- if post_install_delay:
- logging.debug("Post install delay specified, "
- "waiting %ss...", post_install_delay)
- time.sleep(post_install_delay)
- break
- except socket.error:
- pass
+ addr = vm.get_address()
+ if addr:
+ try:
+ client.connect((addr, port))
+ msg = client.recv(1024)
+ if msg == 'done':
+ if post_install_delay:
+ logging.debug("Post install delay specified, "
+ "waiting %ss...", post_install_delay)
+ time.sleep(post_install_delay)
+ break
+ except socket.error:
+ pass
time.sleep(1)
client.close()
end_time = time.time()
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] KVM test: Add implementation of network based unattended installation
2010-05-19 9:20 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
2010-05-19 9:20 ` [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation Jason Wang
@ 2010-05-19 9:20 ` Jason Wang
2010-05-27 16:30 ` Lucas Meneghel Rodrigues
1 sibling, 1 reply; 7+ messages in thread
From: Jason Wang @ 2010-05-19 9:20 UTC (permalink / raw)
To: lmr, autotest; +Cc: kvm
This patch could let the unattended installation to be done through
the following method:
- cdrom: the original method which does the installation from cdrom
- url: installing the linux guest from http or ftp, tree url was specified
through url
- nfs: installing the linux guest from nfs. the server address was
specified through nfs_server, and the director was specified through
nfs_dir
For url and nfs installation, the extra_params need to be configurated
to specify the location of unattended files:
- If the unattended file in the tree is used, "extra_parmas= append
ks=floppy" and unattended_file params need to be specified in the
configuration file.
- If the unattended file located at remote server is used,
unattended_file option must be none and "extram_params= append
ks=http://xxx" need to be speficied in the configuration file and
don't forget the add the finish nofitication part.
The --kernel and --initrd were used directly for the network
installation instead of the tftp/bootp param because the user mode
network is too slow to do this.
Only the unattended files for RHEL and Fedora gues ts are modified,
others are kept unmodified and could do the installation from cdrom.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
client/tests/kvm/scripts/unattended.py | 103 +++++++++++++++++++++++++-
client/tests/kvm/tests_base.cfg.sample | 1
client/tests/kvm/unattended/Fedora-10.ks | 2 -
client/tests/kvm/unattended/Fedora-11.ks | 2 -
client/tests/kvm/unattended/Fedora-12.ks | 2 -
client/tests/kvm/unattended/Fedora-8.ks | 2 -
client/tests/kvm/unattended/Fedora-9.ks | 2 -
client/tests/kvm/unattended/RHEL-3-series.ks | 2 -
client/tests/kvm/unattended/RHEL-4-series.ks | 2 -
client/tests/kvm/unattended/RHEL-5-series.ks | 2 -
10 files changed, 107 insertions(+), 13 deletions(-)
diff --git a/client/tests/kvm/scripts/unattended.py b/client/tests/kvm/scripts/unattended.py
index fdadd03..b738e3f 100755
--- a/client/tests/kvm/scripts/unattended.py
+++ b/client/tests/kvm/scripts/unattended.py
@@ -50,6 +50,7 @@ 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.nfs_mount = tempfile.mkdtemp(prefix='nfs_', dir='/tmp')
flopy_name = os.environ['KVM_TEST_floppy']
self.floppy_img = os.path.join(kvm_test_dir, flopy_name)
floppy_dir = os.path.dirname(self.floppy_img)
@@ -60,6 +61,16 @@ class UnattendedInstall(object):
self.pxe_image = os.environ.get('KVM_TEST_pxe_image', '')
self.pxe_initrd = os.environ.get('KVM_TEST_pxe_initrd', '')
+ self.medium = os.environ.get('KVM_TEST_medium', '')
+ self.url = os.environ.get('KVM_TEST_url', '')
+ self.kernel = os.environ.get('KVM_TEST_kernel', '')
+ self.initrd = os.environ.get('KVM_TEST_initrd', '')
+ self.nfs_server = os.environ.get('KVM_TEST_nfs_server', '')
+ self.nfs_dir = os.environ.get('KVM_TEST_nfs_dir', '')
+ self.image_path = kvm_test_dir
+ self.kernel_path = os.path.join(self.image_path, self.kernel)
+ self.initrd_path = os.path.join(self.image_path, self.initrd)
+
def create_boot_floppy(self):
"""
@@ -106,7 +117,8 @@ class UnattendedInstall(object):
dest = os.path.join(self.floppy_mount, dest_fname)
# Replace KVM_TEST_CDKEY (in the unattended file) with the cdkey
- # provided for this test
+ # provided for this test and replace the KVM_TEST_MEDIUM with
+ # the tree url or nfs address provided for this test.
unattended_contents = open(self.unattended_file).read()
dummy_cdkey_re = r'\bKVM_TEST_CDKEY\b'
real_cdkey = os.environ.get('KVM_TEST_cdkey')
@@ -117,7 +129,20 @@ class UnattendedInstall(object):
else:
print ("WARNING: 'cdkey' required but not specified for "
"this unattended installation")
+
+ dummy_re = r'\bKVM_TEST_MEDIUM\b'
+ if self.medium == "cdrom":
+ content = "cdrom"
+ elif self.medium == "url":
+ content = "url --url %s" % self.url
+ elif self.medium == "nfs":
+ content = "nfs --server=%s --dir=%s" % (self.nfs_server, self.nfs_dir)
+ else:
+ raise SetupError("Unexpected installation medium %s" % self.url)
+
+ unattended_contents = re.sub(dummy_re, content, unattended_contents)
+ print unattended_contents
# Write the unattended file contents to 'dest'
open(dest, 'w').write(unattended_contents)
@@ -216,6 +241,58 @@ class UnattendedInstall(object):
print "PXE boot successfuly set"
+ def setup_url(self):
+ """
+ Download the vmlinuz and initrd.img from URL
+ """
+ print "Downloading the vmlinuz and initrd.img"
+ os.chdir(self.image_path)
+
+ kernel_fetch_cmd = "wget %s/isolinux/%s" % (self.url, self.kernel)
+ initrd_fetch_cmd = "wget %s/isolinux/%s" % (self.url, self.initrd)
+
+ if os.path.exists(self.kernel):
+ os.unlink(self.kernel)
+ if os.path.exists(self.initrd):
+ os.unlink(self.initrd)
+
+ if os.system(kernel_fetch_cmd) != 0:
+ raise SetupError("Could not fetch vmlinuz from %s" % self.url)
+ if os.system(initrd_fetch_cmd) != 0:
+ raise SetupError("Could not fetch initrd.img from %s" % self.url)
+
+ print "Downloading finish"
+
+ def setup_nfs(self):
+ """
+ Copy the vmlinuz and initrd.img from nfs.
+ """
+ print "Copying the vmlinuz and initrd.img from nfs"
+
+ m_cmd = "mount %s:%s %s -o ro" % (self.nfs_server, self.nfs_dir, self.nfs_mount)
+ if os.system(m_cmd):
+ raise SetupError('Could not mount nfs server.')
+
+ kernel_fetch_cmd = "cp %s/isolinux/%s %s" % (self.nfs_mount,
+ self.kernel,
+ self.image_path)
+ initrd_fetch_cmd = "cp %s/isolinux/%s %s" % (self.nfs_mount,
+ self.initrd,
+ self.image_path)
+
+ try:
+ if os.system(kernel_fetch_cmd):
+ raise SetupError("Could not copy the vmlinuz from %s" %
+ self.nfs_mount)
+ if os.system(initrd_fetch_cmd):
+ raise SetupError("Could not copy the initrd.img from %s" %
+ self.nfs_mount)
+ finally:
+ u_cmd = "umount %s" % self.nfs_mount
+ if os.system(u_cmd):
+ raise SetupError("Could not unmont nfs at %s" % self.nfs_mount)
+ self.cleanup(self.nfs_mount)
+
def cleanup(self, mount):
"""
Clean up a previously used mountpoint.
@@ -234,6 +311,7 @@ class UnattendedInstall(object):
print "Starting unattended install setup"
print "Variables set:"
+ print " medium: " + str(self.medium)
print " qemu_img_bin: " + str(self.qemu_img_bin)
print " cdrom iso: " + str(self.cdrom_iso)
print " unattended_file: " + str(self.unattended_file)
@@ -245,10 +323,25 @@ class UnattendedInstall(object):
print " pxe_dir: " + str(self.pxe_dir)
print " pxe_image: " + str(self.pxe_image)
print " pxe_initrd: " + str(self.pxe_initrd)
-
- self.create_boot_floppy()
- if self.tftp_root:
- self.setup_pxe_boot()
+ print " url: " + str(self.url)
+ print " kernel: " + str(self.kernel)
+ print " initrd: " + str(self.initrd)
+ print " nfs_server: " + str(self.nfs_server)
+ print " nfs_dir: " + str(self.nfs_dir)
+ print " nfs_mount: " + str(self.nfs_mount)
+
+ if self.unattended_file:
+ self.create_boot_floppy()
+ if self.medium == "cdrom":
+ if self.tftp_root:
+ self.setup_pxe_boot()
+ elif self.medium == "url":
+ self.setup_url()
+ elif self.medium == "nfs":
+ self.setup_nfs()
+ else:
+ raise SetupError("Unexpected installation method %s" %
+ self.medium)
print "Unattended install setup finished successfuly"
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index 646738b..789ae23 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -83,6 +83,7 @@ variants:
nic_mode = user
redirs += " unattended_install"
guest_port_unattended_install = 12323
+ medium = cdrom
- boot: install setup unattended_install
type = boot
diff --git a/client/tests/kvm/unattended/Fedora-10.ks b/client/tests/kvm/unattended/Fedora-10.ks
index 61e59d7..43c236a 100644
--- a/client/tests/kvm/unattended/Fedora-10.ks
+++ b/client/tests/kvm/unattended/Fedora-10.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
diff --git a/client/tests/kvm/unattended/Fedora-11.ks b/client/tests/kvm/unattended/Fedora-11.ks
index 0be7d06..bef3af7 100644
--- a/client/tests/kvm/unattended/Fedora-11.ks
+++ b/client/tests/kvm/unattended/Fedora-11.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US
diff --git a/client/tests/kvm/unattended/Fedora-12.ks b/client/tests/kvm/unattended/Fedora-12.ks
index 0be7d06..bef3af7 100644
--- a/client/tests/kvm/unattended/Fedora-12.ks
+++ b/client/tests/kvm/unattended/Fedora-12.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US
diff --git a/client/tests/kvm/unattended/Fedora-8.ks b/client/tests/kvm/unattended/Fedora-8.ks
index f4a872d..cde85dd 100644
--- a/client/tests/kvm/unattended/Fedora-8.ks
+++ b/client/tests/kvm/unattended/Fedora-8.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
diff --git a/client/tests/kvm/unattended/Fedora-9.ks b/client/tests/kvm/unattended/Fedora-9.ks
index f4a872d..cde85dd 100644
--- a/client/tests/kvm/unattended/Fedora-9.ks
+++ b/client/tests/kvm/unattended/Fedora-9.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
diff --git a/client/tests/kvm/unattended/RHEL-3-series.ks b/client/tests/kvm/unattended/RHEL-3-series.ks
index 884b386..5321118 100644
--- a/client/tests/kvm/unattended/RHEL-3-series.ks
+++ b/client/tests/kvm/unattended/RHEL-3-series.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
diff --git a/client/tests/kvm/unattended/RHEL-4-series.ks b/client/tests/kvm/unattended/RHEL-4-series.ks
index ce4a430..159998b 100644
--- a/client/tests/kvm/unattended/RHEL-4-series.ks
+++ b/client/tests/kvm/unattended/RHEL-4-series.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
diff --git a/client/tests/kvm/unattended/RHEL-5-series.ks b/client/tests/kvm/unattended/RHEL-5-series.ks
index f4a872d..cde85dd 100644
--- a/client/tests/kvm/unattended/RHEL-5-series.ks
+++ b/client/tests/kvm/unattended/RHEL-5-series.ks
@@ -1,5 +1,5 @@
install
-cdrom
+KVM_TEST_MEDIUM
text
reboot
lang en_US.UTF-8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation
2010-05-19 9:20 ` [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation Jason Wang
@ 2010-05-26 13:58 ` Lucas Meneghel Rodrigues
2010-05-28 8:20 ` Jason Wang
0 siblings, 1 reply; 7+ messages in thread
From: Lucas Meneghel Rodrigues @ 2010-05-26 13:58 UTC (permalink / raw)
To: Jason Wang; +Cc: autotest, kvm
On Wed, 2010-05-19 at 17:20 +0800, Jason Wang wrote:
> When we do the unattended installation in tap mode, we should use
> vm.get_address() instead of the 'localhost' in order the connect to
> the finish program running in the guest.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> client/tests/kvm/tests/unattended_install.py | 25 +++++++++++++------------
> 1 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py
> index e2cec8e..e71f993 100644
> --- a/client/tests/kvm/tests/unattended_install.py
> +++ b/client/tests/kvm/tests/unattended_install.py
> @@ -17,7 +17,6 @@ def run_unattended_install(test, params, env):
> vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
>
> port = vm.get_port(int(params.get("guest_port_unattended_install")))
> - addr = ('localhost', port)
> if params.get("post_install_delay"):
> post_install_delay = int(params.get("post_install_delay"))
> else:
> @@ -31,17 +30,19 @@ def run_unattended_install(test, params, env):
> time_elapsed = 0
> while time_elapsed < install_timeout:
> client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> - try:
> - client.connect(addr)
> - msg = client.recv(1024)
> - if msg == 'done':
> - if post_install_delay:
> - logging.debug("Post install delay specified, "
> - "waiting %ss...", post_install_delay)
> - time.sleep(post_install_delay)
> - break
> - except socket.error:
> - pass
> + addr = vm.get_address()
> + if addr:
^ Per coding style, we should check for is None
if addr is not None:
> + try:
> + client.connect((addr, port))
> + msg = client.recv(1024)
> + if msg == 'done':
> + if post_install_delay:
> + logging.debug("Post install delay specified, "
> + "waiting %ss...", post_install_delay)
> + time.sleep(post_install_delay)
> + break
> + except socket.error:
> + pass
^ If vm.get_address() returns None, we'll have to fail the test, if we
don't we'll get a false PASS.
> time.sleep(1)
> client.close()
> end_time = time.time()
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] KVM test: Add implementation of network based unattended installation
2010-05-19 9:20 ` [PATCH 3/3] KVM test: Add implementation of network based " Jason Wang
@ 2010-05-27 16:30 ` Lucas Meneghel Rodrigues
0 siblings, 0 replies; 7+ messages in thread
From: Lucas Meneghel Rodrigues @ 2010-05-27 16:30 UTC (permalink / raw)
To: Jason Wang; +Cc: autotest, kvm
On Wed, 2010-05-19 at 17:20 +0800, Jason Wang wrote:
> This patch could let the unattended installation to be done through
> the following method:
>
> - cdrom: the original method which does the installation from cdrom
> - url: installing the linux guest from http or ftp, tree url was specified
> through url
> - nfs: installing the linux guest from nfs. the server address was
> specified through nfs_server, and the director was specified through
> nfs_dir
>
> For url and nfs installation, the extra_params need to be configurated
> to specify the location of unattended files:
>
> - If the unattended file in the tree is used, "extra_parmas= append
> ks=floppy" and unattended_file params need to be specified in the
> configuration file.
> - If the unattended file located at remote server is used,
> unattended_file option must be none and "extram_params= append
> ks=http://xxx" need to be speficied in the configuration file and
> don't forget the add the finish nofitication part.
>
> The --kernel and --initrd were used directly for the network
> installation instead of the tftp/bootp param because the user mode
> network is too slow to do this.
Hi Jason, I had reviewed your patchset, implemented the suggestions I
pointed out, and I have one more thing we need to work out before we
commit this - We absolutely need to provide examples on the config file,
decently commented. So, could you please provide examples:
* HTTP install using remote kickstart
* NFS install using local kickstart
And re-send the patchset? I will send the patchset with my modifications
directly to you and will wait on your follow up.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation
2010-05-26 13:58 ` Lucas Meneghel Rodrigues
@ 2010-05-28 8:20 ` Jason Wang
0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2010-05-28 8:20 UTC (permalink / raw)
To: Lucas Meneghel Rodrigues; +Cc: autotest, kvm
Lucas Meneghel Rodrigues wrote:
> On Wed, 2010-05-19 at 17:20 +0800, Jason Wang wrote:
>
>> When we do the unattended installation in tap mode, we should use
>> vm.get_address() instead of the 'localhost' in order the connect to
>> the finish program running in the guest.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>> client/tests/kvm/tests/unattended_install.py | 25 +++++++++++++------------
>> 1 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py
>> index e2cec8e..e71f993 100644
>> --- a/client/tests/kvm/tests/unattended_install.py
>> +++ b/client/tests/kvm/tests/unattended_install.py
>> @@ -17,7 +17,6 @@ def run_unattended_install(test, params, env):
>> vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
>>
>> port = vm.get_port(int(params.get("guest_port_unattended_install")))
>> - addr = ('localhost', port)
>> if params.get("post_install_delay"):
>> post_install_delay = int(params.get("post_install_delay"))
>> else:
>> @@ -31,17 +30,19 @@ def run_unattended_install(test, params, env):
>> time_elapsed = 0
>> while time_elapsed < install_timeout:
>> client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>> - try:
>> - client.connect(addr)
>> - msg = client.recv(1024)
>> - if msg == 'done':
>> - if post_install_delay:
>> - logging.debug("Post install delay specified, "
>> - "waiting %ss...", post_install_delay)
>> - time.sleep(post_install_delay)
>> - break
>> - except socket.error:
>> - pass
>> + addr = vm.get_address()
>> + if addr:
>>
>
> ^ Per coding style, we should check for is None
>
> if addr is not None:
>
>
>> + try:
>> + client.connect((addr, port))
>> + msg = client.recv(1024)
>> + if msg == 'done':
>> + if post_install_delay:
>> + logging.debug("Post install delay specified, "
>> + "waiting %ss...", post_install_delay)
>> + time.sleep(post_install_delay)
>> + break
>> + except socket.error:
>> + pass
>>
>
> ^ If vm.get_address() returns None, we'll have to fail the test, if we
> don't we'll get a false PASS.
>
>
An vm may not get its ip address during the startup and because we have
timeout, I think it's safe here.
>> time.sleep(1)
>> client.close()
>> end_time = time.time()
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm
@ 2010-05-28 8:25 Jason Wang
0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2010-05-28 8:25 UTC (permalink / raw)
To: lmr, autotest; +Cc: kvm
"-kernel" option is useful for both unattended installation and the
unittest in /kvm/user/test.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
client/tests/kvm/kvm_vm.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index bca9d15..c7eed56 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -360,6 +360,16 @@ class VM:
tftp = kvm_utils.get_path(root_dir, tftp)
qemu_cmd += add_tftp(help, tftp)
+ kernel = params.get("kernel")
+ if kernel:
+ kernel = kvm_utils.get_path(root_dir, kernel)
+ qemu_cmd += " -kernel %s" % kernel
+
+ initrd = params.get("initrd")
+ if initrd:
+ initrd = kvm_utils.get_path(root_dir, initrd)
+ qemu_cmd += " -initrd %s" % initrd
+
for redir_name in kvm_utils.get_sub_dict_names(params, "redirs"):
redir_params = kvm_utils.get_sub_dict(params, redir_name)
guest_port = int(redir_params.get("guest_port"))
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-05-28 8:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 9:20 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
2010-05-19 9:20 ` [PATCH 2/3] KVM test: Do not use the hard-coded address during unattended installation Jason Wang
2010-05-26 13:58 ` Lucas Meneghel Rodrigues
2010-05-28 8:20 ` Jason Wang
2010-05-19 9:20 ` [PATCH 3/3] KVM test: Add implementation of network based " Jason Wang
2010-05-27 16:30 ` Lucas Meneghel Rodrigues
-- strict thread matches above, loose matches on Subject: below --
2010-05-28 8:25 [PATCH 1/3] KVM test: Add the support of kernel and initrd option for qemu-kvm Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).