Skip to contentSkip to conversation

KVM test: Control files automatic generation to save memory

RFC PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Feb 11, 2010 KVM

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 KVM test: Control files automatic generation to save memory

As our configuration system generates a list of dicts with test parameters, and that list might be potentially *very* large, keeping all this information in memory might be a problem for smaller virtualization hosts due to the memory pressure created. Tests made on my 4GB laptop show that most of the memory is being used during a typical kvm autotest session.

So, instead of keeping all this information in memory, let's take a different approach and unfold all the tests generated by the config system and generate a control file:

job.run_test('kvm', params={param1, param2, ...}, tag='foo', ...) job.run_test('kvm', params={param1, param2, ...}, tag='bar', ...)

By dumping all the dicts that were before in the memory to a control file, the memory usage of a typical kvm autotest session is drastically reduced making it easier to run in smaller virt hosts.

The advantages of taking this new approach are:
* You can see what tests are going to run and the dependencies between them by looking at the generated control file
* The control file is all ready to use, you can for example paste it on the web interface and profit
* As mentioned, a lot less memory consumption, avoiding memory pressure on virtualization hosts.

This is a crude 1st pass at implementing this approach, so please provide comments.

---
 client/tests/kvm/control             |   64 ----
 client/tests/kvm/generate_control.py |  586 ++++++++++++++++++++++++++++++++++
 client/tests/kvm/kvm_config.py       |  524 ------------------------------
 3 files changed, 586 insertions(+), 588 deletions(-)
 delete mode 100644 client/tests/kvm/control
 create mode 100755 client/tests/kvm/generate_control.py
 delete mode 100755 client/tests/kvm/kvm_config.py
client/tests/kvm/control deleted +0 -64
deleted file mode 100644
index 163286e..0000000
@@ -1,64 +0,0 @@
-AUTHOR = """
[email protected] (Uri Lublin)
[email protected] (Dror Russo)
[email protected] (Michael Goldish)
[email protected] (David Huff)
[email protected] (Alexey Eromenko)
[email protected] (Mike Burns)
-"""
-TIME = 'MEDIUM'
-NAME = 'KVM test'
-TEST_TYPE = 'client'
-TEST_CLASS = 'Virtualization'
-TEST_CATEGORY = 'Functional'
-
-DOC = """
-Executes the KVM test framework on a given host. This module is separated in
-minor functions, that execute different tests for doing Quality Assurance on
-KVM (both kernelspace and userspace) code.
-
-For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest
-"""
-
-import sys, os, logging
-# Add the KVM tests dir to the python path
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-sys.path.append(kvm_test_dir)
-# Now we can import modules inside the KVM tests dir
-import kvm_utils, kvm_config
-
-# set English environment (command output might be localized, need to be safe)
-os.environ['LANG'] = 'en_US.UTF-8'
-
-build_cfg_path = os.path.join(kvm_test_dir, "build.cfg")
-build_cfg = kvm_config.config(build_cfg_path)
-# Make any desired changes to the build configuration here. For example:
-#build_cfg.parse_string("""
-#release_tag = 84
-#""")
-if not kvm_utils.run_tests(build_cfg.get_list(), job):
-    logging.error("KVM build step failed, exiting.")
-    sys.exit(1)
-
-tests_cfg_path = os.path.join(kvm_test_dir, "tests.cfg")
-tests_cfg = kvm_config.config(tests_cfg_path)
-# Make any desired changes to the test configuration here. For example:
-#tests_cfg.parse_string("""
-#display = sdl
-#install|setup: timeout_multiplier = 3
-#""")
-
-pools_cfg_path = os.path.join(kvm_test_dir, "address_pools.cfg")
-tests_cfg.parse_file(pools_cfg_path)
-hostname = os.uname()[1].split(".")[0]
-if tests_cfg.filter("^" + hostname):
-    tests_cfg.parse_string("only ^%s" % hostname)
-else:
-    tests_cfg.parse_string("only ^default_host")
-
-# Run the tests
-kvm_utils.run_tests(tests_cfg.get_list(), job)
-
-# Generate a nice HTML report inside the job's results dir
-kvm_utils.create_report(kvm_test_dir, job.resultdir)
-
client/tests/kvm/generate_control.py new file +586 -0

586 lines not on this page · raw message

client/tests/kvm/kvm_config.py deleted +0 -524

524 lines not on this page · raw message

Signature · 1 line
1.6.6.1