Skip to contentSkip to conversation

Re-submitting some of the patches on the patch queue

PATCH Applied Lucas Meneghel Rodrigues 5 participants 21 messages Jun 8, 2009 – Jun 10, 2009 KVM

lore
Share & tools
lore
#0 lore raw

cover Re-submitting some of the patches on the patch queue

I have rebased some of the patches on the patch queue I sent earlier to the list. I am sending them to your appreciation, the other will follow.

#1 lore raw

PATCH 1/8 kvm_config: Allow for "=" in the value of a config parameter

fix modifies kvm_config.split_and_strip so it will only split once per line.

example: kernel_args = "ks=floppy console=ttyS0 noacpi"

---
 client/tests/kvm/kvm_config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_config.py +1 -1
index 8b6ab15..40f16f1 100755
@@ -136,7 +136,7 @@ class config:
             @param str: String that will be processed
             @param sep: Separator that will be used to split the string
         """
-        temp = str.split(sep)
+        temp = str.split(sep, 1)
         for i in range(len(temp)):
             temp[i] = temp[i].strip()
             temp[i] = temp[i].strip("\"\'")
Signature · 1 line
1.6.2.2
#2 lore raw

PATCH 1/3 Make possible to use kvm_config as a standalone program.

Replace autotest exceptions for standard python exceptions. This will allow kvm_config.py to be used as a stand alone program.

---
 client/tests/kvm/kvm_config.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
client/tests/kvm/kvm_config.py +3 -4
index 8b6ab15..dda421b 100755
@@ -1,5 +1,4 @@
 import re, os, sys, StringIO
-from autotest_lib.client.common_lib import error
 
 """
 KVM configuration file utility functions.
@@ -356,7 +355,7 @@ class config:
                 # (inside an exception or inside subvariants)
                 if restricted:
                     e_msg = "Using variants in this context is not allowed"
-                    raise error.AutotestError()
+                    raise ValueError(e_msg)
                 if self.debug and not restricted:
                     self.__debug_print(indented_line,
                                      "Entering variants block (%d dicts in"
@@ -401,7 +400,7 @@ class config:
                                             words[1])
                     if not os.path.exists(filename):
                         e_msg = "Cannot include %s -- file not found" % filename
-                        raise error.AutotestError(e_msg)
+                        raise IOError(e_msg)
                     new_file = open(filename, "r")
                     list = self.parse(new_file, list, restricted)
                     new_file.close()
@@ -409,7 +408,7 @@ class config:
                         self.__debug_print("", "Leaving file %s" % words[1])
                 else:
                     e_msg = "Cannot include anything because no file is open"
-                    raise error.AutotestError(e_msg)
+                    raise ValueError(e_msg)
 
             # Parse multi-line exceptions
             # (the block is parsed for each dict separately)
Signature · 1 line
1.6.2.2
#3 lore raw

PATCH 2/3 Fixing bad line breaks

During the conversion of logging statements, some bad line continuation were introduced. This patch fixes the mistakes.

---
 client/tests/kvm/kvm_tests.py        |   12 ++++++------
 client/tests/kvm/make_html_report.py |    5 ++---
 2 files changed, 8 insertions(+), 9 deletions(-)
client/tests/kvm/kvm_tests.py +6 -6
index cccc48e..9adea6f 100644
@@ -274,8 +274,8 @@ def run_autotest(test, params, env):
             copy = True
     # Perform the copy
     if copy:
-        logging.info("Copying %s.tar.bz2 to guest (file is missing or has a"
-                     " different size)..." % test_name)
+        logging.info("Copying %s.tar.bz2 to guest \
+        (file is missing or has a different size)..." % test_name)
         if not vm.scp_to_remote(tarred_test_path, ""):
             raise error.TestFail("Could not copy %s.tar.bz2 to guest" %
                                  test_name)
@@ -291,8 +291,8 @@ def run_autotest(test, params, env):
 
     # Extract <test_name>.tar.bz2 into autotest/tests
     logging.info("Extracting %s.tar.bz2..." % test_name)
-    status = session.get_command_status("tar xvfj %s.tar.bz2 -C "
-                                        "autotest/tests" % test_name)
+    status = session.get_command_status("tar xvfj %s.tar.bz2 -C \
+    autotest/tests" % test_name)
     if status != 0:
         raise error.TestFail("Could not extract %s.tar.bz2" % test_name)
 
@@ -321,8 +321,8 @@ def run_autotest(test, params, env):
     status_fail = False
     if result_list == []:
         status_fail = True
-        message_fail = "Test '%s' did not produce any recognizable"
-        " results" % test_name
+        message_fail = "Test '%s' did not produce any recognizable \
+        results" % test_name
     for result in result_list:
         logging.info(str(result))
         if result[1] == "FAIL":
client/tests/kvm/make_html_report.py +2 -3
index 6aed39e..5b2e579 100755
@@ -1442,9 +1442,8 @@ return true;
     stat_str = 'No test cases executed'
     if total_executed>0:
         failed_perct = int(float(total_failed)/float(total_executed)*100)
-        stat_str = 'From %d tests executed, '
-        '%d have passed (%d%s)' % (total_executed, total_passed,failed_perct,
-                                   '% failures')
+        stat_str = 'From %d tests executed, %d have passed (%d%% failures)' % \
+        (total_executed, total_passed, failed_perct)
 
 
     kvm_ver_str = metadata['kvmver']
Signature · 1 line
1.6.2.2
#4 lore raw

PATCH 2/8 RHEL-4.7 step files: fix the initial boot barriers

Fix the first barrier to include the 'boot:' prompt. This is crucial because the guest accepts keyboard input only after this prompt appears.

Visibility: Small (Data file on the kvm test)
Risk: Low (Small, tested change to a data file)

---
 client/tests/kvm/steps/RHEL-4.7-i386.steps   |    2 +-
 client/tests/kvm/steps/RHEL-4.7-x86_64.steps |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
client/tests/kvm/steps/RHEL-4.7-i386.steps +1 -1
index 3816c15..763d473 100644
@@ -4,7 +4,7 @@
 # --------------------------------
 step unknown
 screendump 20090413_013526_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
-barrier_2 188 30 354 265 48ef114b5a42ba0d5bebfaee47dce498 50
+barrier_2 44 38 0 363 d9ca61811a10b33cc95515d4796541e7 50
 # Sending keys: ret
 key ret
 # --------------------------------
client/tests/kvm/steps/RHEL-4.7-x86_64.steps +1 -1
index 644446f..36f0109 100644
@@ -6,7 +6,7 @@ step 8.84
 screendump 20080101_000001_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
 # boot options
 sleep 5
-barrier_2 194 59 101 59 8c4f6b29e4087e1bed13c40e4a6a904f 44 optional
+barrier_2 44 36 0 365 ea4c08daabe1f982b243fce9c5b542a0 44 optional
 # Sending keys: ret
 key ret
 # --------------------------------
Signature · 1 line
1.6.2.2
#5 lore raw

PATCH 3/3 Fix bad logging calls

During the conversion of kvm autotest to upstream coding standards, some bad logging calls were left behind. This patch fixes them.

---
 client/tests/kvm/kvm_utils.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
client/tests/kvm/kvm_utils.py +3 -3
index 434190d..37a1f22 100644
@@ -304,7 +304,7 @@ class kvm_spawn:
 
         # Print some debugging info
         if match == None and self.poll() != 0:
-            logging.debug("Timeout elapsed or process terminated. Output:",
+            logging.debug("Timeout elapsed or process terminated. Output: %s",
                           format_str_for_message(data.strip()))
 
         return (match, data)
@@ -465,8 +465,8 @@ class kvm_spawn:
 
         # Print some debugging info
         if status != 0:
-            logging.debug("Command failed; status: %d, output:" % status \
-                    + format_str_for_message(output.strip()))
+            logging.debug("Command failed; status: %d, output: %s", status,
+                          format_str_for_message(output.strip()))
 
         return (status, output)
 
Signature · 1 line
1.6.2.2
#6 lore raw

PATCH 3/8 WinXP step file fixes

Add an optional barrier to deal with a closed start menu.

---
 client/tests/kvm/steps/WinXP-32-setupssh.steps |   10 ++++++++--
 client/tests/kvm/steps/WinXP-32.steps          |    4 +++-
 client/tests/kvm/steps/WinXP-64.steps          |    3 +--
 3 files changed, 12 insertions(+), 5 deletions(-)
client/tests/kvm/steps/WinXP-32-setupssh.steps +8 -2
index 729d9df..ebb665f 100644
@@ -4,8 +4,14 @@
 # --------------------------------
 step 24.72
 screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
-# open start menu
-barrier_2 125 79 342 270 368b3d82c870dbcdc4dfc2a49660e798 124
+# desktop reached
+barrier_2 36 32 392 292 3828d3a9587b3a9766a567a2b7570e42 124
+# --------------------------------
+step 24.72
+screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
+# open start menu if not already open
+sleep 10
+barrier_2 84 48 0 552 082462ce890968a264b9b13cddda8ae3 10 optional
 # Sending keys: ctrl-esc
 key ctrl-esc
 # --------------------------------
client/tests/kvm/steps/WinXP-32.steps +3 -1
index b0c6e35..f52fd0e 100644
@@ -136,7 +136,8 @@ key alt-n
 step 2251.56
 screendump 20080101_000022_dcdc2fe9606c044ce648422afe42e23d.ppm
 # User
-barrier_2 409 35 64 188 3d71d4d7a9364c1e6415b3d554ce6e5b 9
+barrier_2 161 37 312 187 a941ecbeb73f9d73e3e9c38da9a4b743 9
+# Sending keys: $user alt-n
 var user
 key alt-n
 # --------------------------------
@@ -154,6 +155,7 @@ barrier_2 48 51 391 288 bbac8a522510d7c8d6e515f6a3fbd4c3 240
 step 2279.61
 screendump 20090416_150641_b72ad5c48ec2dbc9814d569e38cbb4cc.ppm
 # Win XP Start Menu (closed)
+sleep 20
 barrier_2 104 41 0 559 a7cc02cecff2cb495f300aefbb99d9ae 5 optional
 # Sending keys: ctrl-esc
 key ctrl-esc
client/tests/kvm/steps/WinXP-64.steps +1 -2
index 20bac81..91e6d0f 100644
@@ -74,7 +74,6 @@ key ret
 # --------------------------------
 step 286.86
 screendump 20080101_000010_bb878343930f948c0346f103a387157a.ppm
-barrier_2 69 15 179 8 93889bdbe5351e61a6d9c7d00bb1c971 10
 # --------------------------------
 step 409.46
 screendump 20080101_000011_30db9777a7883a07e6e65bff74e1d98f.ppm
@@ -100,7 +99,7 @@ key 0xdc
 step 978.02
 screendump 20080101_000014_213fbe6fa13bf32dfac6a00bf4205e45.ppm
 # Windows XP Start Menu Opened
-barrier_2 48 20 274 420 c4a9620d84508013050e5a37a0d9e4ef 15
+barrier_2 129 30 196 72 aae68af7e05e2312c707f2f4bd73f024 15
 # Sending keys: u
 key u
 # --------------------------------
Signature · 1 line
1.6.2.2
#7 lore raw

PATCH 4/8 RHEL 5.3 step file fixes

Fix the initial boot barriers to include the 'boot:' prompt. Also fix a barrier in 5.3 of a dialog that sometimes appears at an unexpected location.

---
 client/tests/kvm/steps/RHEL-5.3-i386.steps   |   12 ++++++++++--
 client/tests/kvm/steps/RHEL-5.3-x86_64.steps |    2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)
client/tests/kvm/steps/RHEL-5.3-i386.steps +10 -2
index 86066d8..0964f47 100644
@@ -7,7 +7,7 @@ step 10.33
 screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
 # boot options
 sleep 10
-barrier_2 459 65 5 223 a817e977c049abaaab9a391d3cbeb1ab 52
+barrier_2 44 40 0 410 2f6c4cea4cf5b03bec757893e4982897 52
 # Sending keys: ret
 key ret
 # --------------------------------
@@ -187,10 +187,18 @@ key alt-f
 step 1518.52
 screendump 20080101_000024_3e641443dd4ea558467e517a4be68517.ppm
 # confirm no rhn
-barrier_2 97 18 146 77 a6a767b46d079c6879ebd5aec00cda46 43
+barrier_2 97 18 146 77 a6a767b46d079c6879ebd5aec00cda46 15 optional
 # Sending keys: alt-n
 key alt-n
 # --------------------------------
+step 1518.52
+screendump 20090506_091708_e5436357421502fccb3df89a830fd2f4.ppm
+# confirm no rhn (2)
+barrier_2 60 37 59 15 d94ff141696970e06545ce9854306970 5 optional
+# Sending keys: alt-tab alt-n
+key alt-tab
+key alt-n
+# --------------------------------
 step 1526.55
 screendump 20080101_000025_e10ec4a12e28baa41af798cbdbf308a1.ppm
 # finish update setup
client/tests/kvm/steps/RHEL-5.3-x86_64.steps +1 -1
index 96ba87e..fc0db20 100644
@@ -7,7 +7,7 @@ step 9.22
 screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
 # boot options
 sleep 10
-barrier_2 441 88 18 213 881883a4fa307a918f40804c70b9880d 46
+barrier_2 43 39 0 411 3c4a56d04a8ea1c0c5c1edfe10d472a0 46
 # Sending keys: ret
 key ret
 # --------------------------------
Signature · 1 line
1.6.2.2
#8 lore raw

PATCH 5/8 stepeditor.py: get rid of some shortcuts

Disable a few keyboard shortcuts that were initially assumed to be useful, but apparently override the default functionality of the involved keys (e.g. 'home', 'end', 'delete') regardless of the widget that has the keyboard focus.

Also make some indentation changes to the UI description.

---
 client/tests/kvm/stepeditor.py |   63 +++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 33 deletions(-)
client/tests/kvm/stepeditor.py +30 -33
index f2ef1aa..9669200 100755
@@ -858,27 +858,27 @@ class StepMakerWindow:
 class StepEditor(StepMakerWindow):
     ui = '''<ui>
     <menubar name="MenuBar">
-      <menu action="File">
-        <menuitem action="Open"/>
-        <separator/>
-        <menuitem action="Quit"/>
-      </menu>
-      <menu action="Edit">
-        <menuitem action="CopyStep"/>
-        <menuitem action="DeleteStep"/>
-      </menu>
-      <menu action="Insert">
-        <menuitem action="InsertNewBefore"/>
-        <menuitem action="InsertNewAfter"/>
-        <separator/>
-        <menuitem action="InsertStepsBefore"/>
-        <menuitem action="InsertStepsAfter"/>
-      </menu>
-      <menu action="Tools">
-        <menuitem action="CleanUp"/>
-      </menu>
+        <menu action="File">
+            <menuitem action="Open"/>
+            <separator/>
+            <menuitem action="Quit"/>
+        </menu>
+        <menu action="Edit">
+            <menuitem action="CopyStep"/>
+            <menuitem action="DeleteStep"/>
+        </menu>
+        <menu action="Insert">
+            <menuitem action="InsertNewBefore"/>
+            <menuitem action="InsertNewAfter"/>
+            <separator/>
+            <menuitem action="InsertStepsBefore"/>
+            <menuitem action="InsertStepsAfter"/>
+        </menu>
+        <menu action="Tools">
+            <menuitem action="CleanUp"/>
+        </menu>
     </menubar>
-    </ui>'''
+</ui>'''
 
     # Constructor
 
@@ -896,7 +896,7 @@ class StepEditor(StepMakerWindow):
         self.window.add_accel_group(accelgroup)
 
         # Create an ActionGroup
-        actiongroup = gtk.ActionGroup('UIManagerExample')
+        actiongroup = gtk.ActionGroup('StepEditor')
 
         # Create actions
         actiongroup.add_actions([
@@ -904,22 +904,22 @@ class StepEditor(StepMakerWindow):
              self.quit),
             ('Open', gtk.STOCK_OPEN, '_Open', None, 'Open steps file',
              self.open_steps_file),
-            ('CopyStep', gtk.STOCK_COPY, '_Copy current step...', None,
+            ('CopyStep', gtk.STOCK_COPY, '_Copy current step...', "",
              'Copy current step to user specified position', self.copy_step),
-            ('DeleteStep', gtk.STOCK_DELETE, '_Delete current step', None,
+            ('DeleteStep', gtk.STOCK_DELETE, '_Delete current step', "",
              'Delete current step', self.event_remove_clicked),
-            ('InsertNewBefore', gtk.STOCK_ADD, '_New step before current', None,
+            ('InsertNewBefore', gtk.STOCK_ADD, '_New step before current', "",
              'Insert new step before current step', self.insert_before),
-            ('InsertNewAfter', gtk.STOCK_ADD, 'N_ew step after current', None,
+            ('InsertNewAfter', gtk.STOCK_ADD, 'N_ew step after current', "",
              'Insert new step after current step', self.insert_after),
             ('InsertStepsBefore', gtk.STOCK_ADD, '_Steps before current...',
-             None, 'Insert steps (from file) before current step',
+             "", 'Insert steps (from file) before current step',
              self.insert_steps_before),
-            ('InsertStepsAfter', gtk.STOCK_ADD, 'Steps _after current...',
-             None, 'Insert steps (from file) after current step',
+            ('InsertStepsAfter', gtk.STOCK_ADD, 'Steps _after current...', "",
+             'Insert steps (from file) after current step',
              self.insert_steps_after),
-            ('CleanUp', gtk.STOCK_DELETE, '_Clean up data directory',
-             None, 'Move unused PPM files to a backup directory', self.cleanup),
+            ('CleanUp', gtk.STOCK_DELETE, '_Clean up data directory', "",
+             'Move unused PPM files to a backup directory', self.cleanup),
             ('File', None, '_File'),
             ('Edit', None, '_Edit'),
             ('Insert', None, '_Insert'),
@@ -939,9 +939,6 @@ class StepEditor(StepMakerWindow):
 
         create_shortcut("Next", self.event_next_clicked, "Page_Down")
         create_shortcut("Previous", self.event_prev_clicked, "Page_Up")
-        create_shortcut("First", self.event_first_clicked, "Home")
-        create_shortcut("Last", self.event_last_clicked, "End")
-        create_shortcut("Delete", self.event_remove_clicked, "Delete")
 
         # Add the actiongroup to the uimanager
         uimanager.insert_action_group(actiongroup, 0)
Signature · 1 line
1.6.2.2
#9 lore raw

PATCH 6/8 Choose a monitor filename in the constructor of VM class

Choose a monitor filename in the VM class constructor instead of the VM.create() method. This will reduce the number of monitor files left in /tmp, because the constructor is called fewer times than VM.create().

Risk: Low (comprehensible change, just moving a block of code).
Visibility: Small (users of kvm test).

---
 client/tests/kvm/kvm_vm.py |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
client/tests/kvm/kvm_vm.py +11 -10
index 76b0251..3001648 100644
@@ -115,6 +115,17 @@ class VM:
         self.iso_dir = iso_dir
 
 
+        # Find available monitor filename
+        while True:
+            # The monitor filename should be unique
+            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
+            kvm_utils.generate_random_string(4)
+            self.monitor_file_name = os.path.join("/tmp",
+                                                  "monitor-" + self.instance)
+            if not os.path.exists(self.monitor_file_name):
+                break
+
+
     def verify_process_identity(self):
         """
         Make sure .pid really points to the original qemu process. If .pid
@@ -297,16 +308,6 @@ class VM:
                     logging.error("Actual MD5 sum differs from expected one")
                     return False
 
-        # Find available monitor filename
-        while True:
-            # The monitor filename should be unique
-            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
-            kvm_utils.generate_random_string(4)
-            self.monitor_file_name = os.path.join("/tmp",
-                                                  "monitor-" + self.instance)
-            if not os.path.exists(self.monitor_file_name):
-                break
-
         # Handle port redirections
         redir_names = kvm_utils.get_sub_dict_names(params, "redirs")
         host_ports = kvm_utils.find_free_ports(5000, 6000, len(redir_names))
Signature · 1 line
1.6.2.2
#10 lore raw

Re: [KVM-AUTOTEST PATCH 6/8] Choose a monitor filename in the constructor of VM class

Quoted 3 lines · Lucas Meneghel Rodrigues

Choose a monitor filename in the VM class constructor instead of the VM.create() method. This will reduce the number of monitor files left in /tmp, because the constructor is called fewer times than VM.create().

Applied.

Quoted 47 lines

Risk: Low (comprehensible change, just moving a block of code).
Visibility: Small (users of kvm test).

---
 client/tests/kvm/kvm_vm.py |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
client/tests/kvm/kvm_vm.py +11 -10
index 76b0251..3001648 100644
@@ -115,6 +115,17 @@ class VM:
         self.iso_dir = iso_dir
 
 
+        # Find available monitor filename
+        while True:
+            # The monitor filename should be unique
+            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
+            kvm_utils.generate_random_string(4)
+            self.monitor_file_name = os.path.join("/tmp",
+                                                  "monitor-" + self.instance)
+            if not os.path.exists(self.monitor_file_name):
+                break
+
+
     def verify_process_identity(self):
         """
         Make sure .pid really points to the original qemu process. If .pid
@@ -297,16 +308,6 @@ class VM:
                     logging.error("Actual MD5 sum differs from expected one")
                     return False
 
-        # Find available monitor filename
-        while True:
-            # The monitor filename should be unique
-            self.instance = time.strftime("%Y%m%d-%H%M%S-") + \
-            kvm_utils.generate_random_string(4)
-            self.monitor_file_name = os.path.join("/tmp",
-                                                  "monitor-" + self.instance)
-            if not os.path.exists(self.monitor_file_name):
-                break
-
         # Handle port redirections
         redir_names = kvm_utils.get_sub_dict_names(params, "redirs")
         host_ports = kvm_utils.find_free_ports(5000, 6000, len(redir_names))
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#11 lore raw

Re: [KVM-AUTOTEST PATCH 5/8] stepeditor.py: get rid of some shortcuts

In reply to Lucas Meneghel Rodrigues
Quoted 115 lines · Lucas Meneghel Rodrigues

Disable a few keyboard shortcuts that were initially assumed to be useful, but apparently override the default functionality of the involved keys (e.g. 'home', 'end', 'delete') regardless of the widget that has the keyboard focus.

Also make some indentation changes to the UI description.

---
 client/tests/kvm/stepeditor.py |   63 +++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 33 deletions(-)
client/tests/kvm/stepeditor.py +30 -33
index f2ef1aa..9669200 100755
@@ -858,27 +858,27 @@ class StepMakerWindow:
 class StepEditor(StepMakerWindow):
     ui = '''<ui>
     <menubar name="MenuBar">
-      <menu action="File">
-        <menuitem action="Open"/>
-        <separator/>
-        <menuitem action="Quit"/>
-      </menu>
-      <menu action="Edit">
-        <menuitem action="CopyStep"/>
-        <menuitem action="DeleteStep"/>
-      </menu>
-      <menu action="Insert">
-        <menuitem action="InsertNewBefore"/>
-        <menuitem action="InsertNewAfter"/>
-        <separator/>
-        <menuitem action="InsertStepsBefore"/>
-        <menuitem action="InsertStepsAfter"/>
-      </menu>
-      <menu action="Tools">
-        <menuitem action="CleanUp"/>
-      </menu>
+        <menu action="File">
+            <menuitem action="Open"/>
+            <separator/>
+            <menuitem action="Quit"/>
+        </menu>
+        <menu action="Edit">
+            <menuitem action="CopyStep"/>
+            <menuitem action="DeleteStep"/>
+        </menu>
+        <menu action="Insert">
+            <menuitem action="InsertNewBefore"/>
+            <menuitem action="InsertNewAfter"/>
+            <separator/>
+            <menuitem action="InsertStepsBefore"/>
+            <menuitem action="InsertStepsAfter"/>
+        </menu>
+        <menu action="Tools">
+            <menuitem action="CleanUp"/>
+        </menu>
     </menubar>
-    </ui>'''
+</ui>'''
 
     # Constructor
 
@@ -896,7 +896,7 @@ class StepEditor(StepMakerWindow):
         self.window.add_accel_group(accelgroup)
 
         # Create an ActionGroup
-        actiongroup = gtk.ActionGroup('UIManagerExample')
+        actiongroup = gtk.ActionGroup('StepEditor')
 
         # Create actions
         actiongroup.add_actions([
@@ -904,22 +904,22 @@ class StepEditor(StepMakerWindow):
              self.quit),
             ('Open', gtk.STOCK_OPEN, '_Open', None, 'Open steps file',
              self.open_steps_file),
-            ('CopyStep', gtk.STOCK_COPY, '_Copy current step...', None,
+            ('CopyStep', gtk.STOCK_COPY, '_Copy current step...', "",
              'Copy current step to user specified position', self.copy_step),
-            ('DeleteStep', gtk.STOCK_DELETE, '_Delete current step', None,
+            ('DeleteStep', gtk.STOCK_DELETE, '_Delete current step', "",
              'Delete current step', self.event_remove_clicked),
-            ('InsertNewBefore', gtk.STOCK_ADD, '_New step before current', None,
+            ('InsertNewBefore', gtk.STOCK_ADD, '_New step before current', "",
              'Insert new step before current step', self.insert_before),
-            ('InsertNewAfter', gtk.STOCK_ADD, 'N_ew step after current', None,
+            ('InsertNewAfter', gtk.STOCK_ADD, 'N_ew step after current', "",
              'Insert new step after current step', self.insert_after),
             ('InsertStepsBefore', gtk.STOCK_ADD, '_Steps before current...',
-             None, 'Insert steps (from file) before current step',
+             "", 'Insert steps (from file) before current step',
              self.insert_steps_before),
-            ('InsertStepsAfter', gtk.STOCK_ADD, 'Steps _after current...',
-             None, 'Insert steps (from file) after current step',
+            ('InsertStepsAfter', gtk.STOCK_ADD, 'Steps _after current...', "",
+             'Insert steps (from file) after current step',
              self.insert_steps_after),
-            ('CleanUp', gtk.STOCK_DELETE, '_Clean up data directory',
-             None, 'Move unused PPM files to a backup directory', self.cleanup),
+            ('CleanUp', gtk.STOCK_DELETE, '_Clean up data directory', "",
+             'Move unused PPM files to a backup directory', self.cleanup),
             ('File', None, '_File'),
             ('Edit', None, '_Edit'),
             ('Insert', None, '_Insert'),
@@ -939,9 +939,6 @@ class StepEditor(StepMakerWindow):
 
         create_shortcut("Next", self.event_next_clicked, "Page_Down")
         create_shortcut("Previous", self.event_prev_clicked, "Page_Up")
-        create_shortcut("First", self.event_first_clicked, "Home")
-        create_shortcut("Last", self.event_last_clicked, "End")
-        create_shortcut("Delete", self.event_remove_clicked, "Delete")
 
         # Add the actiongroup to the uimanager
         uimanager.insert_action_group(actiongroup, 0)
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#12 lore raw

Re: [KVM-AUTOTEST PATCH 4/8] RHEL 5.3 step file fixes

In reply to Lucas Meneghel Rodrigues
Quoted 3 lines · Lucas Meneghel Rodrigues

Fix the initial boot barriers to include the 'boot:' prompt. Also fix a barrier in 5.3 of a dialog that sometimes appears at an unexpected location.

Applied.

Quoted 52 lines
---
 client/tests/kvm/steps/RHEL-5.3-i386.steps   |   12 ++++++++++--
 client/tests/kvm/steps/RHEL-5.3-x86_64.steps |    2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)
client/tests/kvm/steps/RHEL-5.3-i386.steps +10 -2
index 86066d8..0964f47 100644
@@ -7,7 +7,7 @@ step 10.33
 screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
 # boot options
 sleep 10
-barrier_2 459 65 5 223 a817e977c049abaaab9a391d3cbeb1ab 52
+barrier_2 44 40 0 410 2f6c4cea4cf5b03bec757893e4982897 52
 # Sending keys: ret
 key ret
 # --------------------------------
@@ -187,10 +187,18 @@ key alt-f
 step 1518.52
 screendump 20080101_000024_3e641443dd4ea558467e517a4be68517.ppm
 # confirm no rhn
-barrier_2 97 18 146 77 a6a767b46d079c6879ebd5aec00cda46 43
+barrier_2 97 18 146 77 a6a767b46d079c6879ebd5aec00cda46 15 optional
 # Sending keys: alt-n
 key alt-n
 # --------------------------------
+step 1518.52
+screendump 20090506_091708_e5436357421502fccb3df89a830fd2f4.ppm
+# confirm no rhn (2)
+barrier_2 60 37 59 15 d94ff141696970e06545ce9854306970 5 optional
+# Sending keys: alt-tab alt-n
+key alt-tab
+key alt-n
+# --------------------------------
 step 1526.55
 screendump 20080101_000025_e10ec4a12e28baa41af798cbdbf308a1.ppm
 # finish update setup
client/tests/kvm/steps/RHEL-5.3-x86_64.steps +1 -1
index 96ba87e..fc0db20 100644
@@ -7,7 +7,7 @@ step 9.22
 screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
 # boot options
 sleep 10
-barrier_2 441 88 18 213 881883a4fa307a918f40804c70b9880d 46
+barrier_2 43 39 0 411 3c4a56d04a8ea1c0c5c1edfe10d472a0 46
 # Sending keys: ret
 key ret
 # --------------------------------
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#13 lore raw

Re: [KVM-AUTOTEST PATCH 3/8] WinXP step file fixes

In reply to Lucas Meneghel Rodrigues
Quoted 1 line · Lucas Meneghel Rodrigues

Add an optional barrier to deal with a closed start menu.

Applied.

Quoted 71 lines
---
 client/tests/kvm/steps/WinXP-32-setupssh.steps |   10 ++++++++--
 client/tests/kvm/steps/WinXP-32.steps          |    4 +++-
 client/tests/kvm/steps/WinXP-64.steps          |    3 +--
 3 files changed, 12 insertions(+), 5 deletions(-)
client/tests/kvm/steps/WinXP-32-setupssh.steps +8 -2
index 729d9df..ebb665f 100644
@@ -4,8 +4,14 @@
 # --------------------------------
 step 24.72
 screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
-# open start menu
-barrier_2 125 79 342 270 368b3d82c870dbcdc4dfc2a49660e798 124
+# desktop reached
+barrier_2 36 32 392 292 3828d3a9587b3a9766a567a2b7570e42 124
+# --------------------------------
+step 24.72
+screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
+# open start menu if not already open
+sleep 10
+barrier_2 84 48 0 552 082462ce890968a264b9b13cddda8ae3 10 optional
 # Sending keys: ctrl-esc
 key ctrl-esc
 # --------------------------------
client/tests/kvm/steps/WinXP-32.steps +3 -1
index b0c6e35..f52fd0e 100644
@@ -136,7 +136,8 @@ key alt-n
 step 2251.56
 screendump 20080101_000022_dcdc2fe9606c044ce648422afe42e23d.ppm
 # User
-barrier_2 409 35 64 188 3d71d4d7a9364c1e6415b3d554ce6e5b 9
+barrier_2 161 37 312 187 a941ecbeb73f9d73e3e9c38da9a4b743 9
+# Sending keys: $user alt-n
 var user
 key alt-n
 # --------------------------------
@@ -154,6 +155,7 @@ barrier_2 48 51 391 288 bbac8a522510d7c8d6e515f6a3fbd4c3 240
 step 2279.61
 screendump 20090416_150641_b72ad5c48ec2dbc9814d569e38cbb4cc.ppm
 # Win XP Start Menu (closed)
+sleep 20
 barrier_2 104 41 0 559 a7cc02cecff2cb495f300aefbb99d9ae 5 optional
 # Sending keys: ctrl-esc
 key ctrl-esc
client/tests/kvm/steps/WinXP-64.steps +1 -2
index 20bac81..91e6d0f 100644
@@ -74,7 +74,6 @@ key ret
 # --------------------------------
 step 286.86
 screendump 20080101_000010_bb878343930f948c0346f103a387157a.ppm
-barrier_2 69 15 179 8 93889bdbe5351e61a6d9c7d00bb1c971 10
 # --------------------------------
 step 409.46
 screendump 20080101_000011_30db9777a7883a07e6e65bff74e1d98f.ppm
@@ -100,7 +99,7 @@ key 0xdc
 step 978.02
 screendump 20080101_000014_213fbe6fa13bf32dfac6a00bf4205e45.ppm
 # Windows XP Start Menu Opened
-barrier_2 48 20 274 420 c4a9620d84508013050e5a37a0d9e4ef 15
+barrier_2 129 30 196 72 aae68af7e05e2312c707f2f4bd73f024 15
 # Sending keys: u
 key u
 # --------------------------------
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#14 lore raw

Re: [KVM-AUTOTEST PATCH 2/8] RHEL-4.7 step files: fix the initial boot barriers

In reply to Lucas Meneghel Rodrigues
Quoted 3 lines · Lucas Meneghel Rodrigues

Fix the first barrier to include the 'boot:' prompt. This is crucial because the guest accepts keyboard input only after this prompt appears.

Applied.

Quoted 35 lines

Visibility: Small (Data file on the kvm test)
Risk: Low (Small, tested change to a data file)

---
 client/tests/kvm/steps/RHEL-4.7-i386.steps   |    2 +-
 client/tests/kvm/steps/RHEL-4.7-x86_64.steps |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
client/tests/kvm/steps/RHEL-4.7-i386.steps +1 -1
index 3816c15..763d473 100644
@@ -4,7 +4,7 @@
 # --------------------------------
 step unknown
 screendump 20090413_013526_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
-barrier_2 188 30 354 265 48ef114b5a42ba0d5bebfaee47dce498 50
+barrier_2 44 38 0 363 d9ca61811a10b33cc95515d4796541e7 50
 # Sending keys: ret
 key ret
 # --------------------------------
client/tests/kvm/steps/RHEL-4.7-x86_64.steps +1 -1
index 644446f..36f0109 100644
@@ -6,7 +6,7 @@ step 8.84
 screendump 20080101_000001_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
 # boot options
 sleep 5
-barrier_2 194 59 101 59 8c4f6b29e4087e1bed13c40e4a6a904f 44 optional
+barrier_2 44 36 0 365 ea4c08daabe1f982b243fce9c5b542a0 44 optional
 # Sending keys: ret
 key ret
 # --------------------------------
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#15 lore raw

Re: [KVM-AUTOTEST PATCH 1/8] kvm_config: Allow for "=" in the value of a config parameter

In reply to Lucas Meneghel Rodrigues
Quoted 2 lines · Lucas Meneghel Rodrigues

fix modifies kvm_config.split_and_strip so it will only split once per line.

Applied.

Quoted 20 lines

example: kernel_args = "ks=floppy console=ttyS0 noacpi"

---
 client/tests/kvm/kvm_config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_config.py +1 -1
index 8b6ab15..40f16f1 100755
@@ -136,7 +136,7 @@ class config:
             @param str: String that will be processed
             @param sep: Separator that will be used to split the string
         """
-        temp = str.split(sep)
+        temp = str.split(sep, 1)
         for i in range(len(temp)):
             temp[i] = temp[i].strip()
             temp[i] = temp[i].strip("\"\'")
Signature · 3 lines
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
#16 lore raw

PATCH 1/1 A test patch - Boot VMs until one of them becomes unresponsive

In reply to Lucas Meneghel Rodrigues

Hi,

This test will boot VMs until one of them becomes unresponsive, and records the maximum number of VMs successfully started.

Signature · 2 lines
Yolkfull
Regards,
client/tests/kvm/kvm_tests.py +67 -0
index cccc48e..7d00277 100644
@@ -466,3 +466,70 @@ def run_linux_s3(test, params, env):
     logging.info("VM resumed after S3")
 
     session.close()
+
+def run_boot_vms(tests, params, env):
+    """
+    Boots VMs until one of them becomes unresponsive, and records the maximum
+    number of VMs successfully started:
+    1) boot the first vm
+    2) boot the second vm cloned from the first vm, check whether it boots up
+       and all booted vms can ssh-login
+    3) go on until cannot create VM anymore or cannot allocate memory for VM
+
+    @param test: kvm test object
+    @param params: Dictionary with the test parameters
+    @param env: Dictionary with test environment.
+    """
+    # boot the first vm
+    vm1 = kvm_utils.env_get_vm(env, params.get("main_vm"))
+
+    if not vm1:
+        raise error.TestError("VM object not found in environment")
+    if not vm1.is_alive():
+        raise error.TestError("VM seems to be dead; Test requires a living VM")
+
+    logging.info("Waiting for first guest to be up...")
+
+    vm1_session = kvm_utils.wait_for(vm1.ssh_login, 240, 0, 2)
+    if not vm1_session:
+        raise error.TestFail("Could not log into first guest")
+
+    num = 1
+    vms = [vm1]
+    sessions = [vm1_session]
+
+    # boot the VMs
+    while True:
+        try:
+            num += 1
+            vm_name = "vm" + str(num)
+
+            # clone vm according to the first one
+            curr_vm = vm1.clone(vm_name)
+            logging.info(" Booting the %dth guest" % num)
+            if not curr_vm.create():
+                raise error.TestFail("Cannot boot vm anylonger")
+
+            curr_vm_session = kvm_utils.wait_for(curr_vm.ssh_login, 240, 0, 2)
+
+            if not curr_vm_session:
+                curr_vm.send_monitor_cmd("quit")
+                raise error.TestFail("Could not log into %dth guest" % num)
+
+            logging.info(" %dth guest boots up successfully" % num)
+            sessions.append(curr_vm_session)
+            vms.append(curr_vm)
+
+            # check whether all previous ssh sessions are responsive
+            for vm_session in sessions:
+                if not vm_session.is_responsive():
+                    logging.error("%dth guest's session is not responsive" \
+                                       % (sessions.index(vm_session) + 1))
+
+        except (error.TestFail, OSError):
+            for vm in vms:
+                logging.info("Shut down the %dth guest" % (vms.index(vm) + 1))
+                vm.destroy(gracefully = params.get("kill_vm_gracefully") \
+                                                               == "yes")
+            logging.info("Total number booted successfully: %d" % (num - 1))
+            break
#17 lore raw

Re: [KVM-AUTOTEST PATCH] A test patch - Boot VMs until one of them becomes unresponsive

Quoted 6 lines

Hi,

This test will boot VMs until one of them becomes unresponsive, and records the maximum number of VMs successfully started.

Can you clarify what this test is exactly testing? Is it any of the tests on http://kvm.et.redhat.com/page/KVM-Autotest/TODO (if not, please add it). Are you expecting OOM? Or some VMs to go into swap? Are the VMs completely idle, except for responding to SSH?
Are you going to integrate KSM into this?

TIA,
Y.

#18 lore raw

Re: [KVM-AUTOTEST PATCH] A test patch - Boot VMs until one of them becomes unresponsive

Quoted 11 lines · ----- "Yaniv Kaul
Quoted 8 lines

Hi,

This test will boot VMs until one of them becomes unresponsive, and

records the maximum number of VMs successfully started.

Can you clarify what this test is exactly testing? Is it any of the tests on http://kvm.et.redhat.com/page/KVM-Autotest/TODO (if not, please add it).

The test is in the wiki -- I added it months ago but didn't write it:
'Write a test which adds VMs until one of them becomes unresponsive, and records the maximum number of VMs successfully started. [jasowang]'

Quoted 3 lines

Are you expecting OOM? Or some VMs to go into swap? Are the VMs completely idle, except for responding to SSH?
Are you going to integrate KSM into this?

In my review of the patch I forgot to mention running load on the VMs.
This can be done easily by using 2 sessions per guest (or running in the background of a single session, but I prefer the former), and should be made user configurable via the config file.

I'm not sure about the other things you mentioned -- what should we do about OOM and swap usage? Fail the test? Limit the number of VMs?

And KSM sounds like a good idea, but I'm not sure it should be set up by the framework. Maybe it should be pre-setup on some of the hosts, so eventually some hosts will test with KSM and some without, and the framework can be unaware of that. We can find a way to add that information to the results database (like we currently add the KVM version). Another option is to write a KSM setup test, like kvm_install, that will either run or not run before all other tests, depending on the control file.

Quoted 9 lines

TIA,
Y.

--
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

#19 lore raw

Re: [KVM-AUTOTEST PATCH] A test patch - Boot VMs until one of them becomes unresponsive

In reply to Yolkfull Chow
Quoted 7 lines · Yolkfull Chow

Hi,

This test will boot VMs until one of them becomes unresponsive, and records the maximum number of VMs successfully started.

Hello,

Some more comments (in addition to previous comments by others)
1. Do not just send monitor command "quit" but use vm.destroy
* This was mentioned by Michael, but in a different context.
2. Do not destroy main_vm (or vm1). We may want to run other tests on it.
3. You can use enumerate(vms) instead of looking for vm with index.
4. It would be nice to close all ssh sessions too.

Regards,
Uri.

#20 lore raw

Re: [KVM-AUTOTEST PATCH] A test patch - Boot VMs until one of them becomes unresponsive

Quoted 9 lines · Uri Lublin
Quoted 7 lines · Yolkfull Chow

Hi,

This test will boot VMs until one of them becomes unresponsive, and records the maximum number of VMs successfully started.

Quoted 8 lines

Hello,

Some more comments (in addition to previous comments by others)
1. Do not just send monitor command "quit" but use vm.destroy
* This was mentioned by Michael, but in a different context.
2. Do not destroy main_vm (or vm1). We may want to run other tests on it.
3. You can use enumerate(vms) instead of looking for vm with index.
4. It would be nice to close all ssh sessions too.

OK, I will do modification according to your comments, thank you so much. :)

Best Regards,
Yolkfull

Quoted 7 lines

Regards,
Uri.

Signature · 3 lines
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