KVM test: support TAP networking mode when executing tests in parallel
PATCH 1/1 KVM test: support TAP networking mode when executing tests in parallel
- Add kvm_utils.get_sub_pool() which splits a MAC-IP pool in several pieces.
- Use get_sub_pool() in kvm_scheduler immediately before launching a test.
Signed-off-by Michael Goldish <[email protected]>
--- client/tests/kvm/kvm_scheduler.py | 1 + client/tests/kvm/kvm_utils.py | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-)
client/tests/kvm/kvm_scheduler.py +1 -0
@@ -63,6 +63,7 @@ class scheduler: test_index = int(cmd[1]) test = self.tests[test_index].copy() test.update(self_dict) + test = kvm_utils.get_sub_pool(test, index, self.num_workers) test_iterations = int(test.get("iterations", 1)) status = run_test_func("kvm", params=test, tag=test.get("shortname"),
client/tests/kvm/kvm_utils.py +55 -0
61 lines not on this page · raw message
Signature · 1 line
1.5.4.1
PATCH 1/1 KVM test: kvm_config: remove -f command line option
This patch changes the command line invokation of kvm_config.py from this:
./kvm_config.py --verbose -f <filename>
to this:
./kvm_config.py --verbose <filename>
and also makes the dict printing code slightly shorter.
Signed-off-by Michael Goldish <[email protected]>
--- client/tests/kvm/kvm_config.py | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-)
client/tests/kvm/kvm_config.py +5 -11
@@ -675,19 +675,15 @@ def _array_get_all(a, object_cache): if __name__ == "__main__": - parser = optparse.OptionParser() - parser.add_option('-f', '--file', dest="filename", action='store', - help='path to a config file that will be parsed. ' - 'If not specified, will parse tests.cfg located ' - 'inside the kvm test dir.') + parser = optparse.OptionParser("usage: %prog [options] [filename]") parser.add_option('--verbose', dest="debug", action='store_true', help='include debug messages in console output') options, args = parser.parse_args() - filename = options.filename debug = options.debug - - if not filename: + if args: + filename = args[0] + else: filename = os.path.join(os.path.dirname(sys.argv[0]), "tests.cfg") # Here we configure the stand alone program to use the autotest
@@ -695,11 +691,9 @@ if __name__ == "__main__": logging_manager.configure_logging(kvm_utils.KvmLoggingConfig(), verbose=debug) dicts = config(filename, debug=debug).get_generator() - i = 0 - for dict in dicts: + for i, dict in enumerate(dicts): logging.info("Dictionary #%d:", i) keys = dict.keys() keys.sort() for key in keys: logging.info(" %s = %s", key, dict[key]) - i += 1
Signature · 1 line
1.5.4.1