Hi, As the series is large, here is a basic outline of what it does:
1) Move tests/build.py code to kvm/installer.py so it can be reused; 2) Refactor the kvm/installer.py code, including (but not limited to) changes to allow the module loading code to be reused by other tests; 3) Fix the git/source-tree install code to copy the modules so they are available for other tests; 4) Store the KVM installer object on 'env' so other tests can use it; 5) Add a 'module_probe' test that can be used to stress-test module loading/unloading. The series needs to be applied on top of my previous KvmEnv series[1]. [1] http://thread.gmane.org/gmane.linux.kernel.autotest/2479 The code is also available on git, at: git://github.com/ehabkost/my-autotest-hacks.git installer https://github.com/ehabkost/my-autotest-hacks/tree/installer ---------------------------------- Details: 1) Move tests/build.py code to kvm/installer.py so it can be reused: kvm: tests/build: extract _get_installer_class() method kvm: tests/build: create make_installer() helper function kvm: move installer code from tests/build.py to kvm/installer.py kvm: make the kvm.installer code handle the test params 2) Refactor the kvm/installer.py code, including (but not limited to) changes to allow the module loading code to be reused by other tests: kvm.installer: make a dictionary of installer classes kvm.installer: pass 'mode' as argument to the installer class kvm.installer: support install_mode parameter kvm: rename 'mode' to install_mode on the sample cfg files kvm.installer: rename 'load_modules' attribute to 'should_load_modules' kvm.installer: introduce load_modules() method kvm: introduce a PreinstalledKvm class kvm: installer: extract cpu vendor probing code from load_kvm_modules() kvm.installer: detect CPU vendor on initialization kvm.installer: unload the kvm-<vendor> module too kvm.installer: separate the module unload from the loading code kvm.installer: unload extra_modules before unloading KVM kvm.installer: rename load_modules() to reload_modules() kvm.install: create a load_modules() method kvm.installer: kill Qemu and unload modules on reload_modules() kvm.installer: create unload_modules() method kvm.installer: introduce _unload_modules() method kvm.installer: move the module-list code to a common function kvm.installer: pass module list as argument to _load_kvm_modules() kvm.installer: move _module_list() code to the BaseInstaller class kvm.installer: calculate the module list on initialization kvm: GitInstaller: don't ignore module build errors kvm: GitInstaller: pull code from git only when install() is called kvm.installer: save install_mode on BaseInstaller constructor kvm: GitInstaller: kill __init__() method kvm: installer: move constructor code to set_installer_args() kvm: make_installer() doesn't need a 'test' parameter kvm: installer: introduce full_module_list() method kvm: installer: make load_modules() accept a mod_list parameter kvm: installer: make unload_modules() accept list of modules kvm: installer: create reload_modules_if_needed() method 3) Fix the git/source-tree install code to copy the modules so they are available for other tests: kvm: installer: fix the 'layout 1' detection kvm: installer: install modules to 'build' directory 4) Store the KVM installer object on 'env' so other tests can use it: kvm: KojiInstaller: don't store Koji downloader as attribute kvm: add methods to store a installer object in 'env' kvm: build: register the installer object after install kvm: build: register always-failing installer object in case the build failed 5) Add a 'module_probe' test that can be used to stress-test module loading/unloading: KVM-Test: load/unload kvm module KVM-Test: add interface to get modules from cfg file, and load/unload them kvm: test/module_probe: use installer object to load modules kvm: module_probe: unload modules before starting ------------------------------- Eduardo Habkost (43): kvm: tests/build: extract _get_installer_class() method kvm: tests/build: create make_installer() helper function kvm: move installer code from tests/build.py to kvm/installer.py kvm: make the kvm.installer code handle the test params kvm.installer: make a dictionary of installer classes kvm.installer: pass 'mode' as argument to the installer class kvm.installer: support install_mode parameter kvm: rename 'mode' to install_mode on the sample cfg files kvm.installer: rename 'load_modules' attribute to 'should_load_modules' kvm.installer: introduce load_modules() method kvm: introduce a PreinstalledKvm class kvm: installer: extract cpu vendor probing code from load_kvm_modules() kvm.installer: detect CPU vendor on initialization kvm.installer: unload the kvm-<vendor> module too kvm.installer: separate the module unload from the loading code kvm.installer: unload extra_modules before unloading KVM kvm.installer: rename load_modules() to reload_modules() kvm.install: create a load_modules() method kvm.installer: kill Qemu and unload modules on reload_modules() kvm.installer: create unload_modules() method kvm.installer: introduce _unload_modules() method kvm.installer: move the module-list code to a common function kvm.installer: pass module list as argument to _load_kvm_modules() kvm.installer: move _module_list() code to the BaseInstaller class kvm.installer: calculate the module list on initialization kvm: GitInstaller: don't ignore module build errors kvm: GitInstaller: pull code from git only when install() is called kvm.installer: save install_mode on BaseInstaller constructor kvm: GitInstaller: kill __init__() method kvm: installer: move constructor code to set_installer_args() kvm: make_installer() doesn't need a 'test' parameter kvm: installer: introduce full_module_list() method kvm: installer: make load_modules() accept a mod_list parameter kvm: installer: make unload_modules() accept list of modules kvm: installer: create reload_modules_if_needed() method kvm: installer: fix the 'layout 1' detection kvm: installer: install modules to 'build' directory kvm: KojiInstaller: don't store Koji downloader as attribute kvm: add methods to store a installer object in 'env' kvm: build: register the installer object after install kvm: build: register always-failing installer object in case the build failed kvm: test/module_probe: use installer object to load modules kvm: module_probe: unload modules before starting Suqin Huang (2): KVM-Test: load/unload kvm module KVM-Test: add interface to get modules from cfg file, and load/unload them client/tests/kvm/build.cfg.sample | 14 +- client/tests/kvm/kvm/env.py | 15 + client/tests/kvm/kvm/env_test.py | 19 + client/tests/kvm/kvm/installer.py | 755 ++++++++++++++++++++++++++++++++ client/tests/kvm/kvm_utils.py | 2 +- client/tests/kvm/tests/build.py | 627 +-------------------------- client/tests/kvm/tests/module_probe.py | 54 +++ 7 files changed, 863 insertions(+), 623 deletions(-) create mode 100644 client/tests/kvm/kvm/installer.py create mode 100644 client/tests/kvm/tests/module_probe.py -- 1.7.3.2 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
