[Autotest] [KVM-AUTOTEST][PATCH V2] Patch to install cygwin and run autotest in windows
Hello Lucas, I like to resubmit this patch, in the previous patch i had hard coded it for doing local installation and had missed the remote installation part. So in this patch i have fixed it, 'cyg_param' take different vlaues for local and remote install, to avoid the error in previous patch. Have also altered the commit message, to make it more lucid. Thanks yogi -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] This patch enables installing cygwin and running autotest in windows guests
From: Yogananth subramanian The patch creates two new files 'scripts/cyg_install.py' and 'tests/cyg_install'. 'scripts/cyg_install.py' is used to install cygwin in unattended mode. This patch also introduces a new parameter 'patch_file'to run_autotest() in kvm_test_utils.py file, to install patch for autotest to run in windows. The file 'autotest_control/autotest.patch' is base patch to run any autotest test cases in windows and file 'autotest_control/iozone.patch' is a patch to run iozone on windows. Signed-off-by: Yogananth subramanian --- client/tests/kvm/autotest_control/autotest.patch | 15 client/tests/kvm/autotest_control/iozone.patch | 12 +++ client/tests/kvm/kvm_test_utils.py | 10 ++- client/tests/kvm/scripts/cyg_install.py | 98 ++ client/tests/kvm/tests/autotest.py | 21 - client/tests/kvm/tests/cyg_install.py| 36 client/tests/kvm/tests_base.cfg.sample | 43 +- 7 files changed, 231 insertions(+), 4 deletions(-) create mode 100644 client/tests/kvm/autotest_control/autotest.patch create mode 100644 client/tests/kvm/autotest_control/iozone.patch create mode 100644 client/tests/kvm/scripts/cyg_install.py create mode 100644 client/tests/kvm/tests/cyg_install.py diff --git a/client/tests/kvm/autotest_control/autotest.patch b/client/tests/kvm/autotest_control/autotest.patch new file mode 100644 index 000..f562f95 --- /dev/null +++ b/client/tests/kvm/autotest_control/autotest.patch @@ -0,0 +1,15 @@ +diff -aurpN client/bin/job.py client-new/bin/job.py +--- client/bin/job.py 2010-08-25 01:42:27.0 -0400 client-new/bin/job.py 2010-09-07 09:54:30.0 -0400 +@@ -296,7 +296,10 @@ class base_client_job(base_job.base_job) + + # extract console= and other args from cmdline and add them into the + # base args that we use for all kernels we install +-cmdline = utils.read_one_line('/proc/cmdline') ++if os.path.exists('/proc/cmdline'): ++cmdline = utils.read_one_line('/proc/cmdline') ++else: ++return + kernel_args = [] + for karg in cmdline.split(): + for param in copy_cmdline: diff --git a/client/tests/kvm/autotest_control/iozone.patch b/client/tests/kvm/autotest_control/iozone.patch new file mode 100644 index 000..6229205 --- /dev/null +++ b/client/tests/kvm/autotest_control/iozone.patch @@ -0,0 +1,12 @@ +diff -aurpN client/tests/iozone/iozone.py client-new/tests/iozone/iozone.py +--- client/tests/iozone/iozone.py 2010-08-25 01:42:27.0 -0400 client-new/tests/iozone/iozone.py 2010-09-02 11:38:42.0 -0400 +@@ -43,7 +43,7 @@ class iozone(test.test): + elif (arch == 'x86_64'): + utils.system('make linux-AMD64') + else: +-utils.system('make linux') ++utils.system('make Windows') + + + def run_once(self, dir=None, args=None): diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py index 5412aac..34bccb8 100644 --- a/client/tests/kvm/kvm_test_utils.py +++ b/client/tests/kvm/kvm_test_utils.py @@ -336,7 +336,7 @@ def get_memory_info(lvms): return meminfo -def run_autotest(vm, session, control_path, timeout, outputdir): +def run_autotest(vm, session, control_path, timeout, outputdir, patch_file): """ Run an autotest control file inside a guest (linux only utility). @@ -346,6 +346,7 @@ def run_autotest(vm, session, control_path, timeout, outputdir): @param timeout: Timeout under which the autotest control file must complete. @param outputdir: Path on host where we should copy the guest autotest results to. +@param patch_file: A path to an autotest patch file. """ def copy_if_hash_differs(vm, local_path, remote_path): """ @@ -460,12 +461,19 @@ def run_autotest(vm, session, control_path, timeout, outputdir): os.path.join(autotest_path, 'control')): raise error.TestFail("Could not copy the test control file to guest") +if not patch_file == "": +if not vm.copy_files_to(patch_file, +os.path.join(autotest_path, '../test.patch')): +raise error.TestFail("Could not copy the test patch file to guest") + # Run the test logging.info("Running autotest control file %s on guest, timeout %ss", os.path.basename(control_path), timeout) session.get_command_output("cd %s" % autotest_path) session.get_command_output("rm -f control.state") session.get_command_output("rm -rf results/*") +if not patch_file
Patch to install cygwin and run autotest in windows
Hello Lucas, Submitting the patch again using "git send-email", there was some issue with git config, its resolved now.Thanks for the link. I tried not to make any drastic change to the kvm-autotest infrastructure, run_autotest() accepts an additonal parameter, other then that rest of the patch does not make any major change to existing code. Pasting below the contents of my previous mail, for reference. Autotest part of the patch: This patch introduces a new parameter 'test_patch_file' in tests_config to indicate the patch file. Two new files are added related to patching autotest, 'autotest.patch' which is like base patch for autotest, needed to run autotest in windows and 'iozone.patch' which to used run iozone on windows. Similar patches could be developed for test cases like 'dacapo' and sysbench which would enable running tests related to java and mysql/postgresql, i will be happy to write patches for them too. Cygwin installtion part of the patch: This patch also adds two new files 'scripts/cyg_install.py' and 'tests/cyg_install'. 'scripts/cyg_install.py' is used to do unattended install on cygwin. The parameter 'cyg_path' indicates the path of the setup file. Installation can be done either local, using 'cyg_install.local' or remotly,using cyg_install.remote'. Local installation requires both the cygwin setup and packages files to be present locally at the path indicated by 'cyg_path'. The parameter 'cyg_param' is used to pass the command line options for cygwin setup. So it can contain options for packages to be installed, proxy server to be used to do remote installation and so on. An iso image cyg.iso containing the setup and packages in case of local install and just the setup in case of remote install, is created on the fly. Installation is started using telnet. This patch acts as complement to the existing support for running tests using Autoit.I will be happy to re-implement or modify the patch based to your comments and also write patch for other test cases like sysbench, dacapo. Thanks yogi -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [Autotest] [KVM-AUTOTEST]Opensuse unattended install
Adds support to do unattended install of Opensuse11, patch adds a new autoyast file (OpenSUSE.xml) and creates entries for unattended install in tests_base.cfg. The patch also introduces a small delay(about 10s) in unattended_install.py file, for autoyast to finsih configuration. Signed-off-by: Yogananth Subramanian --- client/tests/kvm/tests/unattended_install.py |1 + client/tests/kvm/tests_base.cfg.sample | 119 ++--- client/tests/kvm/unattended/OpenSUSE11.xml | 251 ++ 3 files changed, 343 insertions(+), 28 deletions(-) create mode 100644 client/tests/kvm/unattended/OpenSUSE11.xml diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py index 1ddb996..310a353 100644 --- a/client/tests/kvm/tests/unattended_install.py +++ b/client/tests/kvm/tests/unattended_install.py @@ -31,6 +31,7 @@ def run_unattended_install(test, params, env): client.connect(addr) msg = client.recv(1024) if msg == 'done': +time.sleep(10) break except socket.error: pass diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index 9963a44..3ae0d83 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -343,7 +343,7 @@ variants: pxe_image = "vmlinuz" pxe_initrd = "initrd.img" tftp = "images/tftpboot" -extra_params += " -bootp /pxelinux.0 -boot n" +extra_params += " -bootp /pxelinux.0 -boot cn" kernel_args = "ks=floppy nicdelay=60" variants: @@ -476,32 +476,95 @@ variants: md5sum = 7e9e183dc11b9d39f480238e4e12bb05 md5sum_1m = dc7865a75db665efc86d59bca7c1fe07 -- openSUSE-11.0.32: -no setup dbench bonnie -image_name = openSUSE-11.0-32 -install: -steps = openSUSE-11.0-32.steps -cdrom = linux/openSUSE-11.0-DVD-i386.iso -md5sum = ed6a5b3feb668866df812b1c2aed9d7f -md5sum_1m = c720b30557af758e69de450409516369 - -- openSUSE-11.1.32: -no setup dbench bonnie -image_name = openSUSE-11.1-32 -install: -steps = openSUSE-11.1-32-and-64.steps -cdrom = linux/openSUSE-11.1-DVD-i586.iso -md5sum = 8f51b278c0415be28c5699e465444bd3 -md5sum_1m = b70217417468389083429f81ba7ce2bd - -- openSUSE-11.1.64: -no setup dbench bonnie -image_name = openSUSE-11.1-64 -install: -steps = openSUSE-11.1-32-and-64.steps -cdrom = linux/openSUSE-11.1-DVD-x86_64.iso -md5sum = 2afee1b8a87175e6dee2b8dbbd1ad8e8 -md5sum_1m = 768ca32503ef92c28f2d144f2a87e4d0 +- OpenSUSE: +no setup +shell_prompt = ".*:.*\s#" +unattended_install: +pxe_image = "linux" +pxe_initrd = "initrd" +tftp = "images/tftpboot" +extra_params += " -bootp /pxelinux.0 -boot cn" +kernel_args = "autoyast=floppy" + +variants: +- 11.0.32: +no setup autotest linux_s3 +image_name = openSUSE-11.0-32 +cdrom = linux/openSUSE-11.0-DVD-i386.iso +md5sum = ed6a5b3feb668866df812b1c2aed9d7f +md5sum_1m = c720b30557af758e69de450409516369 +install: +steps = openSUSE-11.0-32.steps +unattended_install: +unattended_file = unattended/OpenSUSE11.xml +tftp = images/sles110-32/tftpboot +floppy = images/sles110-32floppy.img +pxe_dir = boot/i386/loader + +- 11.0.64: +no setup autotest linux_s3 +image_name = openSUSE-11.0-64 +cdrom = linux/openSUSE-11.0-DVD-x86_64.iso +md5sum = 512c8346b0f8eb35f28c4eb96454d391 +md5sum_1m = 661aa4cd031df2f25ea0102318a3f4d1 +unattended_install: +unattended_file = unattended/OpenSUSE11.xml +tftp = images/sles110-64/tftpboot +floppy = images/sles110-64floppy.img +
[Autotest] [KVM-AUTOTEST] Unattended install of Opensuse
Hello Lucas, I like to submit a patch to add support to do unattended install of Opensuse. The patch supports Opensuse 11.0 to 11.2(both 32 and 64bit) and works with both ide and virtio drives. Thanks and Regards yogi -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[Autotest] [KVM-AUTOTEST] Patch to fix tap interface support for parallel execution
Hello Lucas, I like to submit a patch to fix support for tap interface in kvm-autotest, while executin it in parallel. This is done by creating workers with different "addres_index", so that MAC address of the guests created will be unique. The currents implementation tries to create just differnt env files and not different Mac address or address_index, so all the guests endup using the same address_index and MAC address. Thanks and Regards Yogi -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [Autotest] [KVM-AUTOTEST] fix tap interface for parallel execution
Adds support to create guests with different MAC address during parallel execution of autotest, this is done by creating worker dicts with different "address_index" Signed-off-by: Yogananth Subramanian --- client/tests/kvm/kvm_scheduler.py |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_scheduler.py b/client/tests/kvm/kvm_scheduler.py index 93b7df6..9000391 100644 --- a/client/tests/kvm/kvm_scheduler.py +++ b/client/tests/kvm/kvm_scheduler.py @@ -33,7 +33,8 @@ class scheduler: # "Personal" worker dicts contain modifications that are applied # specifically to each worker. For example, each worker must use a # different environment file and a different MAC address pool. -self.worker_dicts = [{"env": "env%d" % i} for i in range(num_workers)] +self.worker_dicts = [{"env": "env%d" % i, "address_index": i-1} + for i in range(num_workers)] def worker(self, index, run_test_func): -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] [Autotest] [KVM-AUTOTEST]] support to SLES install
Adds new entry "SUSE" in test_base file for sles and contains autoinst file for doing unatteneded Sles11 64-bit install. Signed-off-by: Yogananth Subramanian --- client/tests/kvm/tests_base.cfg.sample | 22 + client/tests/kvm/unattended/Sles11-64-autoinst.xml | 897 2 files changed, 919 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/unattended/Sles11-64-autoinst.xml diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index b4f7b34..2a5b46b 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -477,6 +477,28 @@ variants: md5sum = 2afee1b8a87175e6dee2b8dbbd1ad8e8 md5sum_1m = 768ca32503ef92c28f2d144f2a87e4d0 +- SUSE: +no setup +shell_prompt = "^r...@.*[\#\$]\s*$|#" +unattended_install: +pxe_image = "linux" +pxe_initrd = "initrd" +extra_params += " -bootp /pxelinux.0 -boot n" +kernel_args = "autoyast=floppy" + +variants: +- 64: +no setup +image_name = sles11-64 +cdrom=linux/SLES-11-DVD-x86_64-GM-DVD1.iso +md5sum = 50a2bd45cd12c3808c3ee48208e2586b +md5sum_1m = 0951cab7c32e332362fc424c1054 +unattended_install: +unattended_file = unattended/Sles11-64-autoinst.xml +tftp = "images/sles11-64/tftpboot" +floppy = "images/sles11-64floppy.img" +pxe_dir = "boot/x86_64/loader" + - @Ubuntu: shell_prompt = "^r...@.*[\#\$]\s*$" diff --git a/client/tests/kvm/unattended/Sles11-64-autoinst.xml b/client/tests/kvm/unattended/Sles11-64-autoinst.xml new file mode 100644 index 000..945d161 --- /dev/null +++ b/client/tests/kvm/unattended/Sles11-64-autoinst.xml @@ -0,0 +1,897 @@ + + +http://www.suse.com/1.0/yast2ns"; xmlns:config="http://www.suse.com/1.0/configns";> + + + + true + false + false + false + true + false + SUSE Linux Enterprise Server 11 - 2.6.27.19-5 + true + false + 2 + 8 + false + + + +processor + + +thermal + + +ata_piix + + +ata_generic + + +piix + + +ide_pci_generic + + +fan + + +jbd + + +ext3 + + +edd + + +grub + + + +YaST_Default_CA +YaST Default CA (linux-h1i4) +US +ENTER PASSWORD HERE +linux-h1i4.site +postmas...@site +false + + +false + + +no +no +no +sshd + +any + +no +yes +no +no +nf_conntrack_netbios_ns +no +yes +no +yes +no +no +no +false +false + + + + + false + + + none + + + + true + true + true + true + false + true + + + + + 1000 + $1$9ibtMhyS$uY16P2nxSWgejk4Ffz/LB0 + users + + + + 19 + x + floppy + + + + 1 + x + bin + daemon + + + 41 + x + xok + + + + 65533 + x + nobody + + + + 43 + x + modem + + + + 5 + x + tty + + + + 7 + x + lp + + + + 104 + ! + uuidd + + + + 51 + ! + postfix + + + + 111 + ! + gdm + + + + 65534 + x + nogroup + nobody + + + 101 + ! + messagebus + + + + 59 + ! + maildrop + + + + 33 + x + video + linux + + + 3 + x + sys + + + + 15 + x + shadow + + + + 20 + x + cdrom + + + + 21 + x + console + + + + 42 + x + trusted + + + + 102 + ! + haldaemon + + + + 16 + x + dialout + linux + + + 106 + ! + polkituser + + + + 10 + x + wheel + + + + 107 + ! + pulse + + + + 8 + x + www + + + + 40 + x + games + + + + 6 + x + disk + + + + 17 +
[PATCH 0/2][Autotest] [KVM-AUTOTEST] Support for Parallel install of guest OS
Hello Lucas, Have rebased them to latest git and sending them again.I have split it into 2 patches. The first one for "Parallel install of guest OS" and second one "support for unattended installation of Sles11-64bit OS". Thanks again for sharing the git config script, made using send-email very easy. Thanks and Regards Yogi -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] [Autotest] [KVM-AUTOTEST] Parallel install of guest OS
The patch enables doing mulitple install of guest OS in parallel. Have added four more options to test_base.cfg, port redirection entry "guest_port_unattend_shell" for host to communicate with guest during installation, "pxe_dir", 'pxe_image' and 'pxe_initrd" to specify locations for kernel and initrd. For parallel installation to work in unattended mode, the floppy image and pxe boot path also has to be unique for each quest. Signed-off-by: Yogananth Subramanian --- client/tests/kvm/scripts/unattended.py | 23 +-- client/tests/kvm/tests/unattended_install.py | 38 - client/tests/kvm/tests_base.cfg.sample |8 + client/tests/kvm/unattended/RHEL-5-series.ks | 12 4 files changed, 46 insertions(+), 35 deletions(-) diff --git a/client/tests/kvm/scripts/unattended.py b/client/tests/kvm/scripts/unattended.py index 63c01b1..ea822a9 100755 --- a/client/tests/kvm/scripts/unattended.py +++ b/client/tests/kvm/scripts/unattended.py @@ -59,8 +59,11 @@ 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.pxe_dir = os.environ['KVM_TEST_pxe_dir'] +self.pxe_image = os.environ['KVM_TEST_pxe_image'] +self.pxe_initrd = os.environ['KVM_TEST_pxe_initrd'] def create_boot_floppy(self): """ @@ -96,7 +99,10 @@ class UnattendedInstall(object): elif self.unattended_file.endswith('.ks'): dest_fname = 'ks.cfg' elif self.unattended_file.endswith('.xml'): -dest_fname = "autounattend.xml" +if self.tftp_root is '': +dest_fname = "autounattend.xml" +else: +dest_fname = "autoinst.xml" dest = os.path.join(self.floppy_mount, dest_fname) @@ -166,21 +172,20 @@ class UnattendedInstall(object): 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') +pxe_dir = os.path.join(self.cdrom_mount, self.pxe_dir) +pxe_image = os.path.join(pxe_dir, self.pxe_image) +pxe_initrd = os.path.join(pxe_dir, self.pxe_initrd) if not os.path.isdir(pxe_dir): raise SetupError('The ISO image does not have a %s dir. The ' 'script assumes that the cd has a %s dir ' 'where to search for the vmlinuz image.' % - (p, p)) + (self.pxe_dir, self.pxe_dir)) if not os.path.isfile(pxe_image) or not os.path.isfile(pxe_initrd): raise SetupError('The location %s is lacking either a vmlinuz ' 'or a initrd.img file. Cannot find a PXE ' - 'image to proceed.' % pxe_dir) + 'image to proceed.' % self.pxe_dir) tftp_image = os.path.join(self.tftp_root, 'vmlinuz') tftp_initrd = os.path.join(self.tftp_root, 'initrd.img') diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py index e3df72a..3978e26 100644 --- a/client/tests/kvm/tests/unattended_install.py +++ b/client/tests/kvm/tests/unattended_install.py @@ -13,11 +13,11 @@ def run_unattended_install(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ +buf = 1024 vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) -server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -server.bind(('', 12323)) -server.listen(1) +port = vm.get_port(int(params.get("guest_port_unattend_shell"))) +addr = ('localhost', port) install_timeout = float(params.get("timeout", 3000)) logging.info("Starting unattended install watch process. &quo