如何使用kvm autotest來測試kernel

來源:互聯網
上載者:User

單獨使用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/autotestdchkconfig --add /etc/init.d/autotestdservice autotestd start

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.