On 06/15/2009 10:45 PM, Michael Goldish wrote:
Currently parameters for barrier_2() are extracted from 'params' in the main
run_steps() test routine, and then passed to barrier_2().
Instead, let barrier_2() extract parameters from 'params' as it sees fit.
This will make adding new parameters slightly easier and cleaner.

Signed-off-by: Michael Goldish<[email protected]>
---
  client/tests/kvm/kvm_guest_wizard.py |   37 ++++++++++++++++-----------------
  1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/client/tests/kvm/kvm_guest_wizard.py 
b/client/tests/kvm/kvm_guest_wizard.py
index 143e61e..eb0e2d5 100644
--- a/client/tests/kvm/kvm_guest_wizard.py
+++ b/client/tests/kvm/kvm_guest_wizard.py


@@ -41,6 +41,18 @@ def barrier_2(vm, words, fail_if_stuck_for, 
stuck_detection_history,
                                                   
"cropped_scrdump_expected.ppm")
      comparison_filename = os.path.join(debug_dir, "comparison.ppm")

+    fail_if_stuck_for = params.get("fail_if_stuck_for")
+    if fail_if_stuck_for:
+        fail_if_stuck_for = float(fail_if_stuck_for)
+    else:
+        fail_if_stuck_for = 1e308
+
+    stuck_detection_history = params.get("stuck_detection_history")
+    if stuck_detection_history:
+        stuck_detection_history = int(stuck_detection_history)
+    else:
+        stuck_detection_history = 2
+

Could be simplified by (preferably in a separate patch):
       fail_if_stuck_for = params.get("fail_if_stuck_for", 1e308)
       fail_if_stuck_for = float(fail_if_stuck_for)

       stuck_detection_history = params.get("stuck_detection_history", 2)
       stuck_detection_history = int(stuck_detection_history)

or even with a single line for each param:
       var = cast(params.get(var_name, default_value))


Regards,
    Uri
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to