From: Alex Jia <[email protected]>

A python dict has no concept of key order, so we
can't guarantee that when we specify 2 test types,
such as

type = s4 migrate

The tests will be executed in the specified order.
So let's use a list of tuples to enforce that
order.

Signed-off-by: Alex Jia <[email protected]>
---
 client/virt/virt_test.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/virt/virt_test.py b/client/virt/virt_test.py
index 8cdfb7b..9870935 100644
--- a/client/virt/virt_test.py
+++ b/client/virt/virt_test.py
@@ -72,7 +72,7 @@ class virt_test(test.test):
                     # Get the test routine corresponding to the specified
                     # test type
                     t_types = params.get("type").split()
-                    test_modules = {}
+                    test_modules = []
                     for t_type in t_types:
                         for d in subtest_dirs:
                             module_path = os.path.join(d, "%s.py" % t_type)
@@ -85,7 +85,7 @@ class virt_test(test.test):
                             raise error.TestError(msg)
                         # Load the test module
                         f, p, d = imp.find_module(t_type, [subtest_dir])
-                        test_modules[t_type] = imp.load_module(t_type, f, p, d)
+                        test_modules.append((t_type, imp.load_module(t_type, 
f, p, d)))
                         f.close()
                     # Preprocess
                     try:
@@ -93,7 +93,7 @@ class virt_test(test.test):
                     finally:
                         env.save()
                     # Run the test function
-                    for t_type, test_module in test_modules.items():
+                    for t_type, test_module in test_modules:
                         msg = "Running function: %s.run_%s()" % (t_type, 
t_type)
                         logging.info(msg)
                         run_func = getattr(test_module, "run_%s" % t_type)
-- 
1.7.11.4

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to