如何使用kvm autotest来测试kernel

单独使用client的步骤

1) http://iamspk.blogspot.com/2011/05/kvm-autotest.html

apt-get install qemu qemu-kvm libvirt-bin

KVM Autotest      Autotest is a framework for fully automated testing. It is designed  primarily to +test the Linux kernel, though it is useful for many other  functions such as +qualifying new hardware. It's an open-source project  under the GPL and is used +and developed by a number of  organizations,including Google, IBM, Red Hat, and +many others.

The KVM-Autotest system is a client test for the autotest   framework. Its main purpose is to serve as an automated regression   testing tool for KVM developers, and for doing regular automated testing   of KVM (provided you use it with the server testing infrastructure).

How to setup KVM Autotest
---------------------------------

Please find below steps to setup KVM Autotest.

1. Get autotest git
git clone git://github.com/autotest/autotest.git

2.   Packages required.
yum install qemu-kvm qemu-kvm-tools syslinux

3. cd autotest/client/tests/kvm

4.  ./get_started.py

Recommend to select "N" for all. It does basic setup to get started.

5.  mkdir /tmp/kvm_autotest_root/isos/linux

6. mount your required iso here.

 mount -t nfs < your iso>   /tmp/kvm_autotest_root/isos/linux

7. get md5sum, md5sum_1M of your iso.

  md5sum

  dd if= bs=1M count=1| md5sum

or

./autotest/client/tools/cd_hash.py  


8.  cd autotest/client/tests/kvm

    Here 3 files needs to be changed

   1. tests.cfg
   2. edit guest-os.cfg
   3. base.cfg

  tests.cfg:

      qemu_binary = /usr/bin/qemu-kvm
       qemu_img_binary = /usr/bin/qemu-img
       only raw
       only virtio_net
       only virtio_blk
       only smp2
       only no_pci_assignable
       only smallpages
       only RHEL.6.64
       only unattended_install.cdrom, boot, shutdown  


    base.cfg

       You can make change base.cfg as per your requirement.
         for ex: nics, network_mode = tap/user, script = qemu-ifup/qemu-ifup-ipv6, ..... etc.
         I recommend to try with Redhat guest once, before ubuntu.
         edit iso name, md5sum, md5sum_1m in .

    guest-os.cfg

             ex:

              - 6.64:
                       no setup
                       nic_hotplug:
                           modprobe_module =
                       block_hotplug:
                           modprobe_module =
                       image_name = rhel6-64
                       unattended_install:
                           unattended_file = unattended/RHEL-6-series.ks
                           #floppy = images/rhel60-64/ks.vfd
                           cdrom_unattended = images/rhel61-64/ks.iso
                           kernel = images/rhel61-64/vmlinuz
                           initrd = images/rhel61-64/initrd.img
                       unattended_install.cdrom:
                           cdrom_cd1 = isos/linux/RHEL-6.0-x86_64-DVD.iso../.
                           md5sum_cd1 = f7141396c6a19399d63e8c195354317d
                           md5sum_1m_cd1 = b060eeef63e2c8700db54ae02056e80c       

9. run ../../common_lib/cartesian_config.py control --verbose


   if your setup is fine, dictionaries will get generated.

10.      run your basic guest install test:

../../bin/autotest control --verbose

11. 查看测试结果

https://github.com/autotest/autotest/wiki/KVMAutotest-GetStartedClient  checking result

1.  client/results/default/job_report

2.  ../../tools/scan_results.py

3.   client/results/default/testname/debug



For more details:

http://www.linux-kvm.org/page/KVM-Autotest



2) http://www.linux-kvm.org/page/KVM-Autotest


在client端用自己的kernel来启动

3) 怎么样用autotest跑自己的kernel

在guest-os.cfg中加,或者改

                    - 6.1.i386:
                kernel = /home/richard/kernel/linux-2.6.38.8/arch/x86/boot/bzImage
            display = nographic
            extra_params += " -initrd /boot/initrd.img-2.6.38-8 "
            extra_params += " -append 'root=/dev/mapper/VolGroup-lv_root' -vnc :0 "
                        nic_hotplug:
                            modprobe_module =
                        block_hotplug:
                            modprobe_module =
                        image_name = rhel6.1-32
                        unattended_install:
                            unattended_file = unattended/RHEL-6-series.ks
                            #floppy = images/rhel61-32/ks.vfd
                            cdrom_unattended = images/rhel61-32/ks.iso
                            kernel = images/rhel61-32/vmlinuz
                            initrd = images/rhel61-32/initrd.img
                        unattended_install.cdrom:
                            cdrom_cd1 = isos/linux/RHEL-6.1-i386-DVD.iso
                            md5sum_cd1 = f8c8a310e34d26339c99d462e3557324
                            md5sum_1m_cd1 = 12f7692e6e20be0d42b9407d956f74c3


使用server

1)安装autotest server 在ubuntu 11.04

https://github.com/autotest/autotest/wiki/AutotestServerInstall

apt-get install gfortran

apt-get install python-dev fort77

apt-get install f2c

apt-get build-dep python-numpy

apt-get install python-numpy


a2enmod rewrite


2)在fedora上安装

https://github.com/autotest/autotest/wiki/KVMAutotest-GetStartedServer



添加测试用例

/usr/local/autotest/utils/test_importer.py -A

把schedule作为一个service

cp /usr/local/autotest/utils/autotest-rh.init /etc/init.d/autotestd

chkconfig --add /etc/init.d/autotestd

service autotestd start

在fedora上用autotest-rh.init, 在ubuntu上用autotest.init。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值