diff mbox

[KVM-AUTOTEST] KVM test: timedrift: open load sessions before taking initial time

Message ID 1269419918-16101-1-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish March 24, 2010, 8:38 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
index 194f09c..9cb7489 100644
--- a/client/tests/kvm/tests/timedrift.py
+++ b/client/tests/kvm/tests/timedrift.py
@@ -82,15 +82,8 @@  def run_timedrift(test, params, env):
         # Set the VM's CPU affinity
         prev_affinity = set_cpu_affinity(vm.get_pid(), cpu_mask)
 
-        # Get time before load
-        # (ht stands for host time, gt stands for guest time)
-        (ht0, gt0) = kvm_test_utils.get_time(session,
-                                             time_command,
-                                             time_filter_re,
-                                             time_format)
-
         try:
-            # Run some load on the guest
+            # Open shell sessions with the guest
             logging.info("Starting load on guest...")
             for i in range(guest_load_instances):
                 load_session = vm.remote_login()
@@ -99,6 +92,15 @@  def run_timedrift(test, params, env):
                 load_session.set_output_prefix("(guest load %d) " % i)
                 load_session.set_output_func(logging.debug)
                 guest_load_sessions.append(load_session)
+
+            # Get time before load
+            # (ht stands for host time, gt stands for guest time)
+            (ht0, gt0) = kvm_test_utils.get_time(session,
+                                                 time_command,
+                                                 time_filter_re,
+                                                 time_format)
+
+            # Run some load on the guest
             for load_session in guest_load_sessions:
                 load_session.sendline(guest_load_command)