Skip to contentSkip to conversation

KVM test: Fedora 11-64 bits step file

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Oct 6, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM test: Fedora 11-64 bits step file

During work of creating kickstart files for fedora and answer files for windows, it's also nice to have step files for the operating systems tested. This patch adds Fedora 11 64 bit step file.

---
 client/bin/package.py                        |   23 +-
 client/tests/kvm/control                     |    4 +-
 client/tests/kvm/kvm.py                      |    1 +
 client/tests/kvm/kvm_tests.cfg.sample        |   55 +++--
 client/tests/kvm/kvm_utils.py                |    1 +
 client/tests/kvm/kvm_vm.py                   |    4 +-
 client/tests/kvm/scripts/hugepage.py         |    8 +-
 client/tests/kvm/scripts/unattended.py       |   15 +-
 client/tests/kvm/steps/Fedora-11-64.steps    |  300 ++++++++++++++++++++++++++
 client/tests/kvm/tests/unattended_install.py |    6 +-
 client/tests/kvm/unattended/Fedora-11.ks     |    2 +-
 client/tests/kvm/unattended/winxp32.sif      |    2 +-
 12 files changed, 364 insertions(+), 57 deletions(-)
 create mode 100644 client/tests/kvm/steps/Fedora-11-64.steps
client/bin/package.py +12 -11
index 9a836b6..3b9c417 100644
@@ -157,20 +157,21 @@ def _dpkg_info(dpkg_package):
 
 def list_all():
     """Returns a list with the names of all currently installed packages."""
-    support_info = os_support()
-    installed_packages = []
+    return []
+    #support_info = os_support()
+    #installed_packages = []
 
-    if support_info['rpm']:
-        installed_packages += utils.system_output('rpm -qa').splitlines()
+    #if support_info['rpm']:
+    #    installed_packages += utils.system_output('rpm -qa').splitlines()
 
-    if support_info['dpkg']:
-        raw_list = utils.system_output('dpkg -l').splitlines()[5:]
-        for line in raw_list:
-            parts = line.split()
-            if parts[0] == "ii":  # only grab "installed" packages
-                installed_packages.append("%s-%s" % (parts[1], parts[2]))
+    #if support_info['dpkg']:
+    #    raw_list = utils.system_output('dpkg -l').splitlines()[5:]
+    #    for line in raw_list:
+    #        parts = line.split()
+    #        if parts[0] == "ii":  # only grab "installed" packages
+    #            installed_packages.append("%s-%s" % (parts[1], parts[2]))
 
-    return installed_packages
+    #return installed_packages
 
 
 def info(package):
client/tests/kvm/control +2 -2
index e5c5d2f..974e91e 100644
@@ -75,12 +75,12 @@ params = {
     "name": "build",
     "shortname": "build",
     "type": "build",
-    "mode": "release",
+    #"mode": "release",
     #"mode": "snapshot",
     #"mode": "localtar",
     #"mode": "localsrc",
     #"mode": "git",
-    #"mode": "noinstall",
+    "mode": "noinstall",
     #"mode": "koji",
 
     ## Are we going to load modules built by this test?
client/tests/kvm/kvm.py +1 -0
index 204164d..eebf2e9 100644
@@ -64,6 +64,7 @@ class kvm(test.test):
                 kvm_utils.dump_env(env, env_filename)
 
             except Exception, e:
+                raise
                 logging.error("Test failed: %s", e)
                 logging.debug("Postprocessing on error...")
                 kvm_preprocessing.postprocess_on_error(self, params, env)
client/tests/kvm/kvm_tests.cfg.sample +32 -23

82 lines not on this page · raw message

client/tests/kvm/kvm_utils.py +1 -0
index 53b664a..0f6ea92 100644
@@ -6,6 +6,7 @@ KVM test utility functions.
 
 import md5, thread, subprocess, time, string, random, socket, os, signal, pty
 import select, re, logging, commands, cPickle
+import common
 from autotest_lib.client.bin import utils
 from autotest_lib.client.common_lib import error
 import kvm_subprocess
client/tests/kvm/kvm_vm.py +2 -2
index 595b749..5cd2894 100755
@@ -268,12 +268,12 @@ class VM:
         # {fat:floppy:}/path/. However vvfat is not usually recommended
         floppy = params.get("floppy")
         if floppy:
-            floppy = os.path.join(image_dir, floppy)
+            floppy = os.path.join(root_dir, floppy)
             qemu_cmd += " -fda %s" % floppy
 
         tftp = params.get("tftp")
         if tftp:
-            tftp = os.path.join(image_dir, tftp)
+            tftp = os.path.join(root_dir, tftp)
             qemu_cmd += " -tftp %s" % tftp
 
         extra_params = params.get("extra_params")
client/tests/kvm/scripts/hugepage.py +4 -4
index 3828533..9668095 100755
@@ -1,10 +1,10 @@
 #!/usr/bin/python
-# -*- coding: utf-8 -*-
-import os, sys, time
-
 """
 Simple script to allocate enough hugepages for KVM testing purposes.
 """
+# -*- coding: utf-8 -*-
+import os, sys, time
+
 
 class HugePageError(Exception):
     """
@@ -13,7 +13,7 @@ class HugePageError(Exception):
     pass
 
 
-class HugePage:
+class HugePage(object):
     def __init__(self, hugepage_path=None):
         """
         Gets environment variable values and calculates the target number
client/tests/kvm/scripts/unattended.py +7 -8
index 5d730d2..6ceeef1 100755
@@ -1,11 +1,11 @@
 #!/usr/bin/python
+"""
+Simple script to setup unattended installs on KVM guests.
+"""
 # -*- coding: utf-8 -*-
 import os, sys, shutil, tempfile, re
 import common
 
-"""
-Simple script to setup unattended installs on KVM guests.
-"""
 
 class SetupError(Exception):
     """
@@ -14,7 +14,7 @@ class SetupError(Exception):
     pass
 
 
-class UnattendedInstall:
+class UnattendedInstall(object):
     """
     Creates a floppy disk image that will contain a config file for unattended
     OS install. Optionally, sets up a PXE install server using qemu built in
@@ -28,7 +28,6 @@ class UnattendedInstall:
         script_dir = os.path.dirname(sys.modules[__name__].__file__)
         kvm_test_dir = os.path.abspath(os.path.join(script_dir, ".."))
         images_dir = os.path.join(kvm_test_dir, 'images')
-        isos_dir = os.path.join(kvm_test_dir, 'isos')
         self.deps_dir = os.path.join(kvm_test_dir, 'deps')
         self.unattended_dir = os.path.join(kvm_test_dir, 'unattended')
 
@@ -55,7 +54,7 @@ class UnattendedInstall:
         self.unattended_file = os.environ['KVM_TEST_unattended_file']
 
         self.qemu_img_bin = os.path.join(kvm_test_dir, 'qemu-img')
-        self.cdrom_iso = os.path.join(isos_dir, cdrom_iso)
+        self.cdrom_iso = os.path.join(kvm_test_dir, cdrom_iso)
         self.floppy_mount = tempfile.mkdtemp(prefix='floppy_', dir='/tmp')
         self.cdrom_mount = tempfile.mkdtemp(prefix='cdrom_', dir='/tmp')
         self.floppy_img = os.path.join(images_dir, 'floppy.img')
@@ -69,9 +68,9 @@ class UnattendedInstall:
         """
         print "Creating boot floppy"
 
-        if self.floppy_img:
+        if os.path.exists(self.floppy_img):
             os.remove(self.floppy_img)
-        #c_cmd = 'bximage -q -fd -size=1.44 %s' % (self.floppy_img)
+
         c_cmd = '%s create -f raw %s 1440k' % (self.qemu_img_bin, self.floppy_img)
         if os.system(c_cmd):
             raise SetupError('Could not create floppy image.')
client/tests/kvm/steps/Fedora-11-64.steps new file +300 -0

300 lines not on this page · raw message

client/tests/kvm/tests/unattended_install.py +1 -5
index 60e2a35..1bd555f 100644
@@ -13,11 +13,7 @@ def run_unattended_install(test, params, env):
     @param params: Dictionary with the test parameters.
     @param env: Dictionary with test environment.
     """
-    vm = kvm_utils.env_get_vm(env, params.get("main_vm"))
-    if not vm:
-        raise error.TestError("VM object not found in environment")
-    if not vm.is_alive():
-        raise error.TestError("VM seems to be dead; Test requires a living VM")
+    vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
 
     logging.info("Starting unattended install watch process")
     server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client/tests/kvm/unattended/Fedora-11.ks +1 -1
index 2e51861..15b67cf 100644
@@ -28,7 +28,7 @@ os.system('iptables -F')
 os.system('echo 0 > /selinux/enforce')
 port = 12323
 buf = 1024
-addr = ('10.0.0.2', port)
+addr = ('10.0.2.2', port)
 client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 client.connect(addr)
 client.sendto('done', addr)
client/tests/kvm/unattended/winxp32.sif +1 -1
index dc0c106..153f499 100644
@@ -64,7 +64,7 @@
     BrandIEUsingUnattended=Yes
 
 [GuiRunOnce]
-    Command0="cmd /c A:\finish.exe 10.0.0.2"
+    Command0="cmd /c A:\finish.exe 10.0.2.2"
 
 [Display]
     Xresolution=1024
Signature · 1 line
1.6.2.5