[autotest] Delete client/tests/kvm and related dead code.
This deletes code related to kernel tests for KVM (N.B. _not_ the
Chrome OS tests that run inside KVM in the builders), as well as
various client-side libraries that become dead after the deletion.
BUG=None
TEST=Run push_to_prod suite on a local instance
Change-Id: I6cb49f7c0eac5da07c27112071e0effda69f2a7a
Reviewed-on: https://chromium-review.googlesource.com/340243
Commit-Ready: Richard Barnette <[email protected]>
Tested-by: Richard Barnette <[email protected]>
Reviewed-by: Kevin Cheng <[email protected]>
Reviewed-by: Dan Shi <[email protected]>
diff --git a/client/bin/base_utils.py b/client/bin/base_utils.py
index bca56d5..f44730f 100644
--- a/client/bin/base_utils.py
+++ b/client/bin/base_utils.py
@@ -98,45 +98,6 @@
raise NameError('extracting tarball produced no dir')
-def hash_file(filename, size=None, method="md5"):
- """
- Calculate the hash of filename.
- If size is not None, limit to first size bytes.
- Throw exception if something is wrong with filename.
- Can be also implemented with bash one-liner (assuming size%1024==0):
- dd if=filename bs=1024 count=size/1024 | sha1sum -
-
- @param filename: Path of the file that will have its hash calculated.
- @param method: Method used to calculate the hash. Supported methods:
- * md5
- * sha1
- @returns: Hash of the file, if something goes wrong, return None.
- """
- chunksize = 4096
- fsize = os.path.getsize(filename)
-
- if not size or size > fsize:
- size = fsize
- f = open(filename, 'rb')
-
- try:
- hash = utils.hash(method)
- except ValueError:
- logging.error("Unknown hash type %s, returning None", method)
-
- while size > 0:
- if chunksize > size:
- chunksize = size
- data = f.read(chunksize)
- if len(data) == 0:
- logging.debug("Nothing left to read but size=%d", size)
- break
- hash.update(data)
- size -= len(data)
- f.close()
- return hash.hexdigest()
-
-
def unmap_url_cache(cachedir, url, expected_hash, method="md5"):
"""
Downloads a file from a URL to a cache directory. If the file is already
diff --git a/client/common_lib/base_utils.py b/client/common_lib/base_utils.py
index 3f7b092..77c36ae 100644
--- a/client/common_lib/base_utils.py
+++ b/client/common_lib/base_utils.py
@@ -26,8 +26,6 @@
import urlparse
import warnings
-from threading import Thread, Event
-
try:
import hashlib
except ImportError:
@@ -551,155 +549,6 @@
if tap_report is not None and tap_report.do_tap_report:
tap_report.record_keyval(path, dictionary, type_tag=type_tag)
-class FileFieldMonitor(object):
- """
- Monitors the information from the file and reports it's values.
-
- It gather the information at start and stop of the measurement or
- continuously during the measurement.
- """
- class Monitor(Thread):
- """
- Internal monitor class to ensure continuous monitor of monitored file.
- """
- def __init__(self, master):
- """
- @param master: Master class which control Monitor
- """
- Thread.__init__(self)
- self.master = master
-
- def run(self):
- """
- Start monitor in thread mode
- """
- while not self.master.end_event.isSet():
- self.master._get_value(self.master.logging)
- time.sleep(self.master.time_step)
-
-
- def __init__(self, status_file, data_to_read, mode_diff, continuously=False,
- contlogging=False, separator=" +", time_step=0.1):
- """
- Initialize variables.
- @param status_file: File contain status.
- @param mode_diff: If True make a difference of value, else average.
- @param data_to_read: List of tuples with data position.
- format: [(start_of_line,position in params)]
- example:
- data:
- cpu 324 345 34 5 345
- cpu0 34 11 34 34 33
- ^^^^
- start of line
- params 0 1 2 3 4
- @param mode_diff: True to subtract old value from new value,
- False make average of the values.
- @parma continuously: Start the monitoring thread using the time_step
- as the measurement period.
- @param contlogging: Log data in continuous run.
- @param separator: Regular expression of separator.
- @param time_step: Time period of the monitoring value.
- """
- self.end_event = Event()
- self.start_time = 0
- self.end_time = 0
- self.test_time = 0
-
- self.status_file = status_file
- self.separator = separator
- self.data_to_read = data_to_read
- self.num_of_params = len(self.data_to_read)
- self.mode_diff = mode_diff
- self.continuously = continuously
- self.time_step = time_step
-
- self.value = [0 for i in range(self.num_of_params)]
- self.old_value = [0 for i in range(self.num_of_params)]
- self.log = []
- self.logging = contlogging
-
- self.started = False
- self.num_of_get_value = 0
- self.monitor = None
-
-
- def _get_value(self, logging=True):
- """
- Return current values.
- @param logging: If true log value in memory. There can be problem
- with long run.
- """
- data = read_file(self.status_file)
- value = []
- for i in range(self.num_of_params):
- value.append(int(get_field(data,
- self.data_to_read[i][1],
- self.data_to_read[i][0],
- self.separator)))
-
- if logging:
- self.log.append(value)
- if not self.mode_diff:
- value = map(lambda x, y: x + y, value, self.old_value)
-
- self.old_value = value
- self.num_of_get_value += 1
- return value
-
-
- def start(self):
- """
- Start value monitor.
- """
- if self.started:
- self.stop()
- self.old_value = [0 for i in range(self.num_of_params)]
- self.num_of_get_value = 0
- self.log = []
- self.end_event.clear()
- self.start_time = time.time()
- self._get_value()
- self.started = True
- if (self.continuously):
- self.monitor = FileFieldMonitor.Monitor(self)
- self.monitor.start()
-
-
- def stop(self):
- """
- Stop value monitor.
- """
- if self.started:
- self.started = False
- self.end_time = time.time()
- self.test_time = self.end_time - self.start_time
- self.value = self._get_value()
- if (self.continuously):
- self.end_event.set()
- self.monitor.join()
- if (self.mode_diff):
- self.value = map(lambda x, y: x - y, self.log[-1], self.log[0])
- else:
- self.value = map(lambda x: x / self.num_of_get_value,
- self.value)
-
-
- def get_status(self):
- """
- @return: Status of monitored process average value,
- time of test and array of monitored values and time step of
- continuous run.
- """
- if self.started:
- self.stop()
- if self.mode_diff:
- for i in range(len(self.log) - 1):
- self.log[i] = (map(lambda x, y: x - y,
- self.log[i + 1], self.log[i]))
- self.log.pop()
- return (self.value, self.test_time, self.log, self.time_step)
-
def is_url(path):
"""Return true if path looks like a URL"""
@@ -1257,226 +1106,6 @@
return cpu_percent, to_return
-class SystemLoad(object):
- """
- Get system and/or process values and return average value of load.
- """
- def __init__(self, pids, advanced=False, time_step=0.1, cpu_cont=False,
- use_log=False):
- """
- @param pids: List of pids to be monitored. If pid = 0 whole system will
- be monitored. pid == 0 means whole system.
- @param advanced: monitor add value for system irq count and softirq
- for process minor and maior page fault
- @param time_step: Time step for continuous monitoring.
- @param cpu_cont: If True monitor CPU load continuously.
- @param use_log: If true every monitoring is logged for dump.
- """
- self.pids = []
- self.stats = {}
- for pid in pids:
- if pid == 0:
- cpu = FileFieldMonitor("/proc/stat",
- [("cpu", 0), # User Time
- ("cpu", 2), # System Time
- ("intr", 0), # IRQ Count
- ("softirq", 0)], # Soft IRQ Count
- True,
- cpu_cont,
- use_log,
- " +",
- time_step)
- mem = FileFieldMonitor("/proc/meminfo",
- [("MemTotal:", 0), # Mem Total
- ("MemFree:", 0), # Mem Free
- ("Buffers:", 0), # Buffers
- ("Cached:", 0)], # Cached
- False,
- True,
- use_log,
- " +",
- time_step)
- self.stats[pid] = ["TOTAL", cpu, mem]
- self.pids.append(pid)
- else:
- name = ""
- if (type(pid) is int):
- self.pids.append(pid)
- name = get_process_name(pid)
- else:
- self.pids.append(pid[0])
- name = pid[1]
-
- cpu = FileFieldMonitor("/proc/%d/stat" %
- self.pids[-1],
- [("", 13), # User Time
- ("", 14), # System Time
- ("", 9), # Minority Page Fault
- ("", 11)], # Majority Page Fault
- True,
- cpu_cont,
- use_log,
- " +",
- time_step)
- mem = FileFieldMonitor("/proc/%d/status" %
- self.pids[-1],
- [("VmSize:", 0), # Virtual Memory Size
- ("VmRSS:", 0), # Resident Set Size
- ("VmPeak:", 0), # Peak VM Size
- ("VmSwap:", 0)], # VM in Swap
- False,
- True,
- use_log,
- " +",
- time_step)
- self.stats[self.pids[-1]] = [name, cpu, mem]
-
- self.advanced = advanced
-
-
- def __str__(self):
- """
- Define format how to print
- """
- out = ""
- for pid in self.pids:
- for stat in self.stats[pid][1:]:
- out += str(stat.get_status()) + "\n"
- return out
-
-
- def start(self, pids=[]):
- """
- Start monitoring of the process system usage.
- @param pids: List of PIDs you intend to control. Use pids=[] to control
- all defined PIDs.
- """
- if pids == []:
- pids = self.pids
-
- for pid in pids:
- for stat in self.stats[pid][1:]:
- stat.start()
-
-
- def stop(self, pids=[]):
- """
- Stop monitoring of the process system usage.
- @param pids: List of PIDs you intend to control. Use pids=[] to control
- all defined PIDs.
- """
- if pids == []:
- pids = self.pids
-
- for pid in pids:
- for stat in self.stats[pid][1:]:
- stat.stop()
-
-
- def dump(self, pids=[]):
- """
- Get the status of monitoring.
- @param pids: List of PIDs you intend to control. Use pids=[] to control
- all defined PIDs.
- @return:
- tuple([cpu load], [memory load]):
- ([(PID1, (PID1_cpu_meas)), (PID2, (PID2_cpu_meas)), ...],
- [(PID1, (PID1_mem_meas)), (PID2, (PID2_mem_meas)), ...])
-
- PID1_cpu_meas:
- average_values[], test_time, cont_meas_values[[]], time_step
- PID1_mem_meas:
- average_values[], test_time, cont_meas_values[[]], time_step
- where average_values[] are the measured values (mem_free,swap,...)
- which are described in SystemLoad.__init__()-FileFieldMonitor.
- cont_meas_values[[]] is a list of average_values in the sampling
- times.
- """
- if pids == []:
- pids = self.pids
-
- cpus = []
- memory = []
- for pid in pids:
- stat = (pid, self.stats[pid][1].get_status())
- cpus.append(stat)
- for pid in pids:
- stat = (pid, self.stats[pid][2].get_status())
- memory.append(stat)
-
- return (cpus, memory)
-
-
- def get_cpu_status_string(self, pids=[]):
- """
- Convert status to string array.
- @param pids: List of PIDs you intend to control. Use pids=[] to control
- all defined PIDs.
- @return: String format to table.
- """
- if pids == []:
- pids = self.pids
-
- headers = ["NAME",
- ("%7s") % "PID",
- ("%5s") % "USER",
- ("%5s") % "SYS",
- ("%5s") % "SUM"]
- if self.advanced:
- headers.extend(["MINFLT/IRQC",
- "MAJFLT/SOFTIRQ"])
- headers.append(("%11s") % "TIME")
- textstatus = []
- for pid in pids:
- stat = self.stats[pid][1].get_status()
- time = stat[1]
- stat = stat[0]
- textstatus.append(["%s" % self.stats[pid][0],
- "%7s" % pid,
- "%4.0f%%" % (stat[0] / time),
- "%4.0f%%" % (stat[1] / time),
- "%4.0f%%" % ((stat[0] + stat[1]) / time),
- "%10.3fs" % time])
- if self.advanced:
- textstatus[-1].insert(-1, "%11d" % stat[2])
- textstatus[-1].insert(-1, "%14d" % stat[3])
-
- return matrix_to_string(textstatus, tuple(headers))
-
-
- def get_mem_status_string(self, pids=[]):
- """
- Convert status to string array.
- @param pids: List of PIDs you intend to control. Use pids=[] to control
- all defined PIDs.
- @return: String format to table.
- """
- if pids == []:
- pids = self.pids
-
- headers = ["NAME",
- ("%7s") % "PID",
- ("%8s") % "TOTAL/VMSIZE",
- ("%8s") % "FREE/VMRSS",
- ("%8s") % "BUFFERS/VMPEAK",
- ("%8s") % "CACHED/VMSWAP",
- ("%11s") % "TIME"]
- textstatus = []
- for pid in pids:
- stat = self.stats[pid][2].get_status()
- time = stat[1]
- stat = stat[0]
- textstatus.append(["%s" % self.stats[pid][0],
- "%7s" % pid,
- "%10dMB" % (stat[0] / 1024),
- "%8dMB" % (stat[1] / 1024),
- "%12dMB" % (stat[2] / 1024),
- "%11dMB" % (stat[3] / 1024),
- "%10.3fs" % time])
-
- return matrix_to_string(textstatus, tuple(headers))
-
-
def get_arch(run_function=run):
"""
Get the hardware architecture of the machine.
diff --git a/client/common_lib/cartesian_config.py b/client/common_lib/cartesian_config.py
deleted file mode 100755
index ac04c24..0000000
--- a/client/common_lib/cartesian_config.py
+++ /dev/null
@@ -1,696 +0,0 @@
-#!/usr/bin/python
-"""
-Cartesian configuration format file parser.
-
- Filter syntax:
- , means OR
- .. means AND
- . means IMMEDIATELY-FOLLOWED-BY
-
- Example:
- qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide
- means match all dicts whose names have:
- (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR
- ((RHEL IMMEDIATELY-FOLLOWED-BY 6) AND raw AND boot) OR
- (smp2 AND qcow2 AND migrate AND ide)
-
- Note:
- 'qcow2..Fedora.14' is equivalent to 'Fedora.14..qcow2'.
- 'qcow2..Fedora.14' is not equivalent to 'qcow2..14.Fedora'.
- 'ide, scsi' is equivalent to 'scsi, ide'.
-
- Filters can be used in 3 ways:
- only <filter>
- no <filter>
- <filter>:
- The last one starts a conditional block.
-
-@copyright: Red Hat 2008-2011
-"""
-
-import re, os, sys, optparse, collections
-
-class ParserError:
- def __init__(self, msg, line=None, filename=None, linenum=None):
- self.msg = msg
- self.line = line
- self.filename = filename
- self.linenum = linenum
-
- def __str__(self):
- if self.line:
- return "%s: %r (%s:%s)" % (self.msg, self.line,
- self.filename, self.linenum)
- else:
- return "%s (%s:%s)" % (self.msg, self.filename, self.linenum)
-
-
-num_failed_cases = 5
-
-
-class Node(object):
- def __init__(self):
- self.name = []
- self.dep = []
- self.content = []
- self.children = []
- self.labels = set()
- self.append_to_shortname = False
- self.failed_cases = collections.deque()
-
-
-def _match_adjacent(block, ctx, ctx_set):
- # TODO: explain what this function does
- if block[0] not in ctx_set:
- return 0
- if len(block) == 1:
- return 1
- if block[1] not in ctx_set:
- return int(ctx[-1] == block[0])
- k = 0
- i = ctx.index(block[0])
- while i < len(ctx):
- if k > 0 and ctx[i] != block[k]:
- i -= k - 1
- k = 0
- if ctx[i] == block[k]:
- k += 1
- if k >= len(block):
- break
- if block[k] not in ctx_set:
- break
- i += 1
- return k
-
-
-def _might_match_adjacent(block, ctx, ctx_set, descendant_labels):
- matched = _match_adjacent(block, ctx, ctx_set)
- for elem in block[matched:]:
- if elem not in descendant_labels:
- return False
- return True
-
-
-# Filter must inherit from object (otherwise type() won't work)
-class Filter(object):
- def __init__(self, s):
- self.filter = []
- for char in s:
- if not (char.isalnum() or char.isspace() or char in ".,_-"):
- raise ParserError("Illegal characters in filter")
- for word in s.replace(",", " ").split():
- word = [block.split(".") for block in word.split("..")]
- for block in word:
- for elem in block:
- if not elem:
- raise ParserError("Syntax error")
- self.filter += [word]
-
-
- def match(self, ctx, ctx_set):
- for word in self.filter:
- for block in word:
- if _match_adjacent(block, ctx, ctx_set) != len(block):
- break
- else:
- return True
- return False
-
-
- def might_match(self, ctx, ctx_set, descendant_labels):
- for word in self.filter:
- for block in word:
- if not _might_match_adjacent(block, ctx, ctx_set,
- descendant_labels):
- break
- else:
- return True
- return False
-
-
-class NoOnlyFilter(Filter):
- def __init__(self, line):
- Filter.__init__(self, line.split(None, 1)[1])
- self.line = line
-
-
-class OnlyFilter(NoOnlyFilter):
- def is_irrelevant(self, ctx, ctx_set, descendant_labels):
- return self.match(ctx, ctx_set)
-
-
- def requires_action(self, ctx, ctx_set, descendant_labels):
- return not self.might_match(ctx, ctx_set, descendant_labels)
-
-
- def might_pass(self, failed_ctx, failed_ctx_set, ctx, ctx_set,
- descendant_labels):
- for word in self.filter:
- for block in word:
- if (_match_adjacent(block, ctx, ctx_set) >
- _match_adjacent(block, failed_ctx, failed_ctx_set)):
- return self.might_match(ctx, ctx_set, descendant_labels)
- return False
-
-
-class NoFilter(NoOnlyFilter):
- def is_irrelevant(self, ctx, ctx_set, descendant_labels):
- return not self.might_match(ctx, ctx_set, descendant_labels)
-
-
- def requires_action(self, ctx, ctx_set, descendant_labels):
- return self.match(ctx, ctx_set)
-
-
- def might_pass(self, failed_ctx, failed_ctx_set, ctx, ctx_set,
- descendant_labels):
- for word in self.filter:
- for block in word:
- if (_match_adjacent(block, ctx, ctx_set) <
- _match_adjacent(block, failed_ctx, failed_ctx_set)):
- return not self.match(ctx, ctx_set)
- return False
-
-
-class Condition(NoFilter):
- def __init__(self, line):
- Filter.__init__(self, line.rstrip(":"))
- self.line = line
- self.content = []
-
-
-class NegativeCondition(OnlyFilter):
- def __init__(self, line):
- Filter.__init__(self, line.lstrip("!").rstrip(":"))
- self.line = line
- self.content = []
-
-
-class Parser(object):
- """
- Parse an input file or string that follows the Cartesian Config File format
- and generate a list of dicts that will be later used as configuration
- parameters by autotest tests that use that format.
-
- @see: http://autotest.kernel.org/wiki/CartesianConfig
- """
-
- def __init__(self, filename=None, debug=False):
- """
- Initialize the parser and optionally parse a file.
-
- @param filename: Path of the file to parse.
- @param debug: Whether to turn on debugging output.
- """
- self.node = Node()
- self.debug = debug
- if filename:
- self.parse_file(filename)
-
-
- def parse_file(self, filename):
- """
- Parse a file.
-
- @param filename: Path of the configuration file.
- """
- self.node = self._parse(FileReader(filename), self.node)
-
-
- def parse_string(self, s):
- """
- Parse a string.
-
- @param s: String to parse.
- """
- self.node = self._parse(StrReader(s), self.node)
-
-
- def get_dicts(self, node=None, ctx=[], content=[], shortname=[], dep=[]):
- """
- Generate dictionaries from the code parsed so far. This should
- be called after parsing something.
-
- @return: A dict generator.
- """
- def process_content(content, failed_filters):
- # 1. Check that the filters in content are OK with the current
- # context (ctx).
- # 2. Move the parts of content that are still relevant into
- # new_content and unpack conditional blocks if appropriate.
- # For example, if an 'only' statement fully matches ctx, it
- # becomes irrelevant and is not appended to new_content.
- # If a conditional block fully matches, its contents are
- # unpacked into new_content.
- # 3. Move failed filters into failed_filters, so that next time we
- # reach this node or one of its ancestors, we'll check those
- # filters first.
- for t in content:
- filename, linenum, obj = t
- if type(obj) is Op:
- new_content.append(t)
- continue
- # obj is an OnlyFilter/NoFilter/Condition/NegativeCondition
- if obj.requires_action(ctx, ctx_set, labels):
- # This filter requires action now
- if type(obj) is OnlyFilter or type(obj) is NoFilter:
- self._debug(" filter did not pass: %r (%s:%s)",
- obj.line, filename, linenum)
- failed_filters.append(t)
- return False
- else:
- self._debug(" conditional block matches: %r (%s:%s)",
- obj.line, filename, linenum)
- # Check and unpack the content inside this Condition
- # object (note: the failed filters should go into
- # new_internal_filters because we don't expect them to
- # come from outside this node, even if the Condition
- # itself was external)
- if not process_content(obj.content,
- new_internal_filters):
- failed_filters.append(t)
- return False
- continue
- elif obj.is_irrelevant(ctx, ctx_set, labels):
- # This filter is no longer relevant and can be removed
- continue
- else:
- # Keep the filter and check it again later
- new_content.append(t)
- return True
-
- def might_pass(failed_ctx,
- failed_ctx_set,
- failed_external_filters,
- failed_internal_filters):
- for t in failed_external_filters:
- if t not in content:
- return True
- filename, linenum, filter = t
- if filter.might_pass(failed_ctx, failed_ctx_set, ctx, ctx_set,
- labels):
- return True
- for t in failed_internal_filters:
- filename, linenum, filter = t
- if filter.might_pass(failed_ctx, failed_ctx_set, ctx, ctx_set,
- labels):
- return True
- return False
-
- def add_failed_case():
- node.failed_cases.appendleft((ctx, ctx_set,
- new_external_filters,
- new_internal_filters))
- if len(node.failed_cases) > num_failed_cases:
- node.failed_cases.pop()
-
- node = node or self.node
- # Update dep
- for d in node.dep:
- dep = dep + [".".join(ctx + [d])]
- # Update ctx
- ctx = ctx + node.name
- ctx_set = set(ctx)
- labels = node.labels
- # Get the current name
- name = ".".join(ctx)
- if node.name:
- self._debug("checking out %r", name)
- # Check previously failed filters
- for i, failed_case in enumerate(node.failed_cases):
- if not might_pass(*failed_case):
- self._debug(" this subtree has failed before")
- del node.failed_cases[i]
- node.failed_cases.appendleft(failed_case)
- return
- # Check content and unpack it into new_content
- new_content = []
- new_external_filters = []
- new_internal_filters = []
- if (not process_content(node.content, new_internal_filters) or
- not process_content(content, new_external_filters)):
- add_failed_case()
- return
- # Update shortname
- if node.append_to_shortname:
- shortname = shortname + node.name
- # Recurse into children
- count = 0
- for n in node.children:
- for d in self.get_dicts(n, ctx, new_content, shortname, dep):
- count += 1
- yield d
- # Reached leaf?
- if not node.children:
- self._debug(" reached leaf, returning it")
- d = {"name": name, "dep": dep, "shortname": ".".join(shortname)}
- for filename, linenum, op in new_content:
- op.apply_to_dict(d)
- yield d
- # If this node did not produce any dicts, remember the failed filters
- # of its descendants
- elif not count:
- new_external_filters = []
- new_internal_filters = []
- for n in node.children:
- (failed_ctx,
- failed_ctx_set,
- failed_external_filters,
- failed_internal_filters) = n.failed_cases[0]
- for obj in failed_internal_filters:
- if obj not in new_internal_filters:
- new_internal_filters.append(obj)
- for obj in failed_external_filters:
- if obj in content:
- if obj not in new_external_filters:
- new_external_filters.append(obj)
- else:
- if obj not in new_internal_filters:
- new_internal_filters.append(obj)
- add_failed_case()
-
-
- def _debug(self, s, *args):
- if self.debug:
- s = "DEBUG: %s" % s
- print s % args
-
-
- def _warn(self, s, *args):
- s = "WARNING: %s" % s
- print s % args
-
-
- def _parse_variants(self, cr, node, prev_indent=-1):
- """
- Read and parse lines from a FileReader object until a line with an
- indent level lower than or equal to prev_indent is encountered.
-
- @param cr: A FileReader/StrReader object.
- @param node: A node to operate on.
- @param prev_indent: The indent level of the "parent" block.
- @return: A node object.
- """
- node4 = Node()
-
- while True:
- line, indent, linenum = cr.get_next_line(prev_indent)
- if not line:
- break
-
- name, dep = map(str.strip, line.lstrip("- ").split(":", 1))
- for char in name:
- if not (char.isalnum() or char in "@._-"):
- raise ParserError("Illegal characters in variant name",
- line, cr.filename, linenum)
- for char in dep:
- if not (char.isalnum() or char.isspace() or char in ".,_-"):
- raise ParserError("Illegal characters in dependencies",
- line, cr.filename, linenum)
-
- node2 = Node()
- node2.children = [node]
- node2.labels = node.labels
-
- node3 = self._parse(cr, node2, prev_indent=indent)
- node3.name = name.lstrip("@").split(".")
- node3.dep = dep.replace(",", " ").split()
- node3.append_to_shortname = not name.startswith("@")
-
- node4.children += [node3]
- node4.labels.update(node3.labels)
- node4.labels.update(node3.name)
-
- return node4
-
-
- def _parse(self, cr, node, prev_indent=-1):
- """
- Read and parse lines from a StrReader object until a line with an
- indent level lower than or equal to prev_indent is encountered.
-
- @param cr: A FileReader/StrReader object.
- @param node: A Node or a Condition object to operate on.
- @param prev_indent: The indent level of the "parent" block.
- @return: A node object.
- """
- while True:
- line, indent, linenum = cr.get_next_line(prev_indent)
- if not line:
- break
-
- words = line.split(None, 1)
-
- # Parse 'variants'
- if line == "variants:":
- # 'variants' is not allowed inside a conditional block
- if (isinstance(node, Condition) or
- isinstance(node, NegativeCondition)):
- raise ParserError("'variants' is not allowed inside a "
- "conditional block",
- None, cr.filename, linenum)
- node = self._parse_variants(cr, node, prev_indent=indent)
- continue
-
- # Parse 'include' statements
- if words[0] == "include":
- if len(words) < 2:
- raise ParserError("Syntax error: missing parameter",
- line, cr.filename, linenum)
- filename = os.path.expanduser(words[1])
- if isinstance(cr, FileReader) and not os.path.isabs(filename):
- filename = os.path.join(os.path.dirname(cr.filename),
- filename)
- if not os.path.isfile(filename):
- self._warn("%r (%s:%s): file doesn't exist or is not a "
- "regular file", line, cr.filename, linenum)
- continue
- node = self._parse(FileReader(filename), node)
- continue
-
- # Parse 'only' and 'no' filters
- if words[0] in ("only", "no"):
- if len(words) < 2:
- raise ParserError("Syntax error: missing parameter",
- line, cr.filename, linenum)
- try:
- if words[0] == "only":
- f = OnlyFilter(line)
- elif words[0] == "no":
- f = NoFilter(line)
- except ParserError, e:
- e.line = line
- e.filename = cr.filename
- e.linenum = linenum
- raise
- node.content += [(cr.filename, linenum, f)]
- continue
-
- # Look for operators
- op_match = _ops_exp.search(line)
-
- # Parse conditional blocks
- if ":" in line:
- index = line.index(":")
- if not op_match or index < op_match.start():
- index += 1
- cr.set_next_line(line[index:], indent, linenum)
- line = line[:index]
- try:
- if line.startswith("!"):
- cond = NegativeCondition(line)
- else:
- cond = Condition(line)
- except ParserError, e:
- e.line = line
- e.filename = cr.filename
- e.linenum = linenum
- raise
- self._parse(cr, cond, prev_indent=indent)
- node.content += [(cr.filename, linenum, cond)]
- continue
-
- # Parse regular operators
- if not op_match:
- raise ParserError("Syntax error", line, cr.filename, linenum)
- node.content += [(cr.filename, linenum, Op(line, op_match))]
-
- return node
-
-
-# Assignment operators
-
-_reserved_keys = set(("name", "shortname", "dep"))
-
-
-def _op_set(d, key, value):
- if key not in _reserved_keys:
- d[key] = value
-
-
-def _op_append(d, key, value):
- if key not in _reserved_keys:
- d[key] = d.get(key, "") + value
-
-
-def _op_prepend(d, key, value):
- if key not in _reserved_keys:
- d[key] = value + d.get(key, "")
-
-
-def _op_regex_set(d, exp, value):
- exp = re.compile("%s$" % exp)
- for key in d:
- if key not in _reserved_keys and exp.match(key):
- d[key] = value
-
-
-def _op_regex_append(d, exp, value):
- exp = re.compile("%s$" % exp)
- for key in d:
- if key not in _reserved_keys and exp.match(key):
- d[key] += value
-
-
-def _op_regex_prepend(d, exp, value):
- exp = re.compile("%s$" % exp)
- for key in d:
- if key not in _reserved_keys and exp.match(key):
- d[key] = value + d[key]
-
-
-def _op_regex_del(d, empty, exp):
- exp = re.compile("%s$" % exp)
- for key in d.keys():
- if key not in _reserved_keys and exp.match(key):
- del d[key]
-
-
-_ops = {"=": (r"\=", _op_set),
- "+=": (r"\+\=", _op_append),
- "<=": (r"\<\=", _op_prepend),
- "?=": (r"\?\=", _op_regex_set),
- "?+=": (r"\?\+\=", _op_regex_append),
- "?<=": (r"\?\<\=", _op_regex_prepend),
- "del": (r"^del\b", _op_regex_del)}
-
-_ops_exp = re.compile("|".join([op[0] for op in _ops.values()]))
-
-
-class Op(object):
- def __init__(self, line, m):
- self.func = _ops[m.group()][1]
- self.key = line[:m.start()].strip()
- value = line[m.end():].strip()
- if value and (value[0] == value[-1] == '"' or
- value[0] == value[-1] == "'"):
- value = value[1:-1]
- self.value = value
-
-
- def apply_to_dict(self, d):
- self.func(d, self.key, self.value)
-
-
-# StrReader and FileReader
-
-class StrReader(object):
- """
- Preprocess an input string for easy reading.
- """
- def __init__(self, s):
- """
- Initialize the reader.
-
- @param s: The string to parse.
- """
- self.filename = "<string>"
- self._lines = []
- self._line_index = 0
- self._stored_line = None
- for linenum, line in enumerate(s.splitlines()):
- line = line.rstrip().expandtabs()
- stripped_line = line.lstrip()
- indent = len(line) - len(stripped_line)
- if (not stripped_line
- or stripped_line.startswith("#")
- or stripped_line.startswith("//")):
- continue
- self._lines.append((stripped_line, indent, linenum + 1))
-
-
- def get_next_line(self, prev_indent):
- """
- Get the next line in the current block.
-
- @param prev_indent: The indentation level of the previous block.
- @return: (line, indent, linenum), where indent is the line's
- indentation level. If no line is available, (None, -1, -1) is
- returned.
- """
- if self._stored_line:
- ret = self._stored_line
- self._stored_line = None
- return ret
- if self._line_index >= len(self._lines):
- return None, -1, -1
- line, indent, linenum = self._lines[self._line_index]
- if indent <= prev_indent:
- return None, -1, -1
- self._line_index += 1
- return line, indent, linenum
-
-
- def set_next_line(self, line, indent, linenum):
- """
- Make the next call to get_next_line() return the given line instead of
- the real next line.
- """
- line = line.strip()
- if line:
- self._stored_line = line, indent, linenum
-
-
-class FileReader(StrReader):
- """
- Preprocess an input file for easy reading.
- """
- def __init__(self, filename):
- """
- Initialize the reader.
-
- @parse filename: The name of the input file.
- """
- StrReader.__init__(self, open(filename).read())
- self.filename = filename
-
-
-if __name__ == "__main__":
- parser = optparse.OptionParser('usage: %prog [options] filename '
- '[extra code] ...\n\nExample:\n\n '
- '%prog tests.cfg "only my_set" "no qcow2"')
- parser.add_option("-v", "--verbose", dest="debug", action="store_true",
- help="include debug messages in console output")
- parser.add_option("-f", "--fullname", dest="fullname", action="store_true",
- help="show full dict names instead of short names")
- parser.add_option("-c", "--contents", dest="contents", action="store_true",
- help="show dict contents")
-
- options, args = parser.parse_args()
- if not args:
- parser.error("filename required")
-
- c = Parser(args[0], debug=options.debug)
- for s in args[1:]:
- c.parse_string(s)
-
- for i, d in enumerate(c.get_dicts()):
- if options.fullname:
- print "dict %4d: %s" % (i + 1, d["name"])
- else:
- print "dict %4d: %s" % (i + 1, d["shortname"])
- if options.contents:
- keys = d.keys()
- keys.sort()
- for key in keys:
- print " %s = %s" % (key, d[key])
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 848c7d6..8c90bdf 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -4,14 +4,13 @@
Internal global error types
"""
-import sys, traceback, threading
+import sys, traceback
from traceback import format_exception
# Add names you want to be imported by 'from errors import *' to this list.
# This must be list not a tuple as we modify it to include all of our
# the Exception classes we define below at the end of this file.
-__all__ = ['format_error', 'context_aware', 'context', 'get_context',
- 'exception_context']
+__all__ = ['format_error']
def format_error():
@@ -24,142 +23,6 @@
return ''.join(trace)
-# Exception context information:
-# ------------------------------
-# Every function can have some context string associated with it.
-# The context string can be changed by calling context(str) and cleared by
-# calling context() with no parameters.
-# get_context() joins the current context strings of all functions in the
-# provided traceback. The result is a brief description of what the test was
-# doing in the provided traceback (which should be the traceback of a caught
-# exception).
-#
-# For example: assume a() calls b() and b() calls c().
-#
-# @error.context_aware
-# def a():
-# error.context("hello")
-# b()
-# error.context("world")
-# error.get_context() ----> 'world'
-#
-# @error.context_aware
-# def b():
-# error.context("foo")
-# c()
-#
-# @error.context_aware
-# def c():
-# error.context("bar")
-# error.get_context() ----> 'hello --> foo --> bar'
-#
-# The current context is automatically inserted into exceptions raised in
-# context_aware functions, so usually test code doesn't need to call
-# error.get_context().
-
-ctx = threading.local()
-
-
-def _new_context(s=""):
- if not hasattr(ctx, "contexts"):
- ctx.contexts = []
- ctx.contexts.append(s)
-
-
-def _pop_context():
- ctx.contexts.pop()
-
-
-def context(s="", log=None):
- """
- Set the context for the currently executing function and optionally log it.
-
- @param s: A string. If not provided, the context for the current function
- will be cleared.
- @param log: A logging function to pass the context message to. If None, no
- function will be called.
- """
- ctx.contexts[-1] = s
- if s and log:
- log("Context: %s" % get_context())
-
-
-def base_context(s="", log=None):
- """
- Set the base context for the currently executing function and optionally
- log it. The base context is just another context level that is hidden by
- default. Functions that require a single context level should not use
- base_context().
-
- @param s: A string. If not provided, the base context for the current
- function will be cleared.
- @param log: A logging function to pass the context message to. If None, no
- function will be called.
- """
- ctx.contexts[-1] = ""
- ctx.contexts[-2] = s
- if s and log:
- log("Context: %s" % get_context())
-
-
-def get_context():
- """Return the current context (or None if none is defined)."""
- if hasattr(ctx, "contexts"):
- return " --> ".join([s for s in ctx.contexts if s])
-
-
-def exception_context(e):
- """Return the context of a given exception (or None if none is defined)."""
- if hasattr(e, "_context"):
- return e._context # pylint: disable=W0212
-
-
-def set_exception_context(e, s):
- """Set the context of a given exception."""
- e._context = s
-
-
-def join_contexts(s1, s2):
- """Join two context strings."""
- if s1:
- if s2:
- return "%s --> %s" % (s1, s2)
- else:
- return s1
- else:
- return s2
-
-
-def context_aware(fn):
- """A decorator that must be applied to functions that call context()."""
- def new_fn(*args, **kwargs):
- _new_context()
- _new_context("(%s)" % fn.__name__)
- try:
- try:
- return fn(*args, **kwargs)
- except Exception, e:
- if not exception_context(e):
- set_exception_context(e, get_context())
- raise
- finally:
- _pop_context()
- _pop_context()
- new_fn.__name__ = fn.__name__
- new_fn.__doc__ = fn.__doc__
- new_fn.__dict__.update(fn.__dict__)
- return new_fn
-
-
-def _context_message(e):
- s = exception_context(e)
- if s:
- return " [context: %s]" % s
- else:
- return ""
-
-
-
class TimeoutException(Exception):
"""
Generic exception raised on retry timeouts.
@@ -180,7 +43,7 @@
class AutotestError(Exception):
"""The parent of all errors deliberatly thrown within the client code."""
def __str__(self):
- return Exception.__str__(self) + _context_message(self)
+ return Exception.__str__(self)
class JobError(AutotestError):
@@ -199,8 +62,6 @@
msg = "Unhandled %s: %s"
msg %= (unhandled_exception.__class__.__name__,
unhandled_exception)
- if not isinstance(unhandled_exception, AutotestError):
- msg += _context_message(unhandled_exception)
msg += "\n" + traceback.format_exc()
JobError.__init__(self, msg)
@@ -250,8 +111,6 @@
msg = "Unhandled %s: %s"
msg %= (unhandled_exception.__class__.__name__,
unhandled_exception)
- if not isinstance(unhandled_exception, AutotestError):
- msg += _context_message(unhandled_exception)
msg += "\n" + traceback.format_exc()
TestError.__init__(self, msg)
@@ -267,8 +126,6 @@
msg = "Unhandled %s: %s"
msg %= (unhandled_exception.__class__.__name__,
unhandled_exception)
- if not isinstance(unhandled_exception, AutotestError):
- msg += _context_message(unhandled_exception)
msg += "\n" + traceback.format_exc()
TestFail.__init__(self, msg)
@@ -291,7 +148,6 @@
if self.additional_text:
msg += ", " + self.additional_text
- msg += _context_message(self)
msg += '\n' + repr(self.result_obj)
return msg
diff --git a/client/tests/kvm/README b/client/tests/kvm/README
deleted file mode 100644
index 628f3d9..0000000
--- a/client/tests/kvm/README
+++ /dev/null
@@ -1,20 +0,0 @@
-For the impatient:
-
-Execute the get_started.py script located on this directory,
-that will guide you through setting up the default kvm test
-scenario:
-
- * Guest install with Fedora 12
- * Boot, reboot and shutdown test
-
-The script will help you to create all the directories, and
-even get the OS iso in case you don't have it yet.
-
-For the not so impatient:
-
-You are *strongly* advised to read the online docs:
-
-http://www.linux-kvm.org/page/KVM-Autotest/Client_Install
-
-So you can have a better idea of how the test is organized
-and how it works.
diff --git a/client/tests/kvm/__init__.py b/client/tests/kvm/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/client/tests/kvm/__init__.py
+++ /dev/null
diff --git a/client/tests/kvm/autoit/notepad1.au3 b/client/tests/kvm/autoit/notepad1.au3
deleted file mode 100644
index 87ae23c..0000000
--- a/client/tests/kvm/autoit/notepad1.au3
+++ /dev/null
@@ -1,44 +0,0 @@
-; This is a sample AutoIt script, based on the notepad1 sample script by Jonathan Bennett.
-; It runs notepad, enters some text and exits.
-
-
-; Exit with a nonzero exit status if the parameter equals 0.
-; This is useful for functions that return 0 upon failure.
-Func Assert($n)
- If $n = 0 Then Exit(1)
-EndFunc
-
-; Wait for a window to exist, activate it, and wait for it to become active.
-; If timeout expires while waiting, exit with a nonzero exit status.
-Func WaitForWindow($title, $text="", $timeout=60)
- Assert(WinWait($title, $text, $timeout))
- WinActivate($title, $text)
- Assert(WinWaitActive($title, $text, $timeout))
-EndFunc
-
-; Run Notepad
-Assert(Run("notepad.exe"))
-
-; Wait up to 10 seconds for Notepad to become active --
-; it is titled "Untitled - Notepad" on English systems
-WaitForWindow("Untitled - Notepad", "", 10)
-
-; Now that the Notepad window is active type some text
-Send("Hello from Notepad.{ENTER}1 2 3 4 5 6 7 8 9 10{ENTER}")
-Sleep(500)
-Send("+{UP 2}")
-Sleep(500)
-
-; Now quit by pressing Alt-f and then x (File menu -> Exit)
-Send("!f")
-Send("x")
-
-; Now a screen will pop up and ask to save the changes, the window is called
-; "Notepad" and has some text "Yes" and "No"
-WaitForWindow("Notepad", "", 10)
-Send("n")
-
-; Now wait for Notepad to close before continuing
-WinWaitClose("Untitled - Notepad", "", 10)
-
-; Finished!
diff --git a/client/tests/kvm/autotest_control/bonnie.control b/client/tests/kvm/autotest_control/bonnie.control
deleted file mode 100644
index 2717a80..0000000
--- a/client/tests/kvm/autotest_control/bonnie.control
+++ /dev/null
@@ -1,21 +0,0 @@
-AUTHOR = "Martin Bligh <[email protected]>"
-NAME = "bonnie"
-TIME = "MEDIUM"
-TEST_CLASS = "Kernel"
-TEST_CATEGORY = "Functional"
-TEST_TYPE = "client"
-DOC = """\
-Bonnie is a benchmark which measures the performance of Unix file system
-operations. Bonnie is concerned with identifying bottlenecks; the name is a
-tribute to Bonnie Raitt, who knows how to use one.
-
-For more info, see http://www.textuality.com/bonnie/
-
-This benchmark configuration run generates sustained write traffic
-of 35-50MB/s of .1MB writes to just one disk. It appears to have a
-sequential and a random workload. It gives profile measurements for:
-throughput, %CPU rand seeks per second. Not sure if the the CPU numbers
-are trustworthy.
-"""
-
-job.run_test('bonnie')
diff --git a/client/tests/kvm/autotest_control/cpu_hotplug.control b/client/tests/kvm/autotest_control/cpu_hotplug.control
deleted file mode 100644
index 826584b..0000000
--- a/client/tests/kvm/autotest_control/cpu_hotplug.control
+++ /dev/null
@@ -1,10 +0,0 @@
-AUTHOR = 'Martin Bligh <[email protected]>'
-DOC = 'lhcs_regression: Regression test for CPU hotplug'
-NAME = 'cpu_hotplug'
-TIME = 'MEDIUM' ## ?
-EXPERIMENTAL = 'True'
-TEST_CLASS = 'kernel'
-TEST_CATEGORY = 'Functional'
-TEST_TYPE = 'client'
-
-job.run_test('cpu_hotplug')
diff --git a/client/tests/kvm/autotest_control/ctcs.control b/client/tests/kvm/autotest_control/ctcs.control
deleted file mode 100644
index c105344..0000000
--- a/client/tests/kvm/autotest_control/ctcs.control
+++ /dev/null
@@ -1,19 +0,0 @@
-AUTHOR = """
-Manas Kumar Nayak ([email protected]) (original code)
-Lucas Meneghel Rodrigues ([email protected]) (rewrite)
-Cao, Chen <[email protected]> (use ctcs2 and port it to 64)
-Lucas Meneghel Rodrigues ([email protected]) (use ctcs new source repo)
-"""
-NAME = "CTCS"
-TEST_TYPE = "CLIENT"
-TEST_CLASS = "HARDWARE"
-TEST_CATEGORY = "BENCHMARK"
-TIME = "MEDIUM"
-DOC = """
-Executes CTCS for a period of time specified. You can also provide a cerberus
-test control file of your own, trough the parameter tcf_contents.
-
-see https://github.com/autotest/ctcs
-"""
-
-job.run_test(url='ctcs', length='1h', tc_opt='-k -C -a')
diff --git a/client/tests/kvm/autotest_control/dbench.control b/client/tests/kvm/autotest_control/dbench.control
deleted file mode 100644
index 7fb8a37..0000000
--- a/client/tests/kvm/autotest_control/dbench.control
+++ /dev/null
@@ -1,20 +0,0 @@
-TIME="SHORT"
-AUTHOR = "Martin Bligh <[email protected]>"
-DOC = """
-dbench is one of our standard kernel stress tests. It produces filesystem
-load like netbench originally did, but involves no network system calls.
-Its results include throughput rates, which can be used for performance
-analysis.
-
-More information on dbench can be found here:
-http://samba.org/ftp/tridge/dbench/README
-
-Currently it needs to be updated in its configuration. It is a great test for
-the higher level I/O systems but barely touches the disk right now.
-"""
-NAME = 'dbench'
-TEST_CLASS = 'kernel'
-TEST_CATEGORY = 'Functional'
-TEST_TYPE = 'client'
-
-job.run_test('dbench', seconds=60)
diff --git a/client/tests/kvm/autotest_control/disktest.control b/client/tests/kvm/autotest_control/disktest.control
deleted file mode 100644
index 532425c..0000000
--- a/client/tests/kvm/autotest_control/disktest.control
+++ /dev/null
@@ -1,15 +0,0 @@
-AUTHOR = 'Sudhir Kumar <[email protected]>'
-NAME = 'Disktest'
-DOC = '''\
-Pattern test of the disk, using unique signatures for each block and each
-iteration of the test. Designed to check for data corruption issues in the
-disk and disk controller.
-
-It writes 50MB/s of 500KB size ops.
-'''
-TIME = 'MEDIUM'
-TEST_CATEGORY = 'Kernel'
-TEST_TYPE = 'client'
-TEST_CLASS = 'Hardware'
-
-job.run_test('disktest')
diff --git a/client/tests/kvm/autotest_control/ebizzy.control b/client/tests/kvm/autotest_control/ebizzy.control
deleted file mode 100644
index 80514b9..0000000
--- a/client/tests/kvm/autotest_control/ebizzy.control
+++ /dev/null
@@ -1,11 +0,0 @@
-NAME = "ebizzy"
-AUTHOR = "Sudhir Kumar <[email protected]>"
-TIME = "MEDIUM, VARIABLE"
-TEST_CATEGORY = "FUNCTIONAL"
-TEST_CLASS = "SYSTEM STRESS"
-TEST_TYPE = "CLIENT"
-DOC = """
-http://sourceforge.net/project/platformdownload.php?group_id=202378&sel_platform=3809
-"""
-
-job.run_test('ebizzy', args = '-vv')
diff --git a/client/tests/kvm/autotest_control/flail.control b/client/tests/kvm/autotest_control/flail.control
deleted file mode 100644
index 82a27bd..0000000
--- a/client/tests/kvm/autotest_control/flail.control
+++ /dev/null
@@ -1,17 +0,0 @@
-AUTHOR = "Pradeep Kumar Surisetty <[email protected]>"
-NAME = "flail"
-TEST_CATEGORY = "Stress"
-TEST_CLASS = "General"
-TEST_TYPE = "client"
-TIME = 'MEDIUM'
-EXPERIMENTAL = "True"
-
-DOC='''
-flail is a systemcall fuzzer tool. This test simply runs flail.
-Fuzzing is slang for fault injection . It runs all system calls
-for that kernel version with random args.
-The goal is to find bugs in software without reading code or
-designing detailed test cases.
-'''
-
-job.run_test('flail')
diff --git a/client/tests/kvm/autotest_control/hackbench.control b/client/tests/kvm/autotest_control/hackbench.control
deleted file mode 100644
index 5b94865..0000000
--- a/client/tests/kvm/autotest_control/hackbench.control
+++ /dev/null
@@ -1,13 +0,0 @@
-AUTHOR = "Sudhir Kumar <[email protected]>"
-NAME = "Hackbench"
-TIME = "SHORT"
-TEST_CLASS = "Kernel"
-TEST_CATEGORY = "Benchmark"
-TEST_TYPE = "client"
-
-DOC = """
-Hackbench is a benchmark which measures the performance, overhead and
-scalability of the Linux scheduler.
-
-"""
-job.run_test('hackbench')
diff --git a/client/tests/kvm/autotest_control/hwclock.control b/client/tests/kvm/autotest_control/hwclock.control
deleted file mode 100644
index bf3e9d3..0000000
--- a/client/tests/kvm/autotest_control/hwclock.control
+++ /dev/null
@@ -1,12 +0,0 @@
-AUTHOR = "Martin J. Bligh <[email protected]>"
-NAME = "Hwclock"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "General"
-TEST_TYPE = "client"
-
-DOC = """
-This test checks that we can set and read the hwclock successfully
-"""
-
-job.run_test('hwclock')
diff --git a/client/tests/kvm/autotest_control/iozone.control b/client/tests/kvm/autotest_control/iozone.control
deleted file mode 100644
index 17d9be2..0000000
--- a/client/tests/kvm/autotest_control/iozone.control
+++ /dev/null
@@ -1,18 +0,0 @@
-AUTHOR = "Ying Tao <[email protected]>"
-TIME = "MEDIUM"
-NAME = "IOzone"
-TEST_TYPE = "client"
-TEST_CLASS = "Kernel"
-TEST_CATEGORY = "Benchmark"
-
-DOC = """
-Iozone is useful for performing a broad filesystem analysis of a vendors
-computer platform. The benchmark tests file I/O performance for the following
-operations:
- Read, write, re-read, re-write, read backwards, read strided, fread,
- fwrite, random read, pread ,mmap, aio_read, aio_write
-
-For more information see http://www.iozone.org
-"""
-
-job.run_test('iozone')
diff --git a/client/tests/kvm/autotest_control/kernbench.control b/client/tests/kvm/autotest_control/kernbench.control
deleted file mode 100644
index 76a546e..0000000
--- a/client/tests/kvm/autotest_control/kernbench.control
+++ /dev/null
@@ -1,12 +0,0 @@
-AUTHOR = "Sudhir Kumar <[email protected]>"
-NAME = "Kernbench"
-TIME = "SHORT"
-TEST_CLASS = "Kernel"
-TEST_CATEGORY = "Benchmark"
-TEST_TYPE = "client"
-
-DOC = """
-A standard CPU benchmark. Runs a kernel compile and measures the performance.
-"""
-
-job.run_test('kernbench')
diff --git a/client/tests/kvm/autotest_control/monotonic_time.control b/client/tests/kvm/autotest_control/monotonic_time.control
deleted file mode 100644
index 4dbfec4..0000000
--- a/client/tests/kvm/autotest_control/monotonic_time.control
+++ /dev/null
@@ -1,37 +0,0 @@
-NAME = 'monotonic_time'
-AUTHOR = 'Michael Davidson <[email protected]>'
-TIME = 'MEDIUM'
-TEST_CLASS = 'Kernel'
-TEST_CATEGORY = 'Functional'
-TEST_TYPE = 'client'
-DOC = """
-monotonic_time checks various time interfaces:
- gettimeofday()
- clock_gettime(CLOCK_MONTONIC)
- TSC
-for monotonicity.
-
-Based on time-warp-test.c by Ingo Molnar.
-"""
-
-#
-# Test gettimeofday(), TSC, and clock_gettime(CLOCK_MONOTONIC)
-#
-# Tests run for 'duration' seconds and check that the selected
-# time interface does not go backwards by more than 'threshold'.
-#
-# Note that the threshold value has the same resolution as the
-# clock source:
-# gettimeofday() - microseconds
-# clock_gettime(CLOCK_MONOTONIC) - nanoseconds
-# TSC - CPU clock cycles
-#
-#
-job.run_test('monotonic_time', tag='gtod', test_type='gtod',
- duration=300, threshold=0)
-
-job.run_test('monotonic_time', tag='clock', test_type='clock',
- duration=300, threshold=0)
-
-job.run_test('monotonic_time', tag='tsc', test_type='tsc',
- duration=300, threshold=0)
diff --git a/client/tests/kvm/autotest_control/npb.control b/client/tests/kvm/autotest_control/npb.control
deleted file mode 100644
index 2a8a8bb..0000000
--- a/client/tests/kvm/autotest_control/npb.control
+++ /dev/null
@@ -1,28 +0,0 @@
-NAME = "NAS Parallel Benchmarks"
-AUTHOR = "Cao, Chen <[email protected]>"
-TEST_TYPE = "CLIENT"
-TEST_CLASS = "HARDWARE"
-TEST_CATEGORY = "BENCHMARK"
-TIME = "MEDIUM"
-DOC = """\
-Using NPB, OpenMP implementation.
-
-See http://www.nas.nasa.gov/Software/NPB/
-"""
-
-# Supported tests (benchmarks):
-# bt.A bt.B bt.C bt.D bt.E bt.S bt.W
-# cg.A cg.B cg.C cg.S cg.W
-# dc.A dc.B dc.S dc.W
-# ep.A ep.B ep.C ep.D ep.E ep.S ep.W
-# ft.A ft.B ft.S ft.W
-# is.A is.B is.C is.S is.W
-# lu.A lu.B lu.C lu.S lu.W
-# mg.A mg.B mg.S mg.W
-# sp.A sp.B sp.C sp.D sp.E sp.S sp.W
-# ua.A ua.B ua.C ua.S ua.W
-#
-# Please refer to npb.py for more infomation about
-# the arguments.
-job.run_test(url='npb', tests='ep.A ep.B')
-
diff --git a/client/tests/kvm/autotest_control/rtc.control b/client/tests/kvm/autotest_control/rtc.control
deleted file mode 100644
index b7597e3..0000000
--- a/client/tests/kvm/autotest_control/rtc.control
+++ /dev/null
@@ -1,15 +0,0 @@
-TIME="SHORT"
-AUTHOR = "Jason Wang <[email protected]>"
-DOC = """
-rtc is a simple test of realtime clock driver which was grabbed from
-Documentation/rtc.txt. It does the functional test of interrupt, alarm and
-requeseted frequency.
-
-Please refer the kernel documentation for details.
-"""
-NAME = 'rtc'
-TEST_CLASS = 'kernel'
-TEST_CATEGORY = 'Functional'
-TEST_TYPE = 'client'
-
-job.run_test('rtc', maxfreq=8192)
diff --git a/client/tests/kvm/autotest_control/scrashme.control b/client/tests/kvm/autotest_control/scrashme.control
deleted file mode 100644
index ccb1376..0000000
--- a/client/tests/kvm/autotest_control/scrashme.control
+++ /dev/null
@@ -1,14 +0,0 @@
-NAME='scrashme'
-AUTHOR='Yi Yang <[email protected]>'
-TEST_CATEGORY='Stress'
-TEST_CLASS='Kernel'
-TEST_TYPE='client'
-TIME='MEDIUM'
-DOC='''
-Runs the scrashme suite located at:
-http://www.codemonkey.org.uk/projects/scrashme/
-
-Runs the scrashme syscalls test suite. This test mode will exercise
-kernel syscalls randomically, or in a sequential fashion.
-'''
-job.run_test('scrashme', args_list="--mode random", tag="random")
diff --git a/client/tests/kvm/autotest_control/sleeptest.control b/client/tests/kvm/autotest_control/sleeptest.control
deleted file mode 100644
index 725ae81..0000000
--- a/client/tests/kvm/autotest_control/sleeptest.control
+++ /dev/null
@@ -1,15 +0,0 @@
-AUTHOR = "Autotest Team"
-NAME = "Sleeptest"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "General"
-TEST_TYPE = "client"
-
-DOC = """
-This test simply sleeps for 1 second by default. It's a good way to test
-profilers and double check that autotest is working.
-The seconds argument can also be modified to make the machine sleep for as
-long as needed.
-"""
-
-job.run_test('sleeptest', seconds = 1)
diff --git a/client/tests/kvm/autotest_control/stress.control b/client/tests/kvm/autotest_control/stress.control
deleted file mode 100644
index b722013..0000000
--- a/client/tests/kvm/autotest_control/stress.control
+++ /dev/null
@@ -1,14 +0,0 @@
-NAME='Stress'
-AUTHOR='Sudhir Kumar <[email protected]>'
-EXPERIMENTAL='True'
-TEST_TYPE='client'
-TIME='MEDIUM'
-TEST_CATEGORY='Functional'
-TEST_CLASS='Software'
-DOC='''\
-stress is not a benchmark, but is rather a tool designed to put given subsytems
-under a specified load. Instances in which this is useful include those in which
-a system administrator wishes to perform tuning activities, a kernel or libc
-programmer wishes to evaluate denial of service possibilities, etc.
-'''
-job.run_test('stress')
diff --git a/client/tests/kvm/autotest_control/systemtap.control b/client/tests/kvm/autotest_control/systemtap.control
deleted file mode 100644
index f7418fc..0000000
--- a/client/tests/kvm/autotest_control/systemtap.control
+++ /dev/null
@@ -1,14 +0,0 @@
-AUTHOR = """
-Anton Blanchard <[email protected]>
-"""
-NAME = "Systemtap test suite"
-TEST_TYPE = "client"
-TEST_CLASS = "General"
-TEST_CATEGORY = "Functional"
-TIME = "MEDIUM"
-DOC = """\
-This test runs the systemtap testsuite. You will need a kernel with debug
-symbols, or a matching debuginfo package from your distro.
-"""
-
-job.run_test(url='systemtap', local=False)
diff --git a/client/tests/kvm/autotest_control/tsc.control b/client/tests/kvm/autotest_control/tsc.control
deleted file mode 100644
index 0c1c65a..0000000
--- a/client/tests/kvm/autotest_control/tsc.control
+++ /dev/null
@@ -1,13 +0,0 @@
-NAME = 'Check TSC'
-AUTHOR = 'Michael Davidson <[email protected]>'
-TIME = 'MEDIUM'
-TEST_CLASS = 'Kernel'
-TEST_CATEGORY = 'Functional'
-TEST_TYPE = 'client'
-DOC = """
-checktsc is a user space program that checks TSC synchronization
-between pairs of CPUs on an SMP system using a technique borrowed
-from the Linux 2.6.18 kernel.
-"""
-
-job.run_test('tsc')
diff --git a/client/tests/kvm/base.cfg.sample b/client/tests/kvm/base.cfg.sample
deleted file mode 100644
index 0e6d222..0000000
--- a/client/tests/kvm/base.cfg.sample
+++ /dev/null
@@ -1,185 +0,0 @@
-# Copy this file to base.cfg and edit it.
-#
-# Define the objects we'll be using
-vms = vm1
-vm_type = kvm
-images = image1
-cdroms = cd1
-nics = nic1
-monitors = humanmonitor1
-main_monitor = humanmonitor1
-monitor_type_humanmonitor1 = human
-monitor_type = human
-main_vm = vm1
-
-# Location of the qemu programs. You can refer to absolute paths here.
-qemu_binary = qemu
-qemu_img_binary = qemu-img
-
-# Default VM params
-# Number of processors
-smp = 1
-
-# Memory
-mem = 1024
-
-# Hard disk
-image_size = 10G
-image_raw_device = no
-drive_index_image1 = 0
-drive_cache = none
-
-# Cdrom drive index
-drive_index_cd1 = 1
-
-# Display
-display = vnc
-
-# If display = spice, you can set specific spice stuff here
-qxl = on
-qxl_dev_nr = 1
-spice = disable-ticketing
-
-# NIC parameters
-nic_mode = tap
-# By default we use libvirt's bridge
-bridge = virbr0
-run_tcpdump = yes
-
-# Some preprocessor/postprocessor params
-start_vm = yes
-kill_vm = no
-kill_vm_gracefully = yes
-kill_unresponsive_vms = yes
-
-# Screendump thread params
-convert_ppm_files_to_png_on_error = yes
-keep_ppm_files = no
-keep_ppm_files_on_error = no
-take_regular_screendumps = yes
-keep_screendumps_on_error = yes
-screendump_delay = 5
-screendump_quality = 30
-screendump_temp_dir = /dev/shm
-screendump_verbose = no
-
-# Default remote shell port (SSH under linux)
-shell_port = 22
-
-# Default scheduler params
-used_cpus = 1
-used_mem = 512
-
-# Port redirections
-redirs = remote_shell
-guest_port_remote_shell = 22
-
-# Profilers
-profilers = kvm_stat
-
-# Timeouts
-login_timeout = 360
-
-# NFS directory of guest images
-images_good = fileserver.foo.com:/autotest/images_good
-
-# NICs
-variants:
- - @rtl8139:
- nic_model = rtl8139
- no ethtool
- jumbo:
- mtu = 1500
- - e1000:
- nic_model = e1000
- jumbo:
- mtu = 16110
- ethtool:
- # gso gro lro is only supported by latest kernel
- supported_features = "tx rx sg tso gso gro lro"
- - virtio_net:
- nic_model = virtio
- # You can add advanced attributes on nic_extra_params such as mrg_rxbuf
- #nic_extra_params =
- # You can add advanced attributes through netdev_extra_params
- # such as sndbuf, as an example, you can uncomment the
- # following lines to enable the vhost support ( only available
- # for tap )
- #netdev_extra_params = "vhost=on"
- jumbo:
- mtu = 65520
- ethtool:
- supported_features = "tx sg tso gso"
- whql.submission.device.net:
- test_device = VirtIO Ethernet Adapter$
- # Device selection for the NDISTest client machine
- dp_regex_testdev = VirtIO Ethernet Adapter$
- dp_regex_clientmsgdev = VirtIO Ethernet Adapter #2$
- dp_regex_clientsupportdev = VirtIO Ethernet Adapter #3$
- # Device selection for the NDISTest server machine
- dp_regex_servermsgdev = VirtIO Ethernet Adapter$
- dp_regex_serversupportdev = VirtIO Ethernet Adapter #2$
-
-variants:
- - @up:
- no autotest.npb autotest.tsc
- - smp2:
- smp = 2
- used_cpus = 2
- stress_boot: used_cpus = 10
- timedrift.with_load: used_cpus = 100
-
-variants:
- - @ide:
- drive_format=ide
- - scsi:
- drive_format=scsi
- - virtio_blk:
- drive_format=virtio
- # Some older qemu might need image_boot=yes for virtio images to work.
- # Please uncomment the below if that is the case.
- #image_boot=yes
- - ahci:
- drive_format=ahci
- cd_format=ahci
- - usb.stick:
- drive_format=usb2
- - usb.cdrom:
- cd_format=usb2
-
-variants:
- - @qcow2:
- image_format = qcow2
- check_image = yes
- - vmdk:
- no ioquit
- image_format = vmdk
- - raw:
- no ioquit
- image_format = raw
-
-variants:
- - @smallpages:
- - hugepages:
- setup_hugepages = yes
- extra_params += " -mem-path /mnt/kvm_hugepage"
-
-variants:
- - @no_pci_assignable:
- pci_assignable = no
- - pf_assignable:
- pci_assignable = pf
- device_names = eth1
- - vf_assignable:
- pci_assignable = vf
- # Driver (kernel module) that supports SR-IOV hardware.
- # As of today (30-11-2009), we have 2 drivers for this type of hardware:
- # Intel® 82576 Gigabit Ethernet Controller - igb
- # Neterion® X3100™ - vxge
- driver = igb
- # Driver option to specify the maximum number of virtual functions
- # (on vxge the option is , for example, is max_config_dev)
- # the default below is for the igb driver
- driver_option = "max_vfs=7"
- # Number of devices that are going to be requested.
- devices_requested = 7
diff --git a/client/tests/kvm/build.cfg.sample b/client/tests/kvm/build.cfg.sample
deleted file mode 100644
index d4aea95..0000000
--- a/client/tests/kvm/build.cfg.sample
+++ /dev/null
@@ -1,92 +0,0 @@
-# Copy this file to build.cfg and edit it.
-#
-# This configuration file holds the KVM build test config parameters.
-# The default is noinstall (won't attempt to build KVM), so if you stick with it
-# please make sure:
-# 1) You have setup symbolic links to qemu and qemu-img binaries on the
-# KVM test dir.
-# 2) The appropriate KVM modules are already loaded on your machine.
-
-vm_type = kvm
-
-variants:
- - build:
- type = build
- # Load modules built/installed by the build test?
- load_modules = no
- # Save the results of this build on test.resultsdir?
- save_results = no
- # Preserve the source code directory between tests?
- preserve_srcdir = yes
- variants:
- - localtar:
- install_mode = localtar
- ## Install from tarball located on the host's filesystem.
- tarball = /tmp/kvm-84.tar.gz
- # In some cases, you might want to provide a ROM dir, so ROM
- # files can be copied from there to your source based install
- # path_to_rom_images = /usr/share/kvm
- - localsrc:
- install_mode = localsrc
- ## Install from tarball located on the host's filesystem.
- srcdir = /tmp/kvm-84
- # In some cases, you might want to provide a ROM dir, so ROM
- # files can be copied from there to your source based install
- # path_to_rom_images = /usr/share/kvm
- - git:
- install_mode = git
- ## Install KVM from git repositories.
- ## This now only concerns the userspace component, and it assumes
- ## the kernel modules are shipped with the linux kernel.
- user_git_repo = git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
- # user_branch = user_branch_name
- # user_lbranch = user_lbranch_name
- # user_commit = user_commit_name
- # user_patches = ['http://foo.com/patch1', 'http://foo.com/patch2']
- ## This is how you pass extra params to the userspace configure script
- # extra_configure_options = '--enable-spice --disable-werror'
- # spice_repo = git://anongit.freedesktop.org/spice/spice
- # spice_branch = master
- # spice_lbranch = master
- # spice_patches = []
- # spice_protocol_repo = git://anongit.freedesktop.org/spice/spice-protocol
- # spice_protocol_branch = master
- # spice_protocol_lbranch = master
- # spice_protocol_patches = []
- # In some cases, you might want to provide a ROM dir, so ROM
- # files can be copied from there to your source based install
- # path_to_rom_images = /usr/share/kvm
- - yum:
- install_mode = yum
- src_pkg = qemu
- ## Name of the rpms we need installed
- pkg_list = ['qemu-kvm', 'qemu-kvm-tools', 'qemu-system-x86', 'qemu-common', 'qemu-img']
- ## Paths of the qemu relevant executables that should be checked
- qemu_bin_paths = ['/usr/bin/qemu-kvm', '/usr/bin/qemu-img']
- ## List of RPMs that will be installed
- pkg_path_list = ['http://foo.com/rpm1', 'http://foo.com/rpm2']
- - koji:
- install_mode = koji
- ## Install KVM from koji (Fedora build server)
- ## It is possible to install packages right from Koji if you
- ## provide a release tag or a build.
- ## Tag (if available)
- koji_tag = dist-f11
- ## Build (if available, is going to override tag).
- ## Build ID can be either an integer or a string as below
- koji_build = qemu-0.10-16.fc11
- # koji_build = 250544
- ## Command to interact with the build server
- koji_cmd = /usr/bin/koji
- ## The name of the source package that will be built
- src_pkg = qemu
- ## Name of the rpms we need installed
- pkg_list = ['qemu-kvm', 'qemu-kvm-tools', 'qemu-system-x86', 'qemu-common', 'qemu-img']
- ## Paths of the qemu relevant executables that should be checked
- qemu_bin_paths = ['/usr/bin/qemu-kvm', '/usr/bin/qemu-img']
-
-
-# Choose your install method here. The variant noinstall is not defined by
-# default, so therefore no attempt to build/install KVM will be made by
-# default
-only build.noinstall
diff --git a/client/tests/kvm/cdkeys.cfg.sample b/client/tests/kvm/cdkeys.cfg.sample
deleted file mode 100644
index 2d1d05d..0000000
--- a/client/tests/kvm/cdkeys.cfg.sample
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copy this file to cdkeys.cfg and edit it.
-#
-# Replace the 'CDKEY' strings with real cdkeys where necessary.
-# Feel free to add additional guests as required.
-
-RHEL.5.3.i386: cdkey = CDKEY
-RHEL.5.3.x86_64: cdkey = CDKEY
-Win2000: cdkey = CDKEY
-WinXP.32: cdkey = CDKEY
-WinXP.64: cdkey = CDKEY
-Win2003.32: cdkey = CDKEY
-Win2003.64: cdkey = CDKEY
-WinVista.32: cdkey = CDKEY
-WinVista.64: cdkey = CDKEY
-Win2008.32: cdkey = CDKEY
-Win2008.64: cdkey = CDKEY
-Win7.32: cdkey = CDKEY
-Win7.64: cdkey = CDKEY
diff --git a/client/tests/kvm/common.py b/client/tests/kvm/common.py
deleted file mode 100644
index ce78b85..0000000
--- a/client/tests/kvm/common.py
+++ /dev/null
@@ -1,8 +0,0 @@
-import os, sys
-dirname = os.path.dirname(sys.modules[__name__].__file__)
-client_dir = os.path.abspath(os.path.join(dirname, "..", ".."))
-sys.path.insert(0, client_dir)
-import setup_modules
-sys.path.pop(0)
-setup_modules.setup(base_path=client_dir,
- root_module_name="autotest_lib.client")
diff --git a/client/tests/kvm/control b/client/tests/kvm/control
deleted file mode 100644
index 959d2bc..0000000
--- a/client/tests/kvm/control
+++ /dev/null
@@ -1,69 +0,0 @@
-AUTHOR = """
[email protected] (Uri Lublin)
[email protected] (Dror Russo)
[email protected] (Michael Goldish)
[email protected] (David Huff)
[email protected] (Alexey Eromenko)
[email protected] (Mike Burns)
-"""
-TIME = 'MEDIUM'
-NAME = 'KVM test'
-TEST_TYPE = 'client'
-TEST_CLASS = 'Virtualization'
-TEST_CATEGORY = 'Functional'
-
-DOC = """
-Executes the KVM test framework on a given host. This module is separated in
-minor functions, that execute different tests for doing Quality Assurance on
-KVM (both kernelspace and userspace) code.
-
-For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest
-"""
-
-import sys, os, logging
-from autotest_lib.client.common_lib import cartesian_config
-from autotest_lib.client.virt import virt_utils
-
-# set English environment (command output might be localized, need to be safe)
-os.environ['LANG'] = 'en_US.UTF-8'
-
-str = """
-# This string will be parsed after build.cfg. Make any desired changes to the
-# build configuration here. For example:
-#release_tag = 84
-"""
-
-parser = cartesian_config.Parser()
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-parser.parse_file(os.path.join(kvm_test_dir, "build.cfg"))
-parser.parse_string(str)
-if not virt_utils.run_tests(parser, job):
- logging.error("KVM build step failed, exiting.")
- sys.exit(1)
-
-str = """
-# This string will be parsed after tests.cfg. Make any desired changes to the
-# test configuration here. For example:
-#display = sdl
-#install, setup: timeout_multiplier = 3
-"""
-
-parser = cartesian_config.Parser()
-parser.parse_file(os.path.join(kvm_test_dir, "tests.cfg"))
-
-if args:
- # We get test parameters from command line
- for arg in args:
- try:
- (key, value) = re.findall("^(\w+)=(.*)", arg)[0]
- if key == "only":
- str += "only %s\n" % value
- elif key == "no":
- str += "no %s\n" % value
- else:
- str += "%s = %s\n" % (key, value)
- except IndexError:
- pass
-parser.parse_string(str)
-
-virt_utils.run_tests(parser, job)
diff --git a/client/tests/kvm/control.parallel b/client/tests/kvm/control.parallel
deleted file mode 100644
index 966d8bc..0000000
--- a/client/tests/kvm/control.parallel
+++ /dev/null
@@ -1,197 +0,0 @@
-AUTHOR = """
[email protected] (Uri Lublin)
[email protected] (Dror Russo)
[email protected] (Michael Goldish)
[email protected] (David Huff)
[email protected] (Alexey Eromenko)
[email protected] (Mike Burns)
-"""
-TIME = 'SHORT'
-NAME = 'KVM test'
-TEST_TYPE = 'client'
-TEST_CLASS = 'Virtualization'
-TEST_CATEGORY = 'Functional'
-
-DOC = """
-Executes the KVM test framework on a given host. This module is separated in
-minor functions, that execute different tests for doing Quality Assurance on
-KVM (both kernelspace and userspace) code.
-"""
-
-
-import sys, os, commands, re
-
-#-----------------------------------------------------------------------------
-# set English environment (command output might be localized, need to be safe)
-#-----------------------------------------------------------------------------
-os.environ['LANG'] = 'en_US.UTF-8'
-
-#---------------------------------------------------------
-# Enable modules import from current directory (tests/kvm)
-#---------------------------------------------------------
-pwd = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-sys.path.append(pwd)
-
-# ------------------------
-# create required symlinks
-# ------------------------
-# When dispatching tests from autotest-server the links we need do not exist on
-# the host (the client). The following lines create those symlinks. Change
-# 'rootdir' here and/or mount appropriate directories in it.
-#
-# When dispatching tests on local host (client mode) one can either setup kvm
-# links, or same as server mode use rootdir and set all appropriate links and
-# mount-points there. For example, guest installation tests need to know where
-# to find the iso-files.
-#
-# We create the links only if not already exist, so if one already set up the
-# links for client/local run we do not touch the links.
-rootdir='/tmp/kvm_autotest_root'
-iso=os.path.join(rootdir, 'iso')
-images=os.path.join(rootdir, 'images')
-qemu=os.path.join(rootdir, 'qemu')
-qemu_img=os.path.join(rootdir, 'qemu-img')
-
-
-def link_if_not_exist(ldir, target, link_name):
- t = target
- l = os.path.join(ldir, link_name)
- if not os.path.exists(l):
- os.system('ln -s %s %s' % (t, l))
-
-# Create links only if not already exist
-link_if_not_exist(pwd, '../../', 'autotest')
-link_if_not_exist(pwd, iso, 'isos')
-link_if_not_exist(pwd, images, 'images')
-link_if_not_exist(pwd, qemu, 'qemu')
-link_if_not_exist(pwd, qemu_img, 'qemu-img')
-
-# --------------------------------------------------------
-# Params that will be passed to the KVM install/build test
-# --------------------------------------------------------
-params = {
- "name": "build",
- "shortname": "build",
- "type": "build",
- #"mode": "release",
- #"mode": "snapshot",
- #"mode": "localtar",
- #"mode": "localsrc",
- #"mode": "git",
- "mode": "noinstall",
- #"mode": "koji",
-
- ## Are we going to load modules built by this test?
- ## Defaults to 'yes', so if you are going to provide only userspace code to
- ## be built by this test, please set load_modules to 'no', and make sure
- ## the kvm and kvm-[vendor] module is already loaded by the time you start
- ## it.
- #"load_modules": "no",
-
- ## Install from a kvm release ("mode": "release"). You can optionally
- ## specify a release tag. If you omit it, the test will get the latest
- ## release tag available.
- #"release_tag": '84',
- #"release_dir": 'http://downloads.sourceforge.net/project/kvm/',
- # This is the place that contains the sourceforge project list of files
- #"release_listing": 'http://sourceforge.net/projects/kvm/files/',
-
- ## Install from a kvm snapshot location ("mode": "snapshot"). You can
- ## optionally specify a snapshot date. If you omit it, the test will get
- ## yesterday's snapshot.
- #"snapshot_date": '20090712'
- #"snapshot_dir": 'http://foo.org/kvm-snapshots/',
-
- ## Install from a tarball ("mode": "localtar")
- #"tarball": "/tmp/kvm-84.tar.gz",
-
- ## Install from a local source code dir ("mode": "localsrc")
- #"srcdir": "/path/to/source-dir"
-
- ## Install from koji build server ("mode": "koji")
- ## Koji is the Fedora Project buildserver. It is possible to install
- ## packages right from Koji if you provide a release tag or a build.
- ## Tag (if available)
- #"koji_tag": 'dist-f11',
- ## Build (if available, is going to override tag).
- #"koji_build": 'qemu-0.10-16.fc11',
- ## Command to interact with the build server
- #"koji_cmd": '/usr/bin/koji',
- ## The name of the source package that's being built
- #"src_pkg": 'qemu',
- ## Name of the rpms we need installed
- #"pkg_list": ['qemu-kvm', 'qemu-kvm-tools', 'qemu-system-x86', 'qemu-common', 'qemu-img'],
- ## Paths of the qemu relevant executables that should be checked
- #"qemu_bin_paths": ['/usr/bin/qemu-kvm', '/usr/bin/qemu-img'],
-
- ## Install from git ("mode": "git")
- ## If you provide only "git_repo" and "user_git_repo", the build test
- ## will assume it will perform all build from the userspace dir, building
- ## modules trough make -C kernel LINUX=%s sync. As of today (07-13-2009)
- ## we need 3 git repos, "git_repo" (linux sources), "user_git_repo" and
- ## "kmod_repo" to build KVM userspace + kernel modules.
- #"git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git',
- #"kernel_branch": 'kernel_branch_name',
- #"kernel_lbranch": 'kernel_lbranch_name',
- #"kernel_tag": 'kernel_tag_name',
- #"user_git_repo": 'git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git',
- #"user_branch": 'user_branch_name',
- #"user_lbranch": 'user_lbranch_name',
- #"user_tag": 'user_tag_name',
- #"kmod_repo": 'git://git.kernel.org/pub/scm/virt/kvm/kvm-kmod.git',
- #"kmod_branch": 'kmod_branch_name',
- #"kmod_lbranch": 'kmod_lbranch_name',
- #"kmod_tag": 'kmod_tag_name',
-}
-
-# If you don't want to execute the build stage, just use 'noinstall' as the
-# install type. If you run the tests from autotest-server, make sure that
-# /tmp/kvm-autotest-root/qemu is a link to your existing executable. Note that
-# if kvm_install is chose to run, it overwrites existing qemu and qemu-img
-# links to point to the newly built executables.
-
-if not params.get("mode") == "noinstall":
- if not job.run_test("kvm", params=params, tag=params.get("shortname")):
- print 'kvm_installation failed ... exiting'
- sys.exit(1)
-
-# ----------------------------------------------------------
-# Get test set (dictionary list) from the configuration file
-# ----------------------------------------------------------
-from autotest_lib.client.common_lib import cartesian_config
-
-str = """
-# This string will be parsed after tests.cfg. Make any desired changes to the
-# test configuration here. For example:
-#install, setup: timeout_multiplier = 3
-#display = sdl
-"""
-
-parser = cartesian_config.Parser()
-parser.parse_file(os.path.join(pwd, "tests.cfg"))
-parser.parse_string(str)
-
-tests = list(parser.get_dicts())
-
-# -------------
-# Run the tests
-# -------------
-from autotest_lib.client.virt import virt_scheduler
-from autotest_lib.client.bin import utils
-
-# total_cpus defaults to the number of CPUs reported by /proc/cpuinfo
-total_cpus = utils.count_cpus()
-# total_mem defaults to 3/4 of the total memory reported by 'free'
-total_mem = int(commands.getoutput("free -m").splitlines()[1].split()[1]) * 3/4
-# We probably won't need more workers than CPUs
-num_workers = total_cpus
-
-# Start the scheduler and workers
-s = virt_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd)
-job.parallel([s.scheduler],
- *[(s.worker, i, job.run_test) for i in range(num_workers)])
-
-# create the html report in result dir
-reporter = os.path.join(pwd, 'make_html_report.py')
-html_file = os.path.join(job.resultdir,'results.html')
-os.system('%s -r %s -f %s -R'%(reporter, job.resultdir, html_file))
diff --git a/client/tests/kvm/control.unittests b/client/tests/kvm/control.unittests
deleted file mode 100644
index 8f3fc62..0000000
--- a/client/tests/kvm/control.unittests
+++ /dev/null
@@ -1,26 +0,0 @@
-AUTHOR = """
[email protected] (Michael Goldish)
[email protected] (Naphtali Sprei)
[email protected] (Lucas Meneghel Rodrigues)
-"""
-TIME = 'MEDIUM'
-NAME = 'KVM test'
-TEST_TYPE = 'client'
-TEST_CLASS = 'Virtualization'
-TEST_CATEGORY = 'Unittest'
-
-DOC = """
-Runs the unittests available for a given KVM build.
-"""
-
-import sys, os, logging
-from autotest_lib.client.common_lib import cartesian_config
-from autotest_lib.client.virt import virt_utils
-
-parser = cartesian_config.Parser()
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-tests_cfg_path = os.path.join(kvm_test_dir, "unittests.cfg")
-parser.parse_file(tests_cfg_path)
-
-# Run the tests
-virt_utils.run_tests(parser, job)
diff --git a/client/tests/kvm/deps/Makefile b/client/tests/kvm/deps/Makefile
deleted file mode 100644
index ec6132e..0000000
--- a/client/tests/kvm/deps/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-all:
- make rss.exe finish.exe
-rss.exe:
- i686-pc-mingw32-g++ rss.cpp -O2 -static-libgcc -lws2_32 -lshlwapi -mwindows -o rss.exe
-finish.exe:
- i686-pc-mingw32-g++ finish.cpp -O2 -lws2_32 -o finish.exe
-clean:
- rm -rf rss.exe finish.exe
diff --git a/client/tests/kvm/deps/finish.cpp b/client/tests/kvm/deps/finish.cpp
deleted file mode 100644
index 11f78fb..0000000
--- a/client/tests/kvm/deps/finish.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// Simple application that creates a server socket, listening for connections
-// of the unattended install test. Once it gets a client connected, the
-// app will send back an ACK string, indicating the install process is done.
-//
-// You must link this code with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
-//
-// Author: Lucas Meneghel Rodrigues <[email protected]>
-// Code was adapted from an MSDN sample.
-
-// Usage: finish.exe
-
-#ifdef __MINGW32__
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x500
-#endif
-
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int DEFAULT_PORT = 12323;
-
-void ExitOnError(const char *message, BOOL winsock = FALSE)
-{
- LPVOID system_message;
- char buffer[512];
- int error_code;
-
- if (winsock)
- error_code = WSAGetLastError();
- else
- error_code = GetLastError();
- WSACleanup();
-
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- error_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&system_message,
- 0,
- NULL);
-
- sprintf(buffer,
- "%s!\n"
- "Error code = %d\n"
- "Error message = %s",
- message, error_code, (char *)system_message);
-
- MessageBox(NULL, buffer, "Error", MB_OK | MB_ICONERROR);
-
- LocalFree(system_message);
- ExitProcess(1);
-}
-
-SOCKET PrepareListenSocket(int port)
-{
- sockaddr_in addr;
- linger l;
- int result;
-
- // Create socket
- SOCKET ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (ListenSocket == INVALID_SOCKET)
- ExitOnError("Socket creation failed", TRUE);
-
- // Enable lingering
- l.l_linger = 10;
- l.l_onoff = 1;
- setsockopt(ListenSocket, SOL_SOCKET, SO_LINGER, (char *)&l, sizeof(l));
-
- // Bind the socket
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
- addr.sin_port = htons(port);
-
- result = bind(ListenSocket, (sockaddr *)&addr, sizeof(addr));
- if (result == SOCKET_ERROR)
- ExitOnError("Bind failed", TRUE);
-
- // Start listening for incoming connections
- result = listen(ListenSocket, SOMAXCONN);
- if (result == SOCKET_ERROR)
- ExitOnError("Listen failed", TRUE);
-
- return ListenSocket;
-}
-
-int main(int argc, char **argv)
-{
- WSADATA wsaData;
- SOCKET ListenSocket = INVALID_SOCKET, ClientSocket = INVALID_SOCKET;
- struct addrinfo *result = NULL, hints;
- char *sendbuf = "done";
- int iResult, iSendResult;
-
- // Validate the parameters
- if (argc != 1) {
- ExitOnError("Finish.exe takes no parameters", FALSE);
- }
-
- // Initialize Winsock
- iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
- if (iResult != 0) {
- ExitOnError("WSAStartup failed", FALSE);
- }
-
- // Resolve the server address and port
- ListenSocket = PrepareListenSocket(DEFAULT_PORT);
-
- // Accept a client socket
- ClientSocket = accept(ListenSocket, NULL, NULL);
- if (ClientSocket == INVALID_SOCKET) {
- closesocket(ListenSocket);
- ExitOnError("Accept failed", TRUE);
- }
-
- // No longer need the server socket
- closesocket(ListenSocket);
-
- // Send the ack string to the client
- iSendResult = send(ClientSocket, sendbuf, sizeof(sendbuf), 0);
- if (iSendResult == SOCKET_ERROR) {
- closesocket(ClientSocket);
- ExitOnError("Send failed", TRUE);
- }
- // Report the number of bytes sent
- printf("Bytes sent: %d\n", iSendResult);
-
- // Shutdown the connection since we're done
- iResult = shutdown(ClientSocket, SD_SEND);
- if (iResult == SOCKET_ERROR) {
- closesocket(ClientSocket);
- ExitOnError("Shutdown failed", TRUE);
- }
-
- // Cleanup
- closesocket(ClientSocket);
- WSACleanup();
-
- return 0;
-}
diff --git a/client/tests/kvm/deps/finish.exe b/client/tests/kvm/deps/finish.exe
deleted file mode 100644
index a02b817..0000000
--- a/client/tests/kvm/deps/finish.exe
+++ /dev/null
Binary files differ
diff --git a/client/tests/kvm/deps/heartbeat_slu.py b/client/tests/kvm/deps/heartbeat_slu.py
deleted file mode 100755
index 86660af..0000000
--- a/client/tests/kvm/deps/heartbeat_slu.py
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Heartbeat server/client to detect soft lockups
-"""
-
-import socket, os, sys, time, getopt
-
-def daemonize(output_file):
- try:
- pid = os.fork()
- except OSError, e:
- raise Exception, "error %d: %s" % (e.strerror, e.errno)
-
- if pid:
- os._exit(0)
-
- os.umask(0)
- os.setsid()
- sys.stdout.flush()
- sys.stderr.flush()
-
- if file:
- output_handle = file(output_file, 'a+', 0)
- # autoflush stdout/stderr
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
- else:
- output_handle = file('/dev/null', 'a+')
-
- stdin_handle = open('/dev/null', 'r')
- os.dup2(output_handle.fileno(), sys.stdout.fileno())
- os.dup2(output_handle.fileno(), sys.stderr.fileno())
- os.dup2(stdin_handle.fileno(), sys.stdin.fileno())
-
-def recv_all(sock):
- total_data = []
- while True:
- data = sock.recv(1024)
- if not data:
- break
- total_data.append(data)
- return ''.join(total_data)
-
-def run_server(host, port, daemon, file, queue_size, threshold, drift):
- if daemon:
- daemonize(output_file=file)
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.bind((host, port))
- sock.listen(queue_size)
- timeout_interval = threshold * 2
- prev_check_timestamp = float(time.time())
- while 1:
- c_sock, c_addr = sock.accept()
- heartbeat = recv_all(c_sock)
- local_timestamp = float(time.time())
- drift = check_heartbeat(heartbeat, local_timestamp, threshold, check_drift)
- # NOTE: this doesn't work if the only client is the one that timed
- # out, but anything more complete would require another thread and
- # a lock for client_prev_timestamp.
- if local_timestamp - prev_check_timestamp > threshold * 2.0:
- check_for_timeouts(threshold, check_drift)
- prev_check_timestamp = local_timestamp
- if verbose:
- if check_drift:
- print "%.2f: %s (%s)" % (local_timestamp, heartbeat, drift)
- else:
- print "%.2f: %s" % (local_timestamp, heartbeat)
-
-def run_client(host, port, daemon, file, interval):
- if daemon:
- daemonize(output_file=file)
- seq = 1
- while 1:
- try:
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect((host, port))
- heartbeat = get_heartbeat(seq)
- sock.sendall(heartbeat)
- sock.close()
- if verbose:
- print heartbeat
- except socket.error, (value, message):
- print "%.2f: ERROR, %d - %s" % (float(time.time()), value, message)
-
- seq += 1
- time.sleep(interval)
-
-def get_heartbeat(seq=1):
- return "%s %06d %.2f" % (hostname, seq, float(time.time()))
-
-def check_heartbeat(heartbeat, local_timestamp, threshold, check_drift):
- hostname, seq, timestamp = heartbeat.rsplit()
- timestamp = float(timestamp)
- if client_prev_timestamp.has_key(hostname):
- delta = local_timestamp - client_prev_timestamp[hostname]
- if delta > threshold:
- print "%.2f: ALERT, SLU detected on host %s, delta %ds" \
- % (float(time.time()), hostname, delta)
-
- client_prev_timestamp[hostname] = local_timestamp
-
- if check_drift:
- if not client_clock_offset.has_key(hostname):
- client_clock_offset[hostname] = timestamp - local_timestamp
- client_prev_drift[hostname] = 0
- drift = timestamp - local_timestamp - client_clock_offset[hostname]
- drift_delta = drift - client_prev_drift[hostname]
- client_prev_drift[hostname] = drift
- return "drift %+4.2f (%+4.2f)" % (drift, drift_delta)
-
-def check_for_timeouts(threshold, check_drift):
- local_timestamp = float(time.time())
- hostname_list = list(client_prev_timestamp)
- for hostname in hostname_list:
- timestamp = client_prev_timestamp[hostname]
- delta = local_timestamp - timestamp
- if delta > threshold * 2:
- print "%.2f: ALERT, SLU detected on host %s, no heartbeat for %ds" \
- % (local_timestamp, hostname, delta)
- del client_prev_timestamp[hostname]
- if check_drift:
- del client_clock_offset[hostname]
- del client_prev_drift[hostname]
-
-def usage():
- print """
-Usage:
-
- heartbeat_slu.py --server --address <bind_address> --port <bind_port>
- [--file <output_file>] [--no-daemon] [--verbose]
- [--threshold <heartbeat threshold>]
-
- heartbeat_slu.py --client --address <server_address> -p <server_port>
- [--file output_file] [--no-daemon] [--verbose]
- [--interval <heartbeat interval in seconds>]
-"""
-
-# host information and global data
-hostname = socket.gethostname()
-client_prev_timestamp = {}
-client_clock_offset = {}
-client_prev_drift = {}
-
-# default param values
-host_port = 9001
-host_address = ''
-interval = 1 # seconds between heartbeats
-threshold = 10 # seconds late till alert
-is_server = False
-is_daemon = True
-file_server = "/tmp/heartbeat_server.out"
-file_client = "/tmp/heartbeat_client.out"
-file_selected = None
-queue_size = 5
-verbose = False
-check_drift = False
-
-# process cmdline opts
-try:
- opts, args = getopt.getopt(sys.argv[1:], "vhsfd:p:a:i:t:", [
- "server", "client", "no-daemon", "address=", "port=",
- "file=", "server", "interval=", "threshold=", "verbose",
- "check-drift", "help"])
-except getopt.GetoptError, e:
- print "error: %s" % str(e)
- usage()
- exit(1)
-
-for param, value in opts:
- if param in ["-p", "--port"]:
- host_port = int(value)
- elif param in ["-a", "--address"]:
- host_address = value
- elif param in ["-s", "--server"]:
- is_server = True
- elif param in ["-c", "--client"]:
- is_server = False
- elif param in ["--no-daemon"]:
- is_daemon = False
- elif param in ["-f", "--file"]:
- file_selected = value
- elif param in ["-i", "--interval"]:
- interval = int(value)
- elif param in ["-t", "--threshold"]:
- threshold = int(value)
- elif param in ["-d", "--check-drift"]:
- check_drift = True
- elif param in ["-v", "--verbose"]:
- verbose = True
- elif param in ["-h", "--help"]:
- usage()
- exit(0)
- else:
- print "error: unrecognized option: %s" % value
- usage()
- exit(1)
-
-# run until we're terminated
-if is_server:
- file_server = file_selected or file_server
- run_server(host_address, host_port, is_daemon, file_server, queue_size, threshold, check_drift)
-else:
- file_client = file_selected or file_client
- run_client(host_address, host_port, is_daemon, file_client, interval)
diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
deleted file mode 100644
index ee09671..0000000
--- a/client/tests/kvm/deps/rss.cpp
+++ /dev/null
@@ -1,1011 +0,0 @@
-// Simple remote shell server (and file transfer server)
-// Author: Michael Goldish <[email protected]>
-// Much of the code here was adapted from Microsoft code samples.
-
-// Usage: rss.exe [shell port] [file transfer port]
-// If no shell port is specified the default is 10022.
-// If no file transfer port is specified the default is 10023.
-
-// Definitions:
-// A 'msg' is a 32 bit integer.
-// A 'packet' is a 32 bit unsigned integer followed by a string of bytes.
-// The 32 bit integer indicates the length of the string.
-
-// Protocol for file transfers:
-//
-// When uploading files/directories to the server:
-// 1. The client connects.
-// 2. The server sends RSS_MAGIC.
-// 3. The client sends the chunk size for file transfers (a 32 bit integer
-// between 512 and 1048576 indicating the size in bytes).
-// 4. The client sends RSS_SET_PATH, followed by a packet (as defined above)
-// containing the path (in the server's filesystem) where files and/or
-// directories are to be stored.
-// Uploading a file (optional, can be repeated many times):
-// 5. The client sends RSS_CREATE_FILE, followed by a packet containing the
-// filename (filename only, without a path), followed by a series of
-// packets (called chunks) containing the file's contents. The size of
-// each chunk is the size set by the client in step 3, except for the
-// last chunk, which must be smaller.
-// Uploading a directory (optional, can be repeated many times):
-// 6. The client sends RSS_CREATE_DIR, followed by a packet containing the
-// name of the directory to be created (directory name only, without a
-// path).
-// 7. The client uploads files and directories to the new directory (using
-// steps 5, 6, 8).
-// 8. The client sends RSS_LEAVE_DIR.
-// 9. The client sends RSS_DONE and waits for a response.
-// 10. The server sends RSS_OK to indicate that it's still listening.
-// 11. Steps 4-10 are repeated as many times as necessary.
-// 12. The client disconnects.
-// If a critical error occurs at any time, the server may send RSS_ERROR
-// followed by a packet containing an error message, and the connection is
-// closed.
-//
-// When downloading files from the server:
-// 1. The client connects.
-// 2. The server sends RSS_MAGIC.
-// 3. The client sends the chunk size for file transfers (a 32 bit integer
-// between 512 and 1048576 indicating the size in bytes).
-// 4. The client sends RSS_SET_PATH, followed by a packet (as defined above)
-// containing a path (in the server's filesystem) or a wildcard pattern
-// indicating the files/directories the client wants to download.
-// The server then searches the given path. For every file found:
-// 5. The server sends RSS_CREATE_FILE, followed by a packet containing the
-// filename (filename only, without a path), followed by a series of
-// packets (called chunks) containing the file's contents. The size of
-// each chunk is the size set by the client in step 3, except for the
-// last chunk, which must be smaller.
-// For every directory found:
-// 6. The server sends RSS_CREATE_DIR, followed by a packet containing the
-// name of the directory to be created (directory name only, without a
-// path).
-// 7. The server sends files and directories located inside the directory
-// (using steps 5, 6, 8).
-// 8. The server sends RSS_LEAVE_DIR.
-// 9. The server sends RSS_DONE.
-// 10. Steps 4-9 are repeated as many times as necessary.
-// 11. The client disconnects.
-// If a critical error occurs, the server may send RSS_ERROR followed by a
-// packet containing an error message, and the connection is closed.
-// RSS_ERROR may be sent only when the client expects a msg.
-
-#define _WIN32_WINNT 0x0500
-
-#include <winsock2.h>
-#include <windows.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <shlwapi.h>
-
-#pragma comment(lib, "ws2_32.lib")
-#pragma comment(lib, "shlwapi.lib")
-
-#define TEXTBOX_LIMIT 262144
-
-// Constants for file transfer server
-#define RSS_MAGIC 0x525353
-#define RSS_OK 1
-#define RSS_ERROR 2
-#define RSS_UPLOAD 3
-#define RSS_DOWNLOAD 4
-#define RSS_SET_PATH 5
-#define RSS_CREATE_FILE 6
-#define RSS_CREATE_DIR 7
-#define RSS_LEAVE_DIR 8
-#define RSS_DONE 9
-
-// Globals
-int shell_port = 10022;
-int file_transfer_port = 10023;
-
-HWND hMainWindow = NULL;
-HWND hTextBox = NULL;
-
-char text_buffer[8192] = {0};
-int text_size = 0;
-
-CRITICAL_SECTION critical_section;
-
-FILE *log_file;
-
-struct client_info {
- SOCKET socket;
- char addr_str[256];
- int pid;
- HWND hwnd;
- HANDLE hJob;
- HANDLE hChildOutputRead;
- HANDLE hThreadChildToSocket;
- char *chunk_buffer;
- int chunk_size;
-};
-
-/*-----------------
- * Shared functions
- *-----------------*/
-
-void ExitOnError(const char *message, BOOL winsock = FALSE)
-{
- LPVOID system_message;
- char buffer[512];
- int error_code;
-
- if (winsock)
- error_code = WSAGetLastError();
- else
- error_code = GetLastError();
- WSACleanup();
-
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- error_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&system_message,
- 0,
- NULL);
- sprintf(buffer,
- "%s!\n"
- "Error code = %d\n"
- "Error message = %s",
- message, error_code, (char *)system_message);
- MessageBox(hMainWindow, buffer, "Error", MB_OK | MB_ICONERROR);
-
- LocalFree(system_message);
- ExitProcess(1);
-}
-
-void FlushTextBuffer()
-{
- if (!text_size) return;
- // Clear the text box if it contains too much text
- int len = GetWindowTextLength(hTextBox);
- while (len > TEXTBOX_LIMIT - sizeof(text_buffer)) {
- SendMessage(hTextBox, EM_SETSEL, 0, TEXTBOX_LIMIT * 1/4);
- SendMessage(hTextBox, EM_REPLACESEL, FALSE, (LPARAM)"...");
- len = GetWindowTextLength(hTextBox);
- }
- // Append the contents of text_buffer to the text box
- SendMessage(hTextBox, EM_SETSEL, len, len);
- SendMessage(hTextBox, EM_REPLACESEL, FALSE, (LPARAM)text_buffer);
- // Clear text_buffer
- text_buffer[0] = 0;
- text_size = 0;
- // Make sure the log file's buffer is flushed as well
- if (log_file)
- fflush(log_file);
-}
-
-void AppendMessage(const char *message, ...)
-{
- va_list args;
- char str[512] = {0};
-
- va_start(args, message);
- vsnprintf(str, sizeof(str) - 3, message, args);
- va_end(args);
- strcat(str, "\r\n");
- int len = strlen(str);
-
- EnterCriticalSection(&critical_section);
- // Write message to the log file
- if (log_file)
- fwrite(str, len, 1, log_file);
- // Flush the text buffer if necessary
- if (text_size + len + 1 > sizeof(text_buffer))
- FlushTextBuffer();
- // Append message to the text buffer
- strcpy(text_buffer + text_size, str);
- text_size += len;
- LeaveCriticalSection(&critical_section);
-}
-
-// Flush the text buffer every 250 ms
-DWORD WINAPI UpdateTextBox(LPVOID client_info_ptr)
-{
- while (1) {
- Sleep(250);
- EnterCriticalSection(&critical_section);
- FlushTextBuffer();
- LeaveCriticalSection(&critical_section);
- }
- return 0;
-}
-
-void FormatStringForPrinting(char *dst, const char *src, int size)
-{
- int j = 0;
-
- for (int i = 0; i < size && src[i]; i++) {
- if (src[i] == '\n') {
- dst[j++] = '\\';
- dst[j++] = 'n';
- } else if (src[i] == '\r') {
- dst[j++] = '\\';
- dst[j++] = 'r';
- } else if (src[i] == '\t') {
- dst[j++] = '\\';
- dst[j++] = 't';
- } else if (src[i] == '\\') {
- dst[j++] = '\\';
- dst[j++] = '\\';
- } else dst[j++] = src[i];
- }
- dst[j] = 0;
-}
-
-SOCKET PrepareListenSocket(int port)
-{
- sockaddr_in addr;
- linger l;
- int result;
-
- // Create socket
- SOCKET ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (ListenSocket == INVALID_SOCKET)
- ExitOnError("Socket creation failed", TRUE);
-
- // Enable lingering
- l.l_linger = 10;
- l.l_onoff = 1;
- setsockopt(ListenSocket, SOL_SOCKET, SO_LINGER, (char *)&l, sizeof(l));
-
- // Bind the socket
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
- addr.sin_port = htons(port);
-
- result = bind(ListenSocket, (sockaddr *)&addr, sizeof(addr));
- if (result == SOCKET_ERROR)
- ExitOnError("bind failed", TRUE);
-
- // Start listening for incoming connections
- result = listen(ListenSocket, SOMAXCONN);
- if (result == SOCKET_ERROR)
- ExitOnError("listen failed", TRUE);
-
- return ListenSocket;
-}
-
-client_info* Accept(SOCKET ListenSocket)
-{
- sockaddr_in addr;
- int addrlen = sizeof(addr);
-
- // Accept the connection
- SOCKET socket = accept(ListenSocket, (sockaddr *)&addr, &addrlen);
- if (socket == INVALID_SOCKET) {
- if (WSAGetLastError() == WSAEINTR)
- return NULL;
- else
- ExitOnError("accept failed", TRUE);
- }
-
- // Allocate a new client_info struct
- client_info *ci = (client_info *)calloc(1, sizeof(client_info));
- if (!ci)
- ExitOnError("Could not allocate client_info struct");
- // Populate the new struct
- ci->socket = socket;
- const char *address = inet_ntoa(addr.sin_addr);
- if (!address) address = "unknown";
- sprintf(ci->addr_str, "%s:%d", address, addr.sin_port);
-
- return ci;
-}
-
-// Read a given number of bytes into a buffer
-BOOL Receive(SOCKET socket, char *buffer, int len)
-{
- while (len > 0) {
- int bytes_received = recv(socket, buffer, len, 0);
- if (bytes_received <= 0)
- return FALSE;
- buffer += bytes_received;
- len -= bytes_received;
- }
- return TRUE;
-}
-
-// Send a given number of bytes from a buffer
-BOOL Send(SOCKET socket, const char *buffer, int len)
-{
- while (len > 0) {
- int bytes_sent = send(socket, buffer, len, 0);
- if (bytes_sent <= 0)
- return FALSE;
- buffer += bytes_sent;
- len -= bytes_sent;
- }
- return TRUE;
-}
-
-/*-------------
- * Shell server
- *-------------*/
-
-DWORD WINAPI ChildToSocket(LPVOID client_info_ptr)
-{
- client_info *ci = (client_info *)client_info_ptr;
- char buffer[1024];
- DWORD bytes_read;
-
- while (1) {
- // Read data from the child's STDOUT/STDERR pipes
- if (!ReadFile(ci->hChildOutputRead,
- buffer, sizeof(buffer),
- &bytes_read, NULL) || !bytes_read) {
- if (GetLastError() == ERROR_BROKEN_PIPE)
- break; // Pipe done -- normal exit path
- else
- ExitOnError("ReadFile failed"); // Something bad happened
- }
- // Send data to the client
- Send(ci->socket, buffer, bytes_read);
- }
-
- AppendMessage("Child exited");
- closesocket(ci->socket);
- return 0;
-}
-
-DWORD WINAPI SocketToChild(LPVOID client_info_ptr)
-{
- client_info *ci = (client_info *)client_info_ptr;
- char buffer[256], formatted_buffer[768];
- int bytes_received;
-
- AppendMessage("Shell server: new client connected (%s)", ci->addr_str);
-
- while (1) {
- // Receive data from the socket
- ZeroMemory(buffer, sizeof(buffer));
- bytes_received = recv(ci->socket, buffer, sizeof(buffer), 0);
- if (bytes_received <= 0)
- break;
- // Report the data received
- FormatStringForPrinting(formatted_buffer, buffer, sizeof(buffer));
- AppendMessage("Client (%s) entered text: \"%s\"",
- ci->addr_str, formatted_buffer);
- // Send the data as a series of WM_CHAR messages to the console window
- for (int i = 0; i < bytes_received; i++) {
- SendMessage(ci->hwnd, WM_CHAR, buffer[i], 0);
- SendMessage(ci->hwnd, WM_SETFOCUS, 0, 0);
- }
- }
-
- AppendMessage("Shell server: client disconnected (%s)", ci->addr_str);
-
- // Attempt to terminate the child's process tree:
- // Using taskkill (where available)
- sprintf(buffer, "taskkill /PID %d /T /F", ci->pid);
- system(buffer);
- // .. and using TerminateJobObject()
- TerminateJobObject(ci->hJob, 0);
- // Wait for the ChildToSocket thread to terminate
- WaitForSingleObject(ci->hThreadChildToSocket, 10000);
- // In case the thread refuses to exit, terminate it
- TerminateThread(ci->hThreadChildToSocket, 0);
- // Close the socket
- closesocket(ci->socket);
-
- // Free resources
- CloseHandle(ci->hJob);
- CloseHandle(ci->hThreadChildToSocket);
- CloseHandle(ci->hChildOutputRead);
- free(ci);
-
- AppendMessage("SocketToChild thread exited");
- return 0;
-}
-
-void PrepAndLaunchRedirectedChild(client_info *ci,
- HANDLE hChildStdOut,
- HANDLE hChildStdErr)
-{
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
-
- // Allocate a new console for the child
- HWND hwnd = GetForegroundWindow();
- FreeConsole();
- AllocConsole();
- ShowWindow(GetConsoleWindow(), SW_HIDE);
- if (hwnd)
- SetForegroundWindow(hwnd);
-
- // Set up the start up info struct.
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
- si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
- si.hStdOutput = hChildStdOut;
- si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
- si.hStdError = hChildStdErr;
- // Use this if you want to hide the child:
- si.wShowWindow = SW_HIDE;
- // Note that dwFlags must include STARTF_USESHOWWINDOW if you want to
- // use the wShowWindow flags.
-
- // Launch the process that you want to redirect.
- if (!CreateProcess(NULL, "cmd.exe", NULL, NULL, TRUE,
- 0, NULL, "C:\\", &si, &pi))
- ExitOnError("CreateProcess failed");
-
- // Close any unnecessary handles.
- if (!CloseHandle(pi.hThread))
- ExitOnError("CloseHandle failed");
-
- // Keep the process ID
- ci->pid = pi.dwProcessId;
- // Assign the process to a newly created JobObject
- ci->hJob = CreateJobObject(NULL, NULL);
- AssignProcessToJobObject(ci->hJob, pi.hProcess);
- // Keep the console window's handle
- ci->hwnd = GetConsoleWindow();
-
- // Detach from the child's console
- FreeConsole();
-}
-
-void SpawnSession(client_info *ci)
-{
- HANDLE hOutputReadTmp, hOutputRead, hOutputWrite;
- HANDLE hErrorWrite;
- SECURITY_ATTRIBUTES sa;
-
- // Set up the security attributes struct.
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = TRUE;
-
- // Create the child output pipe.
- if (!CreatePipe(&hOutputReadTmp, &hOutputWrite, &sa, 0))
- ExitOnError("CreatePipe failed");
-
- // Create a duplicate of the output write handle for the std error
- // write handle. This is necessary in case the child application
- // closes one of its std output handles.
- if (!DuplicateHandle(GetCurrentProcess(), hOutputWrite,
- GetCurrentProcess(), &hErrorWrite, 0,
- TRUE, DUPLICATE_SAME_ACCESS))
- ExitOnError("DuplicateHandle failed");
-
- // Create new output read handle and the input write handles. Set
- // the Properties to FALSE. Otherwise, the child inherits the
- // properties and, as a result, non-closeable handles to the pipes
- // are created.
- if (!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp,
- GetCurrentProcess(),
- &hOutputRead, // Address of new handle.
- 0, FALSE, // Make it uninheritable.
- DUPLICATE_SAME_ACCESS))
- ExitOnError("DuplicateHandle failed");
-
- // Close inheritable copies of the handles you do not want to be
- // inherited.
- if (!CloseHandle(hOutputReadTmp))
- ExitOnError("CloseHandle failed");
-
- PrepAndLaunchRedirectedChild(ci, hOutputWrite, hErrorWrite);
-
- ci->hChildOutputRead = hOutputRead;
-
- // Close pipe handles (do not continue to modify the parent).
- // You need to make sure that no handles to the write end of the
- // output pipe are maintained in this process or else the pipe will
- // not close when the child process exits and the ReadFile will hang.
- if (!CloseHandle(hOutputWrite)) ExitOnError("CloseHandle failed");
- if (!CloseHandle(hErrorWrite)) ExitOnError("CloseHandle failed");
-}
-
-DWORD WINAPI ShellListenThread(LPVOID param)
-{
- HANDLE hThread;
-
- SOCKET ListenSocket = PrepareListenSocket(shell_port);
-
- // Inform the user
- AppendMessage("Shell server: waiting for clients to connect...");
-
- while (1) {
- client_info *ci = Accept(ListenSocket);
- if (!ci) break;
- // Under heavy load, spawning cmd.exe might take a while, so tell the
- // client to be patient
- const char *message = "Please wait...\r\n";
- Send(ci->socket, message, strlen(message));
- // Spawn a new redirected cmd.exe process
- SpawnSession(ci);
- // Start transferring data from the child process to the client
- hThread = CreateThread(NULL, 0, ChildToSocket, (LPVOID)ci, 0, NULL);
- if (!hThread)
- ExitOnError("Could not create ChildToSocket thread");
- ci->hThreadChildToSocket = hThread;
- // ... and from the client to the child process
- hThread = CreateThread(NULL, 0, SocketToChild, (LPVOID)ci, 0, NULL);
- if (!hThread)
- ExitOnError("Could not create SocketToChild thread");
- }
-
- return 0;
-}
-
-/*---------------------
- * File transfer server
- *---------------------*/
-
-int ReceivePacket(SOCKET socket, char *buffer, DWORD max_size)
-{
- DWORD packet_size = 0;
-
- if (!Receive(socket, (char *)&packet_size, 4))
- return -1;
- if (packet_size > max_size)
- return -1;
- if (!Receive(socket, buffer, packet_size))
- return -1;
-
- return packet_size;
-}
-
-int ReceiveStrPacket(SOCKET socket, char *buffer, DWORD max_size)
-{
- memset(buffer, 0, max_size);
- return ReceivePacket(socket, buffer, max_size - 1);
-}
-
-BOOL SendPacket(SOCKET socket, const char *buffer, DWORD len)
-{
- if (!Send(socket, (char *)&len, 4))
- return FALSE;
- return Send(socket, buffer, len);
-}
-
-BOOL SendMsg(SOCKET socket, DWORD msg)
-{
- return Send(socket, (char *)&msg, 4);
-}
-
-// Send data from a file
-BOOL SendFileChunks(client_info *ci, const char *filename)
-{
- FILE *fp = fopen(filename, "rb");
- if (!fp) return FALSE;
-
- while (1) {
- int bytes_read = fread(ci->chunk_buffer, 1, ci->chunk_size, fp);
- if (!SendPacket(ci->socket, ci->chunk_buffer, bytes_read))
- break;
- if (bytes_read < ci->chunk_size) {
- if (ferror(fp))
- break;
- else {
- fclose(fp);
- return TRUE;
- }
- }
- }
-
- fclose(fp);
- return FALSE;
-}
-
-// Receive data into a file
-BOOL ReceiveFileChunks(client_info *ci, const char *filename)
-{
- FILE *fp = fopen(filename, "wb");
- if (!fp) return FALSE;
-
- while (1) {
- int bytes_received = ReceivePacket(ci->socket, ci->chunk_buffer,
- ci->chunk_size);
- if (bytes_received < 0)
- break;
- if (bytes_received > 0)
- if (fwrite(ci->chunk_buffer, bytes_received, 1, fp) < 1)
- break;
- if (bytes_received < ci->chunk_size) {
- fclose(fp);
- return TRUE;
- }
- }
-
- fclose(fp);
- return FALSE;
-}
-
-BOOL ExpandPath(char *path, int max_size)
-{
- char temp[512];
- int result;
-
- PathRemoveBackslash(path);
- result = ExpandEnvironmentStrings(path, temp, sizeof(temp));
- if (result == 0 || result > sizeof(temp))
- return FALSE;
- strncpy(path, temp, max_size - 1);
- return TRUE;
-}
-
-int TerminateTransfer(client_info *ci, const char *message)
-{
- AppendMessage(message);
- AppendMessage("File transfer server: client disconnected (%s)",
- ci->addr_str);
- closesocket(ci->socket);
- free(ci->chunk_buffer);
- free(ci);
- return 0;
-}
-
-int TerminateWithError(client_info *ci, const char *message)
-{
- SendMsg(ci->socket, RSS_ERROR);
- SendPacket(ci->socket, message, strlen(message));
- return TerminateTransfer(ci, message);
-}
-
-int ReceiveThread(client_info *ci)
-{
- char path[512], filename[512];
- DWORD msg;
-
- AppendMessage("Client (%s) wants to upload files", ci->addr_str);
-
- while (1) {
- if (!Receive(ci->socket, (char *)&msg, 4))
- return TerminateTransfer(ci, "Could not receive further msgs");
-
- switch (msg) {
- case RSS_SET_PATH:
- if (ReceiveStrPacket(ci->socket, path, sizeof(path)) < 0)
- return TerminateWithError(ci,
- "RSS_SET_PATH: could not receive path, or path too long");
- AppendMessage("Client (%s) set path to %s", ci->addr_str, path);
- if (!ExpandPath(path, sizeof(path)))
- return TerminateWithError(ci,
- "RSS_SET_PATH: error expanding environment strings");
- break;
-
- case RSS_CREATE_FILE:
- if (ReceiveStrPacket(ci->socket, filename, sizeof(filename)) < 0)
- return TerminateWithError(ci,
- "RSS_CREATE_FILE: could not receive filename");
- if (PathIsDirectory(path))
- PathAppend(path, filename);
- AppendMessage("Client (%s) is uploading %s", ci->addr_str, path);
- if (!ReceiveFileChunks(ci, path))
- return TerminateWithError(ci,
- "RSS_CREATE_FILE: error receiving or writing file "
- "contents");
- PathAppend(path, "..");
- break;
-
- case RSS_CREATE_DIR:
- if (ReceiveStrPacket(ci->socket, filename, sizeof(filename)) < 0)
- return TerminateWithError(ci,
- "RSS_CREATE_DIR: could not receive dirname");
- if (PathIsDirectory(path))
- PathAppend(path, filename);
- AppendMessage("Entering dir %s", path);
- if (PathFileExists(path)) {
- if (!PathIsDirectory(path))
- return TerminateWithError(ci,
- "RSS_CREATE_DIR: path exists and is not a directory");
- } else {
- if (!CreateDirectory(path, NULL))
- return TerminateWithError(ci,
- "RSS_CREATE_DIR: could not create directory");
- }
- break;
-
- case RSS_LEAVE_DIR:
- PathAppend(path, "..");
- AppendMessage("Returning to dir %s", path);
- break;
-
- case RSS_DONE:
- if (!SendMsg(ci->socket, RSS_OK))
- return TerminateTransfer(ci,
- "RSS_DONE: could not send OK msg");
- break;
-
- default:
- return TerminateWithError(ci, "Received unexpected msg");
- }
- }
-}
-
-// Given a path or a pattern with wildcards, send files or directory trees to
-// the client
-int SendFiles(client_info *ci, const char *pattern)
-{
- char path[512];
- WIN32_FIND_DATA ffd;
-
- HANDLE hFind = FindFirstFile(pattern, &ffd);
- if (hFind == INVALID_HANDLE_VALUE) {
- // If a weird error occurred (like failure to list directory contents
- // due to insufficient permissions) print a warning and continue.
- if (GetLastError() != ERROR_FILE_NOT_FOUND)
- AppendMessage("WARNING: FindFirstFile failed on pattern %s",
- pattern);
- return 1;
- }
-
- strncpy(path, pattern, sizeof(path) - 1);
- PathAppend(path, "..");
-
- do {
- if (ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
- continue;
- if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- // Directory
- if (!strcmp(ffd.cFileName, ".") || !strcmp(ffd.cFileName, ".."))
- continue;
- PathAppend(path, ffd.cFileName);
- AppendMessage("Entering dir %s", path);
- PathAppend(path, "*");
- if (!SendMsg(ci->socket, RSS_CREATE_DIR)) {
- FindClose(hFind);
- return TerminateTransfer(ci,
- "Could not send RSS_CREATE_DIR msg");
- }
- if (!SendPacket(ci->socket, ffd.cFileName,
- strlen(ffd.cFileName))) {
- FindClose(hFind);
- return TerminateTransfer(ci, "Could not send dirname");
- }
- if (!SendFiles(ci, path)) {
- FindClose(hFind);
- return 0;
- }
- if (!SendMsg(ci->socket, RSS_LEAVE_DIR)) {
- FindClose(hFind);
- return TerminateTransfer(ci,
- "Could not send RSS_LEAVE_DIR msg");
- }
- PathAppend(path, "..");
- PathAppend(path, "..");
- AppendMessage("Returning to dir %s", path);
- } else {
- // File
- PathAppend(path, ffd.cFileName);
- AppendMessage("Client (%s) is downloading %s", ci->addr_str, path);
- // Make sure the file is readable
- FILE *fp = fopen(path, "rb");
- if (fp) fclose(fp);
- else {
- AppendMessage("WARNING: could not read file %s", path);
- PathAppend(path, "..");
- continue;
- }
- if (!SendMsg(ci->socket, RSS_CREATE_FILE)) {
- FindClose(hFind);
- return TerminateTransfer(ci,
- "Could not send RSS_CREATE_FILE msg");
- }
- if (!SendPacket(ci->socket, ffd.cFileName,
- strlen(ffd.cFileName))) {
- FindClose(hFind);
- return TerminateTransfer(ci, "Could not send filename");
- }
- if (!SendFileChunks(ci, path)) {
- FindClose(hFind);
- return TerminateTransfer(ci, "Could not send file contents");
- }
- PathAppend(path, "..");
- }
- } while (FindNextFile(hFind, &ffd));
-
- if (GetLastError() == ERROR_NO_MORE_FILES) {
- FindClose(hFind);
- return 1;
- } else {
- FindClose(hFind);
- return TerminateWithError(ci, "FindNextFile failed");
- }
-}
-
-int SendThread(client_info *ci)
-{
- char pattern[512];
- DWORD msg;
-
- AppendMessage("Client (%s) wants to download files", ci->addr_str);
-
- while (1) {
- if (!Receive(ci->socket, (char *)&msg, 4))
- return TerminateTransfer(ci, "Could not receive further msgs");
-
- switch (msg) {
- case RSS_SET_PATH:
- if (ReceiveStrPacket(ci->socket, pattern, sizeof(pattern)) < 0)
- return TerminateWithError(ci,
- "RSS_SET_PATH: could not receive path, or path too long");
- AppendMessage("Client (%s) asked for %s", ci->addr_str, pattern);
- if (!ExpandPath(pattern, sizeof(pattern)))
- return TerminateWithError(ci,
- "RSS_SET_PATH: error expanding environment strings");
- if (!SendFiles(ci, pattern))
- return 0;
- if (!SendMsg(ci->socket, RSS_DONE))
- return TerminateTransfer(ci,
- "RSS_SET_PATH: could not send RSS_DONE msg");
- break;
-
- default:
- return TerminateWithError(ci, "Received unexpected msg");
- }
- }
-}
-
-DWORD WINAPI TransferThreadEntry(LPVOID client_info_ptr)
-{
- client_info *ci = (client_info *)client_info_ptr;
- DWORD msg;
-
- AppendMessage("File transfer server: new client connected (%s)",
- ci->addr_str);
-
- if (!SendMsg(ci->socket, RSS_MAGIC))
- return TerminateTransfer(ci, "Could not send greeting message");
- if (!Receive(ci->socket, (char *)&ci->chunk_size, 4))
- return TerminateTransfer(ci, "Error receiving chunk size");
- AppendMessage("Client (%s) set chunk size to %d", ci->addr_str,
- ci->chunk_size);
- if (ci->chunk_size > 1048576 || ci->chunk_size < 512)
- return TerminateWithError(ci, "Client set invalid chunk size");
- if (!(ci->chunk_buffer = (char *)malloc(ci->chunk_size)))
- return TerminateWithError(ci, "Memory allocation error");
- if (!Receive(ci->socket, (char *)&msg, 4))
- return TerminateTransfer(ci, "Error receiving msg");
-
- if (msg == RSS_UPLOAD)
- return ReceiveThread(ci);
- else if (msg == RSS_DOWNLOAD)
- return SendThread(ci);
- return TerminateWithError(ci, "Received unexpected msg");
-}
-
-DWORD WINAPI FileTransferListenThread(LPVOID param)
-{
- SOCKET ListenSocket = PrepareListenSocket(file_transfer_port);
-
- // Inform the user
- AppendMessage("File transfer server: waiting for clients to connect...");
-
- while (1) {
- client_info *ci = Accept(ListenSocket);
- if (!ci) break;
- if (!CreateThread(NULL, 0, TransferThreadEntry, (LPVOID)ci, 0, NULL))
- ExitOnError("Could not create file transfer thread");
- }
-
- return 0;
-}
-
-/*--------------------
- * WndProc and WinMain
- *--------------------*/
-
-LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- RECT rect;
- WSADATA wsaData;
- SYSTEMTIME lt;
- char log_filename[256];
-
- switch (msg) {
- case WM_CREATE:
- // Create text box
- GetClientRect(hwnd, &rect);
- hTextBox = CreateWindowEx(WS_EX_CLIENTEDGE,
- "EDIT", "",
- WS_CHILD | WS_VISIBLE | WS_VSCROLL |
- ES_MULTILINE | ES_AUTOVSCROLL,
- 20, 20,
- rect.right - 40,
- rect.bottom - 40,
- hwnd,
- NULL,
- GetModuleHandle(NULL),
- NULL);
- if (!hTextBox)
- ExitOnError("Could not create text box");
- // Set font
- SendMessage(hTextBox, WM_SETFONT,
- (WPARAM)GetStockObject(DEFAULT_GUI_FONT),
- MAKELPARAM(FALSE, 0));
- // Set size limit
- SendMessage(hTextBox, EM_LIMITTEXT, TEXTBOX_LIMIT, 0);
- // Initialize critical section object for text buffer access
- InitializeCriticalSection(&critical_section);
- // Open log file
- GetLocalTime(<);
- sprintf(log_filename, "rss_%02d-%02d-%02d_%02d-%02d-%02d.log",
- lt.wYear, lt.wMonth, lt.wDay,
- lt.wHour, lt.wMinute, lt.wSecond);
- log_file = fopen(log_filename, "wb");
- // Create text box update thread
- if (!CreateThread(NULL, 0, UpdateTextBox, NULL, 0, NULL))
- ExitOnError("Could not create text box update thread");
- // Initialize Winsock
- if (WSAStartup(MAKEWORD(2, 2), &wsaData))
- ExitOnError("Winsock initialization failed");
- // Start the listening threads
- if (!CreateThread(NULL, 0, ShellListenThread, NULL, 0, NULL))
- ExitOnError("Could not create shell server listen thread");
- if (!CreateThread(NULL, 0, FileTransferListenThread, NULL, 0, NULL))
- ExitOnError("Could not create file transfer server listen thread");
- break;
-
- case WM_SIZE:
- MoveWindow(hTextBox, 20, 20,
- LOWORD(lParam) - 40, HIWORD(lParam) - 40, TRUE);
- break;
-
- case WM_DESTROY:
- if (WSACleanup())
- ExitOnError("WSACleanup failed");
- PostQuitMessage(0);
- break;
-
- default:
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
-
- return 0;
-}
-
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nShowCmd)
-{
- WNDCLASSEX wc;
- MSG msg;
- char title[256];
-
- if (strlen(lpCmdLine))
- sscanf(lpCmdLine, "%d %d", &shell_port, &file_transfer_port);
-
- sprintf(title, "Remote Shell Server (listening on ports %d, %d)",
- shell_port, file_transfer_port);
-
- // Create the window class
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
- wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = "RemoteShellServerWindowClass";
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-
- if (!RegisterClassEx(&wc))
- ExitOnError("Could not register window class");
-
- // Create the main window
- hMainWindow =
- CreateWindow("RemoteShellServerWindowClass", title,
- WS_OVERLAPPEDWINDOW,
- 20, 20, 600, 400,
- NULL, NULL, hInstance, NULL);
- if (!hMainWindow)
- ExitOnError("Could not create window");
-
- ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
- UpdateWindow(hMainWindow);
-
- // Main message loop
- while (GetMessage(&msg, NULL, 0, 0)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- ExitProcess(0);
-}
diff --git a/client/tests/kvm/deps/rss.exe b/client/tests/kvm/deps/rss.exe
deleted file mode 100644
index 2c02a8f..0000000
--- a/client/tests/kvm/deps/rss.exe
+++ /dev/null
Binary files differ
diff --git a/client/tests/kvm/deps/rss.reg b/client/tests/kvm/deps/rss.reg
deleted file mode 100644
index 3dccc4a..0000000
--- a/client/tests/kvm/deps/rss.reg
+++ /dev/null
@@ -1,15 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
-"Remote Shell Server"="C:\\rss.exe"
-
-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\winlogon]
-"AutoAdminLogon"="1"
-"DefaultUserName"="Administrator"
-"DefaultPassword"="1q2w3eP"
-
-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]
-"EnableLUA"=dword:00000000
-
-[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Reliability]
-"ShutdownReasonOn"=dword:00000000
diff --git a/client/tests/kvm/deps/setuprss.bat b/client/tests/kvm/deps/setuprss.bat
deleted file mode 100644
index 97298cd..0000000
--- a/client/tests/kvm/deps/setuprss.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-set rsspath=%1
-if [%1]==[] set rsspath=%~dp0\rss.exe
-copy %rsspath% C:\rss.exe
-
-net user Administrator /active:yes
-net user Administrator 1q2w3eP
-netsh firewall set opmode disable
-netsh advfirewall set allprofiles state off
-powercfg /G OFF /OPTION RESUMEPASSWORD
-
-reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe" /t REG_SZ /f
-reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
-reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultUserName" /d "Administrator" /t REG_SZ /f
-reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultPassword" /d "1q2w3eP" /t REG_SZ /f
-reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /d "0" /t REG_DWORD /f
-reg add "HKLM\Software\Policies\Microsoft\Windows NT\Reliability" /v "ShutdownReasonOn" /d "0" /t REG_DWORD /f
-
-rem Just in case reg.exe is missing (e.g. Windows 2000):
-regedit /s %~dp0\rss.reg
-
-start /B C:\rss.exe
diff --git a/client/tests/kvm/deps/test_clock_getres/Makefile b/client/tests/kvm/deps/test_clock_getres/Makefile
deleted file mode 100644
index b4f73c7..0000000
--- a/client/tests/kvm/deps/test_clock_getres/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-CC = gcc
-PROG = test_clock_getres
-SRC = test_clock_getres.c
-LIBS = -lrt
-
-all: $(PROG)
-
-$(PROG):
- $(CC) $(LIBS) -o $(PROG) $(SRC)
-clean:
- rm -f $(PROG)
diff --git a/client/tests/kvm/deps/test_clock_getres/test_clock_getres.c b/client/tests/kvm/deps/test_clock_getres/test_clock_getres.c
deleted file mode 100644
index 81d3b9c..0000000
--- a/client/tests/kvm/deps/test_clock_getres/test_clock_getres.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Test clock resolution for KVM guests that have kvm-clock as clock source
- *
- * Copyright (c) 2010 Red Hat, Inc
- * Author: Lucas Meneghel Rodrigues <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-
-int main(void) {
- struct timespec res;
- int clock_return = clock_getres(CLOCK_MONOTONIC, &res);
- char clocksource[50];
- char line[80];
- FILE *fr;
- if ((fr = fopen(
- "/sys/devices/system/clocksource/clocksource0/current_clocksource",
- "rt")) == NULL) {
- perror("fopen");
- return EXIT_FAILURE;
- }
- while (fgets(line, 80, fr) != NULL) {
- sscanf(line, "%s", &clocksource);
- }
- fclose(fr);
- if (!strncmp(clocksource, "kvm-clock", strlen("kvm-clock"))) {
- if (clock_return == 0) {
- if (res.tv_sec > 1 || res.tv_nsec > 100) {
- printf("FAIL: clock_getres returned bad clock resolution\n");
- return EXIT_FAILURE;
- } else {
- printf("PASS: check successful\n");
- return EXIT_SUCCESS;
- }
- } else {
- printf("FAIL: clock_getres failed\n");
- return EXIT_FAILURE;
- }
- } else {
- printf("FAIL: invalid clock source: %s\n", clocksource);
- return EXIT_FAILURE;
- }
-}
diff --git a/client/tests/kvm/deps/whql_delete_machine_15.cs b/client/tests/kvm/deps/whql_delete_machine_15.cs
deleted file mode 100644
index c7015cc..0000000
--- a/client/tests/kvm/deps/whql_delete_machine_15.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// DTM machine deletion tool
-// Author: Michael Goldish <[email protected]>
-// Based on sample code by Microsoft.
-
-using System;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-using Microsoft.DistributedAutomation.DeviceSelection;
-using Microsoft.DistributedAutomation.SqlDataStore;
-
-namespace automate0
-{
- class AutoJob
- {
- static int Main(string[] args)
- {
- if (args.Length != 2)
- {
- Console.WriteLine("Error: incorrect number of command line arguments");
- Console.WriteLine("Usage: {0} serverName clientName",
- System.Environment.GetCommandLineArgs()[0]);
- return 1;
- }
- string serverName = args[0];
- string clientName = args[1];
-
- try
- {
- // Initialize DeviceScript and connect to data store
- Console.WriteLine("Initializing DeviceScript object");
- DeviceScript script = new DeviceScript();
- Console.WriteLine("Connecting to data store");
- script.ConnectToNamedDataStore(serverName);
-
- // Find the client machine
- IResourcePool rootPool = script.GetResourcePoolByName("$");
- Console.WriteLine("Looking for client machine '{0}'", clientName);
- IResource machine = rootPool.GetResourceByName(clientName);
- if (machine == null)
- {
- Console.WriteLine("Client machine not found");
- return 0;
- }
- Console.WriteLine("Client machine '{0}' found ({1}, {2})",
- clientName, machine.OperatingSystem, machine.ProcessorArchitecture);
-
- // Change the client machine's status to 'unsafe'
- Console.WriteLine("Changing the client machine's status to 'Unsafe'");
- try
- {
- machine.ChangeResourceStatus("Unsafe");
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- }
- while (machine.Status != "Unsafe")
- {
- try
- {
- machine = rootPool.GetResourceByName(clientName);
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- }
- System.Threading.Thread.Sleep(1000);
- }
-
- // Delete the client machine from datastore
- Console.WriteLine("Deleting client machine from data store");
- script.DeleteResource(machine.Id);
- return 0;
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: " + e.Message);
- return 1;
- }
- }
- }
-}
diff --git a/client/tests/kvm/deps/whql_delete_machine_15.exe b/client/tests/kvm/deps/whql_delete_machine_15.exe
deleted file mode 100644
index 7f57134..0000000
--- a/client/tests/kvm/deps/whql_delete_machine_15.exe
+++ /dev/null
Binary files differ
diff --git a/client/tests/kvm/deps/whql_submission_15.cs b/client/tests/kvm/deps/whql_submission_15.cs
deleted file mode 100644
index 2a29ac5..0000000
--- a/client/tests/kvm/deps/whql_submission_15.cs
+++ /dev/null
@@ -1,373 +0,0 @@
-// DTM submission automation program
-// Author: Michael Goldish <[email protected]>
-// Based on sample code by Microsoft.
-
-// Note: this program has only been tested with DTM version 1.5.
-// It might fail to work with other versions, specifically because it uses
-// a few undocumented methods/attributes.
-
-using System;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-using Microsoft.DistributedAutomation.DeviceSelection;
-using Microsoft.DistributedAutomation.SqlDataStore;
-
-namespace automate0
-{
- class AutoJob
- {
- // Wait for a machine to show up in the data store
- static void FindMachine(IResourcePool rootPool, string machineName)
- {
- Console.WriteLine("Looking for machine '{0}'", machineName);
- IResource machine = null;
- while (true)
- {
- try
- {
- machine = rootPool.GetResourceByName(machineName);
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- }
- // Make sure the machine is valid
- if (machine != null &&
- machine.OperatingSystem != null &&
- machine.OperatingSystem.Length > 0 &&
- machine.ProcessorArchitecture != null &&
- machine.ProcessorArchitecture.Length > 0 &&
- machine.GetDevices().Length > 0)
- break;
- System.Threading.Thread.Sleep(1000);
- }
- Console.WriteLine("Client machine '{0}' found ({1}, {2})",
- machineName, machine.OperatingSystem, machine.ProcessorArchitecture);
- }
-
- // Delete a machine pool if it exists
- static void DeleteResourcePool(IDeviceScript script, string poolName)
- {
- while (true)
- {
- try
- {
- IResourcePool pool = script.GetResourcePoolByName(poolName);
- if (pool != null)
- script.DeleteResourcePool(pool);
- break;
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- System.Threading.Thread.Sleep(1000);
- }
- }
- }
-
- // Set the machine's status to 'Reset' and optionally wait for it to become ready
- static void ResetMachine(IResourcePool rootPool, string machineName, bool wait)
- {
- Console.WriteLine("Resetting machine '{0}'", machineName);
- IResource machine;
- while (true)
- {
- try
- {
- machine = rootPool.GetResourceByName(machineName);
- machine.ChangeResourceStatus("Reset");
- break;
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- System.Threading.Thread.Sleep(5000);
- }
- }
- if (wait)
- {
- Console.WriteLine("Waiting for machine '{0}' to be ready", machineName);
- while (machine.Status != "Ready")
- {
- try
- {
- machine = rootPool.GetResourceByName(machineName);
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- }
- System.Threading.Thread.Sleep(1000);
- }
- Console.WriteLine("Machine '{0}' is ready", machineName);
- }
- }
-
- // Look for a device in a machine, and if not found, keep trying for 3 minutes
- static IDevice GetDevice(IResourcePool rootPool, string machineName, string regexStr)
- {
- Regex deviceRegex = new Regex(regexStr, RegexOptions.IgnoreCase);
- int numAttempts = 1;
- DateTime endTime = DateTime.Now.AddSeconds(180);
- while (DateTime.Now < endTime)
- {
- IResource machine = rootPool.GetResourceByName(machineName);
- Console.WriteLine("Looking for device '{0}' in machine '{1}' (machine has {2} devices)",
- regexStr, machineName, machine.GetDevices().Length);
- foreach (IDevice d in machine.GetDevices())
- {
- if (deviceRegex.IsMatch(d.FriendlyName))
- {
- Console.WriteLine("Found device '{0}'", d.FriendlyName);
- return d;
- }
- }
- Console.WriteLine("Device not found");
- if (numAttempts % 5 == 0)
- ResetMachine(rootPool, machineName, true);
- else
- System.Threading.Thread.Sleep(5000);
- numAttempts++;
- }
- Console.WriteLine("Error: device '{0}' not found", deviceRegex);
- return null;
- }
-
- static int Main(string[] args)
- {
- if (args.Length < 5)
- {
- Console.WriteLine("Error: incorrect number of command line arguments");
- Console.WriteLine("Usage: {0} serverName machinePoolName submissionName timeout machineName0 machineName1 ...",
- System.Environment.GetCommandLineArgs()[0]);
- return 1;
- }
- string serverName = args[0];
- string machinePoolName = args[1];
- string submissionName = args[2];
- double timeout = Convert.ToDouble(args[3]);
-
- List<string> machines = new List<string>();
- for (int i = 4; i < args.Length; i++)
- machines.Add(args[i]);
-
- try
- {
- // Initialize DeviceScript and connect to data store
- Console.WriteLine("Initializing DeviceScript object");
- DeviceScript script = new DeviceScript();
- Console.WriteLine("Connecting to data store");
- script.ConnectToNamedDataStore(serverName);
-
- // Wait for client machines to become available
- IResourcePool rootPool = script.GetResourcePoolByName("$");
- foreach (string machineName in machines)
- FindMachine(rootPool, machineName);
-
- // Delete the machine pool if it already exists
- DeleteResourcePool(script, machinePoolName);
-
- // Create the machine pool and add the client machines to it
- // (this must be done because jobs cannot be scheduled for machines in the
- // default pool)
- try
- {
- script.CreateResourcePool(machinePoolName, rootPool.ResourcePoolId);
- }
- catch (Exception e)
- {
- Console.WriteLine("Warning: " + e.Message);
- }
- IResourcePool newPool = script.GetResourcePoolByName(machinePoolName);
- foreach (string machineName in machines)
- {
- Console.WriteLine("Moving machine '{0}' to pool '{1}'", machineName, machinePoolName);
- rootPool.GetResourceByName(machineName).ChangeResourcePool(newPool);
- }
-
- // Reset client machine
- foreach (string machineName in machines)
- ResetMachine(rootPool, machineName, true);
-
- // Get requested device regex and look for a matching device in the first machine
- Console.WriteLine("Device to test:");
- IDevice device = GetDevice(rootPool, machines[0], Console.ReadLine());
- if (device == null)
- return 1;
-
- // Get requested jobs regex
- Console.WriteLine("Jobs to run:");
- Regex jobRegex = new Regex(Console.ReadLine(), RegexOptions.IgnoreCase);
-
- // Create a submission
- Object[] existingSubmissions = script.GetSubmissionByName(submissionName);
- if (existingSubmissions.Length > 0)
- {
- Console.WriteLine("Submission '{0}' already exists -- removing it",
- submissionName);
- script.DeleteSubmission(((ISubmission)existingSubmissions[0]).Id);
- }
- string hardwareId = device.InstanceId.Remove(device.InstanceId.LastIndexOf("\\"));
- Console.WriteLine("Creating submission '{0}' (hardware ID: {1})", submissionName, hardwareId);
- ISubmission submission = script.CreateHardwareSubmission(submissionName, newPool.ResourcePoolId, hardwareId);
-
- // Set submission DeviceData
- List<Object> deviceDataList = new List<Object>();
- while (true)
- {
- ISubmissionDeviceData dd = script.CreateNewSubmissionDeviceData();
- Console.WriteLine("DeviceData name:");
- dd.Name = Console.ReadLine();
- if (dd.Name.Length == 0)
- break;
- Console.WriteLine("DeviceData data:");
- dd.Data = Console.ReadLine();
- deviceDataList.Add(dd);
- }
- submission.SetDeviceData(deviceDataList.ToArray());
-
- // Set submission descriptors
- List<Object> descriptorList = new List<Object>();
- while (true)
- {
- Console.WriteLine("Descriptor path:");
- string descriptorPath = Console.ReadLine();
- if (descriptorPath.Length == 0)
- break;
- descriptorList.Add(script.GetDescriptorByPath(descriptorPath));
- }
- submission.SetLogoDescriptors(descriptorList.ToArray());
-
- // Set machine dimensions
- foreach (string machineName in machines)
- {
- IResource machine = rootPool.GetResourceByName(machineName);
- while (true)
- {
- Console.WriteLine("Dimension name ({0}):", machineName);
- string dimName = Console.ReadLine();
- if (dimName.Length == 0)
- break;
- Console.WriteLine("Dimension value ({0}):", machineName);
- machine.SetDimension(dimName, Console.ReadLine());
- }
- // Set the WDKSubmissionId dimension for all machines
- machine.SetDimension("WDKSubmissionId", submission.Id.ToString() + "_" + submission.Name);
- }
-
- // Get job parameters
- List<string> paramNames = new List<string>();
- List<string> paramValues = new List<string>();
- foreach (string machineName in machines)
- {
- while (true)
- {
- Console.WriteLine("Parameter name ({0}):", machineName);
- string paramName = Console.ReadLine();
- if (paramName.Length == 0)
- break;
- Console.WriteLine("Device regex ({0}):", machineName);
- IDevice d = GetDevice(rootPool, machineName, Console.ReadLine());
- if (d == null)
- return 1;
- string deviceName = d.GetAttribute("name")[0].ToString();
- Console.WriteLine("Setting parameter value to '{0}'", deviceName);
- paramNames.Add(paramName);
- paramValues.Add(deviceName);
- }
- }
-
- // Find jobs that match the requested pattern
- Console.WriteLine("Scheduling jobs:");
- List<IJob> jobs = new List<IJob>();
- foreach (IJob j in submission.GetJobs())
- {
- if (jobRegex.IsMatch(j.Name))
- {
- Console.WriteLine(" " + j.Name);
- // Set job parameters
- for (int i = 0; i < paramNames.Count; i++)
- {
- IParameter p = j.GetParameterByName(paramNames[i]);
- if (p != null)
- p.ScheduleValue = paramValues[i];
- }
- jobs.Add(j);
- }
- }
- if (jobs.Count == 0)
- {
- Console.WriteLine("Error: no submission jobs match pattern '{0}'", jobRegex);
- return 1;
- }
-
- // Create a schedule, add jobs to it and run it
- ISchedule schedule = script.CreateNewSchedule();
- foreach (IScheduleItem item in submission.ProcessJobs(jobs.ToArray()))
- {
- item.Device = device;
- schedule.AddScheduleItem(item);
- }
- schedule.AddSubmission(submission);
- schedule.SetResourcePool(newPool);
- script.RunSchedule(schedule);
-
- // Wait for jobs to complete
- Console.WriteLine("Waiting for all jobs to complete (timeout={0}s)", timeout);
- DateTime endTime = DateTime.Now.AddSeconds(timeout);
- int numCompleted, numFailed;
- do
- {
- System.Threading.Thread.Sleep(30000);
- // Report results in a Python readable format and count completed and failed schedule jobs
- numCompleted = numFailed = 0;
- Console.WriteLine();
- Console.WriteLine("---- [");
- foreach (IResult r in schedule.GetResults())
- {
- if (r.ResultStatus != "InProgress") numCompleted++;
- if (r.ResultStatus == "Investigate") numFailed++;
- Console.WriteLine(" {");
- Console.WriteLine(" 'id': {0}, 'job': r'''{1}''',", r.Job.Id, r.Job.Name);
- Console.WriteLine(" 'logs': r'''{0}''',", r.LogLocation);
- if (r.ResultStatus != "InProgress")
- Console.WriteLine(" 'report': r'''{0}''',",
- submission.GetSubmissionResultReport(r));
- Console.WriteLine(" 'status': '{0}',", r.ResultStatus);
- Console.WriteLine(" 'pass': {0}, 'fail': {1}, 'notrun': {2}, 'notapplicable': {3}",
- r.Pass, r.Fail, r.NotRun, r.NotApplicable);
- Console.WriteLine(" },");
- }
- Console.WriteLine("] ----");
- } while (numCompleted < schedule.GetResults().Length && DateTime.Now < endTime);
-
- Console.WriteLine();
-
- // Cancel incomplete jobs
- foreach (IResult r in schedule.GetResults())
- if (r.ResultStatus == "InProgress")
- r.Cancel();
-
- // Reset the machines
- foreach (string machineName in machines)
- ResetMachine(rootPool, machineName, false);
-
- // Report failures
- if (numCompleted < schedule.GetResults().Length)
- Console.WriteLine("Some jobs did not complete on time.");
- if (numFailed > 0)
- Console.WriteLine("Some jobs failed.");
- if (numFailed > 0 || numCompleted < schedule.GetResults().Length)
- return 1;
-
- Console.WriteLine("All jobs completed.");
- return 0;
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: " + e.Message);
- return 1;
- }
- }
- }
-}
diff --git a/client/tests/kvm/deps/whql_submission_15.exe b/client/tests/kvm/deps/whql_submission_15.exe
deleted file mode 100644
index 605e2e3..0000000
--- a/client/tests/kvm/deps/whql_submission_15.exe
+++ /dev/null
Binary files differ
diff --git a/client/tests/kvm/get_started.py b/client/tests/kvm/get_started.py
deleted file mode 100755
index 4a40925..0000000
--- a/client/tests/kvm/get_started.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/python
-"""
-Program to help setup kvm test environment
-
-@copyright: Red Hat 2010
-"""
-
-import os, sys, logging, shutil, glob
-import common
-from autotest_lib.client.common_lib import logging_manager
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils
-
-
-def check_iso(url, destination, hash):
- """
- Verifies if ISO that can be find on url is on destination with right hash.
-
- This function will verify the SHA1 hash of the ISO image. If the file
- turns out to be missing or corrupted, let the user know we can download it.
-
- @param url: URL where the ISO file can be found.
- @param destination: Directory in local disk where we'd like the iso to be.
- @param hash: SHA1 hash for the ISO image.
- """
- file_ok = False
- if not destination:
- os.makedirs(destination)
- iso_path = os.path.join(destination, os.path.basename(url))
- if not os.path.isfile(iso_path):
- logging.warning("File %s not found", iso_path)
- logging.warning("Expected SHA1 sum: %s", hash)
- answer = utils.ask("Would you like to download it from %s?" % url)
- if answer == 'y':
- try:
- utils.unmap_url_cache(destination, url, hash, method="sha1")
- file_ok = True
- except EnvironmentError, e:
- logging.error(e)
- else:
- logging.warning("Missing file %s", iso_path)
- logging.warning("Please download it or put an exsiting copy on the "
- "appropriate location")
- return
- else:
- logging.info("Found %s", iso_path)
- logging.info("Expected SHA1 sum: %s", hash)
- answer = utils.ask("Would you like to check %s? It might take a while" %
- iso_path)
- if answer == 'y':
- try:
- utils.unmap_url_cache(destination, url, hash, method="sha1")
- file_ok = True
- except EnvironmentError, e:
- logging.error(e)
- else:
- logging.info("File %s present, but chose to not verify it",
- iso_path)
- return
-
- if file_ok:
- logging.info("%s present, with proper checksum", iso_path)
-
-
-if __name__ == "__main__":
- logging_manager.configure_logging(virt_utils.VirtLoggingConfig(),
- verbose=True)
- logging.info("KVM test config helper")
-
- logging.info("")
- logging.info("1 - Verifying directories (check if the directory structure "
- "expected by the default test config is there)")
- base_dir = "/tmp/kvm_autotest_root"
- sub_dir_list = ["images", "isos", "steps_data"]
- for sub_dir in sub_dir_list:
- sub_dir_path = os.path.join(base_dir, sub_dir)
- if not os.path.isdir(sub_dir_path):
- logging.debug("Creating %s", sub_dir_path)
- os.makedirs(sub_dir_path)
- else:
- logging.debug("Dir %s exists, not creating" %
- sub_dir_path)
- logging.info("")
- logging.info("2 - Creating config files from samples (copy the default "
- "config samples to actual config files)")
- kvm_test_dir = os.path.dirname(sys.modules[__name__].__file__)
- kvm_test_dir = os.path.abspath(kvm_test_dir)
- config_file_list = glob.glob(os.path.join(kvm_test_dir, "*.cfg.sample"))
- for config_file in config_file_list:
- src_file = config_file
- dst_file = config_file.rstrip(".sample")
- if not os.path.isfile(dst_file):
- logging.debug("Creating config file %s from sample", dst_file)
- shutil.copyfile(src_file, dst_file)
- else:
- logging.debug("Config file %s exists, not touching" % dst_file)
-
- logging.info("")
- logging.info("3 - Verifying iso (make sure we have the OS ISO needed for "
- "the default test set)")
-
- iso_name = "Fedora-15-x86_64-DVD.iso"
- fedora_dir = "pub/fedora/linux/releases/15/Fedora/x86_64/iso"
- url = os.path.join("http://download.fedoraproject.org/", fedora_dir,
- iso_name)
- hash = "61b3407f62bac22d3a3b2e919c7fc960116012d7"
- destination = os.path.join(base_dir, 'isos', 'linux')
- path = os.path.join(destination, iso_name)
- check_iso(url, destination, hash)
-
- logging.info("")
- logging.info("4 - Verifying winutils.iso (make sure we have the utility "
- "ISO needed for Windows testing)")
-
- logging.info("In order to run the KVM autotests in Windows guests, we "
- "provide you an ISO that this script can download")
-
- url = "http://people.redhat.com/mrodrigu/kvm/winutils.iso"
- hash = "02930224756510e383c44c49bffb760e35d6f892"
- destination = os.path.join(base_dir, 'isos', 'windows')
- path = os.path.join(destination, iso_name)
- check_iso(url, destination, hash)
-
- logging.info("")
- logging.info("5 - Checking if qemu is installed (certify qemu and qemu-kvm "
- "are in the place the default config expects)")
- qemu_default_paths = ['/usr/bin/qemu-kvm', '/usr/bin/qemu-img']
- for qemu_path in qemu_default_paths:
- if not os.path.isfile(qemu_path):
- logging.warning("No %s found. You might need to install qemu-kvm.",
- qemu_path)
- else:
- logging.debug("%s present", qemu_path)
- logging.info("If you wish to change qemu-kvm to qemu or other binary path, "
- "you will have to modify tests.cfg")
-
- logging.info("")
- logging.info("6 - Checking for the KVM module (make sure kvm is loaded "
- "to accelerate qemu-kvm)")
- if not utils.module_is_loaded("kvm"):
- logging.warning("KVM module is not loaded. You might want to load it")
- else:
- logging.debug("KVM module loaded")
-
- logging.info("")
- logging.info("7 - Verify needed packages to get started")
- logging.info("Please take a look at the online documentation "
- "http://www.linux-kvm.org/page/KVM-Autotest/Client_Install "
- "(session 'Install Prerequisite packages')")
-
- client_dir = os.path.abspath(os.path.join(kvm_test_dir, "..", ".."))
- autotest_bin = os.path.join(client_dir, 'bin', 'autotest')
- control_file = os.path.join(kvm_test_dir, 'control')
-
- logging.info("")
- logging.info("When you are done fixing eventual warnings found, "
- "you can run the kvm test using the command line AS ROOT:")
- logging.info("%s %s", autotest_bin, control_file)
- logging.info("Autotest prints the results dir, so you can look at DEBUG "
- "logs if something went wrong")
- logging.info("You can also edit the test config files (see output of "
- "step 2 for a list)")
diff --git a/client/tests/kvm/guest-os.cfg.sample b/client/tests/kvm/guest-os.cfg.sample
deleted file mode 100644
index 1384b71..0000000
--- a/client/tests/kvm/guest-os.cfg.sample
+++ /dev/null
@@ -1,1521 +0,0 @@
-# Copy this file to guest_os.cfg and edit it.
-#
-variants:
- # Linux section
- - @Linux:
- shutdown_command = shutdown -h now
- reboot_command = shutdown -r now
- status_test_command = echo $?
- username = root
- password = 123456
- shell_client = ssh
- shell_port = 22
- file_transfer_client = scp
- file_transfer_port = 22
- mem_chk_cmd = dmidecode -t 17 | awk -F: '/Size/ {print $2}'
- mem_chk_cur_cmd = grep MemTotal /proc/meminfo
- cpu_chk_cmd = grep -c processor /proc/cpuinfo
- unattended_install:
- # If you want to use floppy to hold kickstarts,
- # comment the 3 lines below
- cdroms += " unattended"
- drive_index_unattended = 1
- drive_index_cd1 = 2
- timedrift:
- extra_params += " -no-kvm-pit-reinjection"
- time_command = date +'TIME: %a %m/%d/%Y %H:%M:%S.%N'
- time_filter_re = "(?:TIME: \w\w\w )(.{19})(?:\.\d\d)"
- time_format = "%m/%d/%Y %H:%M:%S"
- guest_load_command = "dd if=/dev/urandom of=/dev/null"
- guest_load_instances = 2
- guest_load_stop_command = "killall -9 dd"
- host_load_command = "bzip2 -c --best /dev/urandom > /dev/null"
- host_load_instances = 8
- ntp:
- time_command = "ntpdate -d -q ns1.nay.redhat.com"
- time_filter_re = "originate timestamp:.*, (.\w+\s+\d+\s+\d+\s+\d+:\d+:\d+)\.(.\d+)"
- time_format = "%b %d %Y %H:%M:%S"
- date:
- time_command = date +'TIME: %a %m/%d/%Y %H:%M:%S.%N'
- time_filter_re = "(?:TIME: \w\w\w )(.{19})(?:\.\d\d)"
- time_format = "%m/%d/%Y %H:%M:%S"
- file_transfer:
- tmp_dir = /tmp/
- clean_cmd = rm -f
- nicdriver_unload:
- readlink_command = readlink -e
- sys_path = "/sys/class/net/%s/device/driver"
- multi_disk:
- show_mount_cmd = mount|gawk '/mnt/{print $1}'
- clean_cmd = "\rm -rf /mnt/*"
- cmd_list = "copy_to_command copy_from_command"
- file_system = "ext3 ext2"
- mount_command = mkdir /mnt/%s && mount /dev/%s /mnt/%s
- umount_command = umount /dev/%s && rmdir /mnt/%s
- list_volume_command = cd /dev && \ls [vhs]d?
- re_str = "[vhs]d[a-z]"
- format_command = echo y | mkfs -t %s /dev/%s
- copy_to_command = \cp -rf /bin/ls /mnt/%s
- copy_from_command = \cp -rf /mnt/%s/ls /tmp/ls
- compare_command = cd /bin && md5sum ls > /tmp/ls.md5 && cd /tmp && md5sum -c ls.md5
- check_result_key_word = OK
- max_disk:
- images += " stg24 stg25 stg26 stg27"
- image_name_stg24 = storage24
- image_name_stg25 = storage25
- image_name_stg26 = storage26
- image_name_stg27 = storage27
- list_volume_command = cd /dev && \ls vd*
- re_str = "[vhs]d[a-z][^0-9]"
- floppy:
- format_floppy_cmd = mkfs -t ext3 /dev/fd0
- test_floppy_cmd = (dd if=/dev/urandom of=/mnt/test_floppy bs=1M count=1) && (rm -f /mnt/test_floppy)
- format_floppy_cmd = mkfs -t ext3 /dev/fd0
- source_file = /etc/passwd
- dest_file = /mnt/passwd
- clean_cmd = rm -f
- mount_dir = /mnt/
- diff_file_cmd = diff
- copy_cmd = cp
-
- variants:
- - CustomGuestLinux:
- image_name = custom_image
- image_size = 10G
- #image_name = /dev/mapper/vg_some_label
- #image_type_raw = yes
-
- - Fedora:
- no setup
- shell_prompt = "^\[.*\][\#\$]\s*$"
- unattended_install:
- boot_path = "images/pxeboot"
- # You have to use ks=floppy if you want to use floppies to
- # hold your kickstart file
- #extra_params += " --append 'ks=floppy nicdelay=60 console=ttyS0,115200 console=tty0'"
- extra_params += " --append 'ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0'"
- variants:
- - 8.32:
- no setup
- image_name = fc8-32
- install:
- steps = steps/Fedora-8-i386.steps
- cdrom_cd1 = isos/linux/Fedora-8-i386-DVD.iso
- md5sum_cd1 = dd6c79fddfff36d409d02242e7b10189
- md5sum_1m_cd1 = dabae451bb69fbbad0e505b25144b1f9
- unattended_install:
- unattended_file = unattended/Fedora-8.ks
- #floppy = images/f8-32/ks.vfd
- cdrom_unattended = images/f8-32/ks.iso
- kernel = images/f8-32/vmlinuz
- initrd = images/f8-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-8-i386-DVD.iso
- md5sum_cd1 = dd6c79fddfff36d409d02242e7b10189
- md5sum_1m_cd1 = dabae451bb69fbbad0e505b25144b1f9
-
- - 8.64:
- no setup
- image_name = f8-64
- install:
- steps = steps/Fedora-8-64.steps
- cdrom_cd1 = isos/linux/Fedora-8-x86_64-DVD.iso
- md5sum_cd1 = 2cb231a86709dec413425fd2f8bf5295
- md5sum_1m_cd1 = 145f6414e19492649a56c89f0a45e719
- unattended_install:
- unattended_file = unattended/Fedora-8.ks
- #floppy = images/f8-64/ks.vfd
- cdrom_unattended = images/f8-64/ks.iso
- kernel = images/f8-64/vmlinuz
- initrd = images/f8-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-8-x86_64-DVD.iso
- md5sum_cd1 = 2cb231a86709dec413425fd2f8bf5295
- md5sum_1m_cd1 = 145f6414e19492649a56c89f0a45e719
-
- - 9.32:
- image_name = f9-32
- install:
- steps = steps/Fedora-9-i386.steps
- cdrom_cd1 = isos/linux/Fedora-9-i386-DVD.iso
- md5sum_cd1 = 72601f685ea8c808c303353d8bf4d307
- md5sum_1m_cd1 = f24fa25689e5863f1b99984c6feb787f
- unattended_install:
- unattended_file = unattended/Fedora-9.ks
- #floppy = images/f9-32/ks.vfd
- cdrom_unattended = images/f9-32/ks.iso
- kernel = images/f9-32/vmlinuz
- initrd = images/f9-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-9-i386-DVD.iso
- md5sum_cd1 = 72601f685ea8c808c303353d8bf4d307
- md5sum_1m_cd1 = f24fa25689e5863f1b99984c6feb787f
-
- - 9.64:
- image_name = f9-64
- install:
- steps = steps/Fedora-9-64.steps
- cdrom_cd1 = isos/linux/Fedora-9-x86_64-DVD.iso
- md5sum_cd1 = 05b2ebeed273ec54d6f9ed3d61ea4c96
- md5sum_1m_cd1 = 9822ab5097e37e8fe306ef2192727db4
- unattended_install:
- unattended_file = unattended/Fedora-9.ks
- #floppy = images/f9-64/ks.vfd
- cdrom_unattended = images/f9-64/ks.iso
- kernel = images/f9-64/vmlinuz
- initrd = images/f9-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-9-x86_64-DVD.iso
- md5sum_cd1 = 05b2ebeed273ec54d6f9ed3d61ea4c96
- md5sum_1m_cd1 = 9822ab5097e37e8fe306ef2192727db4
-
-
- - 10.32:
- image_name = f10-32
- unattended_install:
- unattended_file = unattended/Fedora-10.ks
- #floppy = images/f10-32/ks.vfd
- cdrom_unattended = images/f10-32/ks.iso
- kernel = images/f10-32/vmlinuz
- initrd = images/f10-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-10-i386-DVD.iso
- md5sum_cd1 = 27e581edb392728c4a07d00d3fc5ced0
- md5sum_1m_cd1 = bd67c68bdf595e4ba7131ec702159181
-
- - 10.64:
- image_name = f10-64
- unattended_install:
- unattended_file = unattended/Fedora-10.ks
- #floppy = images/f10-64/ks.vfd
- cdrom_unattended = images/f10-64/ks.iso
- kernel = images/f10-64/vmlinuz
- initrd = images/f10-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-10-x86_64-DVD.iso
- sha1sum_cd1 = f1e5ae7db6a1ba227de7294c4112385922388648
- md5sum_1m_cd1 = 732857cbf40c80c34683e874601d982c
-
- - 11.32:
- image_name = f11-32
- install:
- steps = steps/Fedora-11-32.steps
- unattended_install:
- unattended_file = unattended/Fedora-11.ks
- #floppy = images/f11-32/ks.vfd
- cdrom_unattended = images/f11-32/ks.iso
- kernel = images/f11-32/vmlinuz
- initrd = images/f11-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-11-i386-DVD.iso
- md5sum_cd1 = e3b1e2d1ba42aa4705fa5f41771b3927
- md5sum_1m_cd1 = dc8ddf90648c247339c721395aa49714
-
- - 11.64:
- image_name = f11-64
- unattended_install:
- unattended_file = unattended/Fedora-11.ks
- #floppy = images/f11-64/ks.vfd
- cdrom_unattended = images/f11-64/ks.iso
- kernel = images/f11-64/vmlinuz
- initrd = images/f11-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-11-x86_64-DVD.iso
- md5sum_cd1 = 9d419844adeb93120215fe7505c9bce8
- md5sum_1m_cd1 = 405ee05e2387a2e4328b008d5bcbdd1e
-
- - 12.32:
- image_name = f12-32
- unattended_install:
- unattended_file = unattended/Fedora-12.ks
- #floppy = images/f12-32/ks.vfd
- cdrom_unattended = images/f12-32/ks.iso
- kernel = images/f12-32/vmlinuz
- initrd = images/f12-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-12-i386-DVD.iso
- md5sum_cd1 = 2c4c1c0d09f2fbcfd8ee6a0c5542eeb2
- md5sum_1m_cd1 = eee935d7f0cf2ef03f6ddce3a2a50050
-
- - 12.64:
- image_name = f12-64
- unattended_install:
- unattended_file = unattended/Fedora-12.ks
- #floppy = images/f12-64/ks.vfd
- cdrom_unattended = images/f12-64/ks.iso
- kernel = images/f12-64/vmlinuz
- initrd = images/f12-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-12-x86_64-DVD.iso
- md5sum_cd1 = 6dd31e292cc2eb1140544e9b1ba61c56
- md5sum_1m_cd1 = 514efbd7698b55ff6768c8605438bfc5
-
- - 13.32:
- image_name = f13-32
- unattended_install:
- unattended_file = unattended/Fedora-13.ks
- #floppy = images/f13-32/ks.vfd
- cdrom_unattended = images/f13-32/ks.iso
- kernel = images/f13-32/vmlinuz
- initrd = images/f13-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-13-i386-DVD.iso
- md5sum_cd1 = 212fec517c2629b4b5eaf3662ac13136
- md5sum_1m_cd1 = 4e1578a6ed5a6e7cd03b8fb074030746
-
- - 13.64:
- image_name = f13-64
- unattended_install:
- unattended_file = unattended/Fedora-13.ks
- #floppy = images/f13-64/ks.vfd
- cdrom_unattended = images/f13-64/ks.iso
- kernel = images/f13-64/vmlinuz
- initrd = images/f13-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-13-x86_64-DVD.iso
- md5sum_cd1 = 6fbae6379cf27f36e1f2c7827ba7dc35
- md5sum_1m_cd1 = 68821b9de4d3b5975d6634334e7f47a6
-
- - 14.32:
- image_name = f14-32
- unattended_install:
- unattended_file = unattended/Fedora-14.ks
- #floppy = images/f14-32/ks.vfd
- cdrom_unattended = images/f14-32/ks.iso
- kernel = images/f14-32/vmlinuz
- initrd = images/f14-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-14-i386-DVD.iso
- md5sum_cd1 = 1cc67641506d2f931d669b8d3528dded
- md5sum_1m_cd1 = d314ab126dabab686111e6a0d71d2e67
-
- - 14.64:
- image_name = f14-64
- unattended_install:
- unattended_file = unattended/Fedora-14.ks
- #floppy = images/f14-64/ks.vfd
- cdrom_unattended = images/f14-64/ks.iso
- kernel = images/f14-64/vmlinuz
- initrd = images/f14-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-14-x86_64-DVD.iso
- md5sum_cd1 = f2ebf941dc45f99ee3e8a457c9544552
- md5sum_1m_cd1 = df029f9cffbc3517937a91124a1e0c3a
-
- - 15.32:
- image_name = f15-32
- unattended_install:
- unattended_file = unattended/Fedora-15.ks
- #floppy = images/f15-32/ks.vfd
- cdrom_unattended = images/f15-32/ks.iso
- kernel = images/f15-32/vmlinuz
- initrd = images/f15-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-15-i386-DVD.iso
- md5sum_cd1 = 9a91492ac84dde9ceff0cb346a079487
- md5sum_1m_cd1 = 82a6005e8b7740628c6e53eef92f6bc1
-
- - 15.64:
- image_name = f15-64
- unattended_install:
- unattended_file = unattended/Fedora-15.ks
- #floppy = images/f15-64/ks.vfd
- cdrom_unattended = images/f15-64/ks.iso
- kernel = images/f15-64/vmlinuz
- initrd = images/f15-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/Fedora-15-x86_64-DVD.iso
- md5sum_cd1 = c122a2a4f478da4a3d2d12396e84244e
- md5sum_1m_cd1 = c02f37e293bbc85be02a7c850a61273a
-
- - RHEL:
- no setup
- shell_prompt = "^\[.*\][\#\$]\s*$"
- nic_hotplug:
- modprobe_module = acpiphp
- block_hotplug:
- modprobe_module = acpiphp
- no block_scsi
- unattended_install:
- boot_path = images/pxeboot
- # You have to use ks=floppy if you want to use floppies to
- # hold your kickstart file
- #extra_params += " --append 'ks=floppy nicdelay=60 console=ttyS0,115200 console=tty0'"
- extra_params += " --append 'ks=cdrom nicdelay=60 console=ttyS0,115200 console=tty0'"
-
- variants:
- - 3.9.i386:
- no setup autotest linux_s3 guest_s4 shutdown multi_disk
- image_name = rhel3.9-32
- mem_chk_cmd = dmidecode | awk -F: '/Maximum Capacity/ {print $2}'
- install:
- steps = steps/RHEL-3.9-i386.steps
- cdrom_cd1 = isos/linux/RHEL-3.9-i386-DVD.iso
- md5sum_cd1 = ddd11a1cb104119039b0fa05df6d52b8
- md5sum_1m_cd1 = 5f10c9417c7b8372b3456c1b5f3f9ed0
- unattended_install:
- unattended_file = unattended/RHEL-3-series.ks
- #floppy = images/rhel39-32/ks.vfd
- cdrom_unattended = images/rhel39-32/ks.iso
- kernel = images/rhel39-32/vmlinuz
- initrd = images/rhel39-32/initrd.img
- # 3.X anaconda does not support 'poweroff' on ks
- shutdown_cleanly = no
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-3.9-i386-DVD.iso
- md5sum_cd1 = ddd11a1cb104119039b0fa05df6d52b8
- md5sum_1m_cd1 = 5f10c9417c7b8372b3456c1b5f3f9ed0
-
- - 3.9.x86_64:
- no setup autotest linux_s3 guest_s4 shutdown multi_disk
- image_name = rhel3.9-64
- mem_chk_cmd = dmidecode | awk -F: '/Maximum Capacity/ {print $2}'
- install:
- steps = steps/RHEL-3.9-x86_64.steps
- cdrom_cd1 = isos/linux/RHEL-3.9-x86_64-DVD.iso
- md5sum_cd1 = bf4635e4a4bd3b43838e72bc8c329d55
- md5sum_1m_cd1 = 18ecd37b639109f1b2af05cfb57dfeaf
- unattended_install:
- unattended_file = unattended/RHEL-3-series.ks
- #floppy = images/rhel39-64/ks.vfd
- cdrom_unattended = images/rhel39-64/ks.iso
- kernel = images/rhel39-64/vmlinuz
- initrd = images/rhel39-64/initrd.img
- # 3.X anaconda does not support 'poweroff' on ks
- shutdown_cleanly = no
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-3.9-x86_64-DVD.iso
- md5sum_cd1 = bf4635e4a4bd3b43838e72bc8c329d55
- md5sum_1m_cd1 = 18ecd37b639109f1b2af05cfb57dfeaf
-
- - 4.7.i386:
- no setup autotest
- image_name = rhel4.7-32
- install:
- steps = steps/RHEL-4.7-i386.steps
- cdrom_cd1 = isos/linux/RHEL-4.7-i386-DVD.iso
- md5sum_cd1 = ee5092653732a88ddbaf8eef2484c500
- md5sum_1m_cd1 = 127081cbed825d7232331a2083975528
- unattended_install:
- unattended_file = unattended/RHEL-4-series.ks
- #floppy = images/rhel47-32/ks.vfd
- cdrom_unattended = images/rhel47-32/ks.iso
- kernel = images/rhel47-32/vmlinuz
- initrd = images/rhel47-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-4.7-i386-DVD.iso
- md5sum_cd1 = ee5092653732a88ddbaf8eef2484c500
- md5sum_1m_cd1 = 127081cbed825d7232331a2083975528
- fillup_disk:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
- lvm.lvm_fill:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
-
- - 4.7.x86_64:
- no setup autotest
- image_name = rhel4.7-64
- install:
- steps = steps/RHEL-4.7-x86_64.steps
- cdrom_cd1 = isos/linux/RHEL-4.7-x86_64-DVD.iso
- md5sum_cd1 = ea9dae16dd86f7d94092d0e672333292
- md5sum_1m_cd1 = 58fa63eaee68e269f4cb1d2edf479792
- unattended_install:
- unattended_file = unattended/RHEL-4-series.ks
- #floppy = images/rhel47-64/ks.vfd
- cdrom_unattended = images/rhel47-64/ks.iso
- kernel = images/rhel47-64/vmlinuz
- initrd = images/rhel47-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-4.7-x86_64-DVD.iso
- md5sum_cd1 = ea9dae16dd86f7d94092d0e672333292
- md5sum_1m_cd1 = 58fa63eaee68e269f4cb1d2edf479792
- fillup_disk:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
- lvm.lvm_fill:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
-
- - 4.8.i386:
- no setup autotest
- image_name = rhel4.8-32
- unattended_install:
- unattended_file = unattended/RHEL-4-series.ks
- #floppy = images/rhel48-32/ks.vfd
- cdrom_unattended = images/rhel48-32/ks.iso
- kernel = images/rhel48-32/vmlinuz
- initrd = images/rhel48-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-4.8-i386-DVD.iso
- md5sum_cd1 = b024f0af5079539d3ef51f71fed0b194
- md5sum_1m_cd1 = 969c197402b9058f28a278c1f807d15b
- nicdriver_unload:
- readlink_command = readlink -f
- sys_path = "/sys/class/net/%s/driver"
- fillup_disk:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
- lvm.lvm_fill:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
-
- - 4.8.x86_64:
- no setup autotest
- image_name = rhel4.8-64
- unattended_install:
- unattended_file = unattended/RHEL-4-series.ks
- #floppy = images/rhel48-64/ks.vfd
- cdrom_unattended = images/rhel48-64/ks.iso
- kernel = images/rhel48-64/vmlinuz
- initrd = images/rhel48-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-4.8-x86_64-DVD.iso
- md5sum_cd1 = 696bc877b0200cc942626673fcc3fc09
- md5sum_1m_cd1 = b11ac0ef7fd345ad712966972db63886
- nicdriver_unload:
- readlink_command = readlink -f
- sys_path = "/sys/class/net/%s/driver"
- fillup_disk:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
- lvm.lvm_fill:
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1"
-
- - 5.3.i386:
- no setup
- image_name = rhel5.3-32
- install:
- steps = steps/RHEL-5.3-i386.steps
- cdrom_cd1 = isos/linux/RHEL-5.3-i386-DVD.iso
- md5sum_cd1 = 371c62851611fd32ead440df6f24a296
- md5sum_1m_cd1 = 242318dd44152210f6ff6cdda1bfbf51
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel53-32/ks.vfd
- cdrom_unattended = images/rhel53-32/ks.iso
- kernel = images/rhel53-32/vmlinuz
- initrd = images/rhel53-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.3-i386-DVD.iso
- md5sum_cd1 = 371c62851611fd32ead440df6f24a296
- md5sum_1m_cd1 = 242318dd44152210f6ff6cdda1bfbf51
-
- - 5.3.x86_64:
- no setup
- image_name = rhel5.3-64
- install:
- steps = steps/RHEL-5.3-x86_64.steps
- cdrom_cd1 = isos/linux/RHEL-5.3-x86_64-DVD.iso
- md5sum_cd1 = c5ed6b284410f4d8212cafc78fd7a8c5
- md5sum_1m_cd1 = b999f437583098ea5bbd56fb1de1d011
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel53-64/ks.vfd
- cdrom_unattended = images/rhel53-64/ks.iso
- kernel = images/rhel53-64/vmlinuz
- initrd = images/rhel53-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.3-x86_64-DVD.iso
- md5sum_cd1 = c5ed6b284410f4d8212cafc78fd7a8c5
- md5sum_1m_cd1 = b999f437583098ea5bbd56fb1de1d011
-
- - 5.4.i386:
- no setup
- image_name = rhel5.4-32
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel54-32/ks.vfd
- cdrom_unattended = images/rhel54-32/ks.iso
- kernel = images/rhel54-32/vmlinuz
- initrd = images/rhel54-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.4-i386-DVD.iso
- md5sum_cd1 = 7a12ec6599527e4f3d1790b51eadbfed
- md5sum_1m_cd1 = 0dbeb8f58d213752d8c029e8601abfbb
-
- - 5.4.x86_64:
- no setup
- image_name = rhel5.4-64
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel54-64/ks.vfd
- cdrom_unattended = images/rhel54-64/ks.iso
- kernel = images/rhel54-64/vmlinuz
- initrd = images/rhel54-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.4-x86_64-DVD.iso
- md5sum_cd1 = 04fe3c10202402d7b389528d2bad0210
- md5sum_1m_cd1 = 3e74112003e88a966754849dbb8f5c3f
-
- - 5.5.i386:
- no setup
- image_name = rhel5.5-32
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel55-32/ks.vfd
- cdrom_unattended = images/rhel55-32/ks.iso
- kernel = images/rhel55-32/vmlinuz
- initrd = images/rhel55-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.5-i386-DVD.iso
- md5sum_cd1 = 148858b157f275d9153797efddfc83c3
- md5sum_1m_cd1 = 2502cc7ddb9d0684fe08c4a83d247902
-
- - 5.5.x86_64:
- no setup
- image_name = rhel5.5-64
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel55-64/ks.vfd
- cdrom_unattended = images/rhel55-64/ks.iso
- kernel = images/rhel55-64/vmlinuz
- initrd = images/rhel55-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.5-x86_64-DVD.iso
- md5sum_cd1 = f3119f883257ef9041234feda2f1cad0
- md5sum_1m_cd1 = a744084a03f6a08627f71527fc107a1e
-
- - 5.6.i386:
- no setup
- image_name = rhel5.6-32
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel56-32/ks.vfd
- cdrom_unattended = images/rhel56-32/ks.iso
- kernel = images/rhel56-32/vmlinuz
- initrd = images/rhel56-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.6-i386-DVD.iso
- md5sum_cd1 = c214653d91b81c9a7a7f7249753d0f5d
- md5sum_1m_cd1 = f299a881950bfec81fd5c74484e1b1d4
-
- - 5.6.x86_64:
- no setup
- image_name = rhel5.6-64
- unattended_install:
- unattended_file = unattended/RHEL-5-series.ks
- #floppy = images/rhel56-64/ks.vfd
- cdrom_unattended = images/rhel56-64/ks.iso
- kernel = images/rhel56-64/vmlinuz
- initrd = images/rhel56-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-5.6-x86_64-DVD.iso
- md5sum_cd1 = d77d3815afb381a50148ba55ad930679
- md5sum_1m_cd1 = 9dd97de110e391fcbed88b124a60f7a9
-
- - 6.0.i386:
- no setup
- nic_hotplug:
- modprobe_module =
- block_hotplug:
- modprobe_module =
- image_name = rhel6.0-32
- unattended_install:
- unattended_file = unattended/RHEL-6-series.ks
- #floppy = images/rhel60-32/ks.vfd
- cdrom_unattended = images/rhel60-32/ks.iso
- kernel = images/rhel60-32/vmlinuz
- initrd = images/rhel60-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-6.0-i386-DVD.iso
- md5sum_cd1 = 291d234c93442405972689b4b41c14bc
- md5sum_1m_cd1 = ee2cc3d3babe91a1d581a07099c4318b
-
- - 6.0.x86_64:
- no setup
- nic_hotplug:
- modprobe_module =
- block_hotplug:
- modprobe_module =
- image_name = rhel6.0-64
- unattended_install:
- unattended_file = unattended/RHEL-6-series.ks
- #floppy = images/rhel60-64/ks.vfd
- cdrom_unattended = images/rhel60-64/ks.iso
- kernel = images/rhel60-64/vmlinuz
- initrd = images/rhel60-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-6.0-x86_64-DVD.iso
- md5sum_cd1 = f7141396c6a19399d63e8c195354317d
- md5sum_1m_cd1 = b060eeef63e2c8700db54ae02056e80c
-
- - 6.1.i386:
- no setup
- nic_hotplug:
- modprobe_module =
- block_hotplug:
- modprobe_module =
- image_name = rhel6.1-32
- unattended_install:
- unattended_file = unattended/RHEL-6-series.ks
- #floppy = images/rhel61-32/ks.vfd
- cdrom_unattended = images/rhel61-32/ks.iso
- kernel = images/rhel61-32/vmlinuz
- initrd = images/rhel61-32/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-6.1-i386-DVD.iso
- md5sum_cd1 = f8c8a310e34d26339c99d462e3557324
- md5sum_1m_cd1 = 12f7692e6e20be0d42b9407d956f74c3
-
- - 6.1.x86_64:
- no setup
- nic_hotplug:
- modprobe_module =
- block_hotplug:
- modprobe_module =
- image_name = rhel6.1-64
- unattended_install:
- unattended_file = unattended/RHEL-6-series.ks
- #floppy = images/rhel61-64/ks.vfd
- cdrom_unattended = images/rhel61-64/ks.iso
- kernel = images/rhel61-64/vmlinuz
- initrd = images/rhel61-64/initrd.img
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/RHEL-6.1-x86_64-DVD.iso
- md5sum_cd1 = a051dbf28ef444a019dc6660efe3e3a4
- md5sum_1m_cd1 = cb3b9d140404a6797b0f423dfe620ab8
-
- - OpenSUSE:
- no setup
- shell_prompt = ".*:.*\s#"
- unattended_install:
- # You have to use autoyast=floppy if you want to use floppies to
- # hold your autoyast file
- #extra_params += " --append 'autoyast=floppy console=ttyS0,115200 console=tty0'"
- extra_params += " --append 'autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0'"
- wait_no_ack = yes
-
- variants:
- - 11.0.32:
- image_name = openSUSE-11.0-32
- install:
- steps = steps/openSUSE-11.0-32.steps
- cdrom_cd1 = isos/linux/openSUSE-11.0-DVD-i386.iso
- md5sum_cd1 = ed6a5b3feb668866df812b1c2aed9d7f
- md5sum_1m_cd1 = c720b30557af758e69de450409516369
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-0-32/autoyast.vfd
- cdrom_unattended = images/opensuse-11-0-32/autoyast.iso
- kernel = images/opensuse-11-0-32/linux
- initrd = images/opensuse-11-0-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.0-DVD-i386.iso
- md5sum_cd1 = ed6a5b3feb668866df812b1c2aed9d7f
- md5sum_1m_cd1 = c720b30557af758e69de450409516369
-
- - 11.0.64:
- image_name = openSUSE-11.0-64
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-0-64/autoyast.vfd
- cdrom_unattended = images/opensuse-11-0-64/autoyast.iso
- kernel = images/opensuse-11-0-64/linux
- initrd = images/opensuse-11-0-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.0-DVD-x86_64.iso
- md5sum_cd1 = 512c8346b0f8eb35f28c4eb96454d391
- md5sum_1m_cd1 = 661aa4cd031df2f25ea0102318a3f4d1
-
- - 11.1.32:
- image_name = openSUSE-11.1-32
- install:
- steps = steps/openSUSE-11.1-32-and-64.steps
- cdrom_cd1 = isos/linux/openSUSE-11.1-DVD-i586.iso
- md5sum_cd1 = 8f51b278c0415be28c5699e465444bd3
- md5sum_1m_cd1 = b70217417468389083429f81ba7ce2bd
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-1-32/autoyast.vfd
- cdrom_unattended = images/opensuse-11-1-32/autoyast.iso
- kernel = images/opensuse-11-1-32/linux
- initrd = images/opensuse-11-1-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.1-DVD-i586.iso
- md5sum_cd1 = 8f51b278c0415be28c5699e465444bd3
- md5sum_1m_cd1 = b70217417468389083429f81ba7ce2bd
-
- - 11.1.64:
- image_name = openSUSE-11.1-64
- install:
- steps = steps/openSUSE-11.1-32-and-64.steps
- cdrom_cd1 = isos/linux/openSUSE-11.1-DVD-x86_64.iso
- md5sum_cd1 = 2afee1b8a87175e6dee2b8dbbd1ad8e8
- md5sum_1m_cd1 = 768ca32503ef92c28f2d144f2a87e4d0
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-1-64/autoyast.vfd
- cdrom_unattended = images/opensuse-11-1-64/autoyast.iso
- kernel = images/opensuse-11-1-64/linux
- initrd = images/opensuse-11-1-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.1-DVD-x86_64.iso
- md5sum_cd1 = 2afee1b8a87175e6dee2b8dbbd1ad8e8
- md5sum_1m_cd1 = 768ca32503ef92c28f2d144f2a87e4d0
-
- - 11.2.32:
- image_name = openSUSE-11.2-32
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-2-32/autoyast.vfd
- cdrom_unattended = images/opensuse-11-2-32/autoyast.iso
- kernel = images/opensuse-11-2-32/linux
- initrd = images/opensuse-11-2-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.2-DVD-i586.iso
- md5sum_cd1 = 295d713314a30ad017948f0d542c6d92
- md5sum_1m_cd1 = 1f8767d00acb492be5a5627c834e543f
-
- - 11.2.64:
- image_name = openSUSE-11.2-64
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse11-2-64/autoyast.vfd
- cdrom_unattended = images/opensuse11-2-64/autoyast.iso
- kernel = images/opensuse-11-2-64/linux
- initrd = images/opensuse-11-2-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.2-DVD-x86_64.iso
- md5sum_cd1 = 6a09295e34dc030319d040f67f4742c6
- md5sum_1m_cd1 = 11fd11d39744450b898f04c371dde2e7
-
- - 11.3.32:
- image_name = openSUSE-11.3-32
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-3-32/autoyast.vfd
- cdrom_unattended = images/opensuse-11-3-32/autoyast.iso
- kernel = images/opensuse-11-3-32/linux
- initrd = images/opensuse-11-3-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.3-DVD-i586.iso
- md5sum_cd1 = 1a1da28c84e3cdad750d5cfa21c4fd17
- md5sum_1m_cd1 = 4dd26906ce6cb3946519cb0b0de4b0f8
-
- - 11.3.64:
- image_name = openSUSE-11.3-64
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-3-64/autoyast.vfd
- cdrom_unattended = images/opensuse-11-3-64/autoyast.iso
- kernel = images/opensuse-11-3-64/linux
- initrd = images/opensuse-11-3-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.3-DVD-x86_64.iso
- md5sum_cd1 = adf5d2a0a03c1e3aaf102fd6a4771b87
- md5sum_1m_cd1 = e0dd12dac30d296417256775e1234c6e
-
- - 11.4.32:
- image_name = openSUSE-11.4-32
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-4-32/autoyast.vfd
- cdrom_unattended = images/opensuse-11-4-32/autoyast.iso
- kernel = images/opensuse-11-4-32/linux
- initrd = images/opensuse-11-4-32/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.4-DVD-i586.iso
- md5sum_cd1 = 5f6d6d67c3e256b2513311f4ed650515
-
- - 11.4.64:
- image_name = openSUSE-11.4-64
- unattended_install:
- unattended_file = unattended/OpenSUSE-11.xml
- #floppy = images/opensuse-11-4-64/autoyast.vfd
- cdrom_unattended = images/opensuse-11-4-64/autoyast.iso
- kernel = images/opensuse-11-4-64/linux
- initrd = images/opensuse-11-4-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/openSUSE-11.4-DVD-x86_64.iso
- md5sum_cd1 = 082ebfac494b41cd56b38fb4218c545d
- md5sum_1m_cd1 = 2adcc5623e6c50b5d08acb7f84aa3fb1
-
- - SLES:
- shell_prompt = "^root@.*[\#\$]\s*$|#"
- unattended_install:
- # You have to use autoyast=floppy if you want to use floppies to
- # hold your autoyast file
- #extra_params += " --append 'autoyast=floppy console=ttyS0,115200 console=tty0'"
- extra_params += " --append 'autoyast=device://scd0/autoinst.xml console=ttyS0,115200 console=tty0'"
- kernel = linux
- initrd = initrd
- wait_no_ack = yes
-
- variants:
- - 11.0.32:
- image_name = sles11-32
- unattended_install:
- unattended_file = unattended/SLES-11.xml
- #floppy = images/sles-11-0-32/autoyast.vfd
- cdrom_unattended = images/sles-11-0-32/autoyast.iso
- kernel = images/sles-11-0-32/linux
- initrd = images/sles-11-0-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/SLES-11-DVD-i586-GM-DVD1.iso
- md5sum_cd1 = 4958d4dde2575666355c8a1c5858bab0
- md5sum_1m_cd1 = 1f19d4eff5bcead2a3e5b8b4212b6796
-
- - 11.0.64:
- image_name = sles11-64
- cdrom_cd1 = isos/linux/SLES-11-DVD-x86_64-GM-DVD1.iso
- md5sum_cd1 = 50a2bd45cd12c3808c3ee48208e2586b
- md5sum_1m_cd1 = 00000951cab7c32e332362fc424c1054
- unattended_install:
- unattended_file = unattended/SLES-11.xml
- #floppy = images/sles-11-0-64/autoyast.vfd
- cdrom_unattended = images/sles-11-0-64/autoyast.iso
- kernel = images/sles-11-0-64/linux
- initrd = images/sles-11-0-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/SLES-11-DVD-x86_64-GM-DVD1.iso
- md5sum_cd1 = 50a2bd45cd12c3808c3ee48208e2586b
- md5sum_1m_cd1 = 00000951cab7c32e332362fc424c1054
-
- - 11.1.32:
- image_name = sles11sp1-32
- unattended_install:
- unattended_file = unattended/SLES-11.xml
- #floppy = images/sles-11-1-32/autoyast.vfd
- cdrom_unattended = images/sles-11-1-32/autoyast.iso
- kernel = images/sles-11-1-32/linux
- initrd = images/sles-11-1-32/initrd
- boot_path = boot/i386/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/SLES-11-SP1-DVD-i586-GM-DVD1.iso
- md5sum_cd1 = 0dd6886858d93501c38854552b9b1b0d
- md5sum_1m_cd1 = a626a3d50813410e3ac42794e05773bb
-
- - 11.1.64:
- image_name = sles11sp1-64
- unattended_install:
- unattended_file = unattended/SLES-11.xml
- #floppy = images/sles-11-1-64/autoyast.vfd
- cdrom_unattended = images/sles-11-1-64/autoyast.iso
- kernel = images/sles-11-1-64/linux
- initrd = images/sles-11-1-64/initrd
- boot_path = boot/x86_64/loader
- unattended_install.cdrom:
- cdrom_cd1 = isos/linux/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso
- md5sum_cd1 = d2e10420f3689faa49a004b60fb396b7
- md5sum_1m_cd1 = f7f67b5da46923a9f01da8a2b6909654
-
- - @Ubuntu:
- shell_prompt = "^root@.*[\#\$]\s*$"
-
- variants:
- - Ubuntu-6.10-32:
- only install
- image_name = ubuntu-6.10-32
- steps = steps/Ubuntu-6.10-32.steps
- cdrom_cd1 = isos/linux/ubuntu-6.10-desktop-i386.iso
- md5sum_cd1 = 17fb825641571ce5888a718329efd016
- md5sum_1m_cd1 = 7531d0a84e7451d17c5d976f1c3f8509
-
- - Ubuntu-8.04-32:
- skip = yes
- image_name = ubuntu-8.04-32
- install:
- steps = steps/Ubuntu-8.04-32.steps
- cdrom_cd1 = isos/linux/ubuntu-8.04.1-desktop-i386.iso
- setup:
- steps = steps/Ubuntu-8.04-32-setupssh.steps
-
- - Ubuntu-8.10-server-32:
- image_name = ubuntu-8.10-server-32
- install:
- steps = steps/Ubuntu-8.10-server-32.steps
- cdrom_cd1 = isos/linux/ubuntu-8.10-server-i386.iso
- md5sum_cd1 = a2ec9975a91e1228c8292ed9799dc302
- md5sum_1m_cd1 = ea493eb8ef7722ead693492fd9f8a13f
- setup:
- steps = steps/Ubuntu-8.10-server-32-gcc.steps
-
- - DSL-4.2.5:
- no setup dbench bonnie linux_s3
- image_name = dsl-4.2.5
- install:
- steps = steps/DSL-4.2.5.steps
- cdrom_cd1 = isos/linux/dsl-4.2.5.iso
- md5sum_cd1 = 61694888aede3e01229865b8e6acd4a1
- md5sum_1m_cd1 = 527f2481bd25310f2e3a6e5345ff3d12
-
- - Mandriva-One-2007:
- only install
- image_name = mandriva-one-2007
- steps = steps/Mandriva-One-2007-32.steps
- cdrom_cd1 = isos/linux/mandriva-one-2007-i386.iso
- md5sum_cd1 = 7e9e183dc11b9d39f480238e4e12bb05
- md5sum_1m_cd1 = dc7865a75db665efc86d59bca7c1fe07
-
-
- # Windows section
- - @Windows:
- shutdown_command = shutdown /s /f /t 0
- reboot_command = shutdown /r /f /t 0
- status_test_command = echo %errorlevel%
- shell_prompt = "^\w:\\.*>\s*$"
- username = Administrator
- password = 123456
- shell_linesep = "\r\n"
- shell_client = nc
- shell_port = 10022
- file_transfer_client = rss
- file_transfer_port = 10023
- redirs += " file_transfer"
- guest_port_remote_shell = 10022
- guest_port_file_transfer = 10023
-
- # This ISO will be used for all tests except install:
- cdrom_cd1 = isos/windows/winutils.iso
-
- cpu_chk_cmd = echo %NUMBER_OF_PROCESSORS%
- mem_chk_cmd = wmic memphysical
- mem_chk_cur_cmd = wmic memphysical
-
- unattended_install.cdrom, whql.support_vm_install:
- timeout = 7200
- finish_program = deps/finish.exe
- cdroms += " winutils"
- cdrom_winutils = isos/windows/winutils.iso
- drive_index_winutils = 2
- kernel =
- initrd =
- migrate:
- migration_test_command = ver && vol
- migration_bg_command = start ping -t localhost
- migration_bg_check_command = tasklist | find /I "ping.exe"
- migration_bg_kill_command = taskkill /IM ping.exe /F
- migrate.with_file_transfer:
- guest_path = C:\tmpfile
- stress_boot:
- alive_test_cmd = systeminfo
- timedrift:
- # Timedrift compensation on Windows with hpet does not happen
- disable_hpet = yes
- extra_params += " -rtc-td-hack"
- time_command = "echo TIME: %date% %time%"
- time_filter_re = "(?<=TIME: \w\w\w ).{19}(?=\.\d\d)"
- time_format = "%m/%d/%Y %H:%M:%S"
- # For this to work, the cdrom at d: should contain vlc (d:\vlc\vlc.exe) and a video (d:\ED_1024.avi)
- guest_load_command = 'cmd /c "d:\vlc\vlc -f --loop --no-qt-privacy-ask --no-qt-system-tray d:\ED_1024.avi"'
- # Alternative guest load:
- #guest_load_command = "(dir /s && dir /s && dir /s && dir /s) > nul"
- guest_load_stop_command = "taskkill /F /IM vlc.exe"
- guest_load_instances = 2
- host_load_command = "bzip2 -c --best /dev/urandom > /dev/null"
- # Alternative host load:
- #host_load_command = "dd if=/dev/urandom of=/dev/null"
- host_load_instances = 8
- ntp:
- time_command = "w32tm /stripchart /samples:1 /computer:ns1.nay.redhat.com"
- time_filter_re = "\d+/\d+/\d+\s\d+:\d+:\d+ [AP]M"
- time_format = "%m/%d/%Y %H:%M:%S"
- date:
- time_command = "echo TIME: %date% %time%"
- time_filter_re = "(?<=TIME: \w\w\w ).{19}(?=\.\d\d)"
- time_format = "%m/%d/%Y %H:%M:%S"
- guest_s4:
- check_s4_support_cmd = powercfg /hibernate on
- test_s4_cmd = start ping -t localhost
- check_s4_cmd = tasklist | find /I "ping.exe"
- set_s4_cmd = rundll32.exe PowrProf.dll, SetSuspendState
- kill_test_s4_cmd = taskkill /IM ping.exe /F
- services_up_timeout = 30
- nic_hotplug:
- reference_cmd = ipconfig /all
- find_pci_cmd = ipconfig /all | find "Description"
- wait_secs_for_hook_up = 10
- nic_e1000:
- match_string = "Intel(R) PRO/1000 MT Network Connection"
- nic_virtio:
- match_string = "VirtIO Ethernet"
- block_hotplug:
- wait_secs_for_hook_up = 10
- reference_cmd = wmic diskdrive list brief
- find_pci_cmd = wmic diskdrive list brief
- pci_test_cmd = echo select disk 1 > dt && echo online >> dt && echo detail disk >> dt && echo exit >> dt && diskpart /s dt
- physical_resources_check:
- catch_uuid_cmd =
- file_transfer:
- tmp_dir = C:\
- clean_cmd = del
- vmstop:
- guest_path = C:\
- multi_disk:
- block_list += " E:"
- shell_port = 23
- shell_client = telnet
- post_cmd = del c:\cmd.exe
- file_system = "ntfs fat32"
- cmd_list = "copy_to_command copy_from_command"
- list_volume_command = wmic volume get driveletter
- re_str = "([A-Z]:)"
- format_command = format /fs:%s %s /q /y
- copy_to_command = copy C:\WINDOWS\system32\cmd.exe %s /y
- copy_from_command = copy %s\cmd.exe c:\ /y
- compare_command = fc /b c:\windows\system32\cmd.exe c:\cmd.exe
- check_result_key_word = no difference
- signal_repeat:
- pre_cmd = del diskpart.script && (echo select disk 1 >> diskpart.script && echo create partition primary >> diskpart.script && echo assign >> diskpart.script) && echo select disk 0 >> diskpart.script && echo exit >> diskpart.script && diskpart /s diskpart.script
- max_disk:
- pre_cmd = del diskpart.script && (for /L %i in (1 1 23) do echo select disk %i >> diskpart.script && echo create partition primary >> diskpart.script && echo assign >> diskpart.script) && echo select disk 0 >> diskpart.script && echo exit >> diskpart.script && diskpart /s diskpart.script
- floppy:
- format_floppy_cmd = echo n|format A: /Q /V:test_floppy
- source_file = C:\Windows\System32\cmd.exe
- dest_file = A:\cmd.exe
- clean_cmd = del
- diff_file_cmd = fc
- test_floppy_cmd = "chkdsk A:"
- copy_cmd = copy
-
- variants:
- - CustomGuestWindows:
- image_name = custom_image
- image_size = 20G
- #image_name = /dev/mapper/vg_some_label
- #image_type_raw = yes
- - Win2000:
- no reboot whql
- image_name = win2000-32
- kill_vm_gracefully = no
- install:
- steps = steps/Win2000-32.steps
- cdrom_cd1 = isos/windows/Windows2000_sp4.iso
- md5sum_cd1 = dda6039f3a9173f0f6bfae40f5efdfea
- md5sum_1m_cd1 = dd28fba196d366d56fe774bd93df5527
- user = user
- setup:
- steps = steps/Win2000-32-rss.steps
- unattended_install.cdrom:
- cdrom_cd1 = isos/windows/Windows2000_sp4.iso
- md5sum_cd1 = dda6039f3a9173f0f6bfae40f5efdfea
- md5sum_1m_cd1 = dd28fba196d366d56fe774bd93df5527
- unattended_file = unattended/win2000-32.sif
- floppy = images/win2000-32/answer.vfd
-
- - WinXP:
- image_name = winXP
- variants:
- - 32:
- image_name += -32
- install:
- cdrom_cd1 = isos/windows/WindowsXP-sp2-vlk.iso
- md5sum_cd1 = 743450644b1d9fe97b3cf379e22dceb0
- md5sum_1m_cd1 = b473bf75af2d1269fec8958cf0202bfd
- user = user
- steps = steps/WinXP-32.steps
- setup:
- steps = steps/WinXP-32-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/WindowsXP-sp2-vlk.iso
- md5sum_cd1 = 743450644b1d9fe97b3cf379e22dceb0
- md5sum_1m_cd1 = b473bf75af2d1269fec8958cf0202bfd
- unattended_file = unattended/winxp32.sif
- floppy = images/winXP-32/answer.vfd
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows XP
- desc_path_desc2 = $\WDK\Logo Type\Systems Logo\Windows XP
- dd_data_logoarch = X86
- dd_data_logoos = Windows XP
- dd_data_whqlos = Windows XP
- device:
- dd_data_whqlqual = Basic
- device.net:
- image_name_supportvm = winXP-32-supportvm
- multi_disk:
- list_volume_command = fsutil fsinfo drives
-
-
- - 64:
- image_name += -64
- install:
- cdrom_cd1 = isos/windows/WindowsXP-64.iso
- md5sum_cd1 = 8d3f007ec9c2060cec8a50ee7d7dc512
- md5sum_1m_cd1 = e812363ff427effc512b7801ee70e513
- user = user
- steps = steps/WinXP-64.steps
- setup:
- steps = steps/WinXP-64-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/WindowsXP-64.iso
- md5sum_cd1 = 8d3f007ec9c2060cec8a50ee7d7dc512
- md5sum_1m_cd1 = e812363ff427effc512b7801ee70e513
- unattended_file = unattended/winxp64.sif
- floppy = images/winXP-64/answer.vfd
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows XP
- desc_path_desc2 = $\WDK\Logo Type\Systems Logo\Windows XP
- dd_data_logoarch = AMD64
- dd_data_logoos = Windows XP 64-Bit Edition Version 2003
- dd_data_whqlos = Windows XP x64
- device:
- dd_data_whqlqual = Basic
- device.net:
- image_name_supportvm = winXP-64-supportvm
- multi_disk:
- list_volume_command = fsutil fsinfo drives
-
-
- - Win2003:
- image_name = win2003
- image_size = 20G
-
- variants:
- - 32:
- image_name += -32
- install:
- cdrom_cd1 = isos/windows/en_win_srv_2003_r2_enterprise_with_sp2_cd1_x13-05460.iso
- md5sum_cd1 = 7c3bc891d20c7e6a110c4f1ad82952ba
- md5sum_1m_cd1 = b1671ecf47a270e49e04982bf1474ff9
- sha1sum_cd1 = ee11cc735c695501874d2fa123f7d78449b3de7c
- sha1sum_1m_cd1 = e2d49dc3fbe17a6b2ba1812543f2cc08ef9565c4
- #cdrom_cd1 = isos/windows/Windows2003_r2_VLK.iso
- #md5sum_cd1 = 03e921e9b4214773c21a39f5c3f42ef7
- #md5sum_1m_cd1 = 37c2fdec15ac4ec16aa10fdfdb338aa3
- user = user
- steps = steps/Win2003-32.steps
- setup:
- steps = steps/Win2003-32-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_win_srv_2003_r2_enterprise_with_sp2_cd1_x13-05460.iso
- md5sum_cd1 = 7c3bc891d20c7e6a110c4f1ad82952ba
- md5sum_1m_cd1 = b1671ecf47a270e49e04982bf1474ff9
- sha1sum_cd1 = ee11cc735c695501874d2fa123f7d78449b3de7c
- sha1sum_1m_cd1 = e2d49dc3fbe17a6b2ba1812543f2cc08ef9565c4
- #cdrom_cd1 = isos/windows/Windows2003_r2_VLK.iso
- #md5sum_cd1 = 03e921e9b4214773c21a39f5c3f42ef7
- #md5sum_1m_cd1 = 37c2fdec15ac4ec16aa10fdfdb338aa3
- unattended_file = unattended/win2003-32.sif
- floppy = images/win2003-32/answer.vfd
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows Server 2003
- dd_data_logoarch = X86
- dd_data_logoos = Windows Server 2003
- dd_data_whqlos = Windows Server 2003
- device:
- dd_data_whqlqual = Basic
- device.net:
- image_name_supportvm = win2003-32-supportvm
-
- - 64:
- image_name += -64
- install:
- cdrom_cd1 = isos/windows/en_win_srv_2003_r2_enterprise_x64_with_sp2_cd1_x13-06188.iso
- md5sum_cd1 = 09f4cb31796e9802dcc477e397868c9a
- md5sum_1m_cd1 = c11ebcf6c128d94c83fe623566eb29d7
- sha1sum_cd1 = d04c8f304047397be486c38a6b769f16993d4b39
- sha1sum_1m_cd1 = 3daf6fafda8ba48779df65e4713a3cdbd6c9d136
- #cdrom_cd1 = isos/windows/Windows2003-x64.iso
- #md5sum_cd1 = 5703f87c9fd77d28c05ffadd3354dbbd
- #md5sum_1m_cd1 = 439393c384116aa09e08a0ad047dcea8
- user = user
- steps = steps/Win2003-64.steps
- setup:
- steps = steps/Win2003-64-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_win_srv_2003_r2_enterprise_x64_with_sp2_cd1_x13-06188.iso
- md5sum_cd1 = 09f4cb31796e9802dcc477e397868c9a
- md5sum_1m_cd1 = c11ebcf6c128d94c83fe623566eb29d7
- sha1sum_cd1 = d04c8f304047397be486c38a6b769f16993d4b39
- sha1sum_1m_cd1 = 3daf6fafda8ba48779df65e4713a3cdbd6c9d136
- #cdrom_cd1 = isos/windows/Windows2003-x64.iso
- #md5sum_cd1 = 5703f87c9fd77d28c05ffadd3354dbbd
- #md5sum_1m_cd1 = 439393c384116aa09e08a0ad047dcea8
- unattended_file = unattended/win2003-64.sif
- floppy = images/win2003-64/answer.vfd
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows Server 2003
- dd_data_logoarch = AMD64
- dd_data_logoos = Windows Server 2003
- dd_data_whqlos = Windows Server 2003 x64
- device:
- dd_data_whqlqual = Basic
- device.net:
- image_name_supportvm = win2003-64-supportvm
-
- - WinVista:
- image_name = winvista
- image_size = 20G
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Vista Client\Device Premium
- desc_path_desc2 = $\WDK\Logo Type\Device Logo\Vista Client\Device Standard
- desc_path_desc3 = $\WDK\Logo Type\Device Logo\Vista Client
-
- variants:
- - 32:
- whql.submission:
- dd_data_logoarch = X86
- dd_data_logoos = Windows Vista
- dd_data_whqlos = Windows Vista Client
- device:
- dd_data_whqlqual = Premium
- variants:
- - sp1:
- image_name += -sp1-32
- install:
- cdrom_cd1 = isos/windows/WindowsVista-32.iso
- md5sum_cd1 = 1008f323d5170c8e614e52ccb85c0491
- md5sum_1m_cd1 = c724e9695da483bc0fd59e426eaefc72
- steps = steps/Win-Vista-32.steps
- setup:
- steps = steps/WinVista-32-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/WindowsVista-32.iso
- md5sum_cd1 = 1008f323d5170c8e614e52ccb85c0491
- md5sum_1m_cd1 = c724e9695da483bc0fd59e426eaefc72
- unattended_file = unattended/winvista-32-autounattend.xml
- floppy = images/winvista-sp1-32/answer.vfd
- whql.submission.device.net:
- image_name_supportvm = winvista-sp1-32-supportvm
-
- - sp2:
- image_name += -sp2-32
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_vista_with_sp2_x86_dvd_342266.iso
- md5sum_cd1 = 19ca90a425667812977bab6f4ce24175
- md5sum_1m_cd1 = 89c15020e0e6125be19acf7a2e5dc614
- sha1sum_cd1 = 25ad9a776503e6a583bec07879dbcc5dfd20cd6e
- sha1sum_1m_cd1 = a2afa4cffdc1c362dbf9e62942337f4f875a22cf
- unattended_file = unattended/winvista-32-autounattend.xml
- floppy = images/winvista-sp2-32/answer.vfd
- whql.submission.device.net:
- image_name_supportvm = winvista-sp2-32-supportvm
-
- - 64:
- whql.submission:
- dd_data_logoarch = AMD64
- dd_data_logoos = Windows Vista
- dd_data_whqlos = Windows Vista Client x64
- device:
- dd_data_whqlqual = Premium
- variants:
- - sp1:
- image_name += -sp1-64
- install:
- cdrom_cd1 = isos/windows/WindowsVista-64.iso
- md5sum_cd1 = 11e2010d857fffc47813295e6be6d58d
- md5sum_1m_cd1 = 0947bcd5390546139e25f25217d6f165
- steps = steps/Win-Vista-64.steps
- setup:
- steps = steps/WinVista-64-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/WindowsVista-64.iso
- md5sum_cd1 = 11e2010d857fffc47813295e6be6d58d
- md5sum_1m_cd1 = 0947bcd5390546139e25f25217d6f165
- unattended_file = unattended/winvista-64-autounattend.xml
- floppy = images/winvista-sp1-64/answer.vfd
- whql.submission.device.net:
- image_name_supportvm = winvista-sp1-64-supportvm
-
- - sp2:
- image_name += -sp2-64
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_vista_sp2_x64_dvd_342267.iso
- md5sum_cd1 = a1c024d7abaf34bac3368e88efbc2574
- md5sum_1m_cd1 = 3d84911a80f3df71d1026f7adedc2181
- sha1sum_cd1 = aaee3c04533899f9f8c4ae0c4250ef5fafbe29a3
- sha1sum_1m_cd1 = 1fd21bd3ce2a4de8856c7b8fe6fdf80260f6d1c7
- unattended_file = unattended/winvista-64-autounattend.xml
- floppy = images/winvista-sp2-64/answer.vfd
- whql.submission.device.net:
- image_name_supportvm = winvista-sp2-64-supportvm
-
- - Win2008:
- no whql
- image_name = win2008
- image_size = 20G
-
- variants:
- - 32:
- variants:
- - sp1:
- image_name += -sp1-32
- install:
- cdrom_cd1 = isos/windows/Windows2008-x86.iso
- #en_windows_server_2008_datacenter_enterprise_standard_x86_dvd_X14-26710.iso
- md5sum_cd1 = 0bfca49f0164de0a8eba236ced47007d
- md5sum_1m_cd1 = 07d7f5006393f74dc76e6e2e943e2440
- sha1sum_cd1 = 6ca018ff96f1e9b2b310a36546b6fded99a421e6
- steps = steps/Win2008-32.steps
- setup:
- steps = steps/Win2008-32-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/Windows2008-x86.iso
- md5sum_cd1 = 0bfca49f0164de0a8eba236ced47007d
- md5sum_1m_cd1 = 07d7f5006393f74dc76e6e2e943e2440
- unattended_file = unattended/win2008-32-autounattend.xml
- floppy = images/win2008-sp1-32/answer.vfd
-
- - sp2:
- image_name += -sp2-32
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_server_2008_datacenter_enterprise_standard_sp2_x86_dvd_342333.iso
- md5sum_cd1 = b9201aeb6eef04a3c573d036a8780bdf
- md5sum_1m_cd1 = b7a9d42e55ea1e85105a3a6ad4da8e04
- sha1sum_cd1 = 49d0d6917c1256fe81048d414fa473bbc76a8724
- sha1sum_1m_cd1 = 9662ff7ed715faa00407e4befc484ea52a92a9fb
- unattended_file = unattended/win2008-32-autounattend.xml
- floppy = images/win2008-sp2-32/answer.vfd
-
- - 64:
- variants:
- -sp1:
- image_name += -sp1-64
- install:
- steps = steps/Win2008-64.steps
- cdrom_cd1 = isos/windows/Windows2008-x64.iso
- #en_windows_server_2008_datacenter_enterprise_standard_x64_dvd_X14-26714.iso
- md5sum_cd1 = 27c58cdb3d620f28c36333a5552f271c
- md5sum_1m_cd1 = efdcc11d485a1ef9afa739cb8e0ca766
- sha1sum_cd1 = bd000374709f67e9358814db6ec8f0ddaaa16f70
- passwd = 1q2w3eP
- setup:
- steps = steps/Win2008-64-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/Windows2008-x64.iso
- md5sum_cd1 = 27c58cdb3d620f28c36333a5552f271c
- md5sum_1m_cd1 = efdcc11d485a1ef9afa739cb8e0ca766
- unattended_file = unattended/win2008-64-autounattend.xml
- floppy = images/win2008-sp1-64/answer.vfd
-
- - sp2:
- image_name += -sp2-64
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_server_2008_datacenter_enterprise_standard_sp2_x64_dvd_342336.iso
- md5sum_cd1 = e94943ef484035b3288d8db69599a6b5
- md5sum_1m_cd1 = ee55506823d0efffb5532ddd88a8e47b
- sha1sum_cd1 = 34c7d726c57b0f8b19ba3b40d1b4044c15fc2029
- sha1sum_1m_cd1 = 8fe08b03e3531906855a60a78020ac9577dff5ba
- unattended_file = unattended/win2008-64-autounattend.xml
- floppy = images/win2008-sp2-64/answer.vfd
-
- - r2:
- image_name += -r2-64
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_server_2008_r2_standard_enterprise_datacenter_and_web_x64_dvd_x15-59754.iso
- md5sum_cd1 = 0207ef392c60efdda92071b0559ca0f9
- md5sum_1m_cd1 = a5a22ce25008bd7109f6d830d627e3ed
- sha1sum_cd1 = ad855ea913aaec3f1d0e1833c1aef7a0de326b0a
- sha1sum_1m_cd1 = 9194a3aabae25b36e5f73cad001314b2c8d07d14
- unattended_file = unattended/win2008-r2-autounattend.xml
- floppy = images/win2008-r2-64/answer.vfd
-
- - Win7:
- image_name = win7
- image_size = 20G
- whql.submission:
- desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows 7 Client\Logo
- desc_path_desc2 = $\WDK\Logo Type\Device Logo\Windows 7 Client
- device_data += " adq"
- dd_name_adq = AdditionalQualificationGroup
- dd_data_adq = Windows 7
-
- variants:
- - 32:
- image_name += -32
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_7_ultimate_x86_dvd_x15-65921.iso
- md5sum_cd1 = d0b8b407e8a3d4b75ee9c10147266b89
- md5sum_1m_cd1 = 2b0c2c22b1ae95065db08686bf83af93
- sha1sum_cd1 = 5395dc4b38f7bdb1e005ff414deedfdb16dbf610
- sha1sum_1m_cd1 = 9f9c3780aebeb28a9bf22188eed6bc15475dc9c5
- unattended_file = unattended/win7-32-autounattend.xml
- floppy = images/win7-32/answer.vfd
- whql.submission:
- dd_data_logoarch = X86
- dd_data_logoos = Windows 7
- dd_data_whqlos = Windows 7 Client
- device:
- dd_data_whqlqual = Logo
- device.net:
- image_name_supportvm = win7-32-supportvm
-
- - 64:
- image_name += -64
- install:
- cdrom_cd1 = isos/windows/en_windows_7_ultimate_x64_dvd_x15-65922.iso
- md5sum_cd1 = f43d22e4fb07bf617d573acd8785c028
- md5sum_1m_cd1 = b44d8cf99dbed2a5cb02765db8dfd48f
- passwd = 1q2w3eP
- steps = steps/Win7-64.steps
- setup:
- steps = steps/Win7-64-rss.steps
- unattended_install.cdrom, whql.support_vm_install:
- cdrom_cd1 = isos/windows/en_windows_7_ultimate_x64_dvd_x15-65922.iso
- md5sum_cd1 = f43d22e4fb07bf617d573acd8785c028
- md5sum_1m_cd1 = b44d8cf99dbed2a5cb02765db8dfd48f
- sha1sum_cd1 = 326327cc2ff9f05379f5058c41be6bc5e004baa7
- sha1sum_1m_cd1 = 4a3903bd5157de54f0702e5263e0a683c5775515
- unattended_file = unattended/win7-64-autounattend.xml
- floppy = images/win7-64/answer.vfd
- whql.submission:
- dd_data_logoarch = AMD64
- dd_data_logoos = Windows 7
- dd_data_whqlos = Windows 7 Client x64
- device:
- dd_data_whqlqual = Logo
- device.net:
- image_name_supportvm = win7-64-supportvm
-
-
- # Unix/BSD section
- - @Unix:
- only install
- kill_vm = yes
- kill_vm_gracefully = no
- kill_vm_timeout = 0
-
- variants:
- - NetBSD-1.6.2:
- image_name = NetBSD-1.6.2
- image_size = 4G
- steps = steps/NetBSD-1.6.2.steps
- cdrom_cd1 = isos/bsd/netbsd-1.6.2-i386.iso
- md5sum_cd1 = 72eb680300f77d529bfbc880ba8208f3
- md5sum_1m_cd1 = f1a9e1e825c90adfb1be35c6177bd9ac
-
- - OpenBSD-4.1:
- image_name = OpenBSD-4.1
- steps = steps/OpenBSD-4.1-32.steps
- cdrom_cd1 = isos/unix/openbsd41-i386-07-05-06.iso
- md5sum_cd1 = 984790db10ebdd6fc7a9cf97abc7c967
- md5sum_1m_cd1 = 8fc234b4b0ecfe56843a32ac1d26ed55
-
- # Live CD section
- - @livecd:
- only install
- kill_vm = yes
- kill_vm_gracefully = no
- kill_vm_timeout = 0
-
- variants:
- - Belenix:
- steps = steps/Belenix-0.7.1.steps
- cdrom_cd1 = isos/unix/belenix_0.7.1.iso
- md5sum_cd1 = 29cea6160cf5250de138e2820e53e342
- md5sum_1m_cd1 = 427bbef1b85d6d051799b825d686ae94
-
- - Slax:
- steps = steps/Slax-6.0.7.steps
- cdrom_cd1 = isos/linux/slax-6.0.7.iso
- md5sum_cd1 = cde0ecba3c8289d786e12c44666ded6e
- md5sum_1m_cd1 = ddf02bc7444f22d1160a6e5a8fc8723f
-
- - FreeSBIE-2.0.1:
- steps = steps/FreeSBIE-2.0.1.steps
- cdrom_cd1 = isos/unix/FreeSBIE-2.0.1-RELEASE.iso
- md5sum_cd1 = b2f680d27c21bbfaf4fb90dce090a118
- md5sum_1m_cd1 = 4d81ee7fe0101b0a14225963bfff60c1
-
- - memtest:
- mem = 128
- steps = steps/memtest86+.steps
- cdrom_cd1 = isos/misc/memtest86+-2.01.iso
- md5sum_cd1 = 9fae22f2666369968a76ef59e9a81ced
diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py
deleted file mode 100644
index 5f9632f..0000000
--- a/client/tests/kvm/kvm.py
+++ /dev/null
@@ -1,137 +0,0 @@
-import os, logging, imp
-from autotest_lib.client.bin import test
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_env_process
-
-
-class kvm(test.test):
- """
- Suite of KVM virtualization functional tests.
- Contains tests for testing both KVM kernel code and userspace code.
-
- @copyright: Red Hat 2008-2009
- @author: Uri Lublin ([email protected])
- @author: Dror Russo ([email protected])
- @author: Michael Goldish ([email protected])
- @author: David Huff ([email protected])
- @author: Alexey Eromenko ([email protected])
- @author: Mike Burns ([email protected])
-
- @see: http://www.linux-kvm.org/page/KVM-Autotest/Client_Install
- (Online doc - Getting started with KVM testing)
- """
- version = 1
- env_version = 1
-
-
- def initialize(self, params):
- # Change the value of the preserve_srcdir attribute according to
- # the value present on the configuration file (defaults to yes)
- if params.get("preserve_srcdir", "yes") == "yes":
- self.preserve_srcdir = True
-
-
- def run_once(self, params):
- # Convert params to a Params object
- params = virt_utils.Params(params)
-
- # If a dependency test prior to this test has failed, let's fail
- # it right away as TestNA.
- if params.get("dependency_failed") == 'yes':
- raise error.TestNAError("Test dependency failed")
-
- # Report the parameters we've received and write them as keyvals
- logging.debug("Test parameters:")
- keys = params.keys()
- keys.sort()
- for key in keys:
- logging.debug(" %s = %s", key, params[key])
- self.write_test_keyval({key: params[key]})
-
- # Set the log file dir for the logging mechanism used by kvm_subprocess
- # (this must be done before unpickling env)
- virt_utils.set_log_file_dir(self.debugdir)
-
- # Open the environment file
- env_filename = os.path.join(self.bindir, params.get("env", "env"))
- env = virt_utils.Env(env_filename, self.env_version)
-
- test_passed = False
-
- try:
- try:
- try:
- # Get the test routine corresponding to the specified
- # test type
- t_type = params.get("type")
- # Verify if we have the correspondent source file for it
- virt_dir = os.path.dirname(virt_utils.__file__)
- subtest_dir_virt = os.path.join(virt_dir, "tests")
- subtest_dir_kvm = os.path.join(self.bindir, "tests")
- subtest_dir = None
- for d in [subtest_dir_kvm, subtest_dir_virt]:
- module_path = os.path.join(d, "%s.py" % t_type)
- if os.path.isfile(module_path):
- subtest_dir = d
- break
- if subtest_dir is None:
- raise error.TestError("Could not find test file %s.py "
- "on either %s or %s directory" %
- (t_type, subtest_dir_kvm,
- subtest_dir_virt))
- # Load the test module
- f, p, d = imp.find_module(t_type, [subtest_dir])
- test_module = imp.load_module(t_type, f, p, d)
- f.close()
-
- # Preprocess
- try:
- virt_env_process.preprocess(self, params, env)
- finally:
- env.save()
- # Run the test function
- run_func = getattr(test_module, "run_%s" % t_type)
- try:
- run_func(self, params, env)
- finally:
- env.save()
- test_passed = True
-
- except Exception, e:
- logging.error("Test failed: %s: %s",
- e.__class__.__name__, e)
- try:
- virt_env_process.postprocess_on_error(
- self, params, env)
- finally:
- env.save()
- raise
-
- finally:
- # Postprocess
- try:
- try:
- virt_env_process.postprocess(self, params, env)
- except Exception, e:
- if test_passed:
- raise
- logging.error("Exception raised during "
- "postprocessing: %s", e)
- finally:
- env.save()
-
- except Exception, e:
- if params.get("abort_on_error") != "yes":
- raise
- # Abort on error
- logging.info("Aborting job (%s)", e)
- for vm in env.get_all_vms():
- if vm.is_dead():
- continue
- logging.info("VM '%s' is alive.", vm.name)
- for m in vm.monitors:
- logging.info("'%s' has a %s monitor unix socket at: %s",
- vm.name, m.protocol, m.filename)
- logging.info("The command line used to start '%s' was:\n%s",
- vm.name, vm.make_qemu_command())
- raise error.JobError("Abort requested (%s)" % e)
diff --git a/client/tests/kvm/migration_control.srv b/client/tests/kvm/migration_control.srv
deleted file mode 100644
index 7c63317..0000000
--- a/client/tests/kvm/migration_control.srv
+++ /dev/null
@@ -1,123 +0,0 @@
-AUTHOR = "Yolkfull Chow <[email protected]>"
-TIME = "SHORT"
-NAME = "Migration across multiple hosts"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "Virtualization"
-TEST_TYPE = "Server"
-DOC = """
-Migrate KVM guest between two hosts. It parses the base config file, restricts
-it with appropriate parameters, generates the test dicts, modify the test_dicts
-so there's a distinction between the migration roles ('dest' or 'source').
-"""
-
-import sys, os, commands, glob, shutil, logging, random
-from autotest_lib.server import utils
-from autotest_lib.client.common_lib import cartesian_config
-
-# Specify the directory of autotest before you start this test
-AUTOTEST_DIR = '/usr/local/autotest'
-
-# Specify the root directory that on client machines
-rootdir = '/tmp/kvm_autotest_root'
-
-KVM_DIR = os.path.join(AUTOTEST_DIR, 'client/tests/kvm')
-
-
-def generate_mac_address():
- r = random.SystemRandom()
- mac = "9a:%02x:%02x:%02x:%02x:%02x" % (r.randint(0x00, 0xff),
- r.randint(0x00, 0xff),
- r.randint(0x00, 0xff),
- r.randint(0x00, 0xff),
- r.randint(0x00, 0xff))
- return mac
-
-
-def run(pair):
- logging.info("KVM migration running on source host [%s] and destination "
- "host [%s]\n", pair[0], pair[1])
-
- source = hosts.create_host(pair[0])
- dest = hosts.create_host(pair[1])
- source_at = autotest.Autotest(source)
- dest_at = autotest.Autotest(dest)
-
- cfg_file = os.path.join(KVM_DIR, "tests_base.cfg")
-
- if not os.path.exists(cfg_file):
- raise error.JobError("Config file %s was not found", cfg_file)
-
- # Get test set (dictionary list) from the configuration file
- parser = cartesian_config.Parser()
- test_variants = """
-image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/
-cdrom(_.*)? ?<= /tmp/kvm_autotest_root/
-floppy ?<= /tmp/kvm_autotest_root/
-Linux:
- unattended_install:
- kernel ?<= /tmp/kvm_autotest_root/
- initrd ?<= /tmp/kvm_autotest_root/
-qemu_binary = /usr/libexec/qemu-kvm
-qemu_img_binary = /usr/bin/qemu-img
-only qcow2
-only virtio_net
-only virtio_blk
-only smp2
-only no_pci_assignable
-only smallpages
-only Fedora.14.64
-only migrate_multi_host
-nic_mode = tap
-nic_mac_nic1 = %s
-""" % (generate_mac_address())
- parser.parse_file(cfg_file)
- parser.parse_string(test_variants)
- test_dicts = parser.get_dicts()
-
- source_control_file = dest_control_file = """
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
-sys.path.append(kvm_test_dir)\n
-"""
- for params in test_dicts:
- params['srchost'] = source.ip
- params['dsthost'] = dest.ip
- params['rootdir'] = rootdir
-
- source_params = params.copy()
- source_params['role'] = "source"
-
- dest_params = params.copy()
- dest_params['role'] = "destination"
- dest_params['migration_mode'] = "tcp"
-
- # Report the parameters we've received
- print "Test parameters:"
- keys = params.keys()
- keys.sort()
- for key in keys:
- logging.debug(" %s = %s", key, params[key])
-
- source_control_file += ("job.run_test('kvm', tag='%s', params=%s)" %
- (source_params['shortname'], source_params))
- dest_control_file += ("job.run_test('kvm', tag='%s', params=%s)" %
- (dest_params['shortname'], dest_params))
-
- logging.info('Source control file:\n%s', source_control_file)
- logging.info('Destination control file:\n%s', dest_control_file)
- dest_command = subcommand(dest_at.run,
- [dest_control_file, dest.hostname])
-
- source_command = subcommand(source_at.run,
- [source_control_file, source.hostname])
-
- parallel([dest_command, source_command])
-
-# Grab the pairs (and failures)
-(pairs, failures) = utils.form_ntuples_from_machines(machines, 2)
-
-# Log the failures
-for failure in failures:
- job.record("FAIL", failure[0], "kvm", failure[1])
-
-# Now run through each pair and run
-job.parallel_simple(run, pairs, log=False)
diff --git a/client/tests/kvm/scripts/ksm_overcommit_guest.py b/client/tests/kvm/scripts/ksm_overcommit_guest.py
deleted file mode 100755
index d52be5b..0000000
--- a/client/tests/kvm/scripts/ksm_overcommit_guest.py
+++ /dev/null
@@ -1,237 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
-Auxiliary script used to allocate memory on guests.
-
-@copyright: 2008-2009 Red Hat Inc.
-@author: Jiri Zupka ([email protected])
-"""
-
-
-import os, array, sys, random, copy, tempfile, datetime, math
-
-PAGE_SIZE = 4096 # machine page size
-
-TMPFS_OVERHEAD = 0.0022 # overhead on 1MB of write data
-
-
-class MemFill(object):
- """
- Fills guest memory according to certain patterns.
- """
- def __init__(self, mem, static_value, random_key):
- """
- Constructor of MemFill class.
-
- @param mem: Amount of test memory in MB.
- @param random_key: Seed of random series used for fill up memory.
- @param static_value: Value used to fill all memory.
- """
- if (static_value < 0 or static_value > 255):
- print ("FAIL: Initialization static value"
- "can be only in range (0..255)")
- return
-
- self.tmpdp = tempfile.mkdtemp()
- ret_code = os.system("mount -o size=%dM tmpfs %s -t tmpfs" %
- ((mem+math.ceil(mem*TMPFS_OVERHEAD)),
- self.tmpdp))
- if ret_code != 0:
- if os.getuid() != 0:
- print ("FAIL: Unable to mount tmpfs "
- "(likely cause: you are not root)")
- else:
- print "FAIL: Unable to mount tmpfs"
- else:
- self.f = tempfile.TemporaryFile(prefix='mem', dir=self.tmpdp)
- self.allocate_by = 'L'
- self.npages = ((mem * 1024 * 1024) / PAGE_SIZE)
- self.random_key = random_key
- self.static_value = static_value
- print "PASS: Initialization"
-
-
- def __del__(self):
- if os.path.ismount(self.tmpdp):
- self.f.close()
- os.system("umount %s" % (self.tmpdp))
-
-
- def compare_page(self, original, inmem):
- """
- Compare pages of memory and print the differences found.
-
- @param original: Data that was expected to be in memory.
- @param inmem: Data in memory.
- """
- for ip in range(PAGE_SIZE / original.itemsize):
- if (not original[ip] == inmem[ip]): # find which item is wrong
- originalp = array.array("B")
- inmemp = array.array("B")
- originalp.fromstring(original[ip:ip+1].tostring())
- inmemp.fromstring(inmem[ip:ip+1].tostring())
- for ib in range(len(originalp)): # find wrong byte in item
- if not (originalp[ib] == inmemp[ib]):
- position = (self.f.tell() - PAGE_SIZE + ip *
- original.itemsize + ib)
- print ("Mem error on position %d wanted 0x%Lx and is "
- "0x%Lx" % (position, originalp[ib], inmemp[ib]))
-
-
- def value_page(self, value):
- """
- Create page filled by value.
-
- @param value: String we want to fill the page with.
- @return: return array of bytes size PAGE_SIZE.
- """
- a = array.array("B")
- for i in range((PAGE_SIZE / a.itemsize)):
- try:
- a.append(value)
- except:
- print "FAIL: Value can be only in range (0..255)"
- return a
-
-
- def random_page(self, seed):
- """
- Create page filled by static random series.
-
- @param seed: Seed of random series.
- @return: Static random array series.
- """
- random.seed(seed)
- a = array.array(self.allocate_by)
- for i in range(PAGE_SIZE / a.itemsize):
- a.append(random.randrange(0, sys.maxint))
- return a
-
-
- def value_fill(self, value=None):
- """
- Fill memory page by page, with value generated with value_page.
-
- @param value: Parameter to be passed to value_page. None to just use
- what's on the attribute static_value.
- """
- self.f.seek(0)
- if value is None:
- value = self.static_value
- page = self.value_page(value)
- for pages in range(self.npages):
- page.tofile(self.f)
- print "PASS: Mem value fill"
-
-
- def value_check(self, value=None):
- """
- Check memory to see if data is correct.
-
- @param value: Parameter to be passed to value_page. None to just use
- what's on the attribute static_value.
- @return: if data in memory is correct return PASS
- else print some wrong data and return FAIL
- """
- self.f.seek(0)
- e = 2
- failure = False
- if value is None:
- value = self.static_value
- page = self.value_page(value)
- for pages in range(self.npages):
- pf = array.array("B")
- pf.fromfile(self.f, PAGE_SIZE / pf.itemsize)
- if not (page == pf):
- failure = True
- self.compare_page(page, pf)
- e = e - 1
- if e == 0:
- break
- if failure:
- print "FAIL: value verification"
- else:
- print "PASS: value verification"
-
-
- def static_random_fill(self, n_bytes_on_end=PAGE_SIZE):
- """
- Fill memory by page with static random series with added special value
- on random place in pages.
-
- @param n_bytes_on_end: how many bytes on the end of page can be changed.
- @return: PASS.
- """
- self.f.seek(0)
- page = self.random_page(self.random_key)
- random.seed(self.random_key)
- p = copy.copy(page)
-
- t_start = datetime.datetime.now()
- for pages in range(self.npages):
- rand = random.randint(((PAGE_SIZE / page.itemsize) - 1) -
- (n_bytes_on_end / page.itemsize),
- (PAGE_SIZE/page.itemsize) - 1)
- p[rand] = pages
- p.tofile(self.f)
- p[rand] = page[rand]
-
- t_end = datetime.datetime.now()
- delta = t_end - t_start
- milisec = delta.microseconds / 1e3 + delta.seconds * 1e3
- print "PASS: filling duration = %Ld ms" % milisec
-
-
- def static_random_verify(self, n_bytes_on_end=PAGE_SIZE):
- """
- Check memory to see if it contains correct contents.
-
- @return: if data in memory is correct return PASS
- else print some wrong data and return FAIL.
- """
- self.f.seek(0)
- e = 2
- page = self.random_page(self.random_key)
- random.seed(self.random_key)
- p = copy.copy(page)
- failure = False
- for pages in range(self.npages):
- rand = random.randint(((PAGE_SIZE/page.itemsize) - 1) -
- (n_bytes_on_end/page.itemsize),
- (PAGE_SIZE/page.itemsize) - 1)
- p[rand] = pages
- pf = array.array(self.allocate_by)
- pf.fromfile(self.f, PAGE_SIZE / pf.itemsize)
- if not (p == pf):
- failure = True
- self.compare_page(p, pf)
- e = e - 1
- if e == 0:
- break
- p[rand] = page[rand]
- if failure:
- print "FAIL: Random series verification"
- else:
- print "PASS: Random series verification"
-
-
-def die():
- """
- Quit allocator.
- """
- exit(0)
-
-
-def main():
- """
- Main (infinite) loop of allocator.
- """
- print "PASS: Start"
- end = False
- while not end:
- str = raw_input()
- exec str
-
-
-if __name__ == "__main__":
- main()
diff --git a/client/tests/kvm/scripts/multicast_guest.py b/client/tests/kvm/scripts/multicast_guest.py
deleted file mode 100755
index 350cd5f..0000000
--- a/client/tests/kvm/scripts/multicast_guest.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/python
-import socket, struct, os, signal, sys
-# -*- coding: utf-8 -*-
-
-"""
-Script used to join machine into multicast groups.
-
-@author Amos Kong <[email protected]>
-"""
-
-if __name__ == "__main__":
- if len(sys.argv) < 4:
- print """%s [mgroup_count] [prefix] [suffix]
- mgroup_count: count of multicast addresses
- prefix: multicast address prefix
- suffix: multicast address suffix""" % sys.argv[0]
- sys.exit()
-
- mgroup_count = int(sys.argv[1])
- prefix = sys.argv[2]
- suffix = int(sys.argv[3])
-
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- for i in range(mgroup_count):
- mcast = prefix + "." + str(suffix + i)
- try:
- mreq = struct.pack("4sl", socket.inet_aton(mcast),
- socket.INADDR_ANY)
- s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
- except:
- s.close()
- print "Could not join multicast: %s" % mcast
- raise
-
- print "join_mcast_pid:%s" % os.getpid()
- os.kill(os.getpid(), signal.SIGSTOP)
- s.close()
diff --git a/client/tests/kvm/scripts/virtio_console_guest.py b/client/tests/kvm/scripts/virtio_console_guest.py
deleted file mode 100755
index 8f0bb9f..0000000
--- a/client/tests/kvm/scripts/virtio_console_guest.py
+++ /dev/null
@@ -1,929 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
-Auxiliary script used to send data between ports on guests.
-
-@copyright: 2010 Red Hat, Inc.
-@author: Jiri Zupka ([email protected])
-@author: Lukas Doktor ([email protected])
-"""
-import threading
-from threading import Thread
-import os, select, re, random, sys, array, stat
-import fcntl, traceback, signal, time
-
-DEBUGPATH = "/sys/kernel/debug"
-SYSFSPATH = "/sys/class/virtio-ports/"
-DEVPATH = "/dev/virtio-ports/"
-
-exiting = False
-
-class VirtioGuest:
- """
- Test tools of virtio_ports.
- """
- LOOP_NONE = 0
- LOOP_POLL = 1
- LOOP_SELECT = 2
-
- def __init__(self):
- self.files = {}
- self.exit_thread = threading.Event()
- self.threads = []
- self.ports = {}
- self.poll_fds = {}
- self.catch_signal = None
- self.use_config = threading.Event()
-
-
- def _readfile(self, name):
- """
- Read file and return content as string
-
- @param name: Name of file
- @return: Content of file as string
- """
- out = ""
- try:
- f = open(name, "r")
- out = f.read()
- f.close()
- except:
- print "FAIL: Cannot open file %s" % (name)
-
- return out
-
-
- def _get_port_status(self, in_files=None):
- """
- Get info about ports from kernel debugfs.
-
- @param in_files: Array of input files.
- @return: Ports dictionary of port properties
- """
- ports = {}
- not_present_msg = "FAIL: There's no virtio-ports dir in debugfs"
- if not os.path.ismount(DEBUGPATH):
- os.system('mount -t debugfs none %s' % (DEBUGPATH))
- try:
- if not os.path.isdir('%s/virtio-ports' % (DEBUGPATH)):
- print not_present_msg
- except:
- print not_present_msg
- else:
- viop_names = os.listdir('%s/virtio-ports' % (DEBUGPATH))
- if in_files is not None:
- dev_names = os.listdir('/dev')
- rep = re.compile(r"vport[0-9]p[0-9]+")
- dev_names = filter(lambda x: rep.match(x) is not None, dev_names)
- if len(dev_names) != len(in_files):
- print ("FAIL: Not all ports were successfully initialized "
- "in /dev, only %d from %d." % (len(dev_names),
- len(in_files)))
- return
-
- if len(viop_names) != len(in_files):
- print ("FAIL: Not all ports were successfuly initialized "
- "in debugfs, only %d from %d." % (len(viop_names),
- len(in_files)))
- return
-
- for name in viop_names:
- open_db_file = "%s/virtio-ports/%s" % (DEBUGPATH, name)
- f = open(open_db_file, 'r')
- port = {}
- file = []
- for line in iter(f):
- file.append(line)
- try:
- for line in file:
- m = re.match("(\S+): (\S+)", line)
- port[m.group(1)] = m.group(2)
-
- if port['is_console'] == "yes":
- port["path"] = "/dev/hvc%s" % (port["console_vtermno"])
- # Console works like a serialport
- else:
- port["path"] = "/dev/%s" % name
-
- if not os.path.exists(port['path']):
- print "FAIL: %s not exist" % port['path']
-
- sysfspath = SYSFSPATH + name
- if not os.path.isdir(sysfspath):
- print "FAIL: %s not exist" % (sysfspath)
-
- info_name = sysfspath + "/name"
- port_name = self._readfile(info_name).strip()
- if port_name != port["name"]:
- print ("FAIL: Port info does not match "
- "\n%s - %s\n%s - %s" %
- (info_name , port_name,
- "%s/virtio-ports/%s" % (DEBUGPATH, name),
- port["name"]))
- dev_ppath = DEVPATH + port_name
- if not os.path.exists(dev_ppath):
- print "FAIL: Symlink %s does not exist." % dev_ppath
- if not os.path.realpath(dev_ppath) != "/dev/name":
- print "FAIL: Symlink %s is not correct." % dev_ppath
- except AttributeError:
- print ("Bad data on file %s:\n%s. " %
- (open_db_file, "".join(file).strip()))
- print "FAIL: Bad data on file %s." % open_db_file
- return
-
- ports[port['name']] = port
- f.close()
-
- return ports
-
-
- def check_zero_sym(self):
- """
- Check if port /dev/vport0p0 was created.
- """
- symlink = "/dev/vport0p0"
- if os.path.exists(symlink):
- print "PASS: Symlink %s exists." % symlink
- else:
- print "FAIL: Symlink %s does not exist." % symlink
-
-
- def init(self, in_files):
- """
- Init and check port properties.
- """
- self.ports = self._get_port_status(in_files)
-
- if self.ports is None:
- return
- for item in in_files:
- if (item[1] != self.ports[item[0]]["is_console"]):
- print self.ports
- print "FAIL: Host console is not like console on guest side\n"
- return
-
- print "PASS: Init and check virtioconsole files in system."
-
-
- class Switch(Thread):
- """
- Thread that sends data between ports.
- """
- def __init__ (self, in_files, out_files, event,
- cachesize=1024, method=0):
- """
- @param in_files: Array of input files.
- @param out_files: Array of output files.
- @param method: Method of read/write access.
- @param cachesize: Block to receive and send.
- """
- Thread.__init__(self, name="Switch")
-
- self.in_files = in_files
- self.out_files = out_files
- self.exit_thread = event
- self.method = method
-
- self.cachesize = cachesize
-
-
- def _none_mode(self):
- """
- Read and write to device in blocking mode
- """
- data = ""
- while not self.exit_thread.isSet():
- data = ""
- for desc in self.in_files:
- data += os.read(desc, self.cachesize)
- if data != "":
- for desc in self.out_files:
- os.write(desc, data)
-
-
- def _poll_mode(self):
- """
- Read and write to device in polling mode.
- """
-
- pi = select.poll()
- po = select.poll()
-
- for fd in self.in_files:
- pi.register(fd, select.POLLIN)
-
- for fd in self.out_files:
- po.register(fd, select.POLLOUT)
-
- while not self.exit_thread.isSet():
- data = ""
- t_out = self.out_files
-
- readyf = pi.poll(1.0)
- for i in readyf:
- data += os.read(i[0], self.cachesize)
-
- if data != "":
- while ((len(t_out) != len(readyf)) and not
- self.exit_thread.isSet()):
- readyf = po.poll(1.0)
- for desc in t_out:
- os.write(desc, data)
-
-
- def _select_mode(self):
- """
- Read and write to device in selecting mode.
- """
- while not self.exit_thread.isSet():
- ret = select.select(self.in_files, [], [], 1.0)
- data = ""
- if ret[0] != []:
- for desc in ret[0]:
- data += os.read(desc, self.cachesize)
- if data != "":
- ret = select.select([], self.out_files, [], 1.0)
- while ((len(self.out_files) != len(ret[1])) and not
- self.exit_thread.isSet()):
- ret = select.select([], self.out_files, [], 1.0)
- for desc in ret[1]:
- os.write(desc, data)
-
-
- def run(self):
- if (self.method == VirtioGuest.LOOP_POLL):
- self._poll_mode()
- elif (self.method == VirtioGuest.LOOP_SELECT):
- self._select_mode()
- else:
- self._none_mode()
-
-
- class Sender(Thread):
- """
- Creates a thread which sends random blocks of data to dst port.
- """
- def __init__(self, port, event, length):
- """
- @param port: Destination port
- @param length: Length of the random data block
- """
- Thread.__init__(self, name="Sender")
- self.port = port
- self.exit_thread = event
- self.data = array.array('L')
- for i in range(max(length / self.data.itemsize, 1)):
- self.data.append(random.randrange(sys.maxint))
-
- def run(self):
- while not self.exit_thread.isSet():
- os.write(self.port, self.data)
-
-
- def _open(self, in_files):
- """
- Open devices and return array of descriptors
-
- @param in_files: Files array
- @return: Array of descriptor
- """
- f = []
-
- for item in in_files:
- name = self.ports[item]["path"]
- if (name in self.files):
- f.append(self.files[name])
- else:
- try:
- self.files[name] = os.open(name, os.O_RDWR)
- if (self.ports[item]["is_console"] == "yes"):
- print os.system("stty -F %s raw -echo" % (name))
- print os.system("stty -F %s -a" % (name))
- f.append(self.files[name])
- except Exception, inst:
- print "FAIL: Failed to open file %s" % (name)
- raise inst
- return f
-
- @staticmethod
- def pollmask_to_str(mask):
- """
- Conver pool mast to string
-
- @param mask: poll return mask
- """
- str = ""
- if (mask & select.POLLIN):
- str += "IN "
- if (mask & select.POLLPRI):
- str += "PRI IN "
- if (mask & select.POLLOUT):
- str += "OUT "
- if (mask & select.POLLERR):
- str += "ERR "
- if (mask & select.POLLHUP):
- str += "HUP "
- if (mask & select.POLLMSG):
- str += "MSG "
- return str
-
-
- def poll(self, port, expected, timeout=500):
- """
- Pool event from device and print event like text.
-
- @param file: Device.
- """
- in_f = self._open([port])
-
- p = select.poll()
- p.register(in_f[0])
-
- mask = p.poll(timeout)
-
- maskstr = VirtioGuest.pollmask_to_str(mask[0][1])
- if (mask[0][1] & expected) == expected:
- print "PASS: Events: " + maskstr
- else:
- emaskstr = VirtioGuest.pollmask_to_str(expected)
- print "FAIL: Events: " + maskstr + " Expected: " + emaskstr
-
-
- def lseek(self, port, pos, how):
- """
- Use lseek on the device. The device is unseekable so PASS is returned
- when lseek command fails and vice versa.
-
- @param port: Name of the port
- @param pos: Offset
- @param how: Relativ offset os.SEEK_{SET,CUR,END}
- """
- fd = self._open([port])[0]
-
- try:
- os.lseek(fd, pos, how)
- except Exception, inst:
- if inst.errno == 29:
- print "PASS: the lseek failed as expected"
- else:
- print inst
- print "FAIL: unknown error"
- else:
- print "FAIL: the lseek unexpectedly passed"
-
-
- def blocking(self, port, mode=False):
- """
- Set port function mode blocking/nonblocking
-
- @param port: port to set mode
- @param mode: False to set nonblock mode, True for block mode
- """
- fd = self._open([port])[0]
-
- try:
- fl = fcntl.fcntl(fd, fcntl.F_GETFL)
- if not mode:
- fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
- else:
- fcntl.fcntl(fd, fcntl.F_SETFL, fl & ~os.O_NONBLOCK)
-
- except Exception, inst:
- print "FAIL: Setting (non)blocking mode: " + str(inst)
- return
-
- if mode:
- print "PASS: set to blocking mode"
- else:
- print "PASS: set to nonblocking mode"
-
-
- def __call__(self, sig, frame):
- """
- Call function. Used for signal handle.
- """
- if (sig == signal.SIGIO):
- self.sigio_handler(sig, frame)
-
-
- def sigio_handler(self, sig, frame):
- """
- Handler for sigio operation.
-
- @param sig: signal which call handler.
- @param frame: frame of caller
- """
- if self.poll_fds:
- p = select.poll()
- map(p.register, self.poll_fds.keys())
-
- masks = p.poll(1)
- print masks
- for mask in masks:
- self.poll_fds[mask[0]][1] |= mask[1]
-
-
- def get_sigio_poll_return(self, port):
- """
- Return PASS, FAIL and poll walue in string format.
-
- @param port: Port to check poll information.
- """
- fd = self._open([port])[0]
-
- maskstr = VirtioGuest.pollmask_to_str(self.poll_fds[fd][1])
- if (self.poll_fds[fd][0] ^ self.poll_fds[fd][1]):
- emaskstr = VirtioGuest.pollmask_to_str(self.poll_fds[fd][0])
- print "FAIL: Events: " + maskstr + " Expected: " + emaskstr
- else:
- print "PASS: Events: " + maskstr
- self.poll_fds[fd][1] = 0
-
-
- def set_pool_want_return(self, port, poll_value):
- """
- Set value to static variable.
-
- @param port: Port which should be set excepted mask
- @param poll_value: Value to check sigio signal.
- """
- fd = self._open([port])[0]
- self.poll_fds[fd] = [poll_value, 0]
- print "PASS: Events: " + VirtioGuest.pollmask_to_str(poll_value)
-
-
- def catching_signal(self):
- """
- return: True if should set catch signal, False if ignore signal and
- none when configuration is not changed.
- """
- ret = self.catch_signal
- self.catch_signal = None
- return ret
-
-
- def async(self, port, mode=True, exp_val=0):
- """
- Set port function mode async/sync.
-
- @param port: port which should be pooled.
- @param mode: False to set sync mode, True for sync mode.
- @param exp_val: Value which should be pooled.
- """
- fd = self._open([port])[0]
-
- try:
- fcntl.fcntl(fd, fcntl.F_SETOWN, os.getpid())
- fl = fcntl.fcntl(fd, fcntl.F_GETFL)
-
- self.use_config.clear()
- if mode:
- fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_ASYNC)
- self.poll_fds[fd] = [exp_val, 0]
- self.catch_signal = True
- else:
- del self.poll_fds[fd]
- fcntl.fcntl(fd, fcntl.F_SETFL, fl & ~os.O_ASYNC)
- self.catch_signal = False
-
- os.kill(os.getpid(), signal.SIGUSR1)
- self.use_config.wait()
-
- except Exception, inst:
- print "FAIL: Setting (a)sync mode: " + str(inst)
- return
-
- if mode:
- print "PASS: Set to async mode"
- else:
- print "PASS: Set to sync mode"
-
-
- def close(self, file):
- """
- Close open port.
-
- @param file: File to close.
- """
- descriptor = None
- path = self.ports[file]["path"]
- if path is not None:
- if path in self.files.keys():
- descriptor = self.files[path]
- del self.files[path]
- if descriptor is not None:
- try:
- os.close(descriptor)
- except Exception, inst:
- print "FAIL: Closing the file: " + str(inst)
- return
- print "PASS: Close"
-
-
- def open(self, in_file):
- """
- Direct open devices.
-
- @param in_file: Array of files.
- @return: Array of descriptors.
- """
- name = self.ports[in_file]["path"]
- try:
- self.files[name] = os.open(name, os.O_RDWR)
- if (self.ports[in_file]["is_console"] == "yes"):
- print os.system("stty -F %s raw -echo" % (name))
- print "PASS: Open all filles correctly."
- except Exception, inst:
- print "%s\nFAIL: Failed open file %s" % (str(inst), name)
-
-
- def loopback(self, in_files, out_files, cachesize=1024, mode=LOOP_NONE):
- """
- Start a switch thread.
-
- (There is a problem with multiple opens of a single file).
-
- @param in_files: Array of input files.
- @param out_files: Array of output files.
- @param cachesize: Cachesize.
- @param mode: Mode of switch.
- """
- self.ports = self._get_port_status()
-
- in_f = self._open(in_files)
- out_f = self._open(out_files)
-
- s = self.Switch(in_f, out_f, self.exit_thread, cachesize, mode)
- s.start()
- self.threads.append(s)
- print "PASS: Start switch"
-
-
- def exit_threads(self):
- """
- Function end all running data switch.
- """
- self.exit_thread.set()
- for th in self.threads:
- print "join"
- th.join()
- self.exit_thread.clear()
-
- del self.threads[:]
- for desc in self.files.itervalues():
- os.close(desc)
- self.files.clear()
- print "PASS: All threads finished"
-
-
- def die(self):
- """
- Quit consoleswitch.
- """
- self.exit_threads()
- exit()
-
-
- def send_loop_init(self, port, length):
- """
- Prepares the sender thread. Requires clean thread structure.
- """
- self.ports = self._get_port_status()
- in_f = self._open([port])
-
- self.threads.append(self.Sender(in_f[0], self.exit_thread, length))
- print "PASS: Sender prepare"
-
-
- def send_loop(self):
- """
- Start sender data transfer. Requires senderprepare run first.
- """
- self.threads[0].start()
- print "PASS: Sender start"
-
-
- def send(self, port, length=1, mode=True, is_static=False):
- """
- Send a data of some length
-
- @param port: Port to write data
- @param length: Length of data
- @param mode: True = loop mode, False = one shoot mode
- """
- in_f = self._open([port])
-
- data = ""
- writes = 0
-
- if not is_static:
- while len(data) < length:
- data += "%c" % random.randrange(255)
- try:
- writes = os.write(in_f[0], data)
- except Exception, inst:
- print inst
- else:
- while len(data) < 4096:
- data += "%c" % random.randrange(255)
- if mode:
- while (writes < length):
- try:
- writes += os.write(in_f[0], data)
- except Exception, inst:
- print inst
- if writes >= length:
- print "PASS: Send data length %d" % writes
- else:
- print ("FAIL: Partial send: desired %d, transfered %d" %
- (length, writes))
-
-
- def recv(self, port, length=1, buffer=1024, mode=True):
- """
- Recv a data of some length
-
- @param port: Port to write data
- @param length: Length of data
- @param mode: True = loop mode, False = one shoot mode
- """
- in_f = self._open([port])
-
- recvs = ""
- try:
- recvs = os.read(in_f[0], buffer)
- except Exception, inst:
- print inst
- if mode:
- while (len(recvs) < length):
- try:
- recvs += os.read(in_f[0], buffer)
- except Exception, inst:
- print inst
- if len(recvs) >= length:
- print "PASS: Recv data length %d" % len(recvs)
- else:
- print ("FAIL: Partial recv: desired %d, transfered %d" %
- (length, len(recvs)))
-
-
- def clean_port(self, port, buffer=1024):
- in_f = self._open([port])
- ret = select.select([in_f[0]], [], [], 1.0)
- buf = ""
- if ret[0]:
- buf = os.read(in_f[0], buffer)
- print ("PASS: Rest in socket: ") + str(buf[:10])
-
-
-def is_alive():
- """
- Check is only main thread is alive and if guest react.
- """
- if threading.activeCount() == 2:
- print ("PASS: Guest is ok no thread alive")
- else:
- threads = ""
- for thread in threading.enumerate():
- threads += thread.name + ", "
- print ("FAIL: On guest run thread. Active thread:" + threads)
-
-
-def compile():
- """
- Compile virtio_console_guest.py to speed up.
- """
- import py_compile
- py_compile.compile(sys.path[0] + "/virtio_console_guest.py")
- print "PASS: compile"
- sys.exit()
-
-
-def guest_exit():
- global exiting
- exiting = True
-
-
-def worker(virt):
- """
- Worker thread (infinite) loop of virtio_guest.
- """
- global exiting
- print "PASS: Daemon start."
- p = select.poll()
- p.register(sys.stdin.fileno())
- while not exiting:
- d = p.poll()
- if (d[0][1] == select.POLLIN):
- str = raw_input()
- try:
- exec str
- except:
- exc_type, exc_value, exc_traceback = sys.exc_info()
- print "On Guest exception from: \n" + "".join(
- traceback.format_exception(exc_type,
- exc_value,
- exc_traceback))
- print "FAIL: Guest command exception."
- elif (d[0][1] & select.POLLHUP):
- time.sleep(0.5)
-
-
-def sigusr_handler(sig, frame):
- pass
-
-
-class Daemon:
- """
- Daemonize guest
- """
- def __init__(self, stdin, stdout, stderr):
- """
- Init daemon.
-
- @param stdin: path to stdin file.
- @param stdout: path to stdout file.
- @param stderr: path to stderr file.
- """
- self.stdin = stdin
- self.stdout = stdout
- self.stderr = stderr
-
-
- @staticmethod
- def is_file_open(path):
- """
- Determine process which open file.
-
- @param path: Path to file.
- @return [[pid,mode], ... ].
- """
- opens = []
- pids = os.listdir('/proc')
- for pid in sorted(pids):
- try:
- int(pid)
- except ValueError:
- continue
- fd_dir = os.path.join('/proc', pid, 'fd')
- try:
- for file in os.listdir(fd_dir):
- try:
- p = os.path.join(fd_dir, file)
- link = os.readlink(os.path.join(fd_dir, file))
- if link == path:
- mode = os.lstat(p).st_mode
- opens.append([pid, mode])
- except OSError:
- continue
- except OSError, e:
- if e.errno == 2:
- continue
- raise
- return opens
-
-
- def daemonize(self):
- """
- Run guest as a daemon.
- """
- try:
- pid = os.fork()
- if pid > 0:
- return False
- except OSError, e:
- sys.stderr.write("Daemonize failed: %s\n" % (e))
- sys.exit(1)
-
- os.chdir("/")
- os.setsid()
- os.umask(0)
-
- try:
- pid = os.fork()
- if pid > 0:
- sys.exit(0)
- except OSError, e:
- sys.stderr.write("Daemonize failed: %s\n" % (e))
- sys.exit(1)
-
- sys.stdout.flush()
- sys.stderr.flush()
- si = file(self.stdin,'r')
- so = file(self.stdout,'w')
- se = file(self.stderr,'w')
-
- os.dup2(si.fileno(), sys.stdin.fileno())
- os.dup2(so.fileno(), sys.stdout.fileno())
- os.dup2(se.fileno(), sys.stderr.fileno())
-
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
- return True
-
-
- def start(self):
- """
- Start the daemon
-
- @return: PID of daemon.
- """
- # Check for a pidfile to see if the daemon already runs
- openers = self.is_file_open(self.stdout)
- rundaemon = False
- if len(openers) > 0:
- for i in openers:
- if i[1] & stat.S_IWUSR:
- rundaemon = True
- openers.remove(i)
- if len(openers) > 0:
- for i in openers:
- os.kill(int(i[0]), 9)
- time.sleep(0.3)
-
- # Start the daemon
- if not rundaemon:
- if self.daemonize():
- self.run()
-
-
- def run(self):
- """
- Run guest main thread
- """
- global exiting
- virt = VirtioGuest()
- slave = Thread(target=worker, args=(virt, ))
- slave.start()
- signal.signal(signal.SIGUSR1, sigusr_handler)
- signal.signal(signal.SIGALRM, sigusr_handler)
- while not exiting:
- signal.alarm(1)
- signal.pause()
- catch = virt.catching_signal()
- if catch:
- signal.signal(signal.SIGIO, virt)
- elif catch is False:
- signal.signal(signal.SIGIO, signal.SIG_DFL)
- if catch is not None:
- virt.use_config.set()
- print "PASS: guest_exit"
- sys.exit(0)
-
-
-def main():
- """
- Main function with infinite loop to catch signal from system.
- """
- if (len(sys.argv) > 1) and (sys.argv[1] == "-c"):
- compile()
- stdin = "/tmp/guest_daemon_pi"
- stdout = "/tmp/guest_daemon_po"
- stderr = "/tmp/guest_daemon_pe"
-
- for f in [stdin, stdout, stderr]:
- try:
- os.mkfifo(f)
- except OSError, e:
- if e.errno == 17:
- pass
-
- daemon = Daemon(stdin,
- stdout,
- stderr)
- daemon.start()
-
- d_stdin = os.open(stdin, os.O_WRONLY)
- d_stdout = os.open(stdout, os.O_RDONLY)
- d_stderr = os.open(stderr, os.O_RDONLY)
-
- s_stdin = sys.stdin.fileno()
- s_stdout = sys.stdout.fileno()
- s_stderr = sys.stderr.fileno()
-
- pid = filter(lambda x: x[0] != str(os.getpid()),
- daemon.is_file_open(stdout))[0][0]
-
- print "PASS: Start"
-
- while 1:
- ret = select.select([d_stderr,
- d_stdout,
- s_stdin],
- [], [], 1.0)
- if s_stdin in ret[0]:
- os.write(d_stdin,os.read(s_stdin, 1))
- if d_stdout in ret[0]:
- os.write(s_stdout,os.read(d_stdout, 1024))
- if d_stderr in ret[0]:
- os.write(s_stderr,os.read(d_stderr, 1024))
- if not os.path.exists("/proc/" + pid):
- sys.exit(0)
-
- os.close(d_stdin)
- os.close(d_stdout)
- os.close(d_stderr)
-
-if __name__ == "__main__":
- main()
diff --git a/client/tests/kvm/steps/Belenix-0.7.1.steps b/client/tests/kvm/steps/Belenix-0.7.1.steps
deleted file mode 100644
index 1bd2e94..0000000
--- a/client/tests/kvm/steps/Belenix-0.7.1.steps
+++ /dev/null
@@ -1,198 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 293518701478)
-# Generated on Sat Nov 29 10:43:40 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 blank.qcow2 -cdrom /home/cyber/Installs/belenix_0.7.1.iso -m 512 -nographic -monitor unix:/tmp/monitor_293518701478,server,nowait &
-# --------------------------------
-step 8.02
-screendump 20080101_000001_faeea727b5f7cd77c57fb767fa33d992.ppm
-# grub
-barrier_2 90 36 19 61 e59b18177a40dc7e5d07acad87077435 40
-# Sending keys: ret
-key ret
-# --------------------------------
-step 39.78
-screendump 20080101_000002_28b81bcbfeb52ea67199deabac54e12a.ppm
-# keyboard layout
-sleep 50
-# Sending keys: ret
-key ret
-# --------------------------------
-step 43.14
-screendump 20080101_000003_d8c8456000a07b4e1166ced3d70f1497.ppm
-# desktop -- kde
-barrier_2 263 76 217 73 40a30a742e15cb93ba99a2ce9c2a15cf 17
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 152.62
-screendump 20080101_000004_f3f18b6adb395fe0dd83e223798ce733.ppm
-# desktop reached -- start firefox
-barrier_2 305 131 362 357 b9446171dae321d66de06ebaf74184c5 547
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 156.43
-screendump 20080101_000005_12cb0722c56ec8dfb7c84049c4a231ac.ppm
-barrier_2 190 139 423 228 4bb87189bef6d0a875c7e14501017620 19
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 160.42
-screendump 20080101_000006_3ebe83cee41275a7b42412d710382ec6.ppm
-barrier_2 167 37 424 266 1679a5be13cd88f748e9c9496664ba99 20
-# Sending keys: right
-key right
-# --------------------------------
-step 163.64
-screendump 20080101_000007_4fd54b21326c5b3b480a80c65c3a2452.ppm
-barrier_2 198 68 643 283 8b28d595a8bc63ed5fddf63d710bce4e 16
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 218.29
-screendump 20080101_000008_18a7dae388daf036d0f1b7b807a73086.ppm
-# accept license
-barrier_2 291 46 273 468 ef442a0f007797a35477cd95e7f23c6e 273
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 221.45
-screendump 20080101_000009_a64c3d74b407bb9abe12c36fd9c607d2.ppm
-barrier_2 107 46 272 468 bbede757893f30bdca435b42c54e7c9f 16
-# Sending keys: tab
-key tab
-# --------------------------------
-step 227.00
-screendump 20080101_000010_34a37f23a3dd3b9b9f6c60be781a5253.ppm
-# Sending keys: tab
-key tab
-# --------------------------------
-step 228.50
-screendump 20080101_000011_bab065dcc95361824c48d3118ee1a7f8.ppm
-barrier_2 160 48 602 509 2c9ec1b3ec2e12b63bbf9f4da59d6294 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 237.18
-screendump 20080101_000012_f7e5a8ec78ec58babe440b48fc2fc8bb.ppm
-# firefox started, close it
-barrier_2 454 59 29 130 876cde3f73493357c731650212939a4e 43
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 240.38
-screendump 20080101_000013_2bb6953caced1efd98cf49d34e967e1b.ppm
-# start konqueror
-barrier_2 345 153 340 344 492f43889529807d8349a9f4830818c1 16
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 242.56
-screendump 20080101_000014_e895501b1d7c948a13e65bf13621dd9f.ppm
-barrier_2 129 102 424 251 b486d6cd2f7b82f5f7157294f980b9d6 11
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 244.06
-screendump 20080101_000015_072184da2b9178c96f34911e99c3844a.ppm
-barrier_2 101 65 422 262 26bd8ec9ca29dc2445e3eae5fd1ccab5 7
-# Sending keys: right
-key right
-# --------------------------------
-step 245.44
-screendump 20080101_000016_ee6cd144e63592ed4c29d598d3104a30.ppm
-barrier_2 189 109 641 294 9e3a72ce62ade9b1ddc1870e884014ea 7
-# Sending keys: up up up up up up up up
-key up
-key up
-key up
-key up
-key up
-key up
-key up
-key up
-# --------------------------------
-step 249.45
-screendump 20080101_000017_524bc6237a16cfda5bf295235cac3e7d.ppm
-barrier_2 100 33 641 496 75a24f919e1bcef0e6e5ced5166bdc5e 20
-# Sending keys: ret
-key ret
-# --------------------------------
-step 272.09
-screendump 20080101_000018_433a96ef62ae80d9bba33c3ac8ad9dec.ppm
-# konq started
-barrier_2 204 144 184 316 27d922b90794a9abaf15fe3288a37de5 113
-# Sending keys: tab
-key tab
-# --------------------------------
-step 274.12
-screendump 20080101_000019_302035f848a4a3885d26bfa4637b6c66.ppm
-# Sending keys: tab
-key tab
-# --------------------------------
-step 285.10
-screendump 20080101_000020_72d9fb0d9bde9d0935d9ff0055eea996.ppm
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 298.73
-screendump 20080101_000021_195999cf637458453b67cd641dd8ab30.ppm
-barrier_2 361 176 334 335 1ba0731876f475333f9404cb14779e06 68
-# Sending keys: down
-key down
-# --------------------------------
-step 300.44
-screendump 20080101_000022_3d7ceb3b1b533f860d674e1e2ec5b004.ppm
-# start dtrace toolkit something
-#barrier_2 76 79 0 70 067a6473139cd7f39868b7212e0e7d95 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 308.37
-screendump 20080101_000023_df08e0ac3b18aa1876ecab38a131f1b5.ppm
-# not much to do here
-barrier_2 144 85 234 241 fa3f2314a2426b58d5e375fa77d2a09b 40
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 336.71
-screendump 20080101_000024_e88b580a620c45b6fd19a5a4389456c9.ppm
-barrier_2 317 138 355 359 30d6f871aa43e8df117abc85bc9eb838 142
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 343.91
-screendump 20080101_000025_a556e95df6e8bc6a16d15d4adce5fec0.ppm
-# start some office thing
-barrier_2 118 114 425 261 bee21139e82d43ffd6e32bc401b988fe 36
-# Sending keys: down down down down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 346.86
-screendump 20080101_000026_45ae932346f66d2923bdedf9cc5b007f.ppm
-barrier_2 86 39 424 319 ccd1e7911df240b7334224d1b9b5aa0f 15
-# Sending keys: right
-key right
-# --------------------------------
-step 349.77
-screendump 20080101_000027_adefe48eb7438af24e9db7f9f9ec3dc2.ppm
-# evince
-barrier_2 138 98 642 336 910da689c11227e068cfb78718f0eebc 15
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 363.67
-screendump 20080101_000028_154608b407840aa3fe51bfc5f109f133.ppm
-# get out
-barrier_2 62 56 316 275 4a14ae41224673191d8e275de9aa3b1d 70
-#barrier_2 200 82 0 0 95f876863f57a27805f1bf664fbf77b6 70
-# Sending keys: alt-f4
-key alt-f4
diff --git a/client/tests/kvm/steps/CentOS5-64.steps b/client/tests/kvm/steps/CentOS5-64.steps
deleted file mode 100644
index e17755c..0000000
--- a/client/tests/kvm/steps/CentOS5-64.steps
+++ /dev/null
@@ -1,316 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 389702932126)
-# Generated on Thu Nov 13 09:51:29 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ./blank.qcow2 -cdrom /isos/linux/CentOS-5.0-x86_64-bin-DVD.iso -m 512 -nographic -monitor unix:/tmp/monitor_389702932126,server,nowait &
-# -------- Step 1 recorded at time 6.66 --------
-# install in graphical mode
-barrier_2 44 38 0 412 a2fb1835c7d2ce64b62bb92c6652dcb3 33
-# Sending keys: ret
-key ret
-# -------- Step 2 recorded at time 18.22 --------
-# skip media test
-barrier_2 344 178 182 103 1469c955e81a62411222d9e7191530f8 58
-# Sending keys: tab ret
-key tab
-key ret
-# -------- Step 3 recorded at time 43.36 --------
-barrier_2 245 102 555 498 2ff06e5dcdbfb8762eb5a5188c9d5d28 126
-# Sending keys: alt-n
-key alt-n
-# -------- Step 4 recorded at time 46.54 --------
-# language
-barrier_2 792 153 8 447 74d91650935bfd44435c84ad87a62379 16
-# Sending keys: alt-n
-key alt-n
-# -------- Step 5 recorded at time 51.67 --------
-# keyboard
-barrier_2 791 109 9 491 1a95ee41a824af72b7089af59e3bbf48 26
-# Sending keys: alt-n
-key alt-n
-# -------- Step 6 recorded at time 55.17 --------
-# erase all data?
-barrier_2 422 88 216 329 14946af3a289dbd7867b18a0097eeecb 17
-# Sending keys: alt-y
-key alt-y
-# -------- Step 7 recorded at time 60.79 --------
-# partitioning
-barrier_2 405 210 395 390 8e9c01f6de11172a2e8e29813edcaf8b 28
-# Sending keys: alt-n
-key alt-n
-# -------- Step 8 recorded at time 66.46 --------
-# are you sure?
-barrier_2 208 53 413 349 ec630a0e22ba5258dc14e2644425905c 28
-# Sending keys: alt-y
-key alt-y
-# -------- Step 9 recorded at time 69.60 --------
-# network
-barrier_2 239 271 561 329 ad41c1bc7ad4230cba54cb5d1696d27f 16
-# Sending keys: alt-n
-key alt-n
-# -------- Step 10 recorded at time 73.55 --------
-# timezone
-barrier_2 635 112 165 488 3b3a1a3f40d3e4146ec97073292aa396 20
-# Sending keys: alt-n
-key alt-n
-# -------- Step 11 recorded at time 76.81 --------
-# root password
-barrier_2 119 111 168 125 0e3de5f310b8fb2bdcddd2550545a04d 16
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# -------- Step 12 recorded at time 88.36 --------
-# packages
-barrier_2 161 109 17 120 361e5337363b4c5b9ab4da06c76ecd84 58
-# Sending keys: tab
-key tab
-# -------- Step 13 recorded at time 100.54 --------
-barrier_2 171 49 17 169 75bbe88c10d454cc7d02c4994c64d1f5 61
-# Sending keys: down down down down
-#key down
-#key down
-#key down
-#key down
-# -------- Step 14 recorded at time 105.31 --------
-# Sending keys: down down down
-#key down
-#key down
-#key down
-# -------- Step 15 recorded at time 109.33 --------
-# Sending keys: down down
-#key down
-#key down
-# -------- Step 16 recorded at time 124.18 --------
-# Sending keys: down
-#key down
-# -------- Step 17 recorded at time 133.92 --------
-# Sending keys: pgup
-#key pgup
-# -------- Step 18 recorded at time 136.83 --------
-# Sending keys: up up
-#key up
-#key up
-# -------- Step 19 recorded at time 139.88 --------
-# Sending keys: tab
-key tab
-# -------- Step 20 recorded at time 141.58 --------
-barrier_2 254 64 17 285 4f3f2672e487c6e3e127714755c86c2d 8
-# Sending keys: spc
-key spc
-# -------- Step 21 recorded at time 151.19 --------
-barrier_2 219 68 490 419 2e325c23af767568d9004ece68a7b07c 48
-# Sending keys: alt-c
-key alt-c
-# -------- Step 22 recorded at time 159.86 --------
-# Sending keys: alt-c
-key alt-c
-# -------- Step 23 recorded at time 162.17 --------
-barrier_2 139 49 174 469 32432ea19607dc924f2c52d6d4697676 12
-# Sending keys: alt-n
-key alt-n
-# -------- Step 24 recorded at time 167.44 --------
-# try to add development packages
-barrier_2 335 68 29 125 25620d666214041d2a0a18fd71f5dd1e 26
-# Sending keys: tab
-key tab
-# -------- Step 25 recorded at time 173.52 --------
-# Sending keys: tab
-key tab
-# -------- Step 26 recorded at time 177.43 --------
-# Sending keys: tab
-key tab
-# -------- Step 27 recorded at time 179.35 --------
-# Sending keys: tab
-key tab
-# -------- Step 28 recorded at time 181.30 --------
-# Sending keys: tab
-key tab
-# -------- Step 29 recorded at time 182.48 --------
-# Sending keys: tab tab
-key tab
-key tab
-# -------- Step 30 recorded at time 184.42 --------
-barrier_2 272 56 27 125 3c2b862886baf557edd564260b7738fd 10
-# Sending keys: down down
-key down
-key down
-# -------- Step 31 recorded at time 187.77 --------
-barrier_2 297 64 391 133 f908bab62e8e2582ae9baed2def08b82 17
-# Sending keys: tab
-key tab
-# -------- Step 32 recorded at time 189.41 --------
-barrier_2 285 52 391 129 8bc12db741fbc14460ae8b004dda58f0 8
-# Sending keys: spc down spc down down down down spc down down down down
-key spc
-key down
-key spc
-key down
-key down
-key down
-key down
-key spc
-key down
-key down
-key down
-key down
-# -------- Step 33 recorded at time 195.79 --------
-barrier_2 300 43 387 324 071f707e032413306f626fa8de266f8b 32
-# Sending keys: spc alt-n
-key spc
-key alt-n
-# -------- Step 34 recorded at time 313.56 --------
-# begin installation
-barrier_2 309 270 491 330 0a5a2bc2c3b052ca01ece66aae3844f7 589
-# Sending keys: alt-n
-key alt-n
-# -------- Step 35 recorded at time 2852.74 --------
-# installation complete -- reboot
-barrier_2 234 66 566 534 4c64d662af1da48e5d99227f4cf90f52 12696
-# Sending keys: alt-t
-key alt-t
-# Generated by stepmaker version 20081113 (instance: 509151510660)
-# Generated on Thu Nov 13 10:59:30 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ./blank.qcow2 -cdrom /isos/linux/CentOS-5.0-x86_64-bin-DVD.iso -m 512 -nographic -monitor unix:/tmp/monitor_509151510660,server,nowait &
-# -------- Step 1 recorded at time 5.67 --------
-# -------- Step 2 recorded at time 61.08 --------
-# first boot config
-barrier_2 230 58 570 542 6ac2e0647ac0fe23749c5f4960fc0163 400
-# Sending keys: alt-f
-key alt-f
-# -------- Step 3 recorded at time 64.25 --------
-# disable firewall
-barrier_2 144 46 167 127 b144badcceb083afafcd42d077884a72 16
-# Sending keys: tab
-key tab
-# -------- Step 4 recorded at time 67.61 --------
-barrier_2 143 44 166 128 f8ee80a4932e66b26263eca182941a03 17
-# Sending keys: spc
-key spc
-# -------- Step 5 recorded at time 69.56 --------
-barrier_2 86 57 227 130 944185b230d0bedf780eef52add7ddb4 10
-# Sending keys: down ret
-key down
-key ret
-# -------- Step 6 recorded at time 76.07 --------
-barrier_2 142 43 166 128 aca55986c91d7467ca06872e2153b2b9 33
-# Sending keys: alt-f
-key alt-f
-# -------- Step 7 recorded at time 81.36 --------
-# are you sure?
-#barrier_2 199 51 415 335 09a861330fd47ae1aed97d0ce098542c 26
-barrier_2 40 10 544 356 85e23182558bb416bf07aaad366ef122 26
-# Sending keys: alt-y
-key alt-y
-# -------- Step 8 recorded at time 86.37 --------
-# make SELinux permissive
-barrier_2 193 48 167 145 7fd095057a8f5c6a82ec3548d42ecf9f 25
-# Sending keys: spc
-key spc
-# -------- Step 9 recorded at time 89.59 --------
-barrier_2 42 73 288 158 08ef64e8e4a026481b64ccb1e2a877bb 16
-# Sending keys: down ret
-key down
-key ret
-# -------- Step 10 recorded at time 91.68 --------
-barrier_2 122 45 244 146 823de4b7f466885d2a7abd9b3cebd92b 10
-# Sending keys: alt-f
-key alt-f
-# -------- Step 11 recorded at time 99.97 --------
-# date and time
-barrier_2 21 431 723 169 6a3735523a0b5c88c56b912809a0e900 41
-# Sending keys: alt-f
-key alt-f
-# -------- Step 12 recorded at time 104.43 --------
-# user info
-barrier_2 88 155 337 126 2c9d5cd81c06697a00146f64b900ffb9 22
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# -------- Step 13 recorded at time 112.45 --------
-barrier_2 50 32 302 243 8650103f29ea96ba6119c943d1da314d 40
-# Sending keys: alt-f
-key alt-f
-# -------- Step 14 recorded at time 121.20 --------
-# sound card -- none detected
-barrier_2 168 505 632 95 b07e2279de5a939ab44c6a79b4d1e2d7 44
-# Sending keys: alt-f
-key alt-f
-# -------- Step 15 recorded at time 125.64 --------
-# finish
-barrier_2 205 56 595 544 9f08265eca44738cd91a5eba03130de7 22
-# Sending keys: alt-f
-key alt-f
-# -------- Step 16 recorded at time 141.49 --------
-# login
-barrier_2 55 74 331 298 4c735b82eb1854c0bc440afe021a0929 79
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 17 recorded at time 143.98 --------
-barrier_2 43 69 333 300 45c44e5210a41617f9fcc32abd3ebc56 12
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 18 recorded at time 160.13 --------
-# reached desktop -- shutdown
-barrier_2 143 200 0 0 2656288d0b7652f95e326200e05048c9 81
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 19 recorded at time 162.93 --------
-barrier_2 97 213 17 35 06f328240b027b84140b652d40fa052a 14
-# Sending keys: right right
-key right
-key right
-# -------- Step 20 recorded at time 166.61 --------
-sleep 10
-#barrier_2 93 236 188 33 d2cc1d8cc981b9b94b2335009c5c93d4 18
-# Sending keys: up ret
-key up
-key ret
-# -------- Step 21 recorded at time 172.03 --------
-# bye bye!
-sleep 15
-#barrier_2 195 46 431 311 1cff9c28bbfa7bb41c3f6ed399aaeb9f 27
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/DSL-4.2.5.steps b/client/tests/kvm/steps/DSL-4.2.5.steps
deleted file mode 100644
index 18d57e5..0000000
--- a/client/tests/kvm/steps/DSL-4.2.5.steps
+++ /dev/null
@@ -1,482 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 63561294903)
-# Generated on Thu Nov 13 08:33:45 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ./blank.qcow2 -cdrom /isos/linux/dsl-4.2.5.iso -m 512 -nographic -monitor unix:/tmp/monitor_63561294903,server,nowait &
-# --------------------------------
-step 5.11
-screendump 20080101_000001_4c2f2dd61819f16f8d8988cc8de81d1a.ppm
-barrier_2 44 56 0 394 a37e059808f79379a9e628fac18df9e2 26
-# Sending keys: i n s t a l l ret
-key i
-key n
-key s
-key t
-key a
-key l
-key l
-key ret
-# --------------------------------
-step 26.27
-screendump 20080101_000002_2616d668bbb4c71c46ecfde18cd6ea32.ppm
-# partition tool
-barrier_2 394 207 58 71 f01fe1b8e9eff36b3a225ff4f3673a61 106
-# Sending keys: 1 0 ret
-key 1
-key 0
-key ret
-# --------------------------------
-step 29.40
-screendump 20080101_000003_5cee7d014efbbab38be29c3e23f2ca7b.ppm
-# drive to partition
-barrier_2 345 18 0 16 36a28510a23e09d711b5e57683de7a94 16
-# Sometimes the barrier passes but keys are ignored
-sleep 1
-# Sending keys: h d a ret
-key h
-key d
-key a
-key ret
-# --------------------------------
-step 33.41
-screendump 20080101_000004_48b97c5b9fec59574dacb37b8f376701.ppm
-# start with a zero table
-barrier_2 398 35 0 365 26a34c699ec54f737694fa8a01b0dbe4 20
-# Sending keys: y
-key y
-# --------------------------------
-step 35.77
-screendump 20080101_000005_8d963a50372c2302ff49fd2118ca8544.ppm
-# new partition
-barrier_2 214 68 231 87 0113dcc7150147808c6ca4ad724592dc 12
-# Sending keys: shift-n
-key shift-n
-# --------------------------------
-step 37.93
-screendump 20080101_000006_8c1ee618a4190a5bbd1c2fe9c23b24cb.ppm
-# primary
-barrier_2 102 35 35 326 640193a50b92f75c368d5ee608901633 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 40.03
-screendump 20080101_000007_c9fa302243dad5e2fa581b52653a571d.ppm
-# whole disk
-barrier_2 126 28 36 328 d5dfb98852a7e659f7824aaa063def66 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 41.98
-screendump 20080101_000008_f320b1cc8d266dc766e036a76c25dc73.ppm
-# bootable
-barrier_2 108 31 35 329 551cb59dc44ad4ae6b5409879ec1c649 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 44.71
-screendump 20080101_000009_14d42e2d473a29666096fdbca34a79e8.ppm
-# write
-barrier_2 56 62 137 91 23af6565b81373c9ee51106372d13c90 14
-# Sending keys: shift-w
-key shift-w
-# --------------------------------
-step 46.77
-screendump 20080101_000010_79a58a5c6e1c9aec11ce729845969090.ppm
-# are you sure?
-barrier_2 632 59 37 331 1c5975e047939705c687510c877b2915 10
-# Sending keys: y e s ret
-key y
-key e
-key s
-key ret
-# --------------------------------
-step 56.33
-screendump 20080101_000011_913d1e535a03f56efca7764d73f037c1.ppm
-# quit
-barrier_2 278 20 216 366 f83e7e0600f343216a542dbab13d62cd 48
-# Sending keys: shift-q
-key shift-q
-# --------------------------------
-step 58.84
-screendump 20080101_000012_12a123a1679194f1f0ccfc601bef7b8a.ppm
-barrier_2 192 25 0 375 9b45f7b8591652b63a1cb2c9a9384d1d 13
-# Sending keys: ret
-key ret
-# --------------------------------
-step 61.33
-screendump 20080101_000013_2616d668bbb4c71c46ecfde18cd6ea32.ppm
-# install to hard drive
-barrier_2 328 47 61 105 2c7aa677773d9f12d364a16cfa7b08f3 12
-# Sending keys: 2 ret
-key 2
-key ret
-# --------------------------------
-step 67.36
-screendump 20080101_000014_96131302e7a62550680057cf1c21f6c1.ppm
-# target partition
-barrier_2 335 53 0 125 c8421c9579ed29435b6afa3f0103ebd7 30
-# Sending keys: h d a 1 ret
-key h
-key d
-key a
-key 1
-key ret
-# --------------------------------
-step 71.70
-screendump 20080101_000015_48556760a837b0be3f8cd748f3ac56cb.ppm
-# multi-user logins
-barrier_2 237 19 128 174 ff7b2dd18e27dfebc071ebbea72acb4f 22
-# Sending keys: n
-key n
-# --------------------------------
-step 74.22
-screendump 20080101_000016_ab0aa812f0078ffc1de0733cfe1b6a43.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 75.93
-screendump 20080101_000017_6f4507343b8d80bf3cf147b33af8533f.ppm
-# ext3?
-barrier_2 609 17 0 208 d556365bfc6eeec5b6669f644fb31cf7 9
-# Sending keys: y
-key y
-# --------------------------------
-step 78.48
-screendump 20080101_000018_3284933f5caedfeeedc05f3788866ea1.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 80.59
-screendump 20080101_000019_d47348af25b40fc34ac24763311bddff.ppm
-# continue?
-barrier_2 551 23 0 224 a401ac0d051f151fc32fa0112de19aca 11
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 494.96
-screendump 20080101_000020_bdc818b82a9bab2c02dd5815504d3741.ppm
-# install bootloader
-barrier_2 300 42 0 358 dce2fd7ba2715976fd6028c192ab0469 2072
-# Sending keys: y
-key y
-# --------------------------------
-step 497.03
-screendump 20080101_000021_6677294903144ad779f79f9f080d8f0d.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 499.65
-screendump 20080101_000022_f1f4dd8ef44c2f617275f9b9a2bc3de2.ppm
-# use grub
-barrier_2 440 17 0 383 f4e7440c1bf79918c149878878a2ddc0 13
-# Sending keys: g ret
-key g
-key ret
-# --------------------------------
-step 503.06
-screendump 20080101_000023_d24ff7c3212de3bb0d3541a5184024ab.ppm
-# reboot
-barrier_2 181 17 0 383 5b886d2e5052544e92872f09cee8a45b 17
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 527.22
-screendump 20080101_000024_c9abf329b1f5c84692331506012cea50.ppm
-sleep 50
-# Sending keys: ret
-key ret
-# --------------------------------
-step 534.32
-screendump 20080101_000025_cc45604c7d6caeaa3e0704e99dbecefb.ppm
-# boot DSL
-barrier_2 135 30 19 48 7b2e193b580a55dfbc8eb7fc1cdd9bb0 35
-# Sending keys: ret
-key ret
-# --------------------------------
-step 556.59
-screendump 20080101_000026_0b16e893619602b52c184cdaf6bfa40f.ppm
-# root password
-barrier_2 175 25 0 375 24b5ce02c2a142c9150c85fd4c87f59f 111
-# Sending keys: 1 2 3 4 5 6 ret 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 564.51
-screendump 20080101_000027_a84cf3a270ff46822f622ee66a156b44.ppm
-# password for user "dsl"
-barrier_2 175 24 0 376 06a0929bc49299de55a60c505126e920 40
-# Sending keys: 1 2 3 4 5 6 ret 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 571.23
-screendump 20080101_000028_a2bed9d851bdd24e356ecb81a3e6c5a3.ppm
-# vesa
-barrier_2 160 46 266 184 f05328514f17464c6ac1ba709a402775 34
-# Sending keys: ret
-key ret
-# --------------------------------
-step 574.41
-screendump 20080101_000029_2e367b9de13d94dc5a1d4a92136ac37e.ppm
-# USB mouse? no
-barrier_2 213 154 250 131 f7206ccfe7bbb6f6bde37c2d1fff9588 16
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 576.26
-screendump 20080101_000030_0c6e513f5bf53fe97718dc636279273b.ppm
-# IMPS/2 mouse? no
-barrier_2 255 153 233 131 cc9183fbc52289442775557aa2fb8b98 9
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 577.88
-screendump 20080101_000031_0a1a9ce6dc3afe60cb524815ac7a7afa.ppm
-# ps2 mouse
-barrier_2 342 31 63 135 09afb308bcca619c9f692efe5d8f457c 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 580.07
-screendump 20080101_000032_fc44859666f3c0ff60ab59ea2998501e.ppm
-# 2 buttons
-barrier_2 341 75 65 58 bcb9dd25cf5fffe4a8b22e81b3abad84 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 582.11
-screendump 20080101_000033_8ca577b220d250af69bf0fa2813b9887.ppm
-# 800x600
-barrier_2 157 44 261 88 335952a1f2456b55a85aeeca693a647f 10
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 584.23
-screendump 20080101_000034_b88f561cbb9127c57717beceedd8031c.ppm
-# 16 bit colors
-barrier_2 87 92 302 87 cb441ce405a311dca8dadc583f251a3c 11
-# Sending keys: down down ret
-key down
-key down
-key ret
-# --------------------------------
-step 587.53
-screendump 20080101_000035_610a5e42bc4aca48b80d3c6904afe4b2.ppm
-# choose your own DPI? no
-barrier_2 488 86 101 153 bf44c269ae02f21fb1dbcd219784a8f2 17
-# Sending keys: ret
-key ret
-# --------------------------------
-step 590.10
-screendump 20080101_000036_357d05a4666eec65eaabb192f749b253.ppm
-# keyboard
-barrier_2 399 37 136 38 bb7cb8b3c325623838e5995dc11e8aa5 13
-# Sending keys: ret
-key ret
-# --------------------------------
-step 597.32
-screendump 20080101_000037_bb3ae7772015de8b690d6413a0a87dc1.ppm
-# X started; run xterm
-barrier_2 215 36 318 564 deaadd00025523de42323f245f8b5a55 36
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 601.37
-screendump 20080101_000038_65cc3f92540ec7a94f6c26a412ba487b.ppm
-barrier_2 72 174 10 9 edd8f8853cd723d92c6b7295a5793fd4 20
-# Sending keys: up up
-key up
-key up
-# --------------------------------
-step 604.81
-screendump 20080101_000039_4f5bc1c47a75c547212a8ae09e0656a1.ppm
-barrier_2 81 38 31 213 ab86b82ca555e36069d3d853e175ae6f 17
-# Sending keys: ret
-key ret
-# --------------------------------
-step 607.21
-screendump 20080101_000040_fb050cc61a831366bc6fc5e1d4fae48f.ppm
-barrier_2 143 38 83 56 1cbccaa3e3b6253d318aee3076920cdb 12
-# Sending keys: x t e r m ret
-key x
-key t
-key e
-key r
-key m
-key ret
-# --------------------------------
-step 611.38
-screendump 20080101_000041_87298c9e1729658722f01d28a50e05e3.ppm
-# maximize window
-barrier_2 81 34 53 52 fc02b7cb12c18496e264a54e2141a419 21
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 616.47
-screendump 20080101_000042_46d72d019ecf84d0eed729b194a08495.ppm
-barrier_2 61 175 57 75 213259cf415a8ea02c4e94b5a9e327be 25
-# Sending keys: down down down down ret
-key down
-key down
-key down
-key down
-key ret
-# --------------------------------
-step 626.21
-screendump 20080101_000043_32d0da6e4ed3a38fbd03192617e23c43.ppm
-# enable SSH: ln -s /etc/init.d/ssh /etc/rc5.d/S90ssh
-barrier_2 77 33 9 8 83958b6aae9cc591e25cda540469500d 49
-# Sending keys: l n spc minus s spc slash e t c slash i n i t dot d slash s s h spc slash e t c slash r c 5 dot d slash shift-s 9 0 s s h ret
-key ret
-key ret
-#key l
-#key n
-#key spc
-#key minus
-#key s
-#key spc
-#key slash
-#key e
-#key t
-#key c
-#key slash
-#key i
-#key n
-#key i
-#key t
-#key dot
-#key d
-#key slash
-#key s
-#key s
-#key h
-#key spc
-#key slash
-#key e
-#key t
-#key c
-#key slash
-#key r
-#key c
-#key 5
-#key dot
-#key d
-#key slash
-#key shift-s
-#key 9
-#key 0
-#key s
-#key s
-#key h
-#key ret
-# --------------------------------
-step 641.40
-screendump 20080101_000044_902b118f1b85792713f66d4033bc6a68.ppm
-# permission denied: do that as root
-barrier_2 69 12 17 51 9223726c4a158177d46b52f11dfff2dc 76
-#barrier_2 71 25 15 43 2ef74187f76d680bcc11527ce73f48ae 76
-# Sending keys: s u ret
-key s
-key u
-key ret
-# --------------------------------
-step 644.90
-screendump 20080101_000045_65e700963fe1a7d16e64e32ad9d24b62.ppm
-barrier_2 66 29 14 54 608ffd366afb97b35c2afaf329df5779 17
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 648.62
-screendump 20080101_000046_88fe86711dce3ab65c142a84a88d5959.ppm
-# again...
-barrier_2 125 21 14 71 68862ffc2778cd3852bc9320fa0cc607 19
-# Sending keys: l n spc minus s spc slash e t c slash i n i t dot d slash s s h spc slash e t c slash r c 5 dot d slash shift-s 9 0 s s h ret
-key l
-key n
-key spc
-key minus
-key s
-key spc
-key slash
-key e
-key t
-key c
-key slash
-key i
-key n
-key i
-key t
-key dot
-key d
-key slash
-key s
-key s
-key h
-key spc
-key slash
-key e
-key t
-key c
-key slash
-key r
-key c
-key 5
-key dot
-key d
-key slash
-key shift-s
-key 9
-key 0
-key s
-key s
-key h
-key ret
-# --------------------------------
-step 660.34
-screendump 20080101_000047_bceef19e336dd7772fc4d1b7e3777382.ppm
-# shutdown -- when the VM is started again it will hopefully run SSH
-barrier_2 125 24 15 79 b4e478f1733a12ae1a66c3aaa930852d 59
-# Sending keys: p o w e r o f f ret
-key p
-key o
-key w
-key e
-key r
-key o
-key f
-key f
-key ret
diff --git a/client/tests/kvm/steps/Fedora-11-64.steps b/client/tests/kvm/steps/Fedora-11-64.steps
deleted file mode 100644
index 8c20fca..0000000
--- a/client/tests/kvm/steps/Fedora-11-64.steps
+++ /dev/null
@@ -1,300 +0,0 @@
-# Generated by Step Maker
-# Generated on Tue Oct 6 10:36:47 2009
-# uname -a: Linux freedom 2.6.30.8-64.fc11.x86_64 #1 SMP Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 6.25
-screendump 20091006_101057_5a9e4ddd1aa400022e7352cf316ce525.ppm
-# First boot selection
-barrier_2 455 240 92 15 4125ff600ed281ed9064f4f0e7174d79 31
-# Sending keys: ret
-key ret
-# --------------------------------
-step 18.60
-screendump 20091006_093142_b389f34c806212986da8b3d6e726df0b.ppm
-# Skip disk check
-barrier_2 329 98 189 98 c22e43f436ca151e0221e5794cca9de0 61
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 35.04
-screendump 20091006_093224_b9879baaa82fbdfb43361cfe8d3c94eb.ppm
-# Anaconda
-barrier_2 354 243 336 277 130d9cbc7fa6691e2ec2d88080a53aef 80
-# Sending keys: ret
-key ret
-# --------------------------------
-step 38.52
-screendump 20091006_093251_e4804380593a28835f66021420d58c8a.ppm
-# Keyboard selection
-barrier_2 395 69 129 197 059a6c60cc6a75f26df4f10c84126b99 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 41.68
-screendump 20091006_093324_4c7bf859ec422cc4620f78b957259167.ppm
-# Keyboard selection
-barrier_2 324 61 125 195 30b31d0ec7ad3622ba9cb6d9a5f3c594 15
-# Sending keys: ret
-key ret
-# --------------------------------
-step 45.05
-screendump 20091006_093651_30a3b267354f40f908148e89aac32bae.ppm
-# Re-initialize drive warning
-barrier_2 277 89 371 324 a41a7b0a414c3a28dc060df76733884c 16
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 48.67
-screendump 20091006_093717_ff2bbd32daf09472ca9d0500352bb94a.ppm
-# Hostname selection
-barrier_2 366 67 127 193 aec5091ede1f22134242dc6071181a28 16
-# Sending keys: ret
-key ret
-# --------------------------------
-step 52.69
-screendump 20091006_093740_b04f7f6c829aa7cccc98ab300deb154e.ppm
-# Timezone selection
-barrier_2 403 29 125 195 3535f82a2001fef00a1284f11d0473b0 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 56.10
-screendump 20091006_093759_db91bc8395c81b97679ea8e0166f7fff.ppm
-# Password selection
-barrier_2 338 68 137 191 3275de24f2b5558525f906b7e79c003b 16
-# Sending keys: 1 2 3 4 5 6 tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-# --------------------------------
-step 60.25
-screendump 20091006_093916_9e2ea1b1080110a97a89a9fdcb2da991.ppm
-# Password selection
-barrier_2 343 65 137 193 ba943f1b9fcb43f965beec6877ae7d2a 13
-# Sending keys: 1 2 3 4 5 6 tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-# --------------------------------
-step 65.19
-screendump 20091006_101742_40421c467a7b9cff7a634c3dd7d860fd.ppm
-# Next
-barrier_2 348 66 134 192 c38b11375333600c6defea099205d5e9 17
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 67.90
-screendump 20091006_101756_c180a6bfb126aca6c67c5532a389a117.ppm
-# Warning about password
-barrier_2 423 73 302 332 ba138233c0505bdc1cbb323c95878ef9 11
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 76.77
-screendump 20091006_101825_9fcb98aa91907ed368a72bb219ddeb83.ppm
-# Partitioning screen
-barrier_2 743 67 126 193 e3b6ce97edf0e53443677f64eb399582 42
-# Sending keys: ret
-key ret
-# --------------------------------
-step 79.86
-screendump 20091006_101847_4a977ba29bd000181aeb7d1bcd2ae8ec.ppm
-# Dialog about disk options
-barrier_2 362 68 333 334 9f9ad582e0d6a6ee1c0e7d7806935e8c 14
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 129.23
-screendump 20091006_101934_4c43f3f583d1d10ffd45b07acecfc894.ppm
-# Package selection
-barrier_2 678 49 131 204 18f767f89dd263171198c034e5b69b65 245
-# Sending keys: tab
-key tab
-# --------------------------------
-step 132.07
-screendump 20091006_104352_75857f9e155507789f7917e94bab1cba.ppm
-# Disable office, enable software development
-barrier_2 640 58 128 198 91fb98366cacf968b1e9ab872349189e 13
-# Sending keys: spc down spc
-key spc
-key down
-key spc
-# --------------------------------
-step 135.83
-screendump 20091006_104432_4e2e2cb831e5ace9a61a5e0085f3b496.ppm
-# Proceed
-barrier_2 622 57 129 197 3e6932dddde155c9b5998092e7ddb8f3 15
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1202.16
-screendump 20091006_110235_8bfc7c8eb54958d0c9a941d8374bf965.ppm
-# Reboot
-barrier_2 506 116 395 342 6c4cf0e47d4aba9d85365ffaa6907384 5331
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 1275.40
-screendump 20091006_110407_9329c76ac85b3d3ed67e4fdd84c7df83.ppm
-# First boot
-barrier_2 350 254 484 286 9d72bb3984c90e365f79bae16d8c7c38 365
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1306.15
-screendump 20091006_110504_53c65a8c7147f2f56817f25d7c60ca98.ppm
-# License
-barrier_2 236 69 277 428 9ac059229f81f3bdbca5e3ce302262cb 153
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1321.63
-screendump 20091006_110533_effc23742f795ed6248a5eee20373edb.ppm
-# Create user
-barrier_2 525 105 270 8 51254ae6ed9cba5fd774ddec58e6416f 76
-# Sending keys: tab
-key tab
-# --------------------------------
-step 1364.82
-screendump 20091006_110635_537f533d2e36d5846abb98b304132f03.ppm
-barrier_2 526 110 278 7 15e7915d62c5511f53b4748220fe5f04 215
-# Sending keys: u s e r tab
-key u
-key s
-key e
-key r
-key tab
-# --------------------------------
-step 1367.81
-screendump 20091006_110653_71f19347eade20cf1c4eec83994a44ae.ppm
-barrier_2 523 108 280 8 246b76cdc48bbe200b4d77a225857de7 9
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 1393.22
-screendump 20091006_110816_10bae809cb9101043873a79e4962dc16.ppm
-barrier_2 527 103 277 12 bbefc6b19bd8f25b2801e59f40a0c9a5 112
-# Sending keys: tab tab tab tab
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 1396.15
-screendump 20091006_110833_8a366d29c48140d07765693047333592.ppm
-barrier_2 527 105 273 6 d07d1ddace6a0a746b3f218a0fbf6b2f 10
-# Sending keys: u s e r tab tab tab tab tab tab ret
-key u
-key s
-key e
-key r
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key ret
-# --------------------------------
-step 1401.44
-screendump 20091006_110903_8a17e74066a8d1c1d2e4e7970b520cba.ppm
-# Warning
-barrier_2 566 107 266 9 d877a8e5818bc0e24a28da8ecda02b90 14
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 1486.96
-screendump 20091006_111045_e42563635a5ea916c0114ed18a8775df.ppm
-# Date and time
-barrier_2 335 100 281 8 7e6fce0ad350cc520b2d5de143155f65 426
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1512.78
-screendump 20091006_111128_da235fc79b2cc280b947e12bdd05cc3e.ppm
-# Profile
-barrier_2 534 148 274 5 c0545699bd654177b55627de7f2841da 128
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1515.20
-screendump 20091006_111152_fabcce3f0a32bb3d8976db1e07df4090.ppm
-# Do not send!
-barrier_2 568 146 285 6 2ab34dcb11170a74dc5407a08edd7e40 11
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 1543.84
-screendump 20091006_111235_9191358b97c0b89c213dce06f6ab58bc.ppm
-# Login
-barrier_2 208 86 408 254 caf95d94a614ca983ec1539189bad39e 141
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1547.35
-screendump 20091006_111254_11a45bc04148970ea552e40a298118e1.ppm
-# Password
-barrier_2 153 90 438 220 05a1d279d31c062c954fbf31411a0428 16
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1582.99
-screendump 20091006_111343_6ce2e23219f84766a8bf3c1a294b0a81.ppm
-# Desktop reached, shut down
-barrier_2 156 385 26 36 b2ba693157d7f91a3cbdbeb87d84aa56 170
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 1586.70
-screendump 20091006_111541_63c24ada19a3fef5b0e220f343b91cb5.ppm
-barrier_2 134 129 41 297 82df7cce3e0e3c025b09c2f47b96c1a1 17
-# Sending keys: right right
-key right
-key right
-# --------------------------------
-step 1591.05
-screendump 20091006_111601_e0eba274ed71a5bc482efb84d74bf864.ppm
-barrier_2 115 105 31 294 30aaa764a2eff759272bca1452c478c0 20
-# Sending keys: up ret
-key up
-key ret
-# --------------------------------
-step 1594.11
-screendump 20091006_111627_572ddbe03385bed9a3902cc068fb6471.ppm
-# Bye!
-barrier_2 134 107 24 293 5e4f2da864c54e381ee092b7a6f611f6 13
-# Sending keys: ret
-key ret
diff --git a/client/tests/kvm/steps/Fedora-8-64.steps b/client/tests/kvm/steps/Fedora-8-64.steps
deleted file mode 100644
index 0d25db1..0000000
--- a/client/tests/kvm/steps/Fedora-8-64.steps
+++ /dev/null
@@ -1,281 +0,0 @@
-# Generated by stepmaker 20081103 (instance: 671967557191)
-# Generated on Thu Nov 6 11:48:59 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 -cdrom /isos/linux/Fedora-8-x86_64-DVD.iso ./fedora8.qcow2 -m 512 -monitor unix:/tmp/monitor_671967557191,server,nowait -nographic &
-step 4.41
-# welcome to fedora 8!
-barrier_2 175 25 232 19 67cceac67db2ec29b50dbebc1e602063 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 13.35
-# disc found
-barrier_2 327 177 189 101 14d28b33fa3bb163bef2c9af8b6e0461 45
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 30.48
-# fedora splash screen
-barrier_2 217 63 583 537 74978d008ed5117957ee14430570b9ed 86
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 35.25
-# language
-barrier_2 168 60 0 327 3a1a2ec88adf428f5e644c9194f90814 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 37.85
-# keyboard
-barrier_2 115 58 0 402 3f7951e0650ffe53dee0eeb09e332504 13
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 40.49
-# partition table unreadable
-barrier_2 193 46 429 370 e70133e0276d700e32f04cc48195a35e 13
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 167.79
-# partitioning
-barrier_2 170 42 11 115 1f07d673df4ae1b7777a4b0a2c41fc64 100
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 170.14
-# are you sure?
-barrier_2 88 44 251 228 0f93b8e47b7c5e66042165c3a876f9e1 12
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 172.76
-# network devices
-barrier_2 145 25 17 115 6fc5214535c9ded3371b3bd78692c17b 13
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 175.59
-# time zone
-barrier_2 342 24 15 115 1230b1ae71bec94a879e73bbdd370d3b 14
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 178.30
-# root password
-barrier_2 84 120 15 112 2cf18d3f3ffd5fc14e2e67400773849d 14
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 257.90
-# package selection
-barrier_2 139 47 16 119 c0bf40ff93dd278268fabec28b807d8c 60
-#barrier_2 139 47 16 119 c0bf40ff93dd278268fabec28b807d8c 398
-# Sending keys: tab spc down spc
-key tab
-key spc
-key down
-key spc
-# --------------------------------
-step 259.73
-barrier_2 69 90 15 168 1043ca3df4dd4db7b9617cbefb7390b9 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 275.68
-# begin installation
-barrier_2 158 43 491 188 d04f1fad697bbd7c37d0aa71a6b368cd 80
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1403.60
-# installation done -- reboot
-barrier_2 228 60 572 540 620f0435c7301bb60939c0556c6eecec 5640
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 2946.88
-# welcome
-barrier_2 187 53 223 5 da26f574f1e5d3aa34795f65bd974b30 500
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2950.42
-# license
-barrier_2 212 40 175 350 69469db962c0c19bee953c788e4e583a 18
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2953.09
-# firewall
-barrier_2 61 29 176 133 a1921cc9d4d6d9667681f005471d5148 13
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2956.81
-# selinux
-barrier_2 205 40 172 162 b8aae6931e045dd87b64f79af989d1df 19
-# Sending keys: tab
-key tab
-# --------------------------------
-step 2958.77
-# Sending keys: spc
-key spc
-# --------------------------------
-step 2960.31
-barrier_2 98 96 292 161 c236987a1900a5bafa41cac34e8cee03 8
-# Sending keys: down down ret
-key down
-key down
-key ret
-# --------------------------------
-step 2962.61
-barrier_2 201 55 172 154 bbbde1bee21d026d2e5fcce88d81913a 11
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2965.45
-barrier_2 348 42 251 237 ca54bcfeb036140a5128f7e0868cabc7 14
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 2969.13
-# date and time
-barrier_2 285 56 225 3 2f41bc38c7a1d06ec3b89d1ca0434583 18
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2974.21
-# hardware profile
-barrier_2 94 42 227 9 9be5bab569e2c535aa206b313b9b4303 25
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2978.42
-# are you sure?
-barrier_2 316 41 313 347 5a8b191ebd109a279b327f009e5e0295 21
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2981.26
-# create user
-barrier_2 89 30 176 132 8c245d2f94dd01df60b6ba76e90ff605 14
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 2987.51
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2994.99
-# password weak
-barrier_2 152 21 249 268 17c5b90c03be64b67901cf69eeebff3e 37
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 3000.01
-# reboot
-barrier_2 87 19 298 269 d605b017c9b897abc5a25f2c8549936c 25
-# Sending keys: alt-o
-key alt-o
-# --------------------------------
-step 3061.09
-# login
-barrier_2 80 17 411 132 3e7cb110f3036bb5c5bcb0786dfcaabe 305
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 3063.03
-barrier_2 76 17 411 133 410988083bb964b7cd0170824a5c90e3 10
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 3066.89
-# privileged user
-barrier_2 190 48 442 328 19c0d9a2fd1cf3e17b3cb1890fd3c535 19
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 3087.25
-# desktop
-#barrier_2 129 36 0 0 22d4fe49f6705a7f4d6f9f376e205d6a 102
-#barrier_2 296 23 1 1 5eaa10063865a2ceb485f8b4959a4275 102
-barrier_2 291 12 16 1 a1b7e18bab4b895c1801078472f6a260 102
-# Generated by stepmaker version 20081118 (instance: 65464304535)
-# Generated on Thu Nov 20 17:48:00 2008
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 -cdrom /isos/linux/Fedora-8-x86_64-DVD.iso /var/local/kvm_regression/images/fc8-64.qcow2 -m 512 -snapshot -nographic -monitor unix:/tmp/monitor_65464304535,server,nowait &
-# --------------------------------
-step 48.50
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 50.88
-barrier_2 180 15 14 256 5be42ca35368421055d03abb88be0290 12
-# Sending keys: right right
-key right
-key right
-# --------------------------------
-step 54.63
-barrier_2 156 14 195 249 c46570f6ad6b9828b83afb350e27282d 19
-# Sending keys: up
-key up
-# --------------------------------
-step 56.68
-barrier_2 160 19 193 247 4d7b284ab29c43634d2d565809338556 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 59.09
-sleep 10
-#barrier_2 104 49 502 328 600dabd213b10034a029dc93fb0372a0 12
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
diff --git a/client/tests/kvm/steps/Fedora-8-i386.steps b/client/tests/kvm/steps/Fedora-8-i386.steps
deleted file mode 100644
index 732d705..0000000
--- a/client/tests/kvm/steps/Fedora-8-i386.steps
+++ /dev/null
@@ -1,317 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 194584860983)
-# Generated on Tue Nov 25 13:00:51 2008
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 -cdrom /isos/linux/Fedora-8-i386-DVD.iso ./fedora.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_194584860983,server,nowait &
-# --------------------------------
-step 4.38
-screendump 20080101_000001_bd02964c8e1d2746d502ad20d848338c.ppm
-# welcome to fedora 8
-barrier_2 483 152 80 31 7f4d8942efd7db65e932f5349a397a22 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 12.69
-screendump 20080101_000002_76e3dc860bb332af01b1dda136a8f082.ppm
-# skip media test
-barrier_2 384 145 171 98 8a95f70af2024cebd751ec0cc562e5a9 42
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 29.64
-screendump 20080101_000003_98583c56a3c3e5a39984bd2f8d34f565.ppm
-# graphical installer
-barrier_2 266 86 534 514 cec2f9cd47ac69ca1aae5551d136bce5 85
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 32.21
-screendump 20080101_000004_d0c5ab4c1cd212842aca6bd00c818c22.ppm
-# language
-barrier_2 795 270 5 330 97b6f5aa65e9d90077228f272c3da111 13
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 33.45
-screendump 20080101_000005_fdb91fda25559db12636ef317294c009.ppm
-# keyboard
-barrier_2 794 198 6 402 56a0ed75c12d383d29892b2aa9890e67 6
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 36.18
-screendump 20080101_000006_e881753792c90924a2972cd2199558cc.ppm
-# are you sure?
-barrier_2 388 90 234 327 ea77fe312e583070f081896eb441aa93 14
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 39.35
-screendump 20080101_000007_af9c93674aa2f459aa107fcf2842f283.ppm
-# partitioning
-barrier_2 792 163 8 437 0a874fb780ed7f07ac7d5fc0f9484ce5 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 44.08
-screendump 20080101_000008_b8bfcd7b4c797b163931d1d1dc3244a7.ppm
-# are you sure?
-barrier_2 359 85 249 313 f40ab502ad25f60f368608913193efd2 24
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 46.04
-screendump 20080101_000009_d34a463999eb09858ce7a552c3f6a0a3.ppm
-# network devices
-barrier_2 343 223 457 377 d1710365688d6d61554c3a9bf9fe2b86 10
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 48.94
-screendump 20080101_000010_2e16ffe7d4dcd7b3d01080ddbeb905da.ppm
-# time zone
-barrier_2 794 128 6 472 cb502260b9c7dd536739a4891071708c 15
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 50.80
-screendump 20080101_000011_3eadbd39e20c4d7104e461adcafd98c7.ppm
-# root password
-barrier_2 133 129 198 114 f529542fd9e1ff3d77e0f4ea64b544ee 9
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 62.47
-screendump 20080101_000012_6df8c283a80980714fa9af1e287b0d23.ppm
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 67.84
-screendump 20080101_000013_6c762f44817b543e1103d21ae7e796df.ppm
-# package selection
-barrier_2 125 111 10 119 0767214ce2ddc5cc3d249a651afcd63c 27
-# Sending keys: tab
-key tab
-# --------------------------------
-step 70.19
-screendump 20080101_000014_07f966fc76b20d46e00f8a9ec9c0c84c.ppm
-barrier_2 128 97 13 165 7f3bf45eb06004478f83a98f42593437 12
-# Sending keys: spc down spc
-key spc
-key down
-key spc
-# --------------------------------
-step 72.10
-screendump 20080101_000015_4ed346b0db828e51dcf60024991081c3.ppm
-barrier_2 98 93 16 168 afdb92ebaa913804930a572cdd0d06bb 10
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 81.19
-screendump 20080101_000016_2e2cb3a372574313785cd0c93ec81b4c.ppm
-# begin installation
-barrier_2 315 278 485 322 c0f57cbc492572ebbfff2366cbd05c8b 45
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1356.59
-screendump 20080101_000017_c4cf8fde303f1b4fcb116a0b206a8056.ppm
-# installation done -- reboot
-barrier_2 273 102 527 498 6f86ef8632c8d88f40e9b40f53c9a07d 6377
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 1417.37
-screendump 20080101_000018_db481cdf2556a17507dba9dc696be6b4.ppm
-# welcome -- first boot setup
-barrier_2 250 96 550 504 de8c1198b6c0d7fc1a0f1253523d999d 304
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1419.79
-screendump 20080101_000019_d06a6d35b9cd0173d6177c14dc9e1e02.ppm
-# license
-barrier_2 629 250 171 350 944c0b3669aaf3e716f1a994d17e680d 12
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1422.19
-screendump 20080101_000020_e8ed7648ccca46d6f4560ad814cf34ab.ppm
-# firewall
-barrier_2 632 111 168 489 9ccc4bfe9b643c5a244109cdcc05ac3f 12
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1425.90
-screendump 20080101_000021_ff6a870396705ff56bc4abd5be49702e.ppm
-# selinux -- disable
-barrier_2 257 449 543 151 f684aa8d603ad46be52ba8c80be2f2a4 19
-# Sending keys: tab
-key tab
-# --------------------------------
-step 1427.74
-screendump 20080101_000022_c6c19e3bcfcea001cd350b0e4d760438.ppm
-barrier_2 116 45 292 159 b31d43d996aede0baaeff8639628daf2 9
-# Sending keys: spc
-key spc
-# --------------------------------
-step 1429.25
-screendump 20080101_000023_d71e489b44f3946dd915187e15612300.ppm
-barrier_2 101 95 292 161 049782528d715ab818c0bca8f77fb234 8
-# Sending keys: down down ret
-key down
-key down
-key ret
-# --------------------------------
-step 1431.45
-screendump 20080101_000024_00302fb8be46156ea3b7b192d51f8290.ppm
-barrier_2 83 41 292 161 b359b8e07227fc566275b9ba2b7cbe07 11
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1434.60
-screendump 20080101_000025_6b3bb8a72e0f41b8343c9909a2aa2f74.ppm
-barrier_2 134 167 476 241 f87d25239491aec04e5c7f29a04b686b 16
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 1438.85
-screendump 20080101_000026_ecf306a3f7ace4cb936f009c80afab21.ppm
-# date and time
-barrier_2 221 290 579 310 4502dc2f76ed6aba1a2229c8385a8eae 21
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1445.29
-screendump 20080101_000027_ab7b40c3dc41357cb5ea6980baed56f8.ppm
-# do not send hardware profile
-barrier_2 621 92 179 508 c0aee06a0353c05dc24d2c7f9144005d 32
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1449.14
-screendump 20080101_000028_08d7faa343ad51a921556895965cbd89.ppm
-# do not send!!!!!!!!!!!!!!!!!!!!!!!!
-barrier_2 247 46 384 343 258294defb55d93e85caa1a8b89bcbf3 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1451.73
-screendump 20080101_000029_5f2b6087ab55ec497d273a70e216c8e9.ppm
-# create user
-barrier_2 86 248 340 29 a6b825b658758ab3f9fc478627f7cf59 13
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 1467.93
-screendump 20080101_000030_9fc7cf2f32af756d0d30f5d45a99ae9c.ppm
-barrier_2 50 35 292 238 1b547a686687b81647a38243b459623c 81
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1471.80
-screendump 20080101_000031_7beb5d04f3afda99b82512826b564d9b.ppm
-# weak password
-barrier_2 190 44 425 337 8bcd0eddcf9efdafc83191d8b59d9efb 19
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 1475.86
-screendump 20080101_000032_f33fbd0bd6f8ebf7448f4d8f32144a06.ppm
-# reboot
-barrier_2 118 114 453 267 bb375f26375bdb858ebb0f5b113f07a0 20
-# Sending keys: alt-o
-key alt-o
-# --------------------------------
-step 1542.76
-screendump 20080101_000033_4ed496494a486e6b63775138153c1ed9.ppm
-# login
-barrier_2 96 92 439 120 927882914e972dcb939ab4713cbadabf 334
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 1546.76
-screendump 20080101_000034_f748f3122d676cef208128a0df210643.ppm
-barrier_2 66 71 433 119 08088d67c710b265ee19a9017664233b 20
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1573.91
-screendump 20080101_000035_4cf6b01ce2b794af5408f65c07e16723.ppm
-# desktop reached -- shutdown
-barrier_2 283 13 17 0 043632cd9b819625a6b94e181384b386 136
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 1577.46
-screendump 20080101_000036_6db884dc98473505ce65cdab3d429d91.ppm
-barrier_2 192 24 6 249 0c5f8ddc277606f9cdbc44068a3a2b06 18
-#barrier_2 150 234 12 35 c7b0c6588286451b44e6e8f75529567e 18
-# Sending keys: right right
-key right
-key right
-# --------------------------------
-step 1579.67
-screendump 20080101_000037_a79792e97e3a3f7210a21bcbe9a673a6.ppm
-barrier_2 166 24 190 261 6b38d6857d4803921e138913acaa10cd 11
-#barrier_2 143 249 196 35 edcf943ceba6cf0fcc634a386f5fea2d 11
-# Sending keys: up
-key up
-# --------------------------------
-step 1581.08
-screendump 20080101_000038_05f05e9e4e6a68b3d7d1a57efe09cebf.ppm
-barrier_2 126 41 196 241 de72a826e7ff716e428d0a9df8cc2ace 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1584.45
-screendump 20080101_000039_aac35e2eeebf3065fc4284876df6bf7d.ppm
-# bye bye!
-sleep 15
-#barrier_2 163 150 445 225 5faf52b6450bcdd713365e054387d531 17
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Fedora-9-64.steps b/client/tests/kvm/steps/Fedora-9-64.steps
deleted file mode 100644
index 08da0f0..0000000
--- a/client/tests/kvm/steps/Fedora-9-64.steps
+++ /dev/null
@@ -1,274 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 549372512824)
-# Generated on Thu Nov 27 14:48:55 2008
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 -cdrom /isos/linux/Fedora-9-x86_64-DVD.iso /tmp/fedora.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_549372512824,server,nowait &
-# --------------------------------
-step 8.65
-screendump 20080101_000001_5b6fcf70f920437f0752cbc2a617b0b7.ppm
-# welcome
-barrier_2 490 132 76 31 3c8444174731c3b57062431e9c4eebcc 43
-# Sending keys: ret
-key ret
-# --------------------------------
-step 14.38
-screendump 20080101_000002_b389f34c806212986da8b3d6e726df0b.ppm
-# skip
-barrier_2 400 135 162 151 d8e717cc54096710ddd46e61f0f431f3 29
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 38.15
-screendump 20080101_000003_1d78bed5ed4958be9106e14a64f34563.ppm
-# graphical installer
-barrier_2 227 76 573 524 00f708ece18f20e32f843208f86f25c3 119
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 40.02
-screendump 20080101_000004_d83de685c8a3259a154614eca3e2c7ca.ppm
-# language
-barrier_2 790 283 10 317 cce3c193acc4a0067cc5a8c8506b6f4f 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 41.30
-screendump 20080101_000005_763110f4a9400e6f21deaff1789a5a02.ppm
-# keyboard
-barrier_2 785 207 15 393 fc1b2cdf2718644fce151b620f3a87d4 6
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 45.98
-screendump 20080101_000006_fd188a0ff7fb28829c3e16ed0fa6790e.ppm
-# are you sure?
-barrier_2 387 87 227 329 ff0ca199a35d115062f16bb4d90fa9dd 23
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 48.04
-screendump 20080101_000007_dc10f3c5f8b6dbb6c86db42fac463115.ppm
-# network
-barrier_2 317 246 483 354 d0185a7750f392fabee4d8ec7c6b61c3 10
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 49.35
-screendump 20080101_000008_3589317d8706e50ecf942b5ea64934fa.ppm
-# time zone
-barrier_2 788 121 12 479 f7ea38083956999600de186c68d0f270 7
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 50.90
-screendump 20080101_000009_3b34f2754e67a7e8782a562e2207e001.ppm
-# root password
-barrier_2 98 76 192 141 55cc8aaaeacefd849d0c948cca1b1667 8
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 56.51
-screendump 20080101_000010_0fdd0d26cd636b3903256dcc4efcdd99.ppm
-barrier_2 41 36 123 178 68bd85921700366f136f9d41716af915 28
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 58.49
-screendump 20080101_000011_35dac9daa21b06c3b25a386c71104ab5.ppm
-barrier_2 384 87 229 286 b15b37af72dd0f19c173820e41f36c93 10
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 62.67
-screendump 20080101_000012_8ea06560e0e936c175b27a3dd08bb850.ppm
-# partitioning
-barrier_2 161 214 639 386 3db0d62189437722bde7f223b81cd955 21
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 64.23
-screendump 20080101_000013_4947284576590f2db663823775d57580.ppm
-# write changes to disk?
-barrier_2 348 44 235 327 699648674285480e8305a1ca49f1ff95 8
-# Sending keys: alt-w
-key alt-w
-# --------------------------------
-step 87.20
-screendump 20080101_000014_f06b617603b16805c218c1d9cf1cbac1.ppm
-# package selection
-barrier_2 209 97 18 140 0917179219d015de6b028771ad7a502a 115
-# Sending keys: tab
-key tab
-# --------------------------------
-step 88.50
-screendump 20080101_000015_c2d883009a9bb5d9505fabe4e56a02c6.ppm
-# disable office, enable software development
-barrier_2 158 90 17 140 649739e1f73761e0d780c5a9c7724915 7
-# Sending keys: spc down spc
-key spc
-key down
-key spc
-# --------------------------------
-step 90.80
-screendump 20080101_000016_d05ff23a4fc2f6cdcb5ada539b8fe3c9.ppm
-barrier_2 154 91 19 140 9d6527bec9fc9568647371e98d5983bc 11
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1901.79
-screendump 20080101_000017_5b045a21a20cad0a3230d83b7c9100eb.ppm
-# reboot
-barrier_2 243 84 557 516 0467bbada6e29dfaf745245b10ead9a6 9055
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 2009.30
-screendump 20080101_000018_298bcd9f8bcd221bbc9990eccce6647e.ppm
-# first boot setup
-barrier_2 275 93 525 507 8779b3342e817bd7831bbaa095adc341 538
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2013.84
-screendump 20080101_000019_641948e3e24d43e9d9d28d7779863d47.ppm
-# license
-barrier_2 586 255 214 345 3a6711571a0ccc8f1f431fb249142624 23
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2015.97
-screendump 20080101_000020_1c16d97279529d37f2edf49b0f553880.ppm
-# create user
-barrier_2 104 115 384 113 280264b01fefddf591fe4f1d97894eea 11
-# Sending keys: tab
-key tab
-# --------------------------------
-step 2017.46
-screendump 20080101_000021_177da7b96f45f9992486f29d95f1af4b.ppm
-barrier_2 86 118 390 112 86bc5b8e9349ad4d9166e6591ba848c8 7
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 2035.29
-screendump 20080101_000022_5132d070f050768a767c4c5fce50239c.ppm
-barrier_2 33 41 352 191 f6073e6244ab4e3983c54bacd195e777 89
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2038.61
-screendump 20080101_000023_b8772b13d8326ddd747076bbb99c8cc1.ppm
-# date and time
-barrier_2 138 224 627 347 0c6f815acb6f5920e56a2baf1d02820a 17
-#barrier_2 212 228 547 345 3d42cc6f063669aa3e7011a0f222e27e 17
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step unknown
-screendump 20080101_000024_dcc3389f259296cd64c20311e0f3b3d6.ppm
-# optional barrier for no-acpi configurations
-barrier_2 142 113 458 245 7c627eee56d89141136cfdeec366769b 20 optional
-# Sending keys: ret
-key ret
-# --------------------------------
-step 2042.73
-screendump 20080101_000025_ee5e60626987b02e0913785212db0119.ppm
-# hardware profile -- do not send
-barrier_2 566 82 232 507 826bcd103c0c75639181d608b49d5d67 21
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2044.45
-screendump 20080101_000026_0426bfcfd85cc1f2fa4e698f9d1bda1e.ppm
-# do not send!!!!!!!!!!!!!!
-barrier_2 318 42 312 347 77d5d1d25abd647529c9aa7818fb6597 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2064.36
-screendump 20080101_000027_1ba8ac75e07f9a9e40a958772bf67ad2.ppm
-# login?
-sleep 40
-#barrier_2 124 26 296 225 2642fd78af37137662f36b9bf5ac913d 100
-# Sending keys: ret
-key ret
-# --------------------------------
-step 2067.54
-screendump 20080101_000028_7fc18a00bd87d9e0b71e294c28122fe5.ppm
-# password
-barrier_2 18 40 379 324 6d011b1e13783cb032375543185c3b2d 16
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 2110.40
-screendump 20080101_000029_308bee7ad94a953d5ba8a85242f6c61d.ppm
-# desktop reached -- shutdown
-barrier_2 51 16 246 3 d35e689b07b3d020a53ef1dc09fdfde4 214
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 2111.93
-screendump 20080101_000030_feaffa2e0c9e716d6d87be3c57f18fad.ppm
-barrier_2 143 25 7 206 424dfdf5a3df3a2a29fe7b0a87a733a7 8
-# Sending keys: right right
-key right
-key right
-# --------------------------------
-step 2113.89
-screendump 20080101_000031_d353c1b7de3445891713c5e078d0eb5e.ppm
-barrier_2 149 21 187 293 62d6f8e685e14c442170a80ea3d54d89 10
-# Sending keys: up
-key up
-# --------------------------------
-step 2115.25
-screendump 20080101_000032_3d73da1962ecfbd685cb7abc09e6c269.ppm
-barrier_2 132 23 184 293 2e56afb1984da35622fd78ee93fae720 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 2117.01
-screendump 20080101_000033_bacb38ed4509d97c319cac3e7125d1e8.ppm
-# bye bye!
-sleep 10
-#barrier_2 202 47 433 342 5cac247cd39dc47ed412852fc2654568 9
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Fedora-9-i386.steps b/client/tests/kvm/steps/Fedora-9-i386.steps
deleted file mode 100644
index e58bc1b..0000000
--- a/client/tests/kvm/steps/Fedora-9-i386.steps
+++ /dev/null
@@ -1,268 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 622203467587)
-# Generated on Thu Nov 27 12:01:34 2008
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 -cdrom /isos/linux/Fedora-9-i386-DVD.iso /tmp/fedora.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_622203467587,server,nowait &
-# --------------------------------
-step 4.30
-screendump 20080101_000001_422bd90ff3700da33a802cb4971911f5.ppm
-# welcome
-barrier_2 483 151 77 29 f11722af4fb7e2543d46c851bca3d4ec 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 12.28
-screendump 20080101_000002_76e3dc860bb332af01b1dda136a8f082.ppm
-# skip
-barrier_2 395 181 165 107 c53582165366fd867abddc57b2eb4627 40
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 47.80
-screendump 20080101_000003_82069cba84ac2b8c1cd4ad204b4abd56.ppm
-# graphical installer
-barrier_2 250 71 550 529 fb242c31699b930fe5dd3e651091ed3b 178
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 50.79
-screendump 20080101_000004_d83de685c8a3259a154614eca3e2c7ca.ppm
-# language
-barrier_2 789 281 11 319 97269d92fd84216ab46e932e4b44638b 15
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 52.18
-screendump 20080101_000005_763110f4a9400e6f21deaff1789a5a02.ppm
-# keyboard
-barrier_2 787 205 13 395 f4690d38da6159ab79a691f90b0846ab 7
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 54.89
-screendump 20080101_000006_fd188a0ff7fb28829c3e16ed0fa6790e.ppm
-# are you sure?
-barrier_2 385 86 230 330 abe6f436b33181bb67c6c8be444f1129 14
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 56.76
-screendump 20080101_000007_dc10f3c5f8b6dbb6c86db42fac463115.ppm
-# network devices
-barrier_2 320 247 480 353 bfbc40a616fed4a55673ffe824e1f0d8 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 59.81
-screendump 20080101_000008_e55d1b787e2d4bac4b309082bc0c5e84.ppm
-# time zone
-barrier_2 786 117 14 483 e95cab7c8853cc2b2836a80ab62d41e3 15
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 61.31
-screendump 20080101_000009_3b34f2754e67a7e8782a562e2207e001.ppm
-# root password
-barrier_2 103 79 201 140 9a075ea7e0cfd1d41b765e9352c11858 7
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 66.14
-screendump 20080101_000010_a823cd29ef14192dadeb74615e854483.ppm
-barrier_2 42 36 122 178 4aa198cb48dcf45f37bd83aa99f469d5 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 67.53
-screendump 20080101_000011_35dac9daa21b06c3b25a386c71104ab5.ppm
-# weak password
-barrier_2 385 87 229 286 af1ac2e844173749d9238dfc381f626f 7
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 72.32
-screendump 20080101_000012_8ea06560e0e936c175b27a3dd08bb850.ppm
-# partitioning
-barrier_2 217 211 583 389 4f6c19742544b0021f224d9f03381a52 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 73.93
-screendump 20080101_000013_4947284576590f2db663823775d57580.ppm
-# write changes to disk?
-barrier_2 350 47 233 325 4b2a63c9a570151d10a0387e91f00d49 8
-# Sending keys: alt-w
-key alt-w
-# --------------------------------
-step 177.03
-screendump 20080101_000014_e059058b15f5ad58859b965e380710cf.ppm
-# package selection
-barrier_2 228 93 16 139 c6116413e5e1cccab2acda277b7fcb88 516
-# Sending keys: tab
-key tab
-# --------------------------------
-step 178.28
-screendump 20080101_000015_613c6a29bc1ae4440aee0a8c48ac519d.ppm
-# disable office, enable software development
-barrier_2 209 93 16 139 5f9214eddf0ddc5e9a0a0dda98c695ca 6
-# Sending keys: spc down spc
-key spc
-key down
-key spc
-# --------------------------------
-step 180.71
-screendump 20080101_000016_152ac23ca8fd2d3940379439eaa940a6.ppm
-barrier_2 209 91 16 139 4763c9135edde93017435f10ca3f0bda 12
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2088.61
-screendump 20080101_000017_2aa762432fd01d2e356efbd1d73d795b.ppm
-# installation done -- reboot
-barrier_2 275 91 525 509 02b9fabc34f46d87ff8ab6db3a90249e 9540
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 2186.45
-screendump 20080101_000018_f28fa66350786b29af2c497ca9fd5e6e.ppm
-# first boot setup
-barrier_2 258 83 542 517 d60a92501d0d6f4cd40929f8f5a9fe5d 489
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2188.97
-screendump 20080101_000019_641948e3e24d43e9d9d28d7779863d47.ppm
-# license
-barrier_2 586 253 214 347 b07b7fd304beaf7711de3e030c596269 13
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2190.91
-screendump 20080101_000020_1c16d97279529d37f2edf49b0f553880.ppm
-# create user
-barrier_2 102 142 383 101 46f026c2b5a0fffde855dbb35f075836 10
-# Sending keys: tab
-key tab
-# --------------------------------
-step 2192.99
-screendump 20080101_000021_177da7b96f45f9992486f29d95f1af4b.ppm
-barrier_2 100 136 383 101 6e1aa83f22fddbdd7b8f6ac4dd5248fa 10
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# --------------------------------
-step 2202.75
-screendump 20080101_000022_a403a00c2bdb22522cce29bec7a6838d.ppm
-barrier_2 33 34 352 194 eb1e6a49438017148fe4fb13e98e5bd7 49
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2205.83
-screendump 20080101_000023_074bef911fe75cda358fa6fb332447b9.ppm
-# date and time
-barrier_2 148 224 625 348 17553aea906f64c3ff77521d90b7bbdf 15
-#barrier_2 212 224 550 346 4f86f0387e793650002f9170c79fe8a6 15
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2210.97
-screendump 20080101_000024_7bcf6d86bd1c7981c3c3b9324f387b71.ppm
-# hardware profile
-barrier_2 529 72 234 508 789c47c72ee96c9bfdada2a715cc953f 26
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2212.71
-screendump 20080101_000025_be3ca3994303100ca3878881e66004ed.ppm
-# do not send
-barrier_2 400 77 230 312 ceb78b31a7651c712a86c77c09475c8f 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2235.95
-screendump 20080101_000026_a5cbce1ca879625e4ce6bc837754c1fe.ppm
-# login?
-sleep 50
-#barrier_2 210 56 273 198 f356653659f87d610f7ee209e26809b9 116
-# Sending keys: ret
-key ret
-# --------------------------------
-step 2240.57
-screendump 20080101_000027_f2d638a47e94f6ef991fda8c666d6c32.ppm
-# password
-barrier_2 18 36 377 325 1aab0071a9acaa5ff545ec1e2de6ad57 23
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 2289.63
-screendump 20080101_000028_7594e0d7b11c1b686ce2e4df9b9067f2.ppm
-# desktop reached -- shutdown
-barrier_2 45 18 246 2 e0e4937e16c34a5b32845d90f597eb68 245
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 2303.14
-screendump 20080101_000029_176ee4032a55fcb6902afdf5ea11093f.ppm
-barrier_2 136 20 8 210 5c06a62c744ad8ba3c2a2dfe3f220c39 68
-# Sending keys: right right
-key right
-key right
-# --------------------------------
-step 2305.61
-screendump 20080101_000030_65c927fa9cadaf3f4b45fe8c5da41526.ppm
-barrier_2 164 19 187 295 ba111c02ab043afb26d5de8d25d2ef09 12
-# Sending keys: up
-key up
-# --------------------------------
-step 2307.05
-screendump 20080101_000031_207bf2d60b170fa53068c798c0efd90d.ppm
-barrier_2 145 21 184 294 b34ee68255fc4679e608f73f0025b7be 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 2309.34
-screendump 20080101_000032_1b3c406ce8dd30fa84d63f7144e251df.ppm
-# bye bye!
-sleep 10
-#barrier_2 202 47 433 343 d1d70daae82994ebec4cca9646ec4984 11
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/FreeSBIE-2.0.1.steps b/client/tests/kvm/steps/FreeSBIE-2.0.1.steps
deleted file mode 100644
index d2e63ea..0000000
--- a/client/tests/kvm/steps/FreeSBIE-2.0.1.steps
+++ /dev/null
@@ -1,198 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 775985216608)
-# Generated on Thu Nov 13 12:26:43 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ./netbsd.qcow2 -cdrom /isos/unix/FreeSBIE-2.0.1-RELEASE.iso -m 512 -nographic -monitor unix:/tmp/monitor_775985216608,server,nowait &
-# --------------------------------
-step 7.00
-screendump 20080101_000001_92d90bdf658e72aa3c779d4f4996f606.ppm
-barrier_2 436 46 50 217 40bb5dcbd78bdf0f7681bdedf392bda4 35
-# Sending keys: 1
-key 1
-# --------------------------------
-step 9.89
-screendump 20080101_000002_1f589bd413e5368a50ddcd51518d7980.ppm
-barrier_2 336 63 28 120 374ffe385685b9a6bc94fe9d2832c9bb 14
-# Sending keys: 1
-key 1
-# --------------------------------
-step 36.25
-screendump 20080101_000003_02ab19b29c430b0ee811ca79072b8779.ppm
-# press any key to see boot messages
-barrier_2 405 37 619 731 12b8ebd37200cd1deaa1fdc4a9bd9496 132
-# --------------------------------
-step unknown
-screendump 20080101_000004_02ab19b29c430b0ee811ca79072b8779.ppm
-sleep 5
-barrier_2 402 31 620 735 921fd23f43bc77e0e5c3f67c90c61f7b 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 49.01
-screendump 20080101_000005_2f4ef32dc371cd5ca29eed2fec3f4068.ppm
-# logged in
-barrier_2 211 24 0 376 59a79a9d117e1afbd1036b1a716e115f 64
-# Sending keys: p w d ret l s ret
-key p
-key w
-key d
-key ret
-key l
-key s
-key ret
-# --------------------------------
-step 51.89
-screendump 20080101_000006_a1f12cec64980d76777d5205c4e4faf6.ppm
-# start X
-barrier_2 212 33 0 367 c0fb4d4be94dcb2ec194290cfac77b97 14
-# Sending keys: s t a r t x ret
-key s
-key t
-key a
-key r
-key t
-key x
-key ret
-# --------------------------------
-step 86.37
-screendump 20080101_000007_c1f5f52a1d4958a808b2efce6f885381.ppm
-# let's see what alt-f1 does
-barrier_2 250 88 33 164 29c76e12bab5afa9429b7e517183d5f1 172
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 93.06
-screendump 20080101_000008_dd797d15f2eabb45ea9796d801098f94.ppm
-# xfce 4.2.0 documentation
-barrier_2 230 52 24 167 ae0d38030480a68289b764be993553b9 33
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 97.42
-screendump 20080101_000009_39e5a42b187dff8d9263cd911eb4b80c.ppm
-# start the gimp
-barrier_2 86 54 173 211 b62bfef13b672fe42df37381a2953c8b 22
-# Sending keys: g i m p ret
-#key g
-#key i
-#key m
-#key p
-#key ret
-# --------------------------------
-step 129.55
-screendump 20080101_000010_2bc7215e2cbc9e6dfb7fb444880c74a8.ppm
-# start gaim
-#barrier_2 78 4 422 26 601c2311befdbe6693d5358d5ad27c84 161
-#key alt-tab
-#barrier_2 332 57 42 174 6c75667e9b36b27996466c90a66d8a3f 161
-# Sending keys: alt-f2
-#key alt-f2
-# --------------------------------
-step 132.31
-screendump 20080101_000011_3f7832a9c3db11feb4d0267c2071e1e1.ppm
-#barrier_2 67 60 198 208 e10457de0a72ae52dcad8c0a418d4f17 14
-# Sending keys: g a i m ret
-key g
-key a
-key i
-key m
-key ret
-# --------------------------------
-step 139.82
-screendump 20080101_000012_e47229c3c44c27794b35f5cf0d7be2f7.ppm
-# start thunderbird
-barrier_2 176 139 124 76 cdf3a8082a13fd8f9bc30449c9588a78 38
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 149.85
-screendump 20080101_000013_7404f2dfd573d4b6132efb98d6e538d5.ppm
-barrier_2 70 59 187 208 165a3aaa29b9369f75262bcac7d19843 50
-# Sending keys: t h u n d e r b i r d ret
-key t
-key h
-key u
-key n
-key d
-key e
-key r
-key b
-key i
-key r
-key d
-key ret
-# --------------------------------
-step 167.31
-screendump 20080101_000014_13ee9420484f8e5b8640fd5b465c9426.ppm
-barrier_2 223 62 339 372 e3f7984354911c06d0def1beb2b61b83 87
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 170.08
-screendump 20080101_000015_1a2082d30af9e5927ebed9189562dc8a.ppm
-barrier_2 92 64 466 368 7cfda6dd4f84e8eaa6fe924ffe80d568 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 179.28
-screendump 20080101_000016_a7007b64e90fd241a60e0cd25038fdd5.ppm
-barrier_2 214 114 116 249 eb875cea15339a93ce4d688f9c64c9ac 46
-# Sending keys: tab tab tab tab
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 180.86
-screendump 20080101_000017_652455d6f3648137071662f202969cfa.ppm
-barrier_2 110 68 339 364 6f2d78e7bbb930ce28fd1579ef68a850 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 183.70
-screendump 20080101_000018_f4d237be3f0b55e2c34bacc615a7e540.ppm
-barrier_2 91 49 523 251 6ba108e0492f8b14e4d667ea1e2cd6ef 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 186.55
-screendump 20080101_000019_54065ef58999b94a14e65fd4b62e7d80.ppm
-barrier_2 184 52 364 241 09ebe542361336fa645fb64ba4e7b00f 14
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 193.04
-screendump 20080101_000020_fba8cb5584a273e37f5ef0e0d0e36ca1.ppm
-# try to shut down
-barrier_2 154 106 186 85 354129b4343c734a98d8b5e7e25325ea 32
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 198.01
-screendump 20080101_000021_bf58291c6ed0395cb7a7119c7ac8e6d6.ppm
-# exit X
-barrier_2 54 62 218 207 0d2e45caa34fabd1b2efdec1186c006b 25
-# Sending keys: alt-ctrl-backspace
-key alt-ctrl-backspace
-# --------------------------------
-step 206.83
-screendump 20080101_000022_ffb5ce7a21abc32b6b47a21e5ef1b393.ppm
-# bye bye!
-barrier_2 209 11 0 389 aee560fc89cfab454011ae58fb4ad7d6 44
-# Sending keys: s h u t d o w n spc minus p spc n o w ret
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key minus
-key p
-key spc
-key n
-key o
-key w
-key ret
diff --git a/client/tests/kvm/steps/Mandriva-One-2007-32.steps b/client/tests/kvm/steps/Mandriva-One-2007-32.steps
deleted file mode 100644
index 261c4c2..0000000
--- a/client/tests/kvm/steps/Mandriva-One-2007-32.steps
+++ /dev/null
@@ -1,480 +0,0 @@
-# Generated by stepmaker version 20081106 (instance: 731237596479)
-# Generated on Sun Nov 9 00:04:06 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 mandriva.qcow2 -cdrom /home/cyber/Installs/mandriva-one-2007.iso -m 512 -nographic -monitor unix:/tmp/monitor_731237596479,server,nowait &
-# --------------------------------
-step 4.97
-screendump 20080101_000001_925d19d65efcfc734ab1f6c2ff79e778.ppm
-barrier_2 256 74 311 247 76d228fd5c3e76866ae239c82ad0cf27 25
-# Sending keys: ret
-key ret
-# --------------------------------
-step 59.63
-screendump 20080101_000002_9b15cdfd689e1dac27408851a56f1298.ppm
-# language
-barrier_2 190 209 250 349 21a4ad694338907333894275ea2be5d3 273
-# Sending keys: ret
-key ret
-# --------------------------------
-step 64.22
-screendump 20080101_000004_19978ce010d8adb599c824cb515bd280.ppm
-# country
-barrier_2 531 103 246 455 d03b1a395cd3c35fc2896eea06cded3f 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 76.71
-screendump 20080101_000006_c969dc67d9ab67d4037ede40e405450d.ppm
-# license
-barrier_2 141 111 247 446 1c270bdd546a3efeee72ea7d5ff26625 52
-# Sending keys: up
-key up
-# --------------------------------
-step 78.97
-screendump 20080101_000007_45ce36f2fed7825ccb6bf3f7a3ebd6d8.ppm
-barrier_2 140 107 247 450 be3315bb4fb24c677100a307272d398d 11
-# Sending keys: tab tab tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 80.82
-screendump 20080101_000008_e1077036abbd0c0aa4f32b7a892d0a03.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 82.59
-screendump 20080101_000009_b9f62a14ad24b67fe1cb655475a21aab.ppm
-# keyboard layout
-barrier_2 528 76 247 483 e1e34fd4d993564e3fa0641458d6cf2a 9
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 84.03
-screendump 20080101_000010_42bddd374420bdeac1f313527b5ec0df.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 87.55
-screendump 20080101_000011_8db5d651931cfc4cca59f272c736170e.ppm
-# timezone
-barrier_2 530 97 246 462 09f6fbb565bdbcf5e0aa8c733d14b54a 18
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 89.29
-screendump 20080101_000012_9edf1b43a63f86aea52c4fccde15c93d.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 91.13
-screendump 20080101_000013_9a3afaf32cb029c7d02e10f3e437a531.ppm
-# local time or UTC?
-barrier_2 525 100 249 459 882528ef39ecf1b94a5731179623b5c8 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 115.32
-screendump 20080101_000014_5fb6cb2efea15eec846865dd4210c232.ppm
-# KDE desktop -- Mandriva splash screen
-barrier_2 126 82 796 630 12e591f0aa30b6eaada049aa54a24288 121
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 119.37
-screendump 20080101_000015_ccebb4b113595f397294cab927cc4f17.ppm
-# closed -- disable screensaver
-barrier_2 116 88 0 680 1bda03a33c19049ee52ee3e5918defa1 20
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 125.74
-screendump 20080101_000016_2e1e8036a5066e5f937fa6da47e8cc98.ppm
-barrier_2 92 59 34 513 da24c08d98840a7490ffc973c8547035 32
-# Sending keys: up
-key up
-# --------------------------------
-step 127.69
-screendump 20080101_000017_777acda14811e4a03274ee3e5e74a213.ppm
-# Sending keys: up up up up up up up
-key up
-key up
-key up
-key up
-key up
-key up
-key up
-# --------------------------------
-step 131.17
-screendump 20080101_000018_79d9f9aeebaf9a431043340d7ba97162.ppm
-barrier_2 146 36 13 535 7d9c49461401ef52812d3ea4d7f778a3 17
-# Sending keys: right
-key right
-# --------------------------------
-step 135.23
-screendump 20080101_000019_ff79bcb3c2c99fa248d138208b9048cc.ppm
-barrier_2 92 85 267 306 02c33e0764a568c98fbbdb523b710034 20
-# Sending keys: down
-key down
-# --------------------------------
-step 137.00
-screendump 20080101_000020_962b46cdce1f37969d0b46b73d531dcf.ppm
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 138.58
-screendump 20080101_000021_59e49512b732f0bffa202edeb046dd77.ppm
-# start control center
-barrier_2 51 50 256 318 66c0c90b02e52b0ee0be8d65c66cfe9f 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 143.48
-screendump 20080101_000022_f8237efbe854616a1e8ec8b31106087b.ppm
-barrier_2 86 85 54 106 8eb4642373a12ef0e4d99cbef89f6e35 24
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 145.83
-screendump 20080101_000023_2ba2216efbb51941b52a1dad65b64032.ppm
-barrier_2 81 54 52 106 f7bcfc99d29a358ffe01b3f8b9f29481 12
-# Sending keys: spc
-key spc
-# --------------------------------
-step 147.50
-screendump 20080101_000024_7b6a0045dac8924d26fe40d05f21db57.ppm
-barrier_2 50 108 74 148 b2ee226064b517c637646cc8ead19c67 8
-# Sending keys: down down down down down down
-key down
-key down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 151.12
-screendump 20080101_000025_39e9727cd51e90dffa4e97b0672d660e.ppm
-# open screen saver config
-barrier_2 38 43 75 205 2397cd00b938010903897badda789086 18
-# Sending keys: ret
-key ret
-# --------------------------------
-step 157.35
-screendump 20080101_000026_94e33898dcbf987c0d4298165cf9ae9e.ppm
-barrier_2 554 195 263 436 0bcd41a572530cc357d367dddc1622d4 31
-#barrier_2 103 88 298 95 7872bf68121639c55106ba02d92ab823 31
-# Sending keys: tab tab tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 160.12
-screendump 20080101_000027_4b032430289567e660d597e6bbf1ba04.ppm
-# disable "start automatically"
-barrier_2 66 29 279 456 2b42e20722c65f2400dc33b12096d7e1 14
-# Sending keys: spc
-key spc
-# --------------------------------
-step 162.69
-screendump 20080101_000028_cf4dff37f6b53d201ddfec8690d942ac.ppm
-# apply
-barrier_2 63 33 276 453 b5a5a02d39d74e621856e47ea3362890 13
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 165.35
-screendump 20080101_000029_dc8bcc0a4e32ffe51bb21923eb9ed6aa.ppm
-# close
-barrier_2 552 194 264 436 5abcbcc89d4c54a05d505171a09c67a6 13
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 170.34
-screendump 20080101_000030_9000af7a2fe296441ea83d08c14c678a.ppm
-barrier_2 96 264 27 7 f1dc387efb04dd107123f50a8e8df35c 25
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 172.48
-screendump 20080101_000031_e2d7dd78b347cff293f8ab377c93e499.ppm
-# start installation
-barrier_2 110 83 21 189 d6475983318d360c5d827c1692683689 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 177.80
-screendump 20080101_000032_9acc3e3342549445762ee54ad415902b.ppm
-# next
-barrier_2 240 67 297 312 6c498fb3322f3eb9dd43bf0c7660e38c 27
-# Sending keys: ret
-key ret
-# --------------------------------
-step 180.65
-screendump 20080101_000033_65dbbfa3e4f5346863fcbc7404a8941c.ppm
-# partitioning
-barrier_2 117 307 9 72 c1b077435c7f586f8932353e00472937 14
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 182.79
-screendump 20080101_000034_dadc97259afc217d4e7d0b8d97ea4cda.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 963.34
-screendump 20080101_000035_5eb6e89e403ac7f56bd1adf8c53da4e2.ppm
-# bootloader config
-barrier_2 528 49 8 330 028e5697ffe9691057479a7de1ab5f85 3903
-# Sending keys: ret
-key ret
-# --------------------------------
-step 967.06
-screendump 20080101_000036_bf58bdede3e654f8428682007374e325.ppm
-barrier_2 529 61 8 317 8c520049e52efddff9f6413250080603 19
-# Sending keys: tab tab tab tab tab tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 970.98
-screendump 20080101_000037_8edf94fff51131565ffa09a28d4b4506.ppm
-barrier_2 188 45 349 333 db0df4ca785ae26a6459eb1f05fc0bb8 20
-# Sending keys: ret
-key ret
-# --------------------------------
-step 977.86
-screendump 20080101_000038_fafb3f2dc99c351b635d9a617db427f8.ppm
-# installer asks me to reboot
-barrier_2 528 335 8 45 9517749a0d810059f3f1adceb934ed91 34
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 979.83
-screendump 20080101_000039_3a75d08fb72693a9d51c23f63f580076.ppm
-# finish
-# Sending keys: ret
-key ret
-# --------------------------------
-step 986.74
-screendump 20080101_000040_4e3b8b4d0fe508178b0bb6f95a7c9ad7.ppm
-# closed -- reboot
-barrier_2 134 182 13 92 7ea2c5198a00e63fd8117c0b617ad454 35
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 992.36
-screendump 20080101_000041_88e23f4d3addbb71bdb15abbda3651aa.ppm
-barrier_2 65 83 34 513 20b055f101352c55dc26794ccd29ca74 28
-# Sending keys: up
-key up
-# --------------------------------
-step 994.03
-screendump 20080101_000042_035b45e59ad27150eecf7974939a0ef7.ppm
-barrier_2 88 24 33 727 82c46b59deb961b2178cb32b20bf2518 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 999.22
-screendump 20080101_000043_5f293f78746a062ae4eea4185c6be207.ppm
-# restart
-barrier_2 162 87 533 307 b0b96cf9bb1ad0971c17525a22694783 26
-# Sending keys: alt-r
-key alt-r
-# --------------------------------
-step 1028.41
-screendump 20080101_000044_93e562e7869d5d11396f6c64f721a41c.ppm
-# press enter once the medium is removed
-barrier_2 171 25 243 495 9b1dd11faa55da7f2cb86c8a849b8797 146
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1039.83
-screendump 20080101_000045_c5933a8039c8a63910661372c2b104e3.ppm
-# bootloader
-barrier_2 119 64 222 223 efe803abc273156ca513728d06d1dd15 57
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1086.05
-screendump 20080101_000046_7693afab2b5f95b56773cf8a18779b3f.ppm
-# choose the connection you want to configure
-barrier_2 136 267 249 290 1c5002e26d1365d906e7acf5dcf33dfe 231
-# Sending keys: tab
-key tab
-# --------------------------------
-step 1087.49
-screendump 20080101_000047_ba46476a8b9aa3e4dd71afd1fbfec28d.ppm
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1092.68
-screendump 20080101_000048_b4f3fbaf9d72c1511581374bdf7275c4.ppm
-# root password
-barrier_2 34 84 417 222 1756658ef37991e1e7d7fe4f6afb05f1 26
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 tab tab tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key tab
-key tab
-# --------------------------------
-step 1100.04
-screendump 20080101_000049_5c034ebf27372d8c3d939c58aea3c3f2.ppm
-barrier_2 104 49 673 509 00523f19191246a1ea9cd5f44f4bc679 37
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1104.44
-screendump 20080101_000050_5abcf33f657a0f0917d18495dfd346de.ppm
-# user
-barrier_2 42 106 459 258 c96ed9a40400d48eaeaa856b3d85407b 22
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 tab tab tab tab
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 1114.76
-screendump 20080101_000051_88cafb6a59734a9332862377be7f8dfb.ppm
-barrier_2 130 48 583 511 1d01d69f8af7f6b6f12e394bd8b7bc42 52
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1117.36
-screendump 20080101_000052_6537ae958063281b62f614b6d60b4080.ppm
-barrier_2 198 52 579 507 fa7d25e31b59295880d823de588e3ce4 13
-# Sending keys: tab tab tab tab tab tab tab tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 1121.20
-screendump 20080101_000053_a89823eac57bc76722df02e0d7d443ae.ppm
-# done entering users
-barrier_2 192 50 586 508 513b488bbad88d13878a05f2fc323270 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1129.24
-screendump 20080101_000054_722516564a5c8a87031fc6205a95228d.ppm
-# Mandriva Firsttime thing
-barrier_2 217 72 225 454 70c35a5762216ad170ee6b9c2f128457 40
-# Sending keys: tab
-key tab
-# --------------------------------
-step 1132.40
-screendump 20080101_000055_d8fa7006722f7dec71241eb40c767fef.ppm
-# Sending keys: tab
-key tab
-# --------------------------------
-step 1134.00
-screendump 20080101_000056_a0fd69fc9e2ef96f26a158be07a9c727.ppm
-# skip
-barrier_2 224 72 223 459 9a3089ee0dc37648c723ec2e00001d10 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1150.70
-screendump 20080101_000057_fb47ac9a63ecd680703d3a894a418314.ppm
-# login
-barrier_2 142 125 351 249 f8a64984244ddfcf54f1402c1059b49f 83
-# Sending keys: u s e r tab
-key u
-key s
-key e
-key r
-key tab
-# --------------------------------
-step unknown
-screendump 20080101_000058_fb47ac9a63ecd680703d3a894a418314.ppm
-sleep 1
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1200.88
-screendump 20080101_000059_cf3c4fc84dd33f9fce490e8fd4000849.ppm
-# desktop reached, close splash window
-barrier_2 131 80 791 631 32ab4534a73a470b0ed22ce2cb3b8705 251
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 1204.30
-screendump 20080101_000060_e389ef09ba0e6917ac1bf57c6fa27a21.ppm
-# shutdown
-barrier_2 116 89 0 679 41ba7967cf1276e1e994c5dd1b40b46a 17
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 1207.86
-screendump 20080101_000061_d9d32babdfc3aff6d2f67a534133274f.ppm
-barrier_2 74 104 53 476 8151d77904f2b2583df9294832bf2192 18
-# Sending keys: up
-key up
-# --------------------------------
-step 1209.16
-screendump 20080101_000062_9ed4f10bf509d19827946ba17c629bec.ppm
-barrier_2 86 22 35 690 6a13fa789f46028adcfe8405c4ab33b2 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1214.38
-screendump 20080101_000063_29ba4e588bd22531e325d46035203a06.ppm
-# turn off computer
-barrier_2 163 84 532 309 91a1a1acafe5e6d34f189a6082799c7c 26
-# Sending keys: alt-t
-key alt-t
diff --git a/client/tests/kvm/steps/NetBSD-1.6.2.steps b/client/tests/kvm/steps/NetBSD-1.6.2.steps
deleted file mode 100644
index 74a5599..0000000
--- a/client/tests/kvm/steps/NetBSD-1.6.2.steps
+++ /dev/null
@@ -1,241 +0,0 @@
-# Generated by stepmaker version 20081106 (instance: 924880501364)
-# Generated on Fri Nov 7 13:47:30 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 fbsd.qcow2 -cdrom /home/cyber/Installs/netbsd-1.6.2-cd-i386cd.iso -nographic -monitor unix:/tmp/monitor_924880501364,server,nowait &
-# --------------------------------
-step 4.50
-screendump 20080101_000001_e78ae5083b7c3bb5f7c42a6dddb10519.ppm
-# press return to boot now
-barrier_2 89 17 391 367 03621d285ca1a95c51f7264131efc23c 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 63.48
-screendump 20080101_000002_b7cbbede80d7c00140890591755605f9.ppm
-# install system -- install to hard disk
-barrier_2 254 23 148 204 b5fb6c89f1650c9a9cfbf52085b81d13 295
-# Sending keys: ret
-key ret
-# --------------------------------
-step 64.95
-screendump 20080101_000003_23ede2520271471f3c0fd7e3217b1f51.ppm
-# are you sure?
-barrier_2 138 92 291 195 ae25e45be768044205add63f5dbc1065 7
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 66.70
-screendump 20080101_000004_98d8d220d7c9e46d8eccea8654e28ab6.ppm
-barrier_2 231 82 240 191 e5b01764a5a7eeac9587a32e2ddc73df 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 68.14
-screendump 20080101_000005_e41feb62c112a01a40b81333f4cacf06.ppm
-# disk geometry
-barrier_2 320 64 195 191 5bb82ebb758014b148d342ee95e9156f 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 69.61
-screendump 20080101_000006_62e5c2b3d2177f7352cfb41f23276000.ppm
-# use entire disk
-barrier_2 293 94 214 193 9d6a37eca36938e5612ad3e8f9f2c45b 7
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 70.96
-screendump 20080101_000007_df60b4541c45ee7c775282c558e57861.ppm
-# with X
-barrier_2 258 125 231 193 425b6de43e6672b4c59f10626c4bda3b 7
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 73.13
-screendump 20080101_000008_8fccd0b97081be4259af0f16d06d1637.ppm
-# partitioning
-barrier_2 631 23 4 12 bb7ad76787ffb98bf6b0b4fca71d9c6d 11
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 76.16
-screendump 20080101_000009_e784c5edc6a57288fb47088ed08e38f6.ppm
-barrier_2 47 18 138 15 0edde568c251cfbc96c197e099c38dfb 15
-# Sending keys: ret
-key ret
-# --------------------------------
-step 77.53
-screendump 20080101_000010_b6b049e234d4faf80c560016eb3be13f.ppm
-# are you sure?
-barrier_2 135 102 292 190 2329792485fc3e64213aeb4d4246b07a 7
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 485.02
-screendump 20080101_000011_e3b4a1534fd06041c0a35424df9ba819.ppm
-# bootblocks
-barrier_2 265 96 228 191 a58f7aca9268d18a3a40c373ed079413 2037
-# Sending keys: ret
-key ret
-# --------------------------------
-step 495.85
-screendump 20080101_000012_f41ad29703af5c87094a98d03365130c.ppm
-# start installation
-barrier_2 458 20 4 11 55bab1c8bed8e5271f3b2d59e99e7fbd 54
-# Sending keys: ret
-key ret
-# --------------------------------
-step 498.37
-screendump 20080101_000013_9d99e392a32529195438172419f2c556.ppm
-# full installation
-barrier_2 262 102 229 190 1cb5aa52cce0c2d004f74f044aba49d4 13
-# Sending keys: ret
-key ret
-# --------------------------------
-step 500.20
-screendump 20080101_000014_07eed337e94c75231fb323d089d0c97f.ppm
-# progress bar
-barrier_2 362 116 174 190 8565bf470bb7b9a5703c838b364ef4f4 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 502.60
-screendump 20080101_000015_55aaebbd60a1edc19f9adba19281d44b.ppm
-# medium = cdrom
-barrier_2 177 94 267 194 8afce9f5367842bc4495aa250fcc42ac 12
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 503.76
-screendump 20080101_000016_e5917a21aafa6f80752ba38f5846b90a.ppm
-barrier_2 123 31 262 265 671ea02174fdc405b3f68374c2da9952 6
-# Sending keys: ret
-key ret
-# --------------------------------
-step 506.93
-screendump 20080101_000017_e6715368587d3b101242983a4e88f4dd.ppm
-# continue
-barrier_2 145 18 5 13 93a61b396d899269fe7e58de252e36ac 16
-# Sending keys: down down ret
-key down
-key down
-key ret
-# --------------------------------
-step 1310.85
-screendump 20080101_000018_70429e4c6e9b78b8e3afd645450d769e.ppm
-# installation done
-barrier_2 493 27 0 10 837ebf99ba255c41bb82aacee7889764 4020
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1330.62
-screendump 20080101_000019_4f3238052c78db3c8c2f86c2fc020639.ppm
-# start configuration
-barrier_2 590 20 4 13 91ff6212601a158c04689fa4467a532e 1500
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1333.40
-screendump 20080101_000020_17dd4791fe21e3143997185508348cd9.ppm
-# timezone
-barrier_2 90 34 4 14 c6df4edb5bd5ad0540a5535b1380c11f 14
-# Skipping all steps till number 37
-# --------------------------------
-step 1582.58
-screendump 20080101_000037_9eddcb0ab4940eaa212a5ec644a8bb0a.ppm
-# Sending keys: x ret
-key x
-key ret
-# --------------------------------
-step 1583.92
-screendump 20080101_000038_53b057fbb5270c43b88f2b144257fac7.ppm
-# password cipher -- DES
-barrier_2 682 44 3 11 2cb5462ae4b7a8ced6465b64e2136475 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1585.47
-screendump 20080101_000039_adc18660a59d99d91591a74bbae53c63.ppm
-# set root password?
-barrier_2 137 102 292 191 fa9a9e3d6ba2e16cd67e35365dcad99e 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1587.97
-screendump 20080101_000040_3785874688a21c63b316a16db59aabdf.ppm
-# password
-barrier_2 75 34 0 64 049158ecd38b695c1025c4441e40901e 12
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1589.86
-screendump 20080101_000041_c8050e030417bd8b80955b0e61c2de7f.ppm
-barrier_2 61 34 0 82 83d4679a04329f7c53cdd2977a4879a5 9
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1593.67
-screendump 20080101_000042_9494294d8d2b554c0ed5df8cc92448b6.ppm
-# complete -- reboot
-barrier_2 451 18 0 14 223246fdbc4d9aa99d178f54b238a225 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1606.87
-screendump 20080101_000043_b7cbbede80d7c00140890591755605f9.ppm
-# reboot
-barrier_2 170 120 131 231 df3c6687d91dafb016cbc24c6e6450ca 66
-# Sending keys: d
-key d
-# --------------------------------
-step 1609.38
-screendump 20080101_000045_6bb51516da01dc02ebcdc60175e1a069.ppm
-barrier_2 244 34 129 279 4e50b56ede1d71c2ad9b33fa50bc72ca 6
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1676.54
-screendump 20080101_000046_20530a3d6c5be46830ca1d048064a929.ppm
-# login
-barrier_2 54 19 0 381 b80c5ba7eb92861db00a5499396b2ed1 336
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 1677.83
-screendump 20080101_000047_4f2fd9d27c907721ad7de155d8319b5e.ppm
-barrier_2 73 17 0 383 4e44f0b54ba5f32e6fd0865042575770 6
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1685.44
-screendump 20080101_000048_95b0f8ddfa86a827243049a8ee1cee54.ppm
-# done -- bye bye!
-barrier_2 15 32 0 368 9ccf87a42fe2e2fe61f6dff515ff3816 38
diff --git a/client/tests/kvm/steps/OpenBSD-4.1-32.steps b/client/tests/kvm/steps/OpenBSD-4.1-32.steps
deleted file mode 100644
index e35ab37..0000000
--- a/client/tests/kvm/steps/OpenBSD-4.1-32.steps
+++ /dev/null
@@ -1,348 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 372440917862)
-# Generated on Tue Nov 18 17:14:55 2008
-# uname -a: Linux pink-intel 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda /vm/openbsd-test.qcow2 -cdrom /isos/unix/openbsd41-i386-07-05-06.iso -nographic -monitor unix:/tmp/monitor_372440917862,server,nowait &
-# --------------------------------
-step 6.49
-screendump 20080101_000001_3f996cd4238ffb1496d3ebcfa874f3b0.ppm
-barrier_2 51 16 0 384 854af4fccb6dc3bfeb7ced7bd2b6c284 32
-# Sending keys: ret
-key ret
-# --------------------------------
-step 75.07
-screendump 20080101_000002_c31caf93c9be5e1903464dd2ba7fb50d.ppm
-# What to do: [Install]
-barrier_2 289 18 0 382 cc2d72e6ec348fc346ede71feb9584d5 343
-# Sending keys: i ret
-key i
-key ret
-# --------------------------------
-step 78.82
-screendump 20080101_000003_364ad38f6ad3c6e13600f14af2826f5f.ppm
-# Terminal Type
-barrier_2 201 16 0 384 a2c2d53a52c501a680e49b00c5d969c9 19
-# Sending keys: ret ret
-key ret
-key ret
-# --------------------------------
-step 81.98
-screendump 20080101_000004_08cc5a79bc3003d57311013326378e14.ppm
-# Proceed with Installation
-barrier_2 234 17 0 383 0194a6fdabc4df6bd6017c6e646b32f7 16
-# Sending keys: y ret ret y ret
-key y
-key ret
-key ret
-key y
-key ret
-# --------------------------------
-step 86.08
-screendump 20080101_000005_1d8c22d5297e06aa0337d91d79e8ede1.ppm
-# Hard Disk Partitioner & Slicing
-barrier_2 13 16 0 384 7869f35d3f942932365e6f401c24a6e3 21
-# Sending keys: a spc a ret
-key a
-key spc
-key a
-key ret
-# --------------------------------
-step 88.84
-screendump 20080101_000006_515949c52b1e3a6c9566d98cdf640a81.ppm
-sleep 1
-# Sending keys: ret
-key ret
-# --------------------------------
-step 90.49
-screendump 20080101_000007_5df993a5de42a7fcf85f237708ffec24.ppm
-sleep 1
-# Sending keys: ret
-key ret
-# --------------------------------
-step 94.33
-screendump 20080101_000008_531b55fa7257bad139ceceeeb9237847.ppm
-sleep 1
-# Sending keys: ret
-key ret
-# --------------------------------
-step 96.55
-screendump 20080101_000009_e9af8ce721a450cefe8fb9ae909bdab6.ppm
-barrier_2 172 17 0 383 a6c644dfb0a00ee955d9f8a9cb2a5a0c 11
-# Sending keys: kp_divide ret
-key kp_divide
-key ret
-# --------------------------------
-step 100.19
-screendump 20080101_000010_0ee9a675b6e3a22c7af45a6523e5191c.ppm
-barrier_2 11 14 0 386 9fd4385ee2775e27f0283fe1802c0a0d 18
-# Sending keys: q ret
-key q
-key ret
-# --------------------------------
-step 102.49
-screendump 20080101_000011_17e4cca70cfe7059f8aaca9d936a9876.ppm
-barrier_2 188 18 0 382 e90a7509368b08ef5de9a90986805d80 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 105.22
-screendump 20080101_000012_ed2b1c3b97aaa7f83e4c997488c19840.ppm
-barrier_2 487 16 0 384 34d8c119d9a1ec88766140efbce6ad6a 14
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 371.01
-screendump 20090405_105712_bc7ad3996b687426993d88221f350f12.ppm
-# System Hostname
-barrier_2 219 19 151 381 ec418e4fd36e88610a74e493bda43701 60
-# Sending keys: o p e n b s d minus v m ret
-key o
-key p
-key e
-key n
-key b
-key s
-key d
-key minus
-key v
-key m
-key ret
-# --------------------------------
-step 775.10
-screendump 20090405_105808_9b4b83f1aec151d3c881aaaadd56c24a.ppm
-barrier_2 257 16 0 384 1a4fab2e173b1c25106e0ac8889ac470 60
-# Sending keys: ret
-key ret
-# --------------------------------
-step 778.88
-screendump 20080101_000015_f1f1dfe767e4ae96f609a3a84158eae7.ppm
-barrier_2 490 19 0 381 6ca01c2b2d340d05a007573c5ca7ad83 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 780.77
-screendump 20080101_000016_cb208b944720ebdc76e05f093548b360.ppm
-barrier_2 382 17 0 383 381346c3a8e7b675398d144f107315be 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 787.08
-screendump 20080101_000017_1718d514d2cf16ee8d019e67cd5931e4.ppm
-barrier_2 363 15 0 385 9ab38358f2c6855eb64b7864fdf1df8c 32
-# --------------------------------
-step 788.13
-screendump 20080101_000017_1718d514d2cf16ee8d019e67cd5931e4.ppm
-barrier_2 362 15 0 385 a36c0b6775685603ef2324aa8a11a3a6 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 790.17
-screendump 20080101_000019_322c248157a760cbe317291507151df5.ppm
-# DHCP
-barrier_2 387 19 0 381 c2686ac122232caee60bf4a41ef85cc3 10
-# Sending keys: d h c p ret
-key d
-key h
-key c
-key p
-key ret
-# --------------------------------
-step 808.79
-screendump 20080101_000020_5066840d95b294384798aa7ef45d185d.ppm
-# IPv6 ? (no)
-barrier_2 191 20 0 366 7e36d56f76f6386a6c55d54463e7f08c 93
-# Sending keys: ret
-key ret
-# --------------------------------
-step 814.83
-screendump 20080101_000021_d761d2216df716f62582f02ebd7592b2.ppm
-# Domain Name
-barrier_2 408 18 0 382 ccbc55fbd0cd21c28d7b35ddf3566402 30
-# Sending keys: ret
-key ret
-# --------------------------------
-step 817.57
-screendump 20080101_000022_2f37ff81d8bea52ca382f062749829b0.ppm
-# DNS nameserver
-barrier_2 344 15 0 385 7e3537d94f6390fb43cdd2dba338f1e3 14
-# Sending keys: ret
-key n
-key o
-key n
-key e
-key ret
-# --------------------------------
-step 823.01
-screendump 20080101_000024_f8cc9a062a862d0f1c49d30d9de748f8.ppm
-barrier_2 177 18 0 382 9ba777aa53d19e581948e24e78f235eb 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 825.44
-screendump 20080101_000025_74ee8730a9b0517e217adb95c22b9e6a.ppm
-barrier_2 175 15 0 385 83035c3c640046a68cf5b0d2d690f17b 12
-# Sending keys: ret
-key ret
-# --------------------------------
-step 827.44
-screendump 20080101_000026_f437dcc60e0382c137bd242d49d7bad9.ppm
-barrier_2 461 15 0 385 7692171b85a1f2cced698fdb99737613 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 832.62
-screendump 20080101_000027_0ba8b37ab2e4c24747d6894b79082194.ppm
-# Root Password
-barrier_2 380 18 0 382 6c90b2a02fb49befb74154b1125b331f 26
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 835.45
-screendump 20080101_000028_5ff44c9aa5a47bb99196376ab523ae6a.ppm
-barrier_2 306 19 0 381 f1481c2f224b553f74cd61688189c481 14
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 839.95
-screendump 20080101_000029_5b789449fe51583441734cfff7a9d3ad.ppm
-barrier_2 464 20 0 380 b79c1200da89301a4e0a5f08647ea9b9 23
-# Sending keys: ret
-key ret
-# --------------------------------
-step 841.69
-screendump 20080101_000030_2a31efc9a19f947607bf276b50afc691.ppm
-# Install Source
-barrier_2 337 15 0 385 5980387f1f70714123632d3e6aaf3382 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 846.40
-screendump 20080101_000031_67ad4d5c1e25025e74f7deba1d296400.ppm
-# Path
-barrier_2 399 17 0 383 576f71eda3e84f214cf2b67d87b62011 24
-# Sending keys: 4 1 slash i 3 8 6 ret
-key 4
-key 1
-key slash
-key i
-key 3
-key 8
-key 6
-key ret
-# --------------------------------
-step 853.75
-screendump 20080101_000032_0b1948ac78bc4394901b274129ff2ca5.ppm
-barrier_2 506 18 0 382 5d5bb98729f4bf7de4181c3ce4a16c3c 37
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 861.86
-screendump 20080101_000033_274b416fc4e5afaf4dc9dde1fa36c9ee.ppm
-# Select which packages to install
-barrier_2 269 34 0 366 28e1acd94032c054738720af27f741b8 41
-# Sending keys: ret
-key ret
-# --------------------------------
-step 864.88
-screendump 20080101_000034_cbc2d2088798badc60a89dc703141ba0.ppm
-barrier_2 319 18 0 382 f7aeb3cdb750c2cfc5d18ef97369bcd8 15
-# --------------------------------
-step 866.00
-screendump 20080101_000034_cbc2d2088798badc60a89dc703141ba0.ppm
-barrier_2 316 19 0 381 01c2eedf203256a319e2624dd8dc7e9a 6
-# Sending keys: ret
-key ret
-# --------------------------------
-step 866.89
-screendump 20080101_000036_34b19d11d9d38e1241878db506ad1f30.ppm
-barrier_2 311 20 0 380 b311b02d883f1cc0106a067862e215db 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 869.00
-screendump 20080101_000037_77e50728e78a839592f026b04a00ba1c.ppm
-barrier_2 325 19 0 381 88f0e4e6e8ffdd0606bc1767597c2f52 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 870.09
-screendump 20080101_000038_2abbcd198559b9f2f31fb442900216e2.ppm
-barrier_2 316 20 0 380 e0e54fa98a92bf9c520932e1ebff8bab 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 871.17
-screendump 20080101_000039_88621a05e43c4c7b79aecf19d8540e55.ppm
-barrier_2 315 19 0 381 e0986a2858fb6c99756ff042cd82a64e 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 872.18
-screendump 20080101_000040_fd04cfc121edde638002edfdb6dcd72f.ppm
-barrier_2 254 17 0 383 09be90d671ac5a567027714892315a75 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 878.22
-screendump 20080101_000041_040e08a6bf8129971612ebaa16e852d3.ppm
-barrier_2 256 16 0 384 43ece89a9ade2a6df674d50c956e0daf 30
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1357.70
-screendump 20080101_000042_5487a0b1f1f1e363e7968d995668b44e.ppm
-barrier_2 477 19 0 381 df145ac9f3312f4e5887c93fc6c6c165 2397
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1361.56
-screendump 20080101_000043_c457e9b8858587eb19d7cd341523b397.ppm
-# SSH and other services
-barrier_2 280 18 0 382 e0b00964bff67dc660bdc79edf49da02 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1362.97
-screendump 20080101_000044_ee5fb884912464b46ff551bc90a26bf2.ppm
-barrier_2 390 15 0 385 13945be48af9860ebe297f485d041fa5 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1365.11
-screendump 20080101_000045_fd28d97f6a89abfbdfa403a831329159.ppm
-barrier_2 375 17 0 383 a2155b7f79b4fae38e5ec4d88d8cf768 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1367.01
-screendump 20080101_000046_91698ba5efb289dcad756e0caee7f111.ppm
-barrier_2 317 16 0 384 41567aa598989ceaed311db895dd05d0 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1371.48
-screendump 20080101_000047_98b34e327c40e19958b897aff7762c8b.ppm
-# Timezone (default)
-barrier_2 363 15 0 385 1247fd4632ebe37d5eccdbf9c02dea4b 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1405.09
-screendump 20080101_000048_2bbc9561fe6ac84ee5cec8b1babb23b6.ppm
-# Finish
-barrier_2 638 50 1 334 7b4f51dc29bf1cf94aea7c6712f1ca8c 168
-# Sending keys: ret
-key ret
diff --git a/client/tests/kvm/steps/RHEL-3.9-i386.steps b/client/tests/kvm/steps/RHEL-3.9-i386.steps
deleted file mode 100644
index 7e053f8..0000000
--- a/client/tests/kvm/steps/RHEL-3.9-i386.steps
+++ /dev/null
@@ -1,316 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 315126744591)
-# Generated on Tue Mar 3 14:43:34 2009
-# uname -a: Linux virtlab8.virt.bos.redhat.com 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-kvm -cdrom /mnt/isos/linux/RHEL-3.9-x86_64-DVD.iso /tmp/rhel3-64.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_315126744591,server,nowait &
-# --------------------------------
-step unknown
-screendump 20090404_143150_210be5cd4155aa4fdbd89494106b0f4d.ppm
-barrier_2 42 171 0 265 1e64135a6da7be7e77f9de86f9eff237 20 optional
-# Sending keys: ret
-key ret
-# --------------------------------
-step 33.24
-screendump 20080101_000001_9e427763ab38cb59e66287f190585eb2.ppm
-# boot options
-barrier_2 47 170 0 27 bb2399341a2c56e29213445c375779a6 15 optional
-# Sending keys: ret
-key ret
-# --------------------------------
-step 44.52
-screendump 20080101_000002_48539713881a206003b29551621b6e2d.ppm
-# skip disc check
-barrier_2 101 32 280 120 4ae5c7dab859b7ac13c917913622f6e4 56
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 69.49
-screendump 20080101_000003_2b38dc123fe9c92731c7a41303e78694.ppm
-# welcome
-barrier_2 199 55 13 98 c71fc951379bc8a804cd62fb755869ba 125
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 73.87
-screendump 20080101_000004_3711fce8f175d60c7f59a046d9a10113.ppm
-# language
-barrier_2 111 41 4 89 6745f9a1b1e60af9c0edbbc8ab934c2e 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 77.28
-screendump 20080101_000005_6557d874995a348e4b41568107990ce9.ppm
-# keyboard
-barrier_2 116 32 1 90 842cfc1c4db141deefd7f4b5cbe831c1 17
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 80.53
-screendump 20080101_000006_76746cf9a62803cf9013d7372f857a23.ppm
-# mouse
-barrier_2 66 29 18 92 8bcceb3571d93964b0de77f6611eb7cc 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 85.49
-screendump 20080101_000007_d5ff7c658e3c352869ace83d41b60488.ppm
-# disk partitioning
-barrier_2 195 37 1 93 ecb47251a62cd48c5680a465d535daf3 25
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 90.09
-screendump 20080101_000008_d3055580ec59103214e05adbd19fbe7d.ppm
-# partition table unreadable warning
-barrier_2 55 38 370 178 a273ff274e843826d6db44878e64249d 23
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 96.86
-screendump 20080101_000009_65758b259d83d02d5820b8351a45a76f.ppm
-# auto partition
-barrier_2 228 32 12 92 4576847afa30a1dd00d46e172196cd5c 34
-# Sending keys: alt-v alt-n
-key alt-v
-key alt-n
-# --------------------------------
-step 102.44
-screendump 20080101_000010_67468157a4451761cea376f11a81ae3b.ppm
-# remove partition warning
-barrier_2 94 36 364 196 fff3ed4a43ea146266b2e343989b4b9c 28
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 106.87
-screendump 20080101_000011_8f16a085f65f3da9b2e0b7310f934a84.ppm
-# bootloader config
-barrier_2 153 38 11 101 43b6b911a4aaedb87de64df51355e4e8 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 110.26
-screendump 20080101_000012_300487677371a3395e12275ace7b8d01.ppm
-# network
-barrier_2 94 27 12 89 ed89769edbacd08656ac056620e2d658 17
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 127.09
-screendump 20080101_000014_3b47e6f2ad938ade71b4eb92e3794e18.ppm
-# firewall
-barrier_2 80 42 14 91 59d1c81481d17887ac28156dc32e17ab 47
-# Sending keys: alt-o alt-n
-key alt-o
-key alt-n
-# --------------------------------
-step 132.90
-screendump 20080101_000015_a7c5c74eac047f5582dd31972bf254d3.ppm
-# addn'l language
-barrier_2 218 37 12 88 1dc26febd5cb13861eefa83b6d73677c 29
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 138.83
-screendump 20080101_000016_ac908f9b6517bc5be62a886f3a35b06a.ppm
-# time zone selection
-barrier_2 117 28 11 90 37786fe5515ad39151ef7492570eb8b5 30
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 147.17
-screendump 20080101_000017_41221bc26b7b28eb0c7ae5c030b42927.ppm
-# root password
-barrier_2 216 37 14 95 0171a8619ec7c2d2d7d1921dc65cb34d 42
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 163.12
-screendump 20080101_000018_604ecaafdac54b265372bf4b3f1841d9.ppm
-# pkg defaults
-barrier_2 116 53 14 92 9b6433c29cb6d6195b42663b7ad7baff 80
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 169.37
-screendump 20080101_000019_3584d81bd70ef291bcc4b53faca9cad7.ppm
-# confirm
-barrier_2 178 28 13 93 0dbcb8e0d07ba160a125790fc7da4255 31
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 526.20
-screendump 20080101_000020_3b1ca39267a9f5e9e526c1f3d3feb4a3.ppm
-# graphics
-barrier_2 190 62 8 92 b278cea3f4de024ab7600a20681e156e 1784
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 536.37
-screendump 20080101_000021_1b6ec0cb4697e4478d02f9f6e74b9cdc.ppm
-# monitor config
-barrier_2 230 39 11 87 00be56641a9fc0a7ea8a180e05c7c8fa 51
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 545.56
-screendump 20080101_000022_0c24acfb6accdd0210bf39d37555034a.ppm
-# graphics
-barrier_2 195 59 17 95 b3592e9cd31acdc50cf296e818fa4b1c 46
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 554.53
-screendump 20080101_000023_f1a8e5956d4f67ace2577fd44153b862.ppm
-# reboot
-barrier_2 128 49 3 55 abf9406a61aabd0c040fb95148663dc2 45
-# Sending keys: alt-e
-key alt-e
-# --------------------------------
-step 616.34
-screendump 20080101_000024_2c4461d2bc49cd1617dc5d477b192008.ppm
-# firstboot welcome
-barrier_2 221 48 199 9 ec4dd814a1edf28203a79634869ce901 309
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 621.88
-screendump 20080101_000025_68b1c0f87b75854b9d78c29d1572de68.ppm
-# license agreement
-barrier_2 433 45 186 5 7c4b13d1ac48f667672aa2dc4ae40667 28
-# Sending keys: alt-y alt-n
-key alt-y
-key alt-n
-# --------------------------------
-step 627.84
-screendump 20080101_000026_da52e6b80d320700f57364ed450546ab.ppm
-# date and time
-barrier_2 333 50 202 9 6b7b5e330f8c2529f4ff40610f678c92 30
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 643.62
-screendump 20080101_000027_22252e81cf48e82fdb8863a4f183355e.ppm
-# red hat login
-barrier_2 286 55 178 8 a1fab7d8381cd988b947d9fac98863aa 79
-# Sending keys: down down alt-n
-key down
-key down
-key alt-n
-# --------------------------------
-step 650.41
-screendump 20080101_000028_eb0998f582bdf17dd303f98271379df9.ppm
-# why register
-barrier_2 307 46 169 11 883ddffcf7edc223c64a8b6136cbb758 34
-# Sending keys: down alt-n
-key down
-key alt-n
-# --------------------------------
-step 655.83
-screendump 20080101_000029_e305b03985b556cacf19d90103d655d1.ppm
-# create user
-barrier_2 316 31 171 23 55e1e40e059f07bb2c39e526be68df7b 27
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 671.22
-screendump 20080101_000030_5b7617e1bdcdd0dfb4a42a99e6b1f508.ppm
-# addn'l discs
-barrier_2 362 68 183 0 31ec4fcf1347eaebd6783e1cba1140d3 77
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 676.34
-screendump 20080101_000031_369248a1afd8ec1dadd7e74d7c5e0680.ppm
-# finish
-barrier_2 338 61 182 8 a8d220e1ef78648892f217cd16fbfdce 26
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 688.52
-screendump 20080101_000032_32f952084500acbce063bbe44e3e52fa.ppm
-# username
-barrier_2 95 27 265 240 445c76a950093a3c1cc8e09f4f05a56f 61
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 695.01
-screendump 20080101_000033_c6b334834fac5fc14ea47afb02aea15b.ppm
-# password
-barrier_2 98 18 274 252 40c7a61ce804b6c2ba270cb2ad63c73f 32
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 710.30
-screendump 20080101_000034_586d038f01aec65a4aff1d7f5620541b.ppm
-# open command menu
-barrier_2 111 76 3 519 6f277cf27c2650d15a9e75bb058b4ef9 76
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 772.52
-screendump 20080101_000036_5de75bea9e76f725e437bb9885331ce3.ppm
-# choose logout
-barrier_2 71 107 439 481 b0cf46178b4789f94b7751ea702d27f0 146
-# Sending keys: up up up up up ret
-key up
-key up
-key up
-key up
-key up
-key ret
-# --------------------------------
-step 781.71
-screendump 20080101_000037_c43ca503bc41bc7fcdf040b21e2dd834.ppm
-# shutdown
-barrier_2 214 36 321 250 554113d752c6b7f80f114e8fe8ec0d60 46
-# Sending keys: alt-u alt-o
-key alt-u
-key alt-o
diff --git a/client/tests/kvm/steps/RHEL-3.9-x86_64.steps b/client/tests/kvm/steps/RHEL-3.9-x86_64.steps
deleted file mode 100644
index 6b3e8bf..0000000
--- a/client/tests/kvm/steps/RHEL-3.9-x86_64.steps
+++ /dev/null
@@ -1,311 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 315126744591)
-# Generated on Tue Mar 3 14:43:34 2009
-# uname -a: Linux virtlab8.virt.bos.redhat.com 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-kvm -cdrom /mnt/isos/linux/RHEL-3.9-x86_64-DVD.iso /tmp/rhel3-64.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_315126744591,server,nowait &
-# --------------------------------
-step 33.24
-screendump 20080101_000001_9e427763ab38cb59e66287f190585eb2.ppm
-# boot options
-sleep 5
-barrier_2 47 167 0 27 a4964917d318bfb8b9094569e19b4d60 166 optional
-# Sending keys: ret
-key ret
-# --------------------------------
-step 44.52
-screendump 20080101_000002_48539713881a206003b29551621b6e2d.ppm
-# skip disc check
-barrier_2 101 32 280 120 4ae5c7dab859b7ac13c917913622f6e4 56
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 69.49
-screendump 20080101_000003_2b38dc123fe9c92731c7a41303e78694.ppm
-# welcome
-barrier_2 199 55 13 98 c71fc951379bc8a804cd62fb755869ba 125
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 73.87
-screendump 20080101_000004_3711fce8f175d60c7f59a046d9a10113.ppm
-# language
-barrier_2 111 41 4 89 6745f9a1b1e60af9c0edbbc8ab934c2e 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 77.28
-screendump 20080101_000005_6557d874995a348e4b41568107990ce9.ppm
-# keyboard
-barrier_2 116 32 1 90 842cfc1c4db141deefd7f4b5cbe831c1 17
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 80.53
-screendump 20080101_000006_76746cf9a62803cf9013d7372f857a23.ppm
-# mouse
-barrier_2 66 29 18 92 8bcceb3571d93964b0de77f6611eb7cc 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 85.49
-screendump 20080101_000007_d5ff7c658e3c352869ace83d41b60488.ppm
-# disk partitioning
-barrier_2 195 37 1 93 ecb47251a62cd48c5680a465d535daf3 25
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 90.09
-screendump 20080101_000008_d3055580ec59103214e05adbd19fbe7d.ppm
-# partition table unreadable warning
-barrier_2 55 38 370 178 a273ff274e843826d6db44878e64249d 23
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 96.86
-screendump 20080101_000009_65758b259d83d02d5820b8351a45a76f.ppm
-# auto partition
-barrier_2 228 32 12 92 4576847afa30a1dd00d46e172196cd5c 34
-# Sending keys: alt-v alt-n
-key alt-v
-key alt-n
-# --------------------------------
-step 102.44
-screendump 20080101_000010_67468157a4451761cea376f11a81ae3b.ppm
-# remove partition warning
-barrier_2 94 36 364 196 fff3ed4a43ea146266b2e343989b4b9c 28
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 106.87
-screendump 20080101_000011_8f16a085f65f3da9b2e0b7310f934a84.ppm
-# bootloader config
-barrier_2 153 38 11 101 43b6b911a4aaedb87de64df51355e4e8 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 110.26
-screendump 20080101_000012_300487677371a3395e12275ace7b8d01.ppm
-# network
-barrier_2 94 27 12 89 ed89769edbacd08656ac056620e2d658 17
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 127.09
-screendump 20080101_000014_3b47e6f2ad938ade71b4eb92e3794e18.ppm
-# firewall
-barrier_2 80 42 14 91 59d1c81481d17887ac28156dc32e17ab 47
-# Sending keys: alt-o alt-n
-key alt-o
-key alt-n
-# --------------------------------
-step 132.90
-screendump 20080101_000015_a7c5c74eac047f5582dd31972bf254d3.ppm
-# addn'l language
-barrier_2 218 37 12 88 1dc26febd5cb13861eefa83b6d73677c 29
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 138.83
-screendump 20080101_000016_ac908f9b6517bc5be62a886f3a35b06a.ppm
-# time zone selection
-barrier_2 117 28 11 90 37786fe5515ad39151ef7492570eb8b5 30
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 147.17
-screendump 20080101_000017_41221bc26b7b28eb0c7ae5c030b42927.ppm
-# root password
-barrier_2 216 37 14 95 0171a8619ec7c2d2d7d1921dc65cb34d 42
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 163.12
-screendump 20080101_000018_604ecaafdac54b265372bf4b3f1841d9.ppm
-# pkg defaults
-barrier_2 116 53 14 92 9b6433c29cb6d6195b42663b7ad7baff 80
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 169.37
-screendump 20080101_000019_3584d81bd70ef291bcc4b53faca9cad7.ppm
-# confirm
-barrier_2 178 28 13 93 0dbcb8e0d07ba160a125790fc7da4255 31
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 526.20
-screendump 20080101_000020_3b1ca39267a9f5e9e526c1f3d3feb4a3.ppm
-# graphics
-barrier_2 190 62 8 92 b278cea3f4de024ab7600a20681e156e 1784
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 536.37
-screendump 20080101_000021_1b6ec0cb4697e4478d02f9f6e74b9cdc.ppm
-# monitor config
-barrier_2 230 39 11 87 00be56641a9fc0a7ea8a180e05c7c8fa 51
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 545.56
-screendump 20080101_000022_0c24acfb6accdd0210bf39d37555034a.ppm
-# graphics
-barrier_2 195 59 17 95 b3592e9cd31acdc50cf296e818fa4b1c 46
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 554.53
-screendump 20080101_000023_f1a8e5956d4f67ace2577fd44153b862.ppm
-# reboot
-barrier_2 128 49 3 55 abf9406a61aabd0c040fb95148663dc2 45
-# Sending keys: alt-e
-key alt-e
-# --------------------------------
-step 616.34
-screendump 20080101_000024_2c4461d2bc49cd1617dc5d477b192008.ppm
-# firstboot welcome
-barrier_2 85 23 10 12 bd91a3336a9843614bcca6603d7c309f 1200
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 621.88
-screendump 20080101_000025_68b1c0f87b75854b9d78c29d1572de68.ppm
-# license agreement
-barrier_2 433 45 186 5 7c4b13d1ac48f667672aa2dc4ae40667 28
-# Sending keys: alt-y alt-n
-key alt-y
-key alt-n
-# --------------------------------
-step 627.84
-screendump 20080101_000026_da52e6b80d320700f57364ed450546ab.ppm
-# date and time
-barrier_2 333 50 202 9 6b7b5e330f8c2529f4ff40610f678c92 30
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 643.62
-screendump 20080101_000027_22252e81cf48e82fdb8863a4f183355e.ppm
-# red hat login
-barrier_2 286 55 178 8 a1fab7d8381cd988b947d9fac98863aa 79
-# Sending keys: down down alt-n
-key down
-key down
-key alt-n
-# --------------------------------
-step 650.41
-screendump 20080101_000028_eb0998f582bdf17dd303f98271379df9.ppm
-# why register
-barrier_2 307 46 169 11 883ddffcf7edc223c64a8b6136cbb758 34
-# Sending keys: down alt-n
-key down
-key alt-n
-# --------------------------------
-step 655.83
-screendump 20080101_000029_e305b03985b556cacf19d90103d655d1.ppm
-# create user
-barrier_2 316 31 171 23 55e1e40e059f07bb2c39e526be68df7b 27
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 671.22
-screendump 20080101_000030_5b7617e1bdcdd0dfb4a42a99e6b1f508.ppm
-# addn'l discs
-barrier_2 362 68 183 0 31ec4fcf1347eaebd6783e1cba1140d3 77
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 676.34
-screendump 20080101_000031_369248a1afd8ec1dadd7e74d7c5e0680.ppm
-# finish
-barrier_2 338 61 182 8 a8d220e1ef78648892f217cd16fbfdce 26
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 688.52
-screendump 20080101_000032_32f952084500acbce063bbe44e3e52fa.ppm
-# username
-barrier_2 95 27 265 240 445c76a950093a3c1cc8e09f4f05a56f 600
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 695.01
-screendump 20080101_000033_c6b334834fac5fc14ea47afb02aea15b.ppm
-# password
-barrier_2 98 18 274 252 40c7a61ce804b6c2ba270cb2ad63c73f 32
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 710.30
-screendump 20080101_000034_586d038f01aec65a4aff1d7f5620541b.ppm
-# open command menu
-barrier_2 108 98 38 5 c1d2d092fe1536b7e47c261359f2eb81 300
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 772.52
-screendump 20080101_000036_5de75bea9e76f725e437bb9885331ce3.ppm
-# choose logout
-barrier_2 172 72 16 19 025399cc061f576a0f78c9f78173585b 146
-# Sending keys: up up up up up ret
-key up
-key up
-key up
-key up
-key up
-key ret
-# --------------------------------
-step 781.71
-screendump 20080101_000037_c43ca503bc41bc7fcdf040b21e2dd834.ppm
-# shutdown
-barrier_2 214 36 321 250 554113d752c6b7f80f114e8fe8ec0d60 46
-# Sending keys: alt-u alt-o
-key alt-u
-key alt-o
diff --git a/client/tests/kvm/steps/RHEL-4.7-i386.steps b/client/tests/kvm/steps/RHEL-4.7-i386.steps
deleted file mode 100644
index 763d473..0000000
--- a/client/tests/kvm/steps/RHEL-4.7-i386.steps
+++ /dev/null
@@ -1,297 +0,0 @@
-# Generated by stepmaker version 20090119
-# Generated on Tue Mar 10 09:50:26 2009
-# uname -a: Linux dhcp74-230.virt.bos.redhat.com 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step unknown
-screendump 20090413_013526_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
-barrier_2 44 38 0 363 d9ca61811a10b33cc95515d4796541e7 50
-# Sending keys: ret
-key ret
-# --------------------------------
-step 223.57
-screendump 20080101_000001_48539713881a206003b29551621b6e2d.ppm
-# skip cd check
-barrier_2 89 20 275 129 9a8aef88ecf7c20ac6db3f64cd5704f6 1118
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 281.97
-screendump 20080101_000002_e4df0f60c65720bebe027c6af3f27a6f.ppm
-# welcome
-barrier_2 190 46 437 180 4442cad0d595dbf69b34d3ed5d16825c 292
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 288.80
-screendump 20080101_000003_4ed6a2dcdc3e9049da1691aaea4132ce.ppm
-# language
-barrier_2 59 17 361 80 d4b94ea077e44e7286634228398816ba 34
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 291.65
-screendump 20080101_000004_6e824ecebe6713db5158edfd95398a17.ppm
-# keyboard
-barrier_2 68 20 455 75 28e2179405bcb8bbfbc94a3a1db7e7d2 14
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 326.31
-screendump 20080101_000005_90f95eb23a996537306f2720524725ee.ppm
-# auto partition
-barrier_2 138 29 346 209 57ddc4f49bbd6c0ae04e078269c9a794 173
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 328.79
-screendump 20080101_000006_2100a5ddcb8b8f28c292accaeb612122.ppm
-# unreadable partition table
-barrier_2 69 23 365 179 fab5c88fe4acb19c9fe52a56b0dc512e 12 optional
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 333.25
-screendump 20080101_000007_c5ba1e7a0c5c3a1d359fc117f0a9a9a3.ppm
-# Disk options
-barrier_2 169 26 345 133 62a0642680636db79ca37edd6afca2d9 22
-# Sending keys: alt-v alt-n
-key alt-v
-key alt-n
-# --------------------------------
-step 336.82
-screendump 20080101_000008_3e76d5a7b7c218bdfe7c5a21c7541137.ppm
-# remove partition warning
-barrier_2 61 18 371 202 41535438d233e762fc3c6233dccc2a72 18
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 342.00
-screendump 20080101_000009_82e04b08ed2a794b62d730f142b894aa.ppm
-# bootloader
-barrier_2 73 18 347 75 0a4b19050d4f4e7030adb195af38b7c1 26
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 345.75
-screendump 20080101_000010_78766915c064bc1073884a14f0056766.ppm
-# Network
-barrier_2 49 27 291 58 67b7023dd3a5dcf539b05229e6016f11 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 350.11
-screendump 20080101_000011_d1f5df73b9d8ee5b69e3bcf2bb6a114a.ppm
-# firewall
-barrier_2 53 30 284 61 9ca69764bf5963003f4fd22ea63c05bd 22
-# Sending keys: alt-o alt-s down alt-n
-key alt-o
-key alt-s
-key down
-key alt-n
-# --------------------------------
-step 352.84
-screendump 20080101_000012_386de236de66c66fd88dbce9afd8fa9f.ppm
-# firewall warning
-barrier_2 147 14 324 214 9403c909bb382fa118f80e20f4148135 14
-# Sending keys: alt-p
-key alt-p
-# --------------------------------
-step 358.36
-screendump 20080101_000013_7ab3cac82979a9f1006689e4c76b74e4.ppm
-# addn'l languages
-barrier_2 129 29 317 114 5c55504089e9dc33107726ff24f1aec5 28
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 362.75
-screendump 20080101_000014_1320c3c30d6ed8df17867100dea7395d.ppm
-# timezone
-barrier_2 56 24 559 85 2a162866917e318282d0574673ce3284 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 366.13
-screendump 20080101_000015_0073dc4c09314cee47f6c6805a3c7db3.ppm
-# root password
-barrier_2 80 16 352 74 a58add253094e2cfde131e3cf2f7389e 17
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 380.82
-screendump 20080101_000016_1cb08b93d5c6e0cdfbd5e8d67dc25eaa.ppm
-# package selection
-barrier_2 107 15 306 66 911e65ef02d9a896cb3bd9e2cbf5a924 73
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 386.32
-screendump 20080101_000017_7a163fb6725d8d1c5c564a4005ea761e.ppm
-# start installation
-barrier_2 62 25 571 198 42b8247c714d00d1a2db98c5cc3a75f9 27
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1100.36
-screendump 20080101_000018_89684ac9f5c439a168827e0194b5d544.ppm
-# installation complete
-barrier_2 183 33 353 244 f85db1b56855578bf3d3049e1ff44f5f 3570
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 1293.76
-screendump 20080101_000019_4c68ac7db1e8e0250557c1ea7b250dc4.ppm
-# firstboot welcome
-barrier_2 202 50 234 14 e5e563d2e1393d873e690b5b00bc267b 967
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1296.90
-screendump 20080101_000020_a2467d6713e5c40604a63852f424431b.ppm
-# license
-barrier_2 376 45 236 14 a8c2589252645a863bccdefa36fae24b 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1300.18
-screendump 20080101_000021_246885151d186821a43354ae6bc0874e.ppm
-# date and time
-barrier_2 276 41 236 15 6d113eb4ea4be245f4e4827a9b2fec87 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1304.04
-screendump 20080101_000022_bcde41cf9592a97721faa3bbad31f1d9.ppm
-# Display
-barrier_2 142 53 234 16 e2b295b34893ac8a99352612a638cfea 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1312.38
-screendump 20080101_000023_124f2f5c68e32f6d9d5778ffcea0001f.ppm
-# RHN
-barrier_2 274 48 237 13 f8ba6261a25238312ab51f0e7657e1c5 42
-# Sending keys: tab down alt-n
-key tab
-key down
-key alt-n
-# --------------------------------
-step 1316.32
-screendump 20080101_000024_eaa1bd1e290f960439cbc667eb78b63b.ppm
-# why register
-barrier_2 271 36 237 18 2d8c2a73bcd003489696ff9a52f1eecf 20
-# Sending keys: down alt-n
-key down
-key alt-n
-# --------------------------------
-step 1320.27
-screendump 20080101_000025_5ded7530921f8e85f219538b77e4277b.ppm
-# user creation
-barrier_2 245 35 234 19 991179e1675817c76a05fdb40e326d93 20
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 1330.22
-screendump 20080101_000026_680a742d03074d3a8092c9dee1267777.ppm
-# more cds
-barrier_2 307 57 231 13 b566616f7926485ebcdd94ffb2051686 50
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1332.60
-screendump 20080101_000027_507a80216eaac964f64c84c96bb61fec.ppm
-# finish setup
-barrier_2 242 59 237 16 f5db310d1fc47af74a05eec1a062f1a2 12
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1353.18
-screendump 20080101_000028_966f9ae13ae06feb1a7260157a81e3e2.ppm
-# username
-barrier_2 81 28 289 250 05842b38153ded4580036bc99cf4010f 103
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 1356.03
-screendump 20080101_000029_209d2705e2ba2f516377c2a9a4480840.ppm
-# password
-barrier_2 94 33 278 248 3883763287fa2f81964679ba21b91bde 14
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1372.69
-screendump 20080101_000030_1afc175fed24c810bee0795602680722.ppm
-# run application
-barrier_2 86 76 51 47 1516feb60ef00afeec799dfee0fd88c4 300
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 1376.41
-screendump 20080101_000031_5a74f73c8f4d35f6b22cfed83049643b.ppm
-# shutdown -h now
-barrier_2 124 28 346 218 646933e05afff8ab6b83379018e28927 19
-# Sending keys: s h u t d o w n spc minus h spc n o w alt-r
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key minus
-key h
-key spc
-key n
-key o
-key w
-key alt-r
diff --git a/client/tests/kvm/steps/RHEL-4.7-x86_64.steps b/client/tests/kvm/steps/RHEL-4.7-x86_64.steps
deleted file mode 100644
index 36f0109..0000000
--- a/client/tests/kvm/steps/RHEL-4.7-x86_64.steps
+++ /dev/null
@@ -1,323 +0,0 @@
-# Generated by stepmaker version 20090119
-# Generated on Tue Mar 10 08:37:30 2009
-# uname -a: Linux dhcp74-230.virt.bos.redhat.com 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 8.84
-screendump 20080101_000001_868fe81019ae64a0b066c4c0d4ebc4e1.ppm
-# boot options
-sleep 5
-barrier_2 44 36 0 365 ea4c08daabe1f982b243fce9c5b542a0 44 optional
-# Sending keys: ret
-key ret
-# --------------------------------
-step 22.27
-screendump 20080101_000002_48539713881a206003b29551621b6e2d.ppm
-# skip cd check
-barrier_2 71 20 286 126 6962c31467d63e7f3814fab4a9db6cd3 67
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 52.73
-screendump 20080101_000003_2e8378adb6ed0e206b291939fd6ec543.ppm
-# welcome
-barrier_2 167 59 445 174 384f9a1f24512d63315443c4534fdf10 152
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 57.79
-screendump 20080101_000004_608a95c3e53eddeb5b3b3f2719621960.ppm
-# language
-barrier_2 57 30 362 74 aa7dfc0e182f92fcfb03cae0abe9ed93 25
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 63.27
-screendump 20080101_000005_a000223581c1789da05537cdc9a96ddf.ppm
-# keyboard
-barrier_2 57 22 462 76 3a25a1b9ac6d193566b71dc5925d59df 27
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 70.56
-screendump 20080101_000006_e9265d07f0e297656b07ae9900cd24db.ppm
-# auto partition
-barrier_2 143 14 338 213 5e7d6808f2da364298e851db64ca58b1 36
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 77.80
-screendump 20080101_000007_9e68b4f88e06ebdd79ffde29a74bb15d.ppm
-# partition table warning
-barrier_2 71 26 374 176 b30a4dfb1cbc215e7f73a219c3adb3bd 36 optional
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 82.54
-screendump 20080101_000008_b78839a45fbae32ff3c04fa09f06418d.ppm
-# before auto partition
-barrier_2 172 27 344 137 3de1d1f6a33a54daa4dad21ff0a43c7c 24
-# Sending keys: alt-v alt-n
-key alt-v
-key alt-n
-# --------------------------------
-step 86.15
-screendump 20080101_000009_e167d071914bcd6004a02b9afcd4156e.ppm
-# remove partition warning
-barrier_2 83 24 357 198 0a8b8f166cdb1b7618e3f411f5d0dfa1 18
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 92.73
-screendump 20080101_000010_3e5195219f59aaa00e66a6786c3659f2.ppm
-# bootloader
-barrier_2 67 22 352 74 90c135ebda25dc506220c024266f803c 33
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 98.17
-screendump 20080101_000011_63eb6e3580aa2247fe435036ba322347.ppm
-# network
-barrier_2 129 31 274 59 9e8db5c9c5932969a8ba1753c7f8099c 27
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 109.63
-screendump 20080101_000012_2b446f042c37f44263d10a4c460bc8be.ppm
-# firewall
-barrier_2 47 19 291 67 1047903a9eea17cbdd5479b6b9ba01b5 57
-# Sending keys: alt-o alt-s down alt-n
-key alt-o
-key alt-s
-key down
-key alt-n
-# --------------------------------
-step 115.92
-screendump 20080101_000013_1b8d5fcd94bfe37acca94d14cdbf4026.ppm
-# firewall warning
-barrier_2 148 21 324 209 aeb653f991dd188f74135cb9b638185e 31
-# Sending keys: alt-p
-key alt-p
-# --------------------------------
-step 119.73
-screendump 20080101_000014_ae88680f1b8dfff7c07377481a2b7144.ppm
-# addn'l languages
-barrier_2 127 21 317 117 c226a00fb1a317c659ac85ded4fd203a 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 123.56
-screendump 20080101_000015_3ec95b25de96cd1176753cb40faeb2a3.ppm
-# timezone
-barrier_2 65 21 554 85 3ecd1239af261f744c8fb75702899d31 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 126.73
-screendump 20080101_000016_375368d7d16d64fd9ddce0633fcde3eb.ppm
-# root password
-barrier_2 62 12 373 93 1d3c183081199b5923215f8ee402cace 16
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 146.00
-screendump 20080101_000017_2d99efb31741e29e295b83908320f1ca.ppm
-# package installation
-barrier_2 110 14 304 68 4bde3fef69f896affd19c809845a07a2 96
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 155.53
-screendump 20080101_000018_bebe1f5687fc5e2b079d289aa2cd4e4c.ppm
-# click to begin installation
-barrier_2 174 24 578 199 562615f102cb20232f218ec6dd060e22 48
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1481.93
-screendump 20080101_000019_a65288e0fac29e87493fe14fa8d4c9f1.ppm
-# Installation complete, reboot
-barrier_2 201 30 340 244 6e3d2b57154ea102d9e26e5e9b1d2815 6632
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 1721.65
-screendump 20080101_000020_047d55731db8b7ffd531a0dc83327a74.ppm
-# firstboot welcome
-barrier_2 185 38 231 20 8fbdcc2d005a9ef533e57931962e8637 1199
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1725.42
-screendump 20080101_000021_ad29947d33083aa05cf6a9e69b00dfcf.ppm
-# license agreement
-barrier_2 378 49 228 14 6bf31d2487a102f8dd6e4f21c120fefb 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1729.47
-screendump 20080101_000022_bdff90927f6f37065c331a683acb937c.ppm
-# date and time
-barrier_2 286 42 229 20 ef8b459cad8981f340bae1a6c27c793a 20
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1734.35
-screendump 20080101_000023_77c775d0ab2035c06e89ab84ebf6502f.ppm
-# Display
-barrier_2 155 56 229 10 7a315c714e7004fc5cfa364bba9d3dc1 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1742.53
-screendump 20080101_000024_486a247d5d29464a8bb07c96e5d32bb2.ppm
-# RHN setup
-barrier_2 282 51 231 14 aa042e7596fe34e4576059e1f2849573 41
-# Sending keys: tab tab tab tab tab tab
-key tab
-key tab
-key tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 1757.28
-screendump 20080101_000025_911ed158fe9f7f7072630d0f6e4af1b0.ppm
-# RHN Setup 2
-barrier_2 98 43 574 550 9a09bf59234f8b85cffd7a50c1a36c26 74
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 1764.25
-screendump 20080101_000026_b39724b0e61aa0c5084f8b5fefb3b08f.ppm
-# RHN 3
-barrier_2 215 25 206 116 0f14588de1cf5e9d44562c066849f19e 35
-# Sending keys: down alt-n
-key down
-key alt-n
-# --------------------------------
-step 1768.81
-screendump 20080101_000027_8df8ae889d0952c632d45034693bf106.ppm
-# why register
-barrier_2 285 38 233 23 8e4b2c0a09efa22aa7eab243c14e4493 23
-# Sending keys: down alt-n
-key down
-key alt-n
-# --------------------------------
-step 1774.82
-screendump 20080101_000028_5a396a23a7f50eaded4fc1257978c031.ppm
-# user creation
-barrier_2 246 64 233 7 41cb6e6ef937a010fe36042c0ea3712f 30
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 1800.26
-screendump 20080101_000029_bf265a374bb1528a2be352cfaa9a42ad.ppm
-# more cds
-barrier_2 301 48 239 11 49756e70fe27c0f3b5b6f7cc7466b05e 127
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1804.20
-screendump 20080101_000030_bf343877c0a5ea88507a1cb37de2f03d.ppm
-# finish setup
-barrier_2 249 47 223 17 6d46bfb0e40060c5e03c9fbb4f017aab 20
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1828.13
-screendump 20080101_000031_c5e4bd141fc0aad3bfbbd649412801dd.ppm
-# username
-barrier_2 86 20 286 253 b985cf58247b6ca3c6a2d3af888313e8 120
-# Sending keys: r o o t
-key r
-key o
-key o
-key t
-# --------------------------------
-step 1833.02
-screendump 20080101_000032_ff0349ea60010d38df8f0bdad89af838.ppm
-barrier_2 81 25 288 253 5097ebf52d3f17bbbc6a42d6956cc088 24
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1835.43
-screendump 20080101_000033_56fa5acdd8511d89f63e7e48eecf7940.ppm
-# password
-barrier_2 84 24 287 251 00f73d41b8ecca413e135cf730d94abc 12
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1884.87
-screendump 20080101_000034_acad0f183b2bb588ab448b7a91240d91.ppm
-# run application
-barrier_2 110 24 2 4 e1b661e27f7babfe0e60f2613bec6741 247
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 1887.17
-screendump 20080101_000035_67f5b7874eb5112bd0e193f8677b8283.ppm
-# shutdown -h now
-barrier_2 115 18 352 226 3a0ccca23af2f12a15306d7089305777 11
-# Sending keys: s h u t d o w n spc minus h spc n o w alt-r
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key minus
-key h
-key spc
-key n
-key o
-key w
-key alt-r
diff --git a/client/tests/kvm/steps/RHEL-5.3-i386.steps b/client/tests/kvm/steps/RHEL-5.3-i386.steps
deleted file mode 100644
index 0964f47..0000000
--- a/client/tests/kvm/steps/RHEL-5.3-i386.steps
+++ /dev/null
@@ -1,306 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 852740111933)
-# Generated on Mon Mar 9 11:55:21 2009
-# uname -a: Linux dhcp74-230.virt.bos.redhat.com 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ./qemu -cdrom ./isos/linux/RHEL-5.3-i386-DVD.iso /tmp/rhel53-32.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_852740111933,server,nowait &
-# --------------------------------
-step 10.33
-screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
-# boot options
-sleep 10
-barrier_2 44 40 0 410 2f6c4cea4cf5b03bec757893e4982897 52
-# Sending keys: ret
-key ret
-# --------------------------------
-step 23.98
-screendump 20080101_000002_915802758f9bce2fed0852f6da32bcdf.ppm
-# skip cd check
-barrier_2 122 26 303 75 b2650f904674e10364596ea791d6471a 68
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 51.57
-screendump 20080101_000003_e2a614cc80d103c7884d172b79a26282.ppm
-# welcome
-barrier_2 452 111 118 349 bd10ba9ba2dfe65ca9605edc602bc649 138
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 57.39
-screendump 20080101_000004_c1d80710c8f467b6a83aa6b7b724a18f.ppm
-# language
-barrier_2 66 33 101 120 0c92d319ccaa09982054f1cfa83e6784 29
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 61.57
-screendump 20080101_000005_49b251f036904921d5a6625235146280.ppm
-# keyboard
-barrier_2 72 26 207 121 76e98d83a983d31b239a080343662ee3 21
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 68.26
-screendump 20080101_000006_20cfbb9849a651b86ceb6f53f2dbf4d1.ppm
-# install number
-barrier_2 174 26 367 231 1d60b89783fb3e1037f00c75f841fe19 33
-# Sending keys: cdkey alt-o
-var cdkey
-key alt-o
-# --------------------------------
-step 82.24
-screendump 20080101_000007_fe35ff18ee4c7b5e4d999addf67d1dad.ppm
-# partition table warning
-barrier_2 90 21 352 170 a0a976125a727833294361f582f68669 70
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 89.32
-screendump 20080101_000008_17225191561b079c704bc667a56c0418.ppm
-# partitioning setup
-barrier_2 80 23 165 127 2b676ac2bea2f3c0a9a7b16321048cf2 35
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 93.73
-screendump 20080101_000009_7e87a7d333d654b7122d08aa09964c2d.ppm
-# remove all partitions
-barrier_2 85 32 361 193 2e8680fa98c4fb65366cea34918f5be5 22
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 99.70
-screendump 20080101_000010_7ab2898bd92e3efc408b51f7dd9fd55f.ppm
-# network
-barrier_2 145 21 9 115 7e19760e8c8e7163615176adaefa3558 30
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 108.23
-screendump 20080101_000011_405c41c884be577079c95780ddbae689.ppm
-# region
-barrier_2 67 16 245 120 e15a0ad54706c6843db509ea7879d98e 43
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 113.98
-screendump 20080101_000012_382ccb46e4aa5755c9c2a140b0c49f26.ppm
-# root password
-barrier_2 95 21 89 126 f842182d87690b973db5e5f8a6278d58 29
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 127.33
-screendump 20080101_000013_c36b6e4635c34d799f9b1a0446115873.ppm
-# package selection
-barrier_2 129 20 51 127 7c3f626d50abc77bad2a34a9fd77453d 67
-# Sending keys: tab spc down spc
-key tab
-key spc
-key down
-key spc
-# --------------------------------
-step 131.06
-screendump 20080101_000014_a084afc5ee996c3c744b85a1d153b3e6.ppm
-# confirm package installation
-barrier_2 67 14 56 226 a49ec13fedc8a6b3c71c61700e95505d 19
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 154.49
-screendump 20080101_000015_57d56276f62ab6d31cdcf7a8caf4f8f4.ppm
-# final confirmation
-barrier_2 133 28 495 192 c646efaee34f096d913286f8c4702de3 117
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1320.57
-screendump 20080101_000016_30e6714096dbabcc3ec43bc35e795a0f.ppm
-# install complete, reboot
-barrier_2 125 31 278 253 6a604e73e6e2da5bf06e5daecae610a6 5830
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 1458.91
-screendump 20080101_000017_df631e0baf36bcc0f91086ede038a036.ppm
-# firstboot welcome
-barrier_2 102 21 0 9 92a1476c7020f2af4571f7c98f6c0f62 692
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1467.85
-screendump 20080101_000018_3a65ea761ffc3c31c32ca3ef46c86840.ppm
-# license agreement
-barrier_2 396 39 220 19 b526150fd0ee19e5dbb3ae6344a88017 45
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1473.76
-screendump 20080101_000019_e921aa3d7e868c7d21470cc44cbe2547.ppm
-# firewall
-barrier_2 166 49 220 14 d4fddcfc7431a6097950e9ab0b65876a 30
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1479.60
-screendump 20080101_000020_61aeff12c3046de6196a57f82f240d12.ppm
-# selinux
-barrier_2 185 49 230 13 61c70c04437133c48f5c9e5d8367265f 29
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1490.35
-screendump 20080101_000021_9aba089376e6b6141a562eb8b0e35e8e.ppm
-# kdump
-barrier_2 150 43 228 21 7af9460211dc37093d62103719f03a0d 54
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1500.66
-screendump 20080101_000022_f24bea0aeb0ba803ef26d251f6510be2.ppm
-# date and time
-barrier_2 308 64 220 11 0a0a4d40f348939f0d53f3a70075c469 52
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1509.89
-screendump 20080101_000023_b3cb52d5b938041507dca6c54a86934b.ppm
-# rhn
-barrier_2 474 50 230 22 6aeb540ac2bd1e41d9bebb20b0632a7c 46
-# Sending keys: alt-n alt-f
-key alt-n
-key alt-f
-# --------------------------------
-step 1518.52
-screendump 20080101_000024_3e641443dd4ea558467e517a4be68517.ppm
-# confirm no rhn
-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
-barrier_2 434 56 215 12 abf3716758c76cad32015985c947aa34 40
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1533.83
-screendump 20080101_000026_a4cf94dd0c5bfa489bd58698199d9819.ppm
-# create user
-barrier_2 249 52 223 12 32b7298ffb94947a5fb853ed0e40a2a0 36
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-f
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-f
-# --------------------------------
-step 1546.50
-screendump 20080101_000027_65d7d9efb42c370f191fd22dba1e77b6.ppm
-# sound
-barrier_2 235 41 229 18 baeba056c15f5a4eb842a3cf600e76ef 63
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1564.83
-screendump 20080101_000028_8f7cf7245ec916b21096a2d8e1ae0c1b.ppm
-# addn'l cds
-barrier_2 319 55 211 11 68d3016f64c064b1ea8d4af1790fe841 92
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1579.99
-screendump 20080101_000029_6ee83897623b1f97087da2a66c65d24f.ppm
-# username
-barrier_2 117 24 53 354 6b7605302797afbfbaf3b482566791d4 76
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 1584.71
-screendump 20080101_000030_e02c5b07e428b344dd3c2529fc025b20.ppm
-# password
-barrier_2 103 22 58 361 e93e06058647b1fdb2b9e3bdae6319c3 24
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1636.26
-screendump 20080101_000034_f74bd9d5d107afe04d35b03039c8c3fe.ppm
-# run application
-barrier_2 109 40 8 0 cd314f3c1493f2576aec6579b5c039a6 30
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 1650.46
-screendump 20080101_000035_56365d305d3d62fe0917ad96016171cb.ppm
-# shutdown -h now
-barrier_2 126 22 340 223 69399a6d3fc9f86b9f9b86935ab5b758 71
-# Sending keys: s h u t d o w n spc minus h spc n o w alt-r
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key minus
-key h
-key spc
-key n
-key o
-key w
-key alt-r
diff --git a/client/tests/kvm/steps/RHEL-5.3-x86_64.steps b/client/tests/kvm/steps/RHEL-5.3-x86_64.steps
deleted file mode 100644
index fc0db20..0000000
--- a/client/tests/kvm/steps/RHEL-5.3-x86_64.steps
+++ /dev/null
@@ -1,298 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 338586960500)
-# Generated on Mon Mar 2 17:20:31 2009
-# uname -a: Linux virtlab8.virt.bos.redhat.com 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-kvm -cdrom /mnt/isos/linux/RHEL-5-64-DVD.iso /tmp/rhel53-64.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_338586960500,server,nowait &
-# --------------------------------
-step 9.22
-screendump 20080101_000001_8333460cfad39ef04d6dbbf7d35fdcba.ppm
-# boot options
-sleep 10
-barrier_2 43 39 0 411 3c4a56d04a8ea1c0c5c1edfe10d472a0 46
-# Sending keys: ret
-key ret
-# --------------------------------
-step 20.00
-screendump 20080101_000002_915802758f9bce2fed0852f6da32bcdf.ppm
-# skip disc check
-barrier_2 112 32 304 73 058493d3d51443ca98c90cba1beca3d8 54
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 49.72
-screendump 20080101_000003_d6ceb4b8315d96fc9f126ba611bab7e2.ppm
-# welcome screen
-barrier_2 602 145 91 320 92adb57fd355aa6b1f2fd19a1a72ec82 149
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 62.64
-screendump 20080101_000004_c1d80710c8f467b6a83aa6b7b724a18f.ppm
-# language
-barrier_2 66 30 103 124 2e1e4b440c8e454f13e02ec92bb09000 65
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 67.56
-screendump 20080101_000005_49b251f036904921d5a6625235146280.ppm
-# keyboard
-barrier_2 99 36 204 124 3025d5d5c1cfc1aa51d81ba2296e4d12 25
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 72.73
-screendump 20080101_000006_adf4ea86f899fd18a002988a276cd2b3.ppm
-# installation number
-barrier_2 165 27 367 229 6cbfcd32d26cac038a06d1ba1438d912 26
-# Sending keys: alt-o
-var cdkey
-key alt-o
-# --------------------------------
-step 80.63
-screendump 20080101_000007_fe35ff18ee4c7b5e4d999addf67d1dad.ppm
-# partition table warning
-barrier_2 419 84 217 339 c3d6140bedee0c53242d5714c6874056 39
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 88.08
-screendump 20080101_000008_17225191561b079c704bc667a56c0418.ppm
-# partitioning options
-barrier_2 127 22 142 132 45e22b3785abdc97dff26060efbb5641 37
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 92.22
-screendump 20080101_000009_7e87a7d333d654b7122d08aa09964c2d.ppm
-# remove linux partitions warning
-barrier_2 127 19 364 229 15c98e6e302b2b9da274e1b30160d6ba 21
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 97.96
-screendump 20080101_000010_7ab2898bd92e3efc408b51f7dd9fd55f.ppm
-# network
-barrier_2 86 24 5 117 e44a765869a970387b5a0b678878f800 29
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 104.28
-screendump 20080101_000011_405c41c884be577079c95780ddbae689.ppm
-# Region
-barrier_2 83 25 236 116 bb043bf55bc3dc5f25b75963df25c87c 32
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 106.71
-screendump 20080101_000012_382ccb46e4aa5755c9c2a140b0c49f26.ppm
-# root password
-barrier_2 96 25 86 120 5c7747ff5700e6ccc7b04774a47ed376 12
-# Sending keys: 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 119.08
-screendump 20080101_000013_c36b6e4635c34d799f9b1a0446115873.ppm
-# package set
-barrier_2 127 30 50 117 af08910e7ce7506376cb09a0f3b19a51 62
-# Sending keys: tab spc down spc alt-n
-key tab
-key spc
-key down
-key spc
-key alt-n
-# --------------------------------
-step 137.95
-screendump 20080101_000014_57d56276f62ab6d31cdcf7a8caf4f8f4.ppm
-# confirmation
-barrier_2 212 76 466 190 313cb5dde7710323c5266c01773bd15f 94
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 680.24
-screendump 20080101_000015_0f5fb1d1682698a7fab8a864cea31df8.ppm
-# reboot
-barrier_2 331 48 262 236 4b4f36aab1c101c4d85b2cc012f79e52 2711
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 880.15
-screendump 20080101_000016_78bd069bbe03fb9c769ab271d6bd5f4b.ppm
-# firstboot welcome
-barrier_2 241 60 176 7 950fcbee79681f01ec1946704f24a356 1000
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 893.91
-screendump 20080101_000017_3a65ea761ffc3c31c32ca3ef46c86840.ppm
-# license
-barrier_2 397 48 227 16 620721454ea41bc9e572d493546de40d 69
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 920.81
-screendump 20080101_000018_e921aa3d7e868c7d21470cc44cbe2547.ppm
-# Firewall
-barrier_2 171 42 231 19 04a12e2d46b87228232a2d25948d41fb 134
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 939.99
-screendump 20080101_000019_61aeff12c3046de6196a57f82f240d12.ppm
-# selinux
-barrier_2 173 49 229 21 c1ef533c51ea59bf3beb09d021eb793e 96
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 954.56
-screendump 20080101_000020_86cb7231df787f01372eb6deb5d1fa01.ppm
-# kdump
-barrier_2 150 50 225 16 0c322a1d2c450864c475f7c915f96489 73
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 964.40
-screendump 20080101_000021_3bd5f99c11addabf0f1498faeacbf49f.ppm
-# date and time
-barrier_2 292 63 229 15 341583294593f9011ee54349f1366148 49
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 974.10
-screendump 20080101_000022_b3cb52d5b938041507dca6c54a86934b.ppm
-# skip RHN setup
-barrier_2 482 44 228 12 84698f66e39ff664d44390e651bbc23d 49
-# Sending keys: alt-n alt-f
-key alt-n
-key alt-f
-# --------------------------------
-step 978.99
-screendump 20080101_000023_3e641443dd4ea558467e517a4be68517.ppm
-# confirm skip rhn setup
-barrier_2 511 29 147 502 122d1722ab2a111244557e767189fd2c 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 989.49
-screendump 20080101_000024_e10ec4a12e28baa41af798cbdbf308a1.ppm
-# done update
-barrier_2 412 67 229 14 bac669953e19400adde2df2e62a4c770 53
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1000.24
-screendump 20080101_000025_a4cf94dd0c5bfa489bd58698199d9819.ppm
-# Create User
-barrier_2 251 44 230 16 47f7c7477df75b7f20e86b097d2e3003 54
-# Sending keys: u s e r 1 tab u s e r 1 tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-f
-key u
-key s
-key e
-key r
-key 1
-key tab
-key u
-key s
-key e
-key r
-key 1
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-f
-# --------------------------------
-step 1013.59
-screendump 20080101_000026_65d7d9efb42c370f191fd22dba1e77b6.ppm
-# sound
-barrier_2 242 51 229 17 9bfa44e541b686185c15bc303990c657 67
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1021.80
-screendump 20080101_000027_8f7cf7245ec916b21096a2d8e1ae0c1b.ppm
-# addnl cds
-barrier_2 322 58 233 13 3020acaae8f3dbcedb2c42fdc7aaa823 41
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 1050.70
-screendump 20080101_000028_6ee83897623b1f97087da2a66c65d24f.ppm
-# username
-barrier_2 107 23 62 356 4f22d37887ce59546f605c8d73a5967c 144
-# Sending keys: r o o t
-key r
-key o
-key o
-key t
-# --------------------------------
-step 1062.41
-screendump 20080101_000029_a7cd61e44e6f146338176ac718b9c567.ppm
-# hit enter on username
-barrier_2 106 31 65 347 07ae9a72384b04af98d604ec22bd3665 59
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1066.61
-screendump 20080101_000030_e02c5b07e428b344dd3c2529fc025b20.ppm
-# password
-barrier_2 130 22 48 359 e0190a1ed27e006bbd227f91a6bec84a 21
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1083.48
-screendump 20080101_000031_37c4e936e6d3a790f83987951b832bb6.ppm
-# desktop
-barrier_2 177 284 36 46 57b2e337aa0266a5edb9d5be87dd06c7 84
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 1090.66
-screendump 20080101_000032_56365d305d3d62fe0917ad96016171cb.ppm
-# shutdown
-barrier_2 126 28 341 216 fc79b73cc0404910dcd643741d167cef 36
-# Sending keys: s h u t d o w n spc minus h spc n o w alt-r
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key minus
-key h
-key spc
-key n
-key o
-key w
-key alt-r
diff --git a/client/tests/kvm/steps/Slax-6.0.7.steps b/client/tests/kvm/steps/Slax-6.0.7.steps
deleted file mode 100644
index 1127caf..0000000
--- a/client/tests/kvm/steps/Slax-6.0.7.steps
+++ /dev/null
@@ -1,311 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 742147349315)
-# Generated on Fri Nov 14 21:53:26 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 blank.qcow2 -cdrom /home/cyber/Installs/slax-6.0.7.iso -m 512 -nographic -monitor unix:/tmp/monitor_742147349315,server,nowait &
-# --------------------------------
-step 4.60
-screendump 20080101_000001_17b1eddeecf74e9c422738fdccf48754.ppm
-# slax graphics mode
-barrier_2 289 36 328 79 033976e22c7a6f066699ad16759cc329 23
-# Sending keys: ret
-key ret
-# --------------------------------
-step 49.07
-screendump 20080101_000002_13b85dad15cdc3e6e9ae53a764749f1d.ppm
-barrier_2 282 71 0 529 ac5213d1178a041a4c4f47a4f273c2d9 222
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 51.92
-screendump 20080101_000003_99f10a369f7328e4d4bcad3bad029a00.ppm
-# start konq
-barrier_2 128 168 35 287 2a5de96558f222fd6ff6ff07d8c8cd78 14
-# Sending keys: down down down
-key down
-key down
-key down
-# --------------------------------
-step 53.98
-screendump 20080101_000004_93dd55aeefb5f0c662fbb353f7c110ef.ppm
-barrier_2 86 35 36 310 2c6a3c927db2e0600a8b645404a952e0 10
-# Sending keys: right
-key right
-# --------------------------------
-step 54.74
-screendump 20080101_000005_cc9af730afe5438c539ce2cdc65fa550.ppm
-barrier_2 212 56 227 327 be05a5e316c41a95a752b9964ec2aa12 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 60.35
-screendump 20080101_000006_4d778c528ca584413ebec5daa205afce.ppm
-# start k3b
-barrier_2 362 210 171 5 9a3bf73a85bbc3230cc5a2eb3153da02 28
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 63.06
-screendump 20080101_000007_e8a32f51eab2a7aa4afbb45f595856ad.ppm
-barrier_2 109 167 34 286 791bd475c03dd186935cb1a77e89b691 14
-# Sending keys: down down down down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 65.19
-screendump 20080101_000008_0d7d68c1ac4ddfb51697fb5608b0c835.ppm
-barrier_2 84 39 34 326 2df8adf918ecd854f809f9e1cdb3cdba 11
-# Sending keys: right
-key right
-# --------------------------------
-step 66.28
-screendump 20080101_000009_97da030cf6cace193d2a21a496be0d35.ppm
-barrier_2 168 61 226 346 82b737d3ee7168ee0b0360372e53cba6 5
-# Sending keys: down down down ret
-key down
-key down
-key down
-key ret
-# --------------------------------
-step 75.45
-screendump 20080101_000010_62140a4ab32bea57df1ecf6b5d3f5f16.ppm
-# start some office app
-barrier_2 274 166 252 260 12ff6004f23f3eae78ea9ef321c6e4cc 46
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 78.26
-screendump 20080101_000011_91b4ac45d5957a1b777a98d0f9d62cf3.ppm
-barrier_2 115 167 37 286 6d2479c18f9eef8f05fb9ef70b2eca26 14
-# Sending keys: down down down down down
-key down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 80.67
-screendump 20080101_000012_93b8277728dfb87287b5fc218b01dcd8.ppm
-barrier_2 71 38 35 345 8e6775b89bfb4f98c0d832fa49993e71 12
-# Sending keys: right
-key right
-# --------------------------------
-step 83.57
-screendump 20080101_000013_bd4e49e00069513c382eccc624d0d4c0.ppm
-barrier_2 240 79 225 360 1d4c7ca6d00c55fd3c1124512a09bbee 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 89.02
-screendump 20080101_000014_ee6756175fe39f65d0de508cb2f42392.ppm
-# type something
-barrier_2 466 106 199 156 3b523ba736ef8e15b50161c185eca53a 27
-# Sending keys: shift-h e l l o spc shift-w o r l d shift-1 shift-1 shift-1 shift-1 shift-1 shift-1 shift-1 shift-1 ret ret o o o o o o o o o o o o o o o
-key shift-h
-key e
-key l
-key l
-key o
-key spc
-key shift-w
-key o
-key r
-key l
-key d
-key shift-1
-key shift-1
-key shift-1
-key shift-1
-key shift-1
-key shift-1
-key shift-1
-key shift-1
-key ret
-key ret
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-key o
-# --------------------------------
-step 100.28
-screendump 20080101_000015_30136ceecb359d241bfee3e5aeb31c69.ppm
-# start a file manager
-barrier_2 82 18 286 379 cca0968464124566846e822d5eefd1d1 56
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 103.10
-screendump 20080101_000016_854fa04da915e2e921add4057223da7b.ppm
-barrier_2 132 170 33 286 38d05a76d0446a019c5f199f936abb5c 14
-# Sending keys: up up up up up
-key up
-key up
-key up
-key up
-key up
-# --------------------------------
-step 105.01
-screendump 20080101_000017_6d2f50efdefdbcddbe8f47d187744940.ppm
-barrier_2 128 39 37 435 121e84a88575f9f4a71c9ea696a20b0b 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 110.84
-screendump 20080101_000018_64892878c7a8216625e5954980ca1cbe.ppm
-# start something else
-barrier_2 88 79 140 118 07da33f650dfd5289da3e41142c72a0e 29
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 117.71
-screendump 20080101_000019_01f31d360bef4dd7f5341e30657c8e60.ppm
-barrier_2 123 169 35 287 df8dc45194f5883baec3e3476d42a7d2 34
-# Sending keys: down down down down down down
-key down
-key down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 120.32
-screendump 20080101_000020_9bf8fa915b3ca4cbdad7cb3576603666.ppm
-barrier_2 84 36 34 364 dbf3a3179c31ee6ab9034bd8cbe487df 13
-# Sending keys: right
-key right
-# --------------------------------
-step 122.42
-screendump 20080101_000021_c1199be3534894fb3ca4e4997153712b.ppm
-# info center?
-barrier_2 199 79 227 379 99b7daa0a53ac7bde71bcd922ccaaeb3 11
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 128.86
-screendump 20080101_000022_d6a66c7622788456a9c391d3c74d6bbc.ppm
-# start module manager
-barrier_2 340 130 325 91 819b5de6c16e9c7474e0c3d78f8ed405 32
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 131.63
-screendump 20080101_000023_2746a3f29f1bd3c8c0c45fbe50cc2799.ppm
-barrier_2 125 167 34 288 b38ed506a590f639707454bb941b4f4b 14
-# Sending keys: down down down down down down
-key down
-key down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 133.97
-screendump 20080101_000024_46453efdf529ae1f08f655db38321013.ppm
-barrier_2 74 37 36 362 d434e62be18291aa1d6c955d57301616 12
-# Sending keys: right
-key right
-# --------------------------------
-step 135.51
-screendump 20080101_000025_48c86485ba86364833a2f3b0150802e3.ppm
-barrier_2 163 76 229 380 fd929132184e583961186e6c6d6bf327 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 153.47
-screendump 20080101_000026_0ab4a164152adc8afdd4dd3bb0405cb8.ppm
-# a package management beyond your dreams?!
-barrier_2 112 133 51 178 2686e45f4807b2b45e2235afc0d72cbf 90
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 157.55
-screendump 20080101_000027_983540da45f7f3e7ea8f974cda49332e.ppm
-# start control center
-barrier_2 130 169 35 288 0da4b4b2ac5d012bda140e123a975bbc 20
-# Sending keys: up up up up up up up
-key up
-key up
-key up
-key up
-key up
-key up
-key up
-# --------------------------------
-step 160.37
-screendump 20080101_000028_79932c8bc8d7493a898b4d2d48cf0751.ppm
-barrier_2 125 38 35 398 8721b267ef1bff24d6cccaf983f4b7e3 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 167.68
-screendump 20080101_000029_b556a6bbab28e21d1a70a9e69163104d.ppm
-barrier_2 166 122 18 102 8c6cc284c09821cbc2c016581fce8660 37
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 170.32
-screendump 20080101_000030_100c63da30091d488df6c33d28a5cfa2.ppm
-barrier_2 178 54 18 101 1487f9e5bdbf03dd0488108e9be24302 13
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 173.66
-screendump 20080101_000031_ad913afdb010b7dc43b139d0255a1ac1.ppm
-barrier_2 152 91 17 105 a891a60bde55bc8b65e29c3fbc26dd9b 17
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 176.85
-screendump 20080101_000032_41307c9c5494e99b831310ca331c16d9.ppm
-# let's get out
-barrier_2 255 223 372 197 2ad75148034e8a319b04059bc957d4e6 16
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 187.63
-screendump 20080101_000033_f380102053d67cea049cdfdd6f37b65c.ppm
-barrier_2 117 261 34 287 3dee01c627bcbac57fd744b5bfc124ee 54
-# Sending keys: up
-key up
-# --------------------------------
-step 189.83
-screendump 20080101_000034_a844b243340da1fc5d64f8ac38040145.ppm
-barrier_2 91 25 37 523 73eac7a71d639f61ed952e0a98a06e8c 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 191.54
-screendump 20080101_000035_0d55eea69ad6edc5472da642a37e3cc0.ppm
-# bye bye!
-barrier_2 151 159 392 235 6e73c63c47cc73df302b62c96e33388f 9
-# Sending keys: alt-t
-key alt-t
-# --------------------------------
-step 197.88
-screendump 20080101_000036_76ec1e3bed791d0aa9bc62b0a3efedb7.ppm
-# damn it, let's save the file
-barrier_2 348 42 325 367 38235355abde996a93804a098165f556 32
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
-step 204.60
-screendump 20080101_000037_ce02596394582f522feaf67365b1924c.ppm
-barrier_2 131 66 658 381 72781780cc6f337039a020eb27aaa25d 34
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Ubuntu-6.10-32.steps b/client/tests/kvm/steps/Ubuntu-6.10-32.steps
deleted file mode 100644
index a25789c..0000000
--- a/client/tests/kvm/steps/Ubuntu-6.10-32.steps
+++ /dev/null
@@ -1,127 +0,0 @@
-# Generated by stepmaker version 20081106 (instance: 892168256632)
-# Generated on Fri Nov 7 20:52:52 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ubuntu.qcow2 -snapshot -cdrom /home/cyber/Installs/ubuntu-6.10-i386.iso -m 512 -nographic -monitor unix:/tmp/monitor_892168256632,server,nowait &
-# -------- Step 1 recorded at time 28.43 --------
-# start or install ubuntu
-barrier_2 236 38 0 442 5f278352777e9865a8832abdabc5f2b8 142
-key ret
-# -------- Step 2 recorded at time 94.15 --------
-# livecd desktop
-barrier_2 73 17 240 3 13b2f202e7ffc02e733d40ee2bc88dcf 329
-# Sending keys: ctrl-alt-d down down
-key ctrl-alt-d
-key down
-key down
-# -------- Step 3 recorded at time 97.61 --------
-barrier_2 78 19 50 208 bf0f52d09e4dbe1a5160d04977af3114 17
-key ret
-# -------- Step 4 recorded at time 109.94 --------
-# language
-barrier_2 714 45 161 642 9c6ea4c4637de166ae48285c86317a1d 62
-# Sending keys: alt-f
-key alt-f
-# -------- Step 5 recorded at time 113.39 --------
-# location
-barrier_2 711 41 164 644 eedbf626fb125ac5ae58631471f5a842 17
-# Sending keys: alt-f
-key alt-f
-# -------- Step 6 recorded at time 117.90 --------
-# keyboard layout
-barrier_2 709 45 166 642 6bd618070c8f3031ca9e74ffb80afd3f 23
-# Sending keys: alt-f
-key alt-f
-# -------- Step 7 recorded at time 121.10 --------
-# who are you?
-barrier_2 80 72 216 133 42a2799b34c8221c1a22198cc544d919 16
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 tab m o o f
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key m
-key o
-key o
-key f
-# -------- Step 8 recorded at time 133.21 --------
-barrier_2 37 37 167 430 dfe3c4fef25d9e7751e8478f193f0d2d 61
-key alt-f
-# -------- Step 9 recorded at time 139.00 --------
-# partitioning
-barrier_2 714 44 161 642 12fdb77ba5a7c061445aeb347e6be169 29
-# Sending keys: alt-f
-key alt-f
-# -------- Step 10 recorded at time 145.88 --------
-# install
-barrier_2 716 44 160 642 7694482c104bbf280e1c3332649a9af6 34
-# Sending keys: ret
-key ret
-# -------- Step 12 recorded at time 805.92 --------
-# installation complete -- reboot
-barrier_2 196 44 527 465 18fad38bb439f21fb7223c98a897ca87 3274
-key ret
-# -------- Step 13 recorded at time 838.27 --------
-# remove the disk and press enter
-barrier_2 249 44 312 639 92b11bde3fd9dc40112319778e2d5008 162
-key ret
-# -------- Step 14 recorded at time 889.14 --------
-# login
-barrier_2 42 35 472 430 94aaa850fbdfde43fe9efc3b8069d944 254
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 15 recorded at time 892.41 --------
-barrier_2 51 39 465 429 5a4b56e1133e92ca8d74f944a9d095f9 16
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 16 recorded at time 947.21 --------
-# desktop reached
-barrier_2 67 16 239 4 cf0d3bffd9fe05a8ac830db2ee335b13 274
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 20 recorded at time 90.46 --------
-barrier_2 139 14 11 218 072d17d583af86ec36c3c40535703f84 18
-# Sending keys: right right
-key right
-key right
-# -------- Step 21 recorded at time 93.23 --------
-barrier_2 136 19 184 198 598695da3efc5d54dd1456f8cdce82a0 14
-# Sending keys: up
-key up
-# -------- Step 22 recorded at time 94.68 --------
-barrier_2 140 14 184 202 0664e5985d0cea7eb9bd6ba557d9ca9a 7
-# Sending keys: ret
-key ret
-# -------- Step 23 recorded at time 98.67 --------
-sleep 15
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Ubuntu-8.04-32-setupssh.steps b/client/tests/kvm/steps/Ubuntu-8.04-32-setupssh.steps
deleted file mode 100644
index 7422302..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.04-32-setupssh.steps
+++ /dev/null
@@ -1,184 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Sun Jan 18 08:22:02 2009
-# uname -a: Linux moof 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
-# --------------------------------
-step 40.98
-screendump 20080101_000001_f734b3a05458b6a512088b03ad50596d.ppm
-# login
-barrier_2 57 56 588 435 7a843709976d16d085abfdf8cb1009d9 205
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 43.84
-screendump 20080101_000002_9689d41f9c7dc25304b65f43c3d5fdee.ppm
-barrier_2 61 57 588 434 b7d0dddaf89acd97a06258744058a245 14
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 73.73
-screendump 20080101_000003_69a156f14293eede76159904986cc728.ppm
-# open menu
-barrier_2 68 13 245 5 322892e175e241146f0d1bba419920ff 149
-# Sending keys: alt-f1
-key alt-f1
-# --------------------------------
-step 78.00
-screendump 20080101_000004_65ed2c9cbbcc09805e0c8720f17497de.ppm
-barrier_2 117 204 11 37 775ded16a524d180f7a3b4c0c4dac69a 21
-# Sending keys: down
-key down
-# --------------------------------
-step 81.68
-screendump 20080101_000005_5c030f7483764561d3978064342fad51.ppm
-barrier_2 136 131 178 218 c0937fb06177f9c8c87e51c925a2d518 18
-# Sending keys: right
-key right
-# --------------------------------
-step 85.96
-screendump 20080101_000006_f728b2375452f539fbc4cf0e5ee49f22.ppm
-# Sending keys: up up up up
-key up
-key up
-key up
-key up
-# --------------------------------
-step 89.61
-screendump 20080101_000007_5e33a81143dca5d5881bcfa69a664285.ppm
-# start terminal
-barrier_2 99 13 176 245 72a501d57a0a080b7b96f9f5d34a486d 18
-# Sending keys: ret
-key ret
-# --------------------------------
-step 112.95
-screendump 20080101_000008_164fb5ae3a119fce1688b23fe980b4d7.ppm
-# enable root account
-barrier_2 35 17 315 221 1c40fa91d075a8d58fe5e04b4625f77f 117
-# Sending keys: s u d o spc p a s s w d spc r o o t ret
-key s
-key u
-key d
-key o
-key spc
-key p
-key a
-key s
-key s
-key w
-key d
-key spc
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 123.27
-screendump 20080101_000009_1099c46c6900090fb2b7f2e6a6c380cd.ppm
-barrier_2 189 12 315 241 8d963b674b55e042c90682b1e395a0df 52
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 127.93
-screendump 20080101_000010_aad6d7d9d28befaefcec09e272316391.ppm
-barrier_2 188 10 314 259 f60c45c62f28c9ce3918ffc0d5c743a9 23
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 131.66
-screendump 20080101_000011_42565744a10a9c684fdabc217ad326bb.ppm
-barrier_2 194 9 314 276 c56f6caa05d0b154858b78e4533b425b 19
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 137.32
-screendump 20080101_000012_606a1699c9ea92c4bb577c1ceceddbb6.ppm
-# install openssh-server
-barrier_2 34 14 315 308 477299f68e8f498d2e9dd322ad791ed4 28
-# Sending keys: s u d o spc a p t minus g e t spc i n s t a l l spc o p e n s s h minus s e r v e r ret
-key s
-key u
-key d
-key o
-key spc
-key a
-key p
-key t
-key minus
-key g
-key e
-key t
-key spc
-key i
-key n
-key s
-key t
-key a
-key l
-key l
-key spc
-key o
-key p
-key e
-key n
-key s
-key s
-key h
-key minus
-key s
-key e
-key r
-key v
-key e
-key r
-key ret
-# --------------------------------
-step 151.65
-screendump 20080101_000013_7105d22f56358b8872d5ac71fc619451.ppm
-barrier_2 235 15 314 528 d28fcc5247152604d4ff84e77d003fab 72
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 214.69
-screendump 20080101_000014_a91d797b2322d0ff4ff58b4778d682b9.ppm
-# close terminal
-barrier_2 624 15 321 528 8945f189c2049a671fe0a55f8ab1ee81 315
-# Sending keys: e x i t ret
-key e
-key x
-key i
-key t
-key ret
-# --------------------------------
-step 218.64
-screendump 20080101_000015_f500143acbbcccccb9998eccf2b74bdf.ppm
-# done
-barrier_2 64 47 612 384 b1289b11fa8b3d82185f12fefb19c67e 20
diff --git a/client/tests/kvm/steps/Ubuntu-8.04-32.steps b/client/tests/kvm/steps/Ubuntu-8.04-32.steps
deleted file mode 100644
index 138fa35..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.04-32.steps
+++ /dev/null
@@ -1,246 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 719717491541)
-# Generated on Fri Dec 5 12:20:25 2008
-# uname -a: Linux moof 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
-# QEMU command line: kvm blank.qcow2 -m 512 -cdrom /home/cyber/Installs/ubuntu-8.04.1-desktop-i386.iso -nographic -monitor unix:/tmp/monitor_719717491541,server,nowait &
-# -------- Step 1 recorded at time 2.19 --------
-# english
-barrier_2 98 33 91 244 5342ccb187d91a8e4c89bd37b43cf10a 30
-# Sending keys: ret
-key ret
-# -------- Step 2 recorded at time 4.30 --------
-# try ubuntu
-barrier_2 382 57 133 209 faf0244208f4853533daef5b5c2d48b6 20
-# Sending keys: ret
-key ret
-# -------- Step 3 recorded at time 77.73 --------
-# desktop reached -- disable screensaver
-barrier_2 70 17 241 3 f778cb6ea8d09d88ec230c03b43806de 367
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 4 recorded at time 81.05 --------
-barrier_2 121 62 7 179 36dfac69493465d9dc006f7471f58403 17
-# Sending keys: right right
-key right
-key right
-# -------- Step 5 recorded at time 86.26 --------
-barrier_2 128 59 185 164 8189300e916f0e142e3619758b3f7fc2 26
-# Sending keys: down
-key down
-# -------- Step 6 recorded at time 92.71 --------
-barrier_2 154 186 348 519 f90182ba7c855f53ac416856e2e3bda6 32
-# Sending keys: right
-key right
-# -------- Step 7 recorded at time 95.97 --------
-barrier_2 158 43 346 32 5ca35975bc207052299cae386af8fb93 16
-# Sending keys: up up up up up
-key up
-key up
-key up
-key up
-key up
-# -------- Step 8 recorded at time 99.30 --------
-barrier_2 83 52 349 556 1dedde2eab25af6ce34e8265ce1cf7d9 17
-# Sending keys: ret
-key ret
-# -------- Step 9 recorded at time 105.55 --------
-# don't activate screensaver
-barrier_2 330 72 346 544 2d35e48579e1dee8121142d0dc79a2b2 31
-# Sending keys: alt-a
-key alt-a
-# -------- Step 10 recorded at time 110.25 --------
-barrier_2 52 33 349 585 1d5382c63908af17cbff05737d4d936e 23
-# Sending keys: alt-c
-key alt-c
-# -------- Step 11 recorded at time 113.51 --------
-# start terminal and really stop the screensaver
-barrier_2 128 97 498 356 41d58378ed6c77b1ab4de1e7b67ac54a 16
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 12 recorded at time 115.36 --------
-barrier_2 105 62 8 179 c7d7e6fd72ebf3cf5baa52cd40c6038f 9
-# Sending keys: down
-key down
-# -------- Step 13 recorded at time 118.36 --------
-barrier_2 159 107 172 241 0c044b659e52d1affb202e89580939fc 15
-# Sending keys: right
-key right
-# -------- Step 14 recorded at time 120.11 --------
-barrier_2 112 35 172 30 e4f5c061d2d7a44bfa1cb7a2d5482fb7 9
-# Sending keys: up up up up
-key up
-key up
-key up
-key up
-# -------- Step 15 recorded at time 123.07 --------
-barrier_2 83 62 172 220 c4c5794f36145a2cc9ff646aa4498dcb 15
-# Sending keys: ret
-key ret
-# -------- Step 16 recorded at time 128.50 --------
-# kill the screensaver
-barrier_2 122 22 315 218 f5a63e30768bed4ff675db9c35e53981 27
-# Sending keys: k i l l a l l spc g n o m e minus s c r e e n s a v e r ret
-key k
-key i
-key l
-key l
-key a
-key l
-key l
-key spc
-key g
-key n
-key o
-key m
-key e
-key minus
-key s
-key c
-key r
-key e
-key e
-key n
-key s
-key a
-key v
-key e
-key r
-key ret
-# -------- Step 17 recorded at time 143.16 --------
-barrier_2 123 16 315 239 33414476d4ec7bb1ae63e763fae914d4 73
-# Sending keys: ctrl-d
-key ctrl-d
-# -------- Step 18 recorded at time 146.58 --------
-# go to desktop and start installation
-barrier_2 161 142 447 317 5d75a85fe319fcc4de9f509462a0364a 17
-# Sending keys: ctrl-alt-d
-key ctrl-alt-d
-# -------- Step 19 recorded at time 150.96 --------
-# Sending keys: down down
-key down
-key down
-# -------- Step 20 recorded at time 153.04 --------
-barrier_2 89 91 42 141 511d8f17931d77d3009749c92a2145b8 10
-# Sending keys: ret
-key ret
-# -------- Step 21 recorded at time 163.60 --------
-# welcome
-barrier_2 661 43 317 594 d9cdd1fd7f81608776759749aab8ac99 53
-# Sending keys: alt-f
-key alt-f
-# -------- Step 22 recorded at time 169.20 --------
-# where are you?
-barrier_2 661 44 318 594 cca5ad2ea36cc59cb4cde4b78fa55c3b 28
-# Sending keys: alt-f
-key alt-f
-# -------- Step 23 recorded at time 175.92 --------
-# keyboard layout
-barrier_2 659 42 319 595 3f6668236fc3458ca55528dffaba156c 34
-# Sending keys: alt-f
-key alt-f
-# -------- Step 24 recorded at time 182.55 --------
-# partitioning
-barrier_2 658 42 320 595 904923c034b24685684eece7ae673663 33
-# Sending keys: alt-f
-key alt-f
-# -------- Step 25 recorded at time 192.96 --------
-# who are you?
-barrier_2 658 44 321 594 4076b5182a2439373ab0b9ec22ee00a3 52
-# Sending keys: tab
-key tab
-# -------- Step 26 recorded at time 194.71 --------
-# Sending keys: tab tab
-key tab
-key tab
-# -------- Step 27 recorded at time 197.20 --------
-# user info
-barrier_2 69 59 351 248 0c15a1e1e3ed33637dd1012383fab9ff 12
-# Sending keys: u s e r tab
-key u
-key s
-key e
-key r
-key tab
-# -------- Step 28 recorded at time 204.34 --------
-# Sending keys: tab 1 2 3 4 5 6 tab 1 2 3 4 5 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-# -------- Step 29 recorded at time 216.47 --------
-# Sending keys: tab m o o f
-key tab
-key m
-key o
-key o
-key f
-# -------- Step 30 recorded at time 220.96 --------
-barrier_2 40 35 322 512 cfa88fe4ad121954d7c3e4d82d62cf08 22
-# Sending keys: alt-f
-key alt-f
-# -------- Step 31 recorded at time 227.24 --------
-# install
-barrier_2 658 42 320 595 98993920861eb39c30d843a8dd8b722d 31
-# Sending keys: ret
-key ret
-# -------- Step 32 recorded at time 732.03 --------
-# done -- restart
-barrier_2 400 84 445 415 86ac1c7e2ac6abe52367c31b300e5ffd 3000
-# Sending keys: ret
-key ret
-# -------- Step 33 recorded at time 751.87 --------
-# remove disc and press ENTER
-barrier_2 250 43 111 371 d09146487471f9de5eb1b730f14fbe6a 99
-# Sending keys: ret
-key ret
-# -------- Step 34 recorded at time 794.07 --------
-# login
-barrier_2 43 57 577 435 38920fced24c9c17b63ce1a861b52b46 211
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 35 recorded at time 797.28 --------
-barrier_2 42 55 579 436 a525a8d2e7e1c07dde7e2e04273f275d 16
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 36 recorded at time 826.85 --------
-# desktop reached -- shut down
-barrier_2 67 15 244 4 b540c6eda838536d9feedd33a5dfb701 148
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 37 recorded at time 829.21 --------
-barrier_2 113 66 8 177 c926c3f5b603c660a7e1ad09789df268 12
-# Sending keys: right right
-key right
-key right
-# -------- Step 38 recorded at time 831.77 --------
-barrier_2 119 65 183 160 dd2af960ed1a5becd7382ec5b3b1a18c 13
-# Sending keys: up
-key up
-# -------- Step 39 recorded at time 833.55 --------
-barrier_2 82 28 181 200 5cf96b157d17af8ff86dbf8a5ddd2b5d 9
-# Sending keys: ret
-key ret
-# -------- Step 40 recorded at time 837.94 --------
-# bye bye!
-barrier_2 92 46 790 500 7223921fe5b49ef9cac57a3f39aa688f 22
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Ubuntu-8.04-server-32.steps b/client/tests/kvm/steps/Ubuntu-8.04-server-32.steps
deleted file mode 100644
index aff3c1a..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.04-server-32.steps
+++ /dev/null
@@ -1,210 +0,0 @@
-# Generated by stepmaker version 20081125 (instance: 238244299591)
-# Generated on Mon Dec 1 11:08:56 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 blank.qcow2 -cdrom /home/cyber/Installs/ubuntu-8.04.1-server-i386.iso -m 512 -nographic -monitor unix:/tmp/monitor_238244299591,server,nowait &
-# -------- Step 1 recorded at time 8.61 --------
-# language
-barrier_2 78 33 93 243 3e3a57728359e2535ce6fa20fb253dd2 43
-# Sending keys: ret
-key ret
-# -------- Step 2 recorded at time 10.79 --------
-# install
-barrier_2 187 43 229 212 0de396b020e7b29aaa7db093cbc81fe8 11
-# Sending keys: ret
-key ret
-# -------- Step 3 recorded at time 22.81 --------
-# language
-barrier_2 85 30 118 361 0b1377ac10a31ee881ea40e15d151b8a 60
-# Sending keys: ret
-key ret
-# -------- Step 4 recorded at time 25.79 --------
-# location
-barrier_2 136 29 240 330 b234fdb81b4329ef9b933ed10aded13c 15
-# Sending keys: ret
-key ret
-# -------- Step 5 recorded at time 29.45 --------
-# detect keyboard layout? no
-barrier_2 59 16 437 265 1dd036d165aa123129937eabd72e87a9 18
-# Sending keys: tab
-key tab
-# -------- Step 6 recorded at time 31.23 --------
-barrier_2 48 14 511 266 92361478685b1360630d3ba91f951025 9
-# Sending keys: ret
-key ret
-# -------- Step 7 recorded at time 34.19 --------
-# layout
-barrier_2 62 28 162 362 0561b79d7e5ccb307c898a816865234a 15
-# Sending keys: ret
-key ret
-# -------- Step 8 recorded at time 37.25 --------
-barrier_2 47 34 104 343 28f02bf1ae2dbd9c9b384a2c780ffb89 15
-# Sending keys: ret
-key ret
-# -------- Step 9 recorded at time 72.85 --------
-# hostname -- "ubuntu"
-barrier_2 42 58 34 253 124c0d99d0d977dff6f43c1416c82ac9 178
-# Sending keys: ret
-key ret
-# -------- Step 10 recorded at time 78.39 --------
-# time zone
-barrier_2 205 62 200 123 59e3fcbc24b7643cc14487ae7454b8c3 28
-# Sending keys: ret
-key ret
-# -------- Step 11 recorded at time 90.60 --------
-# partitioning
-barrier_2 314 63 25 236 cba8e8688641832a06ad62b8841312b9 61
-# Sending keys: ret
-key ret
-# -------- Step 12 recorded at time 94.49 --------
-# select disk
-barrier_2 86 56 27 221 d1018dda7671722fae3f2acb62e8546d 19
-# Sending keys: ret
-key ret
-# -------- Step 13 recorded at time 103.32 --------
-# write changes?
-barrier_2 537 41 42 317 6c89d5860d68a4128218ae1c30c2aef4 44
-# Sending keys: tab
-key tab
-# -------- Step 14 recorded at time 104.80 --------
-# Sending keys: tab
-key tab
-# -------- Step 15 recorded at time 106.05 --------
-barrier_2 50 13 451 346 6664d3e69f10fd45c148997bdf99af0f 6
-# Sending keys: ret
-key ret
-# -------- Step 16 recorded at time 543.74 --------
-# user info
-barrier_2 100 84 114 255 77099e23db2f6e0b36279193571eadda 2188
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 17 recorded at time 549.19 --------
-# username
-barrier_2 45 93 126 235 504e523389f23baf34b9628d699e7f77 27
-# Sending keys: ret
-key ret
-# -------- Step 18 recorded at time 552.11 --------
-# password
-barrier_2 78 88 121 223 a28052d2e43f2599357bc777aaf0b241 15
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 19 recorded at time 555.54 --------
-barrier_2 60 89 105 221 116a1195aecac4139f6c700fb948fc39 17
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 20 recorded at time 564.35 --------
-# proxy
-barrier_2 77 89 102 238 35db4602600fb3a01afc3601f001446e 44
-# Sending keys: ret
-key ret
-# -------- Step 21 recorded at time 688.53 --------
-# choose software to install -- OpenSSH server
-barrier_2 361 70 25 171 dfec6a54a0545b8f0a94129db5415b4c 621
-# Sending keys: down down down
-key down
-key down
-key down
-# -------- Step 22 recorded at time 690.23 --------
-barrier_2 57 25 217 252 534e535197e24eace0fc6a59a7877af4 8
-# Sending keys: spc
-key spc
-# -------- Step 23 recorded at time 691.49 --------
-barrier_2 55 30 216 250 75d81efb802b3c0216d223b4acbfb1a5 6
-# Sending keys: ret
-key ret
-# -------- Step 24 recorded at time 813.57 --------
-# reboot
-barrier_2 540 72 34 227 4638b414b246cd732f0e226a569817bd 610
-# Sending keys: ret
-key ret
-# -------- Step 25 recorded at time 857.66 --------
-# login
-barrier_2 121 56 0 344 7f110aa77de8acf2b01ef8ba7266c938 220
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 26 recorded at time 861.04 --------
-barrier_2 83 34 0 366 2c9e3170377090a15ed39a42efe677ea 17
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 27 recorded at time 872.51 --------
-# test for ssh
-barrier_2 128 11 0 389 b7b4656d43de3331aca1be0522a85720 57
-# Sending keys: s s h spc l o c a l h o s t ret
-key s
-key s
-key h
-key spc
-key l
-key o
-key c
-key a
-key l
-key h
-key o
-key s
-key t
-key ret
-# -------- Step 28 recorded at time 879.38 --------
-barrier_2 488 13 0 387 ab3ef3bff32fe564f5ca15f48cfefb7f 34
-# Sending keys: y e s ret
-key y
-key e
-key s
-key ret
-# -------- Step 29 recorded at time 884.12 --------
-barrier_2 236 10 0 390 c12ef84a61900a9c2997f128555fc1ee 24
-# Sending keys: ctrl-c
-key ctrl-c
-# -------- Step 30 recorded at time 886.34 --------
-# shutdown
-barrier_2 127 13 0 387 8486cc2baf085a8d602d2683695e91fd 11
-# Sending keys: s u d o spc p o w e r o f f ret
-key s
-key u
-key d
-key o
-key spc
-key p
-key o
-key w
-key e
-key r
-key o
-key f
-key f
-key ret
-# -------- Step 31 recorded at time 895.44 --------
-barrier_2 228 12 0 388 50c00ec68ad623ad772618230967cfee 45
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
diff --git a/client/tests/kvm/steps/Ubuntu-8.10-64.steps b/client/tests/kvm/steps/Ubuntu-8.10-64.steps
deleted file mode 100644
index 7e3b42a..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.10-64.steps
+++ /dev/null
@@ -1,165 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 508523687947)
-# Generated on Thu Nov 13 10:45:53 2008
-# uname -a: Linux blond-vdsb.qa.qumranet.com 2.6.18-92.1.17.el5 #1 SMP Tue Nov 4 13:43:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: qemu-system-x86_64 ./ubuntu.qcow2 -cdrom /isos/linux/ubuntu-8.10-desktop-amd64.iso -m 512 -nographic -monitor unix:/tmp/monitor_508523687947,server,nowait &
-# -------- Step 1 recorded at time 18.51 --------
-# english
-barrier_2 175 35 80 262 11413382dc673e62fe8f2ed6a810c5c6 93
-key ret
-# -------- Step 2 recorded at time 21.16 --------
-# try ubuntu
-barrier_2 373 48 136 216 2af67f5a5e42ba9b7259f10867481a04 13
-key ret
-# -------- Step 3 recorded at time 110.42 --------
-# disable screensaver
-barrier_2 546 423 0 0 eedd1a7c5b94ddbc7d37d1baf4981e16 446
-key alt-f1
-# -------- Step 4 recorded at time 113.58 --------
-barrier_2 118 193 18 35 f78996649c3e7da444ea1937c569f695 16
-key right
-key right
-# -------- Step 5 recorded at time 116.82 --------
-barrier_2 117 189 194 35 4fe6849f794efef24166beecafd60b44 16
-key down
-# -------- Step 6 recorded at time 121.42 --------
-barrier_2 85 675 359 33 c5df9a948b109d0e75e5edf7aa8ad16c 23
-key right
-# -------- Step 7 recorded at time 123.92 --------
-barrier_2 189 66 352 31 1cf952c382a9f591248e880980f745ea 13
-# Sending keys: up up up up up
-key up
-key up
-key up
-key up
-key up
-# -------- Step 8 recorded at time 127.83 --------
-barrier_2 178 66 356 546 4990575b1c9792ed283dc3cf5cccf37c 20
-key ret
-# -------- Step 9 recorded at time 133.80 --------
-barrier_2 105 62 218 193 c2ed5e13dbe79b247fc174338cb040f8 30
-key tab
-key tab
-key tab
-# -------- Step 10 recorded at time 136.53 --------
-barrier_2 307 29 221 569 5cb23e5de320665d1bb2995dd3a1a390 14
-key spc
-# -------- Step 11 recorded at time 138.77 --------
-# close screensaver dialog
-barrier_2 306 27 221 570 6d4a6222da882425e5f7863f942133fc 11
-key alt-c
-# -------- Step 12 recorded at time 141.96 --------
-# focus on desktop
-barrier_2 143 108 445 340 8feb652e8d3812de5d44588e40241d15 16
-key alt-ctrl-d
-# -------- Step 13 recorded at time 147.43 --------
-key down
-key down
-# -------- Step 14 recorded at time 149.72 --------
-# install
-barrier_2 77 94 47 137 02525e888873650a34554dc6cff7a7e7 11
-key ret
-# -------- Step 15 recorded at time 176.71 --------
-# welcome
-barrier_2 666 52 186 596 2c78dd30e81a4a7714e3a0111a4d4837 135
-key alt-f
-# -------- Step 16 recorded at time 183.30 --------
-# location
-barrier_2 655 44 193 601 b0a1c947f3edcb68442b2d4d48dbf4c9 33
-key alt-f
-# -------- Step 17 recorded at time 188.06 --------
-# keyboard layout
-barrier_2 643 44 206 602 6cf5b3f7057ff93182965d8c36fd720f 24
-key alt-f
-# -------- Step 18 recorded at time 227.80 --------
-# partitioning
-barrier_2 627 44 222 601 ae85a7ca8618b1f4cd3302c664053881 199
-key alt-f
-# -------- Step 19 recorded at time 248.93 --------
-# user info
-barrier_2 125 60 220 208 17e04072490a761c2cf8be8b44f0a247 106
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 tab m o o f
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key m
-key o
-key o
-key f
-# -------- Step 20 recorded at time 257.64 --------
-barrier_2 47 57 182 451 87fb07c258e488c9fb74a81635380260 44
-# Sending keys: alt-f
-key alt-f
-# -------- Step 21 recorded at time 264.21 --------
-# begin installation
-barrier_2 639 101 212 546 41ec69edd5d8ea98977cbd71fd3c928e 33
-# Sending keys: ret
-key ret
-# -------- Step 22 recorded at time 1552.48 --------
-# restart now
-barrier_2 400 50 319 436 27861c890a349734019776827f59e742 6441
-# Sending keys: ret
-key ret
-# -------- Step 23 recorded at time 1569.56 --------
-barrier_2 259 49 108 369 1dc20dfefe0d669fa47f5a20336143f9 85
-# Sending keys: ret
-key ret
-# -------- Step 24 recorded at time 1611.38 --------
-# login
-barrier_2 34 114 450 390 34d05e3fadaede2b278e4322c6864333 209
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# -------- Step 25 recorded at time 1614.21 --------
-barrier_2 29 114 452 390 0af0bd39a3900276df0b61b45fa421da 14
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# -------- Step 26 recorded at time 1658.02 --------
-# desktop reached
-barrier_2 98 91 467 345 2563f9c875174d4c1e6e2c39ac14722d 219
-# Sending keys: alt-f1
-key alt-f1
-# -------- Step 27 recorded at time 1662.27 --------
-barrier_2 86 192 13 37 e0d3e41ad05a44c166ec2c6601854e5a 21
-# Sending keys: right right
-key right
-key right
-# -------- Step 28 recorded at time 1669.04 --------
-# shut down
-barrier_2 106 242 193 38 bde4b4fe4f99363d35b5f6914b36c7c6 34
-# Sending keys: up ret
-key up
-key ret
-# -------- Step 29 recorded at time 1674.62 --------
-barrier_2 386 69 322 250 5470d8be3a0a20e195638cd03771a623 28
-# Sending keys: alt-s
-key alt-s
diff --git a/client/tests/kvm/steps/Ubuntu-8.10-server-32-gcc.steps b/client/tests/kvm/steps/Ubuntu-8.10-server-32-gcc.steps
deleted file mode 100644
index 9b4ddf1..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.10-server-32-gcc.steps
+++ /dev/null
@@ -1,148 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Sun Jan 18 12:16:00 2009
-# uname -a: Linux moof 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
-# --------------------------------
-step 35.40
-screendump 20080101_000001_09d2c6756ee8a8feb6b249431bd7e5f1.ppm
-# login
-barrier_2 117 17 0 383 168efa0c9553057108e81609df740002 177
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 38.97
-screendump 20080101_000002_c093ee3fb51ee4679b573691dd36b279.ppm
-barrier_2 82 14 0 386 b7062fdc5f04bf58a699928d8f8525ce 18
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 44.13
-screendump 20080101_000003_d55afa369b410473eefb1f1e245453ed.ppm
-# enable root access
-barrier_2 41 14 0 386 559a825b2e43dc49b4ffde9a3a58f93c 26
-# Sending keys: s u d o spc p a s s w d spc r o o t ret
-key s
-key u
-key d
-key o
-key spc
-key p
-key a
-key s
-key s
-key w
-key d
-key spc
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step 50.53
-screendump 20080101_000004_5955079091634829d90883e04b95ff36.ppm
-barrier_2 221 13 0 387 fa7a5049b6f2f87eb75e3e9f1d1c380e 32
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 54.54
-screendump 20080101_000005_408fc281aaa91660feb3a669a9f56f0a.ppm
-barrier_2 213 14 0 386 c8cb471a0026499fc113305cac6dbc81 20
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 58.01
-screendump 20080101_000006_6783b214947d4f781ffc6ae6ae035a93.ppm
-barrier_2 222 13 0 387 70640d652e1305d3bebf669cf8d2db87 17
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 62.97
-screendump 20080101_000007_eb472986dab180f8fa8a56d678b9e8f6.ppm
-# install gcc
-barrier_2 41 14 0 386 559a825b2e43dc49b4ffde9a3a58f93c 25
-# Sending keys: s u d o spc a p t minus g e t spc i n s t a l l spc g c c spc g shift-equal shift-equal spc p y t h o n 2 dot 4 spc m a k e ret
-key s
-key u
-key d
-key o
-key spc
-key a
-key p
-key t
-key minus
-key g
-key e
-key t
-key spc
-key i
-key n
-key s
-key t
-key a
-key l
-key l
-key spc
-key g
-key c
-key c
-key spc
-key g
-key shift-equal
-key shift-equal
-key spc
-key p
-key y
-key t
-key h
-key o
-key n
-key 2
-key dot
-key 4
-key spc
-key m
-key a
-key k
-key e
-key ret
-# --------------------------------
-step 75.19
-screendump 20080101_000008_2b9d15f71b1a2a0a5d690c872c8ddc99.ppm
-# are you sure?
-barrier_2 268 15 0 385 608025c0590723681215ab4bd9688c5f 91
-# Sending keys: y ret
-key y
-key ret
-# --------------------------------
-step 293.32
-screendump 20080101_000009_a26018a2633bdac9db7e5cd539f2dde4.ppm
-# done, hopefully
-barrier_2 41 13 0 387 3eb3085d84d4c6668f1f6ddb604b46ec 2091
diff --git a/client/tests/kvm/steps/Ubuntu-8.10-server-32.steps b/client/tests/kvm/steps/Ubuntu-8.10-server-32.steps
deleted file mode 100644
index cd8c5ae..0000000
--- a/client/tests/kvm/steps/Ubuntu-8.10-server-32.steps
+++ /dev/null
@@ -1,258 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 798537530139)
-# Generated on Fri Nov 14 02:10:37 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 blank.qcow2 -cdrom /home/cyber/Installs/ubuntu-8.10-server-i386.iso -m 512 -nographic -monitor unix:/tmp/monitor_798537530139,server,nowait &
-# --------------------------------
-step 5.77
-screendump 20080101_000001_f22f1bdfe49a7b1384be0a7546d332eb.ppm
-# english
-barrier_2 140 42 73 259 12cfb644f293f911bee00d802dcd1c74 29
-# Sending keys: ret
-key ret
-# --------------------------------
-step 7.72
-screendump 20080101_000002_83bfa5f3850fd4299180482d28ac090e.ppm
-# install
-barrier_2 217 270 212 210 c18bfe7533520e7e4d030ab460f35f11 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 23.14
-screendump 20080101_000003_bd5c21354a28e26d122c8be398f64137.ppm
-# language
-barrier_2 106 36 99 342 7c2cf5e0bb33fec4dce7c59e1334594a 77
-# Sending keys: ret
-key ret
-# --------------------------------
-step 25.88
-screendump 20080101_000004_41f6888dd69445cfd43b455ddef7d60b.ppm
-# country
-barrier_2 146 34 232 329 b5392889720cbb701d84df3331fe8801 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 29.97
-screendump 20080101_000005_5385793ff823d651487fdaa25d513fa9.ppm
-# detect keyboard layout? no
-barrier_2 531 65 40 235 02120fce451bdd9c76553dad6088a07a 20
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 33.33
-screendump 20080101_000006_587e85959eb5894bacbe81ae0923d161.ppm
-# keyboard origin
-barrier_2 114 36 156 356 6675cd53d400fcd80acd7c3985952ee7 17
-# Sending keys: ret
-key ret
-# --------------------------------
-step 37.21
-screendump 20080101_000007_31af69e5869a723f9af4cf4740b7eb89.ppm
-# layout
-barrier_2 229 35 94 358 c15e929eee81b746346622822714e1b5 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 72.35
-screendump 20080101_000008_655bd60ec0c4a0b80266fa6bae031434.ppm
-# hostname
-barrier_2 54 57 31 252 b3581f4269713cb9355e0bc292f379b6 300
-# Sending keys: ret
-key ret
-# --------------------------------
-step 76.82
-screendump 20080101_000009_7b7f6dbf89758f69252f69eb36450ada.ppm
-# time zone
-barrier_2 197 62 202 125 14d591694f80c5634c639131fb3dd6f9 60
-# Sending keys: ret
-key ret
-# --------------------------------
-step 90.92
-screendump 20080101_000010_6b032ccc5ebea1c2c3d9b5aec6395219.ppm
-# partitioning
-barrier_2 278 61 26 236 5ad5d6e92739313c68e710ccca19a9df 180
-# Sending keys: ret
-key ret
-# --------------------------------
-step 103.22
-screendump 20080101_000011_d935f7808c0896c739295c9a5cf9e683.ppm
-# select disk
-barrier_2 213 28 25 218 87c432a837647ce0df3144156d1fbb18 61
-# Sending keys: ret
-key ret
-# --------------------------------
-step 111.24
-screendump 20080101_000012_26bddd5607dc43b60cda3219ff373650.ppm
-# write changes?
-barrier_2 528 56 42 319 a6c9ac8ebe2ea86b91c7b70762aa38c8 40
-# Sending keys: tab
-key tab
-# --------------------------------
-step 112.43
-screendump 20080101_000013_0389b4ae17a02cd2cd0c5af39facc90a.ppm
-# Sending keys: tab
-key tab
-# --------------------------------
-step 113.33
-screendump 20080101_000014_39392d76f499133aa1b9848c8bad1e86.ppm
-barrier_2 83 17 429 338 cd35d07cd3ef235f94fd0f4a46f10495 10
-#barrier_2 123 30 444 344 1b6f0655aa77c8782261628a3f74e89c 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 504.88
-screendump 20080101_000015_c1176c547ced77a9f7bf2f2ddec5ee9a.ppm
-# full name of user
-barrier_2 179 57 92 253 d31ef6ef5ac7cf2ea58ff8cbfe52089c 1958
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 509.45
-screendump 20080101_000016_bad391e8df97e2a085d32284ec6b2b7e.ppm
-# username
-barrier_2 96 65 121 236 fbb683b6f3c476030c06cc53fb9eba74 23
-# Sending keys: ret
-key ret
-# --------------------------------
-step 512.88
-screendump 20080101_000017_2fa10b695ab303c150e44da7504680cd.ppm
-# password
-barrier_2 110 60 167 220 88bb79cc81037a3437dc6602bb70a95d 17
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 516.74
-screendump 20080101_000018_5885a6814f2337305695f683985efcf0.ppm
-barrier_2 126 61 155 218 beb9c9678247f78666ff0bd6c48fc125 19
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 523.21
-screendump 20080101_000019_532b4a899082ed9600689e506fa68a1e.ppm
-# set up an encrypted directory? no
-barrier_2 531 60 42 286 5d68950647342e3b41a33f09ef404ba8 32
-# Sending keys: ret
-key ret
-# --------------------------------
-step 534.57
-screendump 20080101_000020_c8b2521d1b272bc966366bda3a87a5a7.ppm
-# HTTP proxy -- none
-barrier_2 210 58 169 238 0e6d5e89ebf9ee8116c3396dc70d576b 57
-# Sending keys: ret
-key ret
-# --------------------------------
-step 663.18
-screendump 20080101_000021_08f8f95d5989fecf0ec9d2361057b429.ppm
-# no auto updates
-barrier_2 439 59 25 252 953a1f91c6a1f49cc8e0c4b2b352e8e1 643
-# Sending keys: ret
-key ret
-# --------------------------------
-step 668.80
-screendump 20080101_000022_e7dcad5f40d3b2f835de359724f1a659.ppm
-# install SSH server
-barrier_2 90 66 262 182 7f27601cae5787eabf2b773769b9daf7 28
-# Sending keys: down down down
-key down
-key down
-key down
-# --------------------------------
-step 670.63
-screendump 20080101_000023_71e429a19d634a6fe82618f2f3eabc6f.ppm
-barrier_2 59 35 213 233 8de5dccad4e02666abdffe526ea7207b 9
-# Sending keys: spc
-key spc
-# --------------------------------
-step 672.22
-screendump 20080101_000024_74ee2adde81d1b2eb0307d538ac9428c.ppm
-barrier_2 45 30 215 233 c17d315dd44461bb23d1528bcbee47e7 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 893.89
-screendump 20080101_000025_f228e582d2c4ed830103d81c734635e9.ppm
-# installation complete -- reboot
-barrier_2 339 119 228 176 7512cd825e95566f1d5b764096596b44 1108
-# Sending keys: ret
-key ret
-# --------------------------------
-step 938.31
-screendump 20080101_000026_474faa9e10969000c2ba7cd0b4ac8a69.ppm
-# make sure everything is OK
-barrier_2 707 146 6 191 8192877e9a26c7db820297e2196397d3 222
-# --------------------------------
-step 940.88
-screendump 20080101_000027_474faa9e10969000c2ba7cd0b4ac8a69.ppm
-# login
-barrier_2 120 19 0 381 42ad3edf8f4bf01140a429e8fb7b46eb 13
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 942.79
-screendump 20080101_000028_e5ead62901e57d1dce3a3398dc128e50.ppm
-barrier_2 82 18 0 382 eb82d9cecec369f66551f5ae5a847d90 10
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 947.45
-screendump 20080101_000029_7e365405f51fcaca323ae2ca4e629827.ppm
-# start X
-barrier_2 128 20 0 380 4cb7532c660deeac92e37f8151da570c 23
-# --------------------------------
-step 970.21
-screendump 20080101_000033_ebc74a3741507f76fca7d963ecb677d0.ppm
-# shutdown -- bye bye
-#barrier_2 130 14 0 386 91291f12b29a670448637661605fdc55 32
-# Sending keys: s u d o spc p o w e r o f f ret
-key s
-key u
-key d
-key o
-key spc
-key p
-key o
-key w
-key e
-key r
-key o
-key f
-key f
-key ret
-# --------------------------------
-step 975.66
-screendump 20080101_000034_dc25b5967c76c998dbf50285be3af3f4.ppm
-barrier_2 135 13 0 387 20fd08d2368cade3e97aafc3e50bd841 27
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
diff --git a/client/tests/kvm/steps/Win-Vista-32.steps b/client/tests/kvm/steps/Win-Vista-32.steps
deleted file mode 100644
index 0fe39e5..0000000
--- a/client/tests/kvm/steps/Win-Vista-32.steps
+++ /dev/null
@@ -1,152 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 798811497164)
-# Generated on Thu Dec 4 13:20:05 2008
-# uname -a: Linux pink-amd.qa.lab.tlv.redhat.com 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -cdrom /isos/windows/WindowsVista-32-bit.iso -m 512 -hda /vm/vista-32.qcow2 -nographic -monitor unix:/tmp/monitor_798811497164,server,nowait &
-# --------------------------------
-step 28.26
-screendump 20080101_000001_6d9b50f2a5e757e76ec17a6db86c73ac.ppm
-# Vista Welcome
-barrier_2 219 83 483 434 0e89a95f9a7dff151adfe1ca3b20547c 141
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 30.20
-screendump 20080101_000002_87d6635f8073cf0ef6b663ada7f9c4e3.ppm
-# Vista Welcome 2
-barrier_2 58 51 433 275 380a6a5205128aaac56124a14c69198d 10
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 36.55
-screendump 20080101_000003_6376913bbcaf19177faca7d4d8ae9cac.ppm
-# CD-Key (skip)
-barrier_2 371 35 118 386 441943164cabcd5f147b6f0ba0667830 32
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 38.71
-screendump 20080101_000004_c0f9f3021eb21da9fd40e7a77442f622.ppm
-# CD-Key (skip) 2
-barrier_2 274 19 201 240 b91e94409e31142db7d9e1c9f3628b67 11
-# Sending keys: alt-o
-key alt-o
-# --------------------------------
-step 45.03
-screendump 20080101_000005_c1fd9369224629d1427f4560901f5902.ppm
-# Vista Edition (Ultimate)
-barrier_2 312 25 118 82 81cd512aef7721e84f7af433dce7ebc4 32
-# Sending keys: tab down down down alt-i
-key tab
-key down
-key down
-key down
-key alt-i
-# --------------------------------
-step 47.79
-screendump 20080101_000006_09c51bfdd7dfb493ffb9f88fce6c5456.ppm
-# Vista Edition (Ultimate)
-barrier_2 331 33 115 417 b5e64bd6d974ef91d3a2ad6e863a66f9 14
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 49.79
-screendump 20080101_000007_efb32b224f027e906242bf254ee72fff.ppm
-# License
-barrier_2 178 28 114 413 25bc8594e67ec5742b70e93bdb6b1227 10
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 50.98
-screendump 20080101_000008_814ce1b00f806eb1fc4f3ec621e3ac76.ppm
-# License 2
-barrier_2 181 26 118 414 526e2f00448e71a178dfe72be87347df 6
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 52.56
-screendump 20080101_000009_b55426ff74844260ea394443db573c0c.ppm
-# Install (custom)
-barrier_2 127 21 195 217 b598e0ea5c4d6852ef33ef6d0eab736b 8
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 60.43
-screendump 20080101_000010_7d0871c17cd0a32a608b48c95f1bf594.ppm
-# HDD Partitioning
-barrier_2 202 141 499 348 aef7f6a17ed0fe6405d4944ed3bd66a7 39
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1583.77
-screendump 20080101_000011_6f46e28968b973c742a65482adfd36a3.ppm
-# User name & Password
-barrier_2 105 17 295 217 facd43b7a1eb7a52eba2facceca7d606 3600
-# Sending keys: u s e r
-key u
-key s
-key e
-key r
-# --------------------------------
-step 1587.31
-screendump 20080101_000012_e8595613efbdcf83d9188df59a0ae829.ppm
-sleep 2
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1590.56
-screendump 20080101_000013_1e50852a8b25aa3d99bfa83fa11ec5d0.ppm
-# PC name
-barrier_2 44 15 281 219 8a1a328647db4ba125a0d721215a288c 16
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1593.76
-screendump 20080101_000014_cb10a011112859cb48e4ecc73df04a28.ppm
-# Help Protect (skip)
-barrier_2 265 20 139 129 1b4fdf10f974c2eee846bf2a8720708b 16
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 1596.53
-screendump 20080101_000015_5f1691730fed2c87e2a38e1e9deffd21.ppm
-# Time & Date Settings
-barrier_2 259 24 136 130 d487984ebced8d89acb1fca00d120317 14
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1598.21
-screendump 20080101_000016_2d9f6e57a164380b6e785757faa19e88.ppm
-# PC location (work)
-barrier_2 283 26 134 127 6e154179b301da750e9e04f16bc142e2 8
-# Sending keys: alt-w
-key alt-w
-# --------------------------------
-step 1600.06
-screendump 20080101_000017_5fbeb6208083f61f68b58d4f08697438.ppm
-# Vista Finish
-barrier_2 54 28 429 310 3124584cb74564a89d1665e8311df506 9
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
-step 2044.77
-screendump 20080101_000018_e233a19f836119df1d46b91b86f423c7.ppm
-# Vista Start Menu
-barrier_2 12 42 45 555 0ea80974a1a51105ead39934c36c2d08 1800
-# Sending keys: 0xdc
-key 0xdc
-# --------------------------------
-step 2052.83
-screendump 20080101_000019_9a4156468d8fbca4814531127893194a.ppm
-# Vista Start Menu Opened
-# Sending keys: tab tab right right
-key tab
-key tab
-key right
-key right
-# --------------------------------
-step 2056.01
-screendump 20080101_000020_ea049d5321da816f4e91bedb87b4e07d.ppm
-# Vista Shutdown
-barrier_2 17 30 387 449 481840dc7db32dd6337e5d94b0be22c6 16
-# Sending keys: u
-key u
diff --git a/client/tests/kvm/steps/Win-Vista-64.steps b/client/tests/kvm/steps/Win-Vista-64.steps
deleted file mode 100644
index e1aef39..0000000
--- a/client/tests/kvm/steps/Win-Vista-64.steps
+++ /dev/null
@@ -1,153 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 243819885822)
-# Generated on Thu Nov 27 13:28:07 2008
-# uname -a: Linux pink-intel.qa.lab.tlv.redhat.com 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -cdrom /isos/windows/WindowsVista-x64.iso -m 512 -name WindowsVista-x64 -hda /vm/vista-64.qcow2 -nographic -monitor unix:/tmp/monitor_243819885822,server,nowait &
-# --------------------------------
-step 38.45
-screendump 20080101_000001_880a7a76c164fa433866e8f708a39573.ppm
-# Vista Welcome
-barrier_2 221 83 480 434 4df095a89ff198eadfdf7b63fd1fc31f 192
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 40.19
-screendump 20080101_000002_6f628e8fa5a32adfd915c16defc3d6e3.ppm
-# Vista Welcome 2
-barrier_2 85 102 424 229 6b6febf73ae3a48d4e4d850d562ee4c6 9
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 49.26
-screendump 20080101_000003_e0e0d0ac4e3ea853acf62aca5b36a8d3.ppm
-# product key (skip)
-barrier_2 384 128 317 359 e9ec5208ed616a74c044d9e32a5d3aa3 45
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 51.26
-screendump 20080101_000004_92e6f9e30f2f736d70fbed2e6a996a4b.ppm
-# Product key (skip) 2
-barrier_2 256 27 201 238 5e126f429ac89cb3579c8722e6996a6a 10
-# Sending keys: alt-o
-key alt-o
-# --------------------------------
-step 56.67
-screendump 20080101_000005_912caab5e6b4dce47a1db8cdd5f69980.ppm
-# Vista Edition (Ultimate)
-barrier_2 192 171 116 82 ae18c45568422f689fefc45b8c1cea49 27
-# Sending keys: tab down down down alt-i
-key tab
-key down
-key down
-key down
-key alt-i
-# --------------------------------
-step 59.38
-screendump 20080101_000006_4664f5537aae51febad5579ba42b8fba.ppm
-# Vista Edition (Ultimate) 2
-barrier_2 590 64 110 424 4f7fe1d48f56797fed12a70ebe8186b3 14
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 61.38
-screendump 20080101_000007_4c0a3e61a0a59dddda99caec5c7e8eaf.ppm
-# License
-barrier_2 168 27 120 414 4bd6abfebf0a8764ec9d86d4be45b21a 10
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 62.94
-screendump 20080101_000008_4d2bebee0af86e1f691e1339d8235102.ppm
-# License 2
-barrier_2 588 75 116 416 130d37c5f4b15ed00ce1425d13df1f83 8
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 65.03
-screendump 20080101_000009_acde7a8356f4bc6e4218c18c823e0d7a.ppm
-# Setup Type (custom)
-barrier_2 119 22 196 217 6691518c5ced0532b445b49a05102580 10
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 70.63
-screendump 20080101_000010_44bc38c11a4520d55682dbdd0beec9fa.ppm
-# HDD Partitioning
-barrier_2 209 135 496 353 b7399cd51f4ad3459324b01d0c523edc 28
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2716.52
-screendump 20080101_000011_49388309cbc060258f70fe615bcbd5b0.ppm
-# user name
-barrier_2 218 18 297 216 cfc31c7472f50d6082317dc5b1e699eb 3600
-# Sending keys: u s e r
-key u
-key s
-key e
-key r
-# --------------------------------
-step 2719.14
-screendump 20080101_000012_6f9bd1d922ab859f6dcfed882fe696d4.ppm
-sleep 2
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2728.56
-screendump 20080101_000013_9c5534594b7ee45f597853dcf8b82c78.ppm
-# computer name
-barrier_2 33 18 284 216 d1a9c533c855febbfb321afd281af595 47
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2731.78
-screendump 20080101_000014_1f11361f3c4183eda3afa85091875ade.ppm
-# Protect Windows?
-barrier_2 103 23 197 307 76a5fa4cfd1eaf334fc19ca44c406976 16
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 2734.71
-screendump 20080101_000015_06447c0a37f1a7643d0a139b62a13c50.ppm
-# Time and Date
-barrier_2 263 26 135 129 7a5b74edc39e133fb1ce42c71f70954a 15
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2737.70
-screendump 20080101_000016_7c13a026424a2d899edd73b59b25fe99.ppm
-# Location (Work)
-barrier_2 313 22 126 130 1e4f0464a85eaec104d99f6f863fd0c5 15
-# Sending keys: alt-w
-key alt-w
-# --------------------------------
-step 2739.72
-screendump 20080101_000017_8fcc7437915b2a7d3287e37f3f94e67a.ppm
-# Thank You
-barrier_2 49 61 432 306 24280506b6e97ecbbc24247c6239fd59 10
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
-step 2926.80
-screendump 20080101_000018_b1df1eb4d45efafa464783598df5a3b9.ppm
-# Vista Taskbar
-barrier_2 16 43 43 557 a47b6415ec2c3c557f9ee21ad4744ce3 900
-# Sending keys: 0xdc
-key 0xdc
-# --------------------------------
-step 2930.49
-screendump 20080101_000019_0a3a309b0b0fe714406b5e1474d68230.ppm
-# Vista Start Menu
-barrier_2 112 19 41 507 b4b2f891cac164d7a45bfbeb0d4361e7 18
-# Sending keys: tab tab right right
-key tab
-key tab
-key right
-key right
-# --------------------------------
-step 2932.93
-screendump 20080101_000020_90fa3306fd39279baeba03f1f7b7faf8.ppm
-# Vista Shutdown
-barrier_2 19 13 384 446 16fa333702d5327b122ef38c781fe010 12
-# Sending keys: u
-key u
diff --git a/client/tests/kvm/steps/Win2000-32-rss.steps b/client/tests/kvm/steps/Win2000-32-rss.steps
deleted file mode 100644
index 34fa5f4..0000000
--- a/client/tests/kvm/steps/Win2000-32-rss.steps
+++ /dev/null
@@ -1,52 +0,0 @@
-# --------------------------------
-step 43.16
-screendump 20080101_000001_5b659c177604f5eefd34042a02463519.ppm
-# reached desktop; close "Getting Started" dialog
-barrier_2 86 12 120 58 deecf2363bbf8725264e9da8dd7a0c4e 216
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 45.98
-screendump 20080101_000002_e47965a8e2b13c234b2024caaf1cd8d2.ppm
-# open start menu
-barrier_2 83 62 283 219 34bb8f3f22754e871514abbc5a2d588a 14
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 47.91
-screendump 20080101_000003_b7fb19d51b89cb288639f2d528c6dd70.ppm
-# run...
-barrier_2 100 63 33 383 9f18731457b7d11c50ab92b81642c393 10
-# Sending keys: up up
-key up
-key up
-# --------------------------------
-step 49.98
-screendump 20080101_000004_e7a3f3fa3157129829c1526b0ad048e9.ppm
-barrier_2 43 19 63 389 32d9745c40deacbbed050934ecb22928 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 53.13
-screendump 20080101_000005_34cd11237ca61f9cf23dcacc4fd84826.ppm
-# run "d:\setuprss"
-barrier_2 53 75 254 306 9234a91426b8d28650cd6d2ddd60c0ff 16
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step unknown
-screendump 20080101_000014_e47965a8e2b13c234b2024caaf1cd8d2.ppm
-# make sure we're done
-sleep 20
-barrier_2 88 65 284 220 8ea5bd06fc592f91cdc322f4ed954469 120
diff --git a/client/tests/kvm/steps/Win2000-32-setupssh.steps b/client/tests/kvm/steps/Win2000-32-setupssh.steps
deleted file mode 100644
index 4002430..0000000
--- a/client/tests/kvm/steps/Win2000-32-setupssh.steps
+++ /dev/null
@@ -1,106 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Tue Jan 13 12:10:34 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 43.16
-screendump 20080101_000001_5b659c177604f5eefd34042a02463519.ppm
-# reached desktop; close "Getting Started" dialog
-barrier_2 76 93 268 176 40dbb3012dd903f5ea9fa41420144e27 216
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 45.98
-screendump 20080101_000002_e47965a8e2b13c234b2024caaf1cd8d2.ppm
-# open start menu
-barrier_2 83 62 283 219 34bb8f3f22754e871514abbc5a2d588a 14
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 47.91
-screendump 20080101_000003_b7fb19d51b89cb288639f2d528c6dd70.ppm
-# run...
-barrier_2 100 63 33 383 9f18731457b7d11c50ab92b81642c393 10
-# Sending keys: up up
-key up
-key up
-# --------------------------------
-step 49.98
-screendump 20080101_000004_e7a3f3fa3157129829c1526b0ad048e9.ppm
-barrier_2 43 19 63 389 32d9745c40deacbbed050934ecb22928 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 53.13
-screendump 20080101_000005_34cd11237ca61f9cf23dcacc4fd84826.ppm
-# run "d:\setup"
-barrier_2 104 82 99 302 9cab2935d6ac4b982dbb42d0a0698c6d 16
-# Sending keys: d shift-0x27 0x2b s e t u p ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key ret
-# --------------------------------
-step 58.76
-screendump 20080101_000006_cda0d7995f609f47fc81030f1cb7795d.ppm
-# setup program
-barrier_2 99 50 377 360 4dda62f75be367e2a03789bcccfd565f 28
-# Sending keys: ret
-key ret
-# --------------------------------
-step 60.55
-screendump 20080101_000007_7932c4698dbb6dce7f86df4c3d87d722.ppm
-# license
-barrier_2 389 92 88 318 4cc65d629be9fee3db74f577d362128b 9
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 62.08
-screendump 20080101_000008_a0cf543568db05688dcf77bbedda4f07.ppm
-barrier_2 387 93 89 317 f6fb5147635d453a2ab40e9016ee452c 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 63.85
-screendump 20080101_000009_2d749e64780f581e46d2f255b2f62524.ppm
-# choose components
-barrier_2 121 172 355 240 f41ac43381a8ce324c7422b83828f4d9 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 65.83
-screendump 20080101_000010_31f0e6d7836eb469d7fa881473a5a68f.ppm
-# destination folder
-barrier_2 168 136 307 273 e8ec2d37290857f02c6fdc6a4c2f84be 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 67.47
-screendump 20080101_000011_120f050a193d7a8de1dd7c14ab9a7474.ppm
-# start menu folder
-barrier_2 172 50 304 361 650b0d5ad7e1675cbc41b8ed145e87bd 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 75.50
-screendump 20080101_000012_ab9a67457f37b60fe1d333ec0caefde4.ppm
-# message
-barrier_2 106 38 268 278 9c69687957f6cf6b1718833251679108 40
-# Sending keys: ret
-key ret
-# --------------------------------
-step 78.65
-screendump 20080101_000013_e36be35c2b14369dc045982b40e2a06b.ppm
-# finish
-barrier_2 174 56 303 355 ae80aee619e4b88f81792b536b806490 16
-# Sending keys: ret
-key ret
-# --------------------------------
-step unknown
-screendump 20080101_000014_e47965a8e2b13c234b2024caaf1cd8d2.ppm
-# make sure it's really finished
-barrier_2 88 65 284 220 8ea5bd06fc592f91cdc322f4ed954469 120
diff --git a/client/tests/kvm/steps/Win2000-32.steps b/client/tests/kvm/steps/Win2000-32.steps
deleted file mode 100644
index 8dd19d7..0000000
--- a/client/tests/kvm/steps/Win2000-32.steps
+++ /dev/null
@@ -1,119 +0,0 @@
-# Generated by stepmaker version 20081110 (instance: 173924304363)
-# Generated on Wed Nov 12 14:46:53 2008
-# Modified on Thu Nov 13 2008
-# uname -a: Linux pink-intel 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda ./win2000.qcow2 -cdrom /isos/windows/Windows2000_sp4.iso -m 256 -nographic -monitor unix:/tmp/monitor_173924304363,server,nowait &
-step 35.38
-screendump 20080101_000001_a13f39d98c144088a64946998b836a2d.ppm
-# Windows 2000 Setup
-barrier_2 287 31 4 7 b7ee25fd93cb9dee3f978c4665fab244 177
-key ret
-# --------------------------------
-step 37.08
-screendump 20080101_000002_26158a04d513e8cd68a1c35ccf28aa3b.ppm
-# License
-barrier_2 297 34 2 4 eab59057276e4d6bc28db13db4ae86bc 9
-key f8
-# --------------------------------
-step 38.77
-screendump 20080101_000003_81d9221b36b5e1eeab7fda769cd13f6d.ppm
-# HDD Partitioning
-barrier_2 489 35 21 42 550a43a3523215fe656880d37c408a6b 8
-key ret
-# --------------------------------
-step 42.46
-screendump 20080101_000004_4b38063a0558d5ed471d34bc01748d5b.ppm
-# HDD Partitioning
-barrier_2 518 45 38 198 718ccde8a2cafd8617fda80a38c0f3f1 18
-key ret
-# --------------------------------
-step 675.85
-screendump 20080101_000005_223279119860c5fd8bdc84f3cc43bb0f.ppm
-# Regional Settings
-barrier_2 112 20 88 75 ffdc315d1a9f9378a2f4a9711c6a998c 3167
-key ret
-# --------------------------------
-step 677.35
-screendump 20080101_000006_aa0284cf71135117428ea0942e858e58.ppm
-# User and Organization
-barrier_2 84 59 153 192 6957a9c20d3e7e7580d4d5071683267f 8
-var user
-key ret
-# --------------------------------
-step 680.88
-screendump 20080101_000007_b9c230b12388053d4ff4e1dd8e5ea4e7.ppm
-# CD-Key
-barrier_2 82 19 109 272 f20310915f8326468d21a2b9e4923454 18
-var cdkey
-# --------------------------------
-step 687.72
-screendump 20080101_000008_f02975f4c32d4ac89004facdf952a341.ppm
-barrier_2 77 18 107 274 08c7465ecbd2013ba7ad42f10d9913a3 34
-key ret
-# --------------------------------
-step 690.72
-screendump 20080101_000009_834d0a8d075853a1d0c99da50f03298e.ppm
-# Computer Name
-barrier_2 272 18 86 77 9f0919fced86a4d9764f26b5d7986cbd 15
-key ret
-# --------------------------------
-step 693.30
-screendump 20080101_000010_a2649ebc78425f623690dce371662dfd.ppm
-# Date & Time
-barrier_2 146 17 85 77 542e04e1aa9f59a3ec9736b51d880248 13
-key ret
-# --------------------------------
-step 799.88
-screendump 20080101_000011_bd7af2be0dc8d4c339b44001909cfd35.ppm
-# Typical Settings
-barrier_2 120 20 155 186 0fec8cfdd2f35f78539021e151b11e07 533
-key ret
-# --------------------------------
-step 803.66
-screendump 20080101_000012_3250dcd46165a41a40386453d0576373.ppm
-# Workgroup
-barrier_2 202 18 85 77 bba6e9ec2c10635d7f391b85ae07c304 19
-key ret
-# --------------------------------
-step 1372.12
-screendump 20080101_000013_a36f8ad80338c278d1c4b9745e651da7.ppm
-# Completing...
-barrier_2 280 48 242 77 19614ab90587c86d677d808ae74ea47d 2842
-key ret
-# --------------------------------
-step 1416.52
-screendump 20080101_000014_06c29db5a64669f08b80549930bd3ae9.ppm
-# Network ID
-barrier_2 239 48 238 78 fbdc278aa9b95f2b92c2544b5af22f1b 222
-key ret
-# --------------------------------
-step 1418.70
-screendump 20080101_000015_ff403bc3a1cb1b9193127b3e08289fdb.ppm
-# user name & password
-barrier_2 155 49 103 208 13a7ba9af1f5b9c5ca824f446aff1ed0 11
-key ret
-# --------------------------------
-step 1420.78
-screendump 20080101_000016_6a9f342e7c924e160cd74f7a16755004.ppm
-barrier_2 220 45 241 78 188087ff65a1a21b48c8c0bb098d2758 10
-key ret
-# --------------------------------
-step 1440.81
-screendump 20080101_000017_003bde606ea103f092cf0dec95ec25cf.ppm
-# Windows 2000 Desktop
-barrier_2 57 25 0 455 a244e060dc4e04cd69a7a0d908301eca 200
-key ctrl-esc
-# --------------------------------
-step 1443.08
-screendump 20080101_000018_ee1f4970f945e1d340187009fbf971a6.ppm
-# Windows 2000 Shutdown
-barrier_2 141 27 28 424 faac78be4bdea48f691d8ee713a84677 11
-key u
-# --------------------------------
-step 1446.72
-screendump 20080101_000019_4f6e7ddc49f75a0b72c6bd0117853e96.ppm
-# Windows 2000 Shutdown
-barrier_2 284 51 169 178 8797901d6da0b71e7414bd607d5173ef 18
-key ret
-sleep 20
-# --------------------------------
diff --git a/client/tests/kvm/steps/Win2003-32-rss.steps b/client/tests/kvm/steps/Win2003-32-rss.steps
deleted file mode 100644
index a194f6b..0000000
--- a/client/tests/kvm/steps/Win2003-32-rss.steps
+++ /dev/null
@@ -1,49 +0,0 @@
-# --------------------------------
-step 25.16
-screendump 20080101_000001_315f40a7863d9981afc999c525abd698.ppm
-barrier_2 48 13 425 231 4da32ca10d3191bc95eba6552c1e3d4d 180
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 27.98
-screendump 20080101_000002_9c888fc55dbcff4c54b2c8ca9abea561.ppm
-# login
-barrier_2 32 11 469 230 3b7b1974fe99ef2ceee9d49e2885253f 30
-# Sending keys: ret
-key ret
-# --------------------------------
-step 40.75
-screendump 20080101_000003_b29321f21ff99f7570213c9e53b2806a.ppm
-barrier_2 66 45 209 233 f8e61ca0d97b8af750fe7c3451401498 90
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 43.99
-screendump 20080101_000004_4e23508d4bf604e5939c9a715bde4e33.ppm
-# run command
-barrier_2 63 41 213 229 61e4e55ac2f0bc30a92d141363c1895a 16
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 49.52
-screendump 20080101_000006_f959391507e8a2eb9af10a802db56d7e.ppm
-# run "d:\setuprss"
-barrier_2 261 34 57 307 62d58248f633ce21c7330ab430e087eb 14
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 88.35
-screendump 20080101_000015_dc5545b4db2a21f13918af699a9e1ffb.ppm
-# done
-barrier_2 62 41 208 229 0da402920a310728fb3cd78e4cbfc13a 90
diff --git a/client/tests/kvm/steps/Win2003-32-setupssh.steps b/client/tests/kvm/steps/Win2003-32-setupssh.steps
deleted file mode 100644
index bc677c8..0000000
--- a/client/tests/kvm/steps/Win2003-32-setupssh.steps
+++ /dev/null
@@ -1,109 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Thu Jan 15 16:56:17 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 25.16
-screendump 20080101_000001_315f40a7863d9981afc999c525abd698.ppm
-barrier_2 48 13 425 231 4da32ca10d3191bc95eba6552c1e3d4d 126
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 27.98
-screendump 20080101_000002_9c888fc55dbcff4c54b2c8ca9abea561.ppm
-# login
-barrier_2 32 11 469 230 3b7b1974fe99ef2ceee9d49e2885253f 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 40.75
-screendump 20080101_000003_b29321f21ff99f7570213c9e53b2806a.ppm
-barrier_2 70 50 292 225 8a7e2554dbd647742ea0f6c2f2208407 64
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 43.99
-screendump 20080101_000004_4e23508d4bf604e5939c9a715bde4e33.ppm
-# start menu
-barrier_2 83 58 286 222 edea71abb6a61e109e5cc78a7f334791 16
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 46.70
-screendump 20080101_000005_8987f840f75653eb9089c8352a51b7ee.ppm
-# run
-barrier_2 24 27 199 255 e5601a2254b6b9fabf271f325fecb0c2 14
-# Sending keys: r
-key r
-# --------------------------------
-step 49.52
-screendump 20080101_000006_f959391507e8a2eb9af10a802db56d7e.ppm
-# run "d:\setup"
-barrier_2 261 34 57 307 62d58248f633ce21c7330ab430e087eb 14
-# Sending keys: d shift-0x27 0x2b s e t u p ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key ret
-# --------------------------------
-step 54.45
-screendump 20080101_000007_007e7efd60d86fa329f3fd96354c54eb.ppm
-barrier_2 66 30 242 225 5bdd9610087fd53bf1ff082c283b83f8 25
-# Sending keys: ret
-key ret
-# --------------------------------
-step 56.23
-screendump 20080101_000008_67dd8c48b63b2cafb15ac2cc1a9db2e4.ppm
-# license
-barrier_2 65 39 82 319 8b3e07631ed01b0f7f0265743f0ede3f 9
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 57.25
-screendump 20080101_000009_437b719f5a238247b2d59bbaa3e4ba78.ppm
-barrier_2 58 40 89 317 05eb2a58144f68e6ee70d1bc822f0bb1 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 58.66
-screendump 20080101_000010_587d5ee6ac23dcc4c841dba772d900bb.ppm
-barrier_2 63 70 226 174 54aa3ffec6097e0080695712ef6556c9 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 60.18
-screendump 20080101_000011_2f94914477e57649a4f89eedb00a9f31.ppm
-# destination folder
-barrier_2 178 76 377 235 3f73ea2ec7ba23ac0d2e76031a12a88b 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 62.20
-screendump 20080101_000012_e4baba911d11e0ad705d8f0dc7ff339e.ppm
-# start menu folder
-barrier_2 62 30 78 162 59e58e55567dba7faeeb7dda90ca1cae 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 71.87
-screendump 20080101_000013_e0738bb6d845a22d0deb9195925291ae.ppm
-# message
-barrier_2 109 44 264 270 c09d165ee816cf6d9e6712e991edc7e8 48
-# Sending keys: ret
-key ret
-# --------------------------------
-step 73.66
-screendump 20080101_000014_03a4072b64379681b41a00f4db276f41.ppm
-# finish
-barrier_2 170 23 241 162 71e55d58fe559777c6d297aa80f18760 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 88.35
-screendump 20080101_000015_dc5545b4db2a21f13918af699a9e1ffb.ppm
-# done
-barrier_2 83 54 284 224 8de7fae686d712c04adf4164c1e70eb0 73
diff --git a/client/tests/kvm/steps/Win2003-32.steps b/client/tests/kvm/steps/Win2003-32.steps
deleted file mode 100644
index 8830e1f..0000000
--- a/client/tests/kvm/steps/Win2003-32.steps
+++ /dev/null
@@ -1,231 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Thu Jan 15 16:20:29 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 4.33
-screendump 20080101_000001_72251447bf5a47c18582faace9a1c6aa.ppm
-barrier_2 303 98 4 302 e456f3265d5f6b4e41e14bc64cb89962 22
-# Sending keys: b ret
-key b
-key ret
-# --------------------------------
-step 30.60
-screendump 20080101_000002_2f38fd98ac246452e624c8858f1a6625.ppm
-# set up windows now
-barrier_2 378 29 35 111 34ec554393e255bf1df89411da0a25e1 131
-# Sending keys: ret
-key ret
-# --------------------------------
-step 32.31
-screendump 20080101_000003_e95fdaaf5f1cc102e781a280ab08dbdb.ppm
-# license
-barrier_2 68 357 15 39 f304cb5b909ff39d1109cce0de072999 9
-# Sending keys: f8
-key f8
-# --------------------------------
-step 34.58
-screendump 20080101_000004_a3b4c067a7992513f8fa597d93a9da36.ppm
-# create partition
-barrier_2 572 45 39 105 f5d8eb98252dbc37c38e7578f6085c59 11
-# Sending keys: c
-key c
-# --------------------------------
-step 36.45
-screendump 20080101_000005_ba99fa62c791a3fe180ac893683bd9e2.ppm
-barrier_2 516 36 39 90 bbd42e0aef09aef3bcae3d2017d5657a 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 42.22
-screendump 20080101_000006_8172895536f8f0584319bbd0a56aceb7.ppm
-barrier_2 531 22 41 103 ab8d9de785e4c8178bfc4871b7d46ccf 29
-# Sending keys: ret
-key ret
-# --------------------------------
-step 44.21
-screendump 20080101_000007_8690540065ef2759e06a889f673f140f.ppm
-# quick format
-barrier_2 537 96 17 114 27c8be1a347363ccafaacf687d7924cc 10
-# Sending keys: up up
-key up
-key up
-# --------------------------------
-step 46.28
-screendump 20080101_000008_7fbd790f24ae3bb5b63074d3184bf96c.ppm
-barrier_2 518 33 33 147 fcf361941f13f9d01834999bb646de8e 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 533.13
-screendump 20080101_000009_9aca2d06e58cb532f051f0d62ec10609.ppm
-# regional settings
-barrier_2 252 84 212 346 f29ac58f25865cabe63b6344cada8569 2434
-# Sending keys: ret
-key ret
-# --------------------------------
-step 535.47
-screendump 20080101_000010_670e327bb9376342243d80cc54b871c7.ppm
-# username
-barrier_2 85 118 382 148 3471ff0e155ae6aaa2d7d365f5e78450 12
-# Sending keys: $user ret
-var user
-key ret
-# --------------------------------
-step 538.77
-screendump 20080101_000011_ddd4d4edea40c7f94d097821cb258a2b.ppm
-# cd key
-barrier_2 42 152 210 199 9fb215da1faaff32622db41e6a6c310b 17
-# Sending keys: $cdkey ret
-var cdkey
-key ret
-# --------------------------------
-step 548.28
-screendump 20080101_000012_f28b4fe1588659709b79e209d6b32066.ppm
-# server licensing
-barrier_2 237 120 226 309 80277ac933f878561ad856a74887c7af 48
-# Sending keys: ret
-key ret
-# --------------------------------
-step 550.71
-screendump 20080101_000013_6741c465518b969fa5a8ee8ea4e12546.ppm
-# computer name
-barrier_2 135 121 214 308 a3dd27e33ec483b3c5e0f131e36d4593 12
-# Sending keys: ret
-key ret
-# --------------------------------
-step 553.23
-screendump 20080101_000014_8e2cf90045f0903e6e26ad737ccb69ab.ppm
-# password warning
-barrier_2 123 58 376 252 11e2aac58b83480128471a9ea72ddec3 13
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 558.19
-screendump 20080101_000015_dabbdf6385892f0b45a0469b4f8197a8.ppm
-# date and time
-barrier_2 127 128 335 299 d6be76fd9cc178eb7cefecddea96eeb3 25
-# Sending keys: ret
-key ret
-# --------------------------------
-step 615.88
-screendump 20080101_000016_548d686c826c2810803958c70d216b8d.ppm
-# network settings
-barrier_2 112 219 352 209 53a385f645446d66004e97ef59673967 288
-# Sending keys: ret
-key ret
-# --------------------------------
-step 618.75
-screendump 20080101_000017_429fd49b57bad17574d960bf579f225d.ppm
-# workgroup
-barrier_2 108 142 354 285 fe4a7de889b0d79b71bb069ad4ae27f7 14
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1140.37
-screendump 20080101_000018_ca23d3a62c6b9d7fcaa07db7c5c9449c.ppm
-# press ctrl-alt-delete to begin
-barrier_2 118 33 118 208 4128e434b94e3517f0e90d152c54c5e3 2608
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 1144.83
-screendump 20080101_000019_b2ec1a1b86e84a769e2a2e54681ec0c3.ppm
-# login
-barrier_2 72 26 160 215 3cfa7c124691fedb347c0523fbdb8859 22
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1193.48
-screendump 20080101_000020_061334151d786c9c741040c96e9dfb9a.ppm
-# windows setup thingy -- close it
-# --------------------------------
-step 1200.53
-screendump 20080101_000021_4dd6d0e8a69b83974b48824f35a32c04.ppm
-# don't close it
-# --------------------------------
-step 1201.89
-screendump 20080101_000022_061334151d786c9c741040c96e9dfb9a.ppm
-barrier_2 84 73 174 27 39099c7ac26181dde7dc51dc11d26f5c 70
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1203.91
-screendump 20080101_000023_6e6440f2681759f28f2239ddd17b2cff.ppm
-# accept license agreement
-barrier_2 62 51 52 280 6e742ffbf59271572d0db1fb7717cfba 10
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 1205.63
-screendump 20080101_000024_1483929273fe23621b86e1a95fbf1247.ppm
-barrier_2 73 50 55 281 b55d3cc121073a7e6d158f4aa14b871d 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1209.08
-screendump 20080101_000025_b4053f3adcc65177e76337a5fb604a2d.ppm
-barrier_2 187 39 45 110 b881d5791a54afd6872179a87af11186 17
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1252.73
-screendump 20080101_000026_ff556be9de099e070803b30c5a3a1c66.ppm
-# setup complete
-barrier_2 209 105 171 27 f5c0ac66c203252e8f4382360a680b64 218
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1262.67
-screendump 20080101_000028_3b56c4d7a99425efd21e31aa34a05b8c.ppm
-# security updates -- finish
-barrier_2 537 50 11 7 5ebb30caa21d7bf9e44bceae34af8d14 23
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1267.03
-screendump 20080101_000029_ba5abf9abfd69e9f82a515fa66ba5424.ppm
-# close page? yes
-barrier_2 115 63 166 228 c5c8c5b7e95691c3d9edd827a9fe8a28 22
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 1272.07
-screendump 20080101_000030_12d51f64d46b1666bf736460dcf8f9b6.ppm
-# manage your server -- close
-barrier_2 299 89 62 114 3e530219161394c1275868591cde4885 25
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 1293.12
-screendump 20080101_000033_7b64f02e71550b4550c18db790fce43a.ppm
-# open start menu
-barrier_2 84 68 283 216 638a0f93d7c3e956f1d3d2ad9002b8ee 74
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 1295.09
-screendump 20080101_000034_02485db76ca67f4a6df164f974cea73e.ppm
-# shut down
-barrier_2 174 45 204 408 ddbf2376c21bd3814218563d239186a5 10
-# Sending keys: u
-key u
-# --------------------------------
-step 1307.95
-screendump 20080101_000035_89ad82803f9ec17e4d5d71b08c132ece.ppm
-# add comment
-barrier_2 80 53 171 101 52ce4358332d28e396291ad605ce4c50 64
-# Sending keys: tab tab tab
-key tab
-key tab
-key tab
-# --------------------------------
-step 1310.26
-screendump 20080101_000036_99d7efa79049893982f4130224c72d5a.ppm
-# Sending keys: b l a h ret
-key b
-key l
-key a
-key h
-key ret
diff --git a/client/tests/kvm/steps/Win2003-64-rss.steps b/client/tests/kvm/steps/Win2003-64-rss.steps
deleted file mode 100644
index ad9247c..0000000
--- a/client/tests/kvm/steps/Win2003-64-rss.steps
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated by Step Maker
-# Generated on Sat Aug 8 22:59:51 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 25.16
-screendump 20080101_000001_315f40a7863d9981afc999c525abd698.ppm
-barrier_2 48 13 425 231 4da32ca10d3191bc95eba6552c1e3d4d 180
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 27.98
-screendump 20080101_000002_9c888fc55dbcff4c54b2c8ca9abea561.ppm
-# login
-barrier_2 32 11 469 230 3b7b1974fe99ef2ceee9d49e2885253f 30
-# Sending keys: ret
-key ret
-# --------------------------------
-step 3.89
-screendump 20090808_225955_b71e538f693e411895d125b28764dbe3.ppm
-# reached desktop
-barrier_2 80 56 285 226 33ef5647b80b4cb24ea68221121a6cdb 180
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 15.63
-screendump 20090808_230251_bb4e1f7922b0f4c7dd1ba08633fd2740.ppm
-# run "d:\setuprss"
-barrier_2 263 34 56 306 cd45be08381106e04309bd65f2538571 25
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 3.89
-screendump 20090808_225955_b71e538f693e411895d125b28764dbe3.ppm
-# make sure we're done
-sleep 20
-barrier_2 80 56 285 226 33ef5647b80b4cb24ea68221121a6cdb 90
diff --git a/client/tests/kvm/steps/Win2003-64.steps b/client/tests/kvm/steps/Win2003-64.steps
deleted file mode 100644
index 9a4d3e7..0000000
--- a/client/tests/kvm/steps/Win2003-64.steps
+++ /dev/null
@@ -1,154 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 75760233472)
-# Generated on Mon Dec 15 11:09:35 2008
-# uname -a: Linux pink-nehalem.qa.lab.tlv.redhat.com 2.6.27.5-117.fc10.x86_64 #1 SMP Tue Nov 18 11:58:53 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -cdrom /isos/windows/Windows2003-x64.iso -m 512 -hda /vm/windows2003-64.qcow2 -nographic -monitor unix:/tmp/monitor_75760233472,server,nowait &
-# --------------------------------
-step 48.67
-screendump 20080101_000001_d23c8c97a0b0bd0817829e4ba5586bb9.ppm
-# Windows Server 2003 Welcome
-barrier_2 176 26 5 8 81f701bcc07fdde6579aaeb3301b8c04 243
-# Sending keys: ret
-key ret
-# --------------------------------
-step 50.21
-screendump 20080101_000002_dab2a2e63b2379de041cece733e39306.ppm
-# License
-barrier_2 254 32 5 7 60c0d5a136f20b53b2e6401fee12a39e 8
-# Sending keys: f8
-key f8
-# --------------------------------
-step 51.72
-screendump 20080101_000003_7d125050bfbe85e60db662ad476dfc82.ppm
-# HDD Partitioning
-barrier_2 600 94 17 79 7c230e9711b413f9c29062bb12ae1d86 8
-# Sending keys: ret
-key ret
-# --------------------------------
-step 55.84
-screendump 20080101_000004_3834f6a401372180ecae90eb3b675d5d.ppm
-# HDD Format
-barrier_2 192 62 32 199 3a1da59a2d0d5c1a818e1daa3ba57f9e 21
-# Sending keys: up up ret
-key up
-key up
-key ret
-# --------------------------------
-step 463.68
-screendump 20080101_000005_9aca2d06e58cb532f051f0d62ec10609.ppm
-# Regional & Language Options
-barrier_2 205 19 155 71 b6ee959efba7247f1fe522ba47efadb8 2039
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 464.96
-screendump 20080101_000006_47a37b82731c6130191dbc0563143606.ppm
-# User & Org
-barrier_2 75 49 225 201 b11d0a32a5180b1074c26666f9ced036 6
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 467.14
-screendump 20080101_000007_a8c24c49ec0da7deac930d876a5e52f9.ppm
-# CD-Key
-barrier_2 72 21 177 274 9fe326905e4ce78d21bf2fabf7254fd8 11
-var cdkey
-key ret
-# --------------------------------
-step 474.13
-screendump 20080101_000008_f28b4fe1588659709b79e209d6b32066.ppm
-# Server Licensing
-barrier_2 228 27 227 145 621add6e9a47dbd06a7a75ceea8de860 35
-# Sending keys: ret
-key ret
-# --------------------------------
-step 477.40
-screendump 20080101_000009_47dced7f55b3cea4c66855c397880560.ppm
-# PC name
-barrier_2 97 20 219 199 e23bb0bef972d0b9e442bef69813fcfe 16
-# Sending keys: ret
-key ret
-# --------------------------------
-step 479.52
-screendump 20080101_000010_8e2cf90045f0903e6e26ad737ccb69ab.ppm
-# Weak Password Warning
-barrier_2 321 30 269 191 ed09ffcbb24e10758caba116d7a48cf5 11
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 484.20
-screendump 20080101_000011_33e16e6254e9896602e2f347d61beb81.ppm
-# Date & Time settings
-barrier_2 143 20 156 72 ed2f168ac4df35c0de455f3a401f2e11 23
-# Sending keys: ret
-key ret
-# --------------------------------
-step 590.18
-screendump 20080101_000012_548d686c826c2810803958c70d216b8d.ppm
-# Network Settings
-barrier_2 127 18 155 74 5682815d192212d0817afab4cabf0ee0 300
-# Sending keys: ret
-key ret
-# --------------------------------
-step 594.24
-screendump 20080101_000013_429fd49b57bad17574d960bf579f225d.ppm
-# Workgroup
-barrier_2 69 19 157 73 aad1efc70ff7c143788d5bafd37b9316 20
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1061.57
-screendump 20080101_000014_b38424f45e0149507009594bda92c15e.ppm
-# Windows Login (GINA)
-barrier_2 168 26 165 210 b7342c534ffda9ff052044c9722ed212 900
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 1064.07
-screendump 20080101_000015_cf0311622a4b1beaef85c0ca0363b608.ppm
-# Windows Login (GINA) 2
-barrier_2 65 24 120 220 d1250d746318781164fb25437370f1b1 13
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1077.51
-screendump 20080101_000016_4ed0f5b690ece61731f56883df60bbe0.ppm
-# Windows 2003 Desktop
-barrier_2 30 34 2 441 0a55f7afacdfef5eccdd11646abce2b6 67
-# Sending keys: 0xdc
-key 0xdc
-# --------------------------------
-step 1081.26
-screendump 20080101_000017_defe197bc5b379b442c5bbbf9fe649f1.ppm
-# Windows 2003 Start Menu Opened
-barrier_2 118 73 209 68 7c9eca05f228fe133007bffb22e14a0c 19
-# Sending keys: u
-key u
-# --------------------------------
-step 1082.84
-screendump 20080101_000018_a94ffa747e87753af749592521d77e66.ppm
-# Windows 2003 Shutdown
-barrier_2 58 8 184 134 20537c177472d1add47a6ff7cca79ddb 8
-# Sending keys: tab tab tab m y c o m m e n t
-key tab
-key tab
-key tab
-key m
-key y
-key c
-key o
-key m
-key m
-key e
-key n
-key t
-# --------------------------------
-step 1086.79
-screendump 20080101_000019_e70d3746292e81f01fa840424a941d31.ppm
-# Windows 2003 Shutdown OK
-barrier_2 40 53 291 416 7596f2b8871430884aaadbc3d3f96f43 20
-# Sending keys: ret
-key ret
diff --git a/client/tests/kvm/steps/Win2008-32-rss.steps b/client/tests/kvm/steps/Win2008-32-rss.steps
deleted file mode 100644
index 0194dad..0000000
--- a/client/tests/kvm/steps/Win2008-32-rss.steps
+++ /dev/null
@@ -1,49 +0,0 @@
-# --------------------------------
-step 40.51
-screendump 20080101_000001_7a0db57f6d01f839e830c034906e18ba.ppm
-barrier_2 470 64 167 217 6315f1c924edab4bff73403959131051 203
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 44.89
-screendump 20080101_000002_b48665cc639417d1c0534b06eff5afdb.ppm
-barrier_2 50 16 296 393 cebca0ab4704c6f674987b582e400c5f 22
-# Sending keys: 1 q 2 w 3 e shift-p ret
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key ret
-# --------------------------------
-step unknown
-screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
-barrier_2 46 45 375 290 b31d69288fc8d8b7661cfe5d5c93c117 292
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 132.34
-screendump 20080101_000010_fbb85586d6ae0a031d6eea173e3fd940.ppm
-# run "d:\setuprss"
-barrier_2 35 60 268 387 ba4f5d1fd4282cac4f6bb93b8adb2911 12
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 175.40
-screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
-# all done!
-sleep 20
-barrier_2 53 48 369 289 17a327dc76e1e0b26a69350bbe31f2d6 90
diff --git a/client/tests/kvm/steps/Win2008-32-setupssh.steps b/client/tests/kvm/steps/Win2008-32-setupssh.steps
deleted file mode 100644
index 67db2a5..0000000
--- a/client/tests/kvm/steps/Win2008-32-setupssh.steps
+++ /dev/null
@@ -1,83 +0,0 @@
-# Generated by stepmaker version 20090119
-# Generated on Thu Jan 22 17:09:04 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# -------- Step 1 recorded at time 18.99 --------
-# press CTRL+ALT+DELETE to log on
-barrier_2 467 63 157 218 e0bd6f85f96fbcd32abd5bc2982a3a71 95
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# -------- Step 2 recorded at time 23.52 --------
-# login (password)
-barrier_2 49 14 301 394 c75db1ff5a7b9a8c757ce590857ae331 23
-# Sending keys: 1 q 2 w 3 e shift-p ret
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key ret
-# -------- Step 5 recorded at time 74.87 --------
-barrier_2 740 51 53 27 e107f97cff0f96b6dd088ac4fa2ca6e5 60
-# Sending keys: ctrl-esc
-key ctrl-esc
-# -------- Step 6 recorded at time 76.07 --------
-barrier_2 108 65 260 359 fafa2b021ede33d7efb6e229d5d09626 10
-# Sending keys: tab up up
-key tab
-key up
-key up
-# -------- Step 7 recorded at time 79.06 --------
-barrier_2 54 20 261 398 be825f592a0e73095e4c4c7e46814e8e 15
-# Sending keys: ret
-key ret
-# -------- Step 8 recorded at time 81.28 --------
-# run "d:\setup"
-barrier_2 52 59 297 427 8a7a42af96074ee353bb15d33d592013 11
-# Sending keys: d shift-0x27 0x2b s e t u p ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key ret
-# -------- Step 9 recorded at time 92.74 --------
-# openssh setup
-barrier_2 107 53 449 418 24c98cf3bed42722e425413835de1329 57
-# Sending keys: ret
-key ret
-# -------- Step 10 recorded at time 94.25 --------
-# license
-barrier_2 82 41 164 377 fa8efbeecf56ee455a651e8d72c58b90 8
-# Sending keys: alt-a
-key alt-a
-# -------- Step 11 recorded at time 96.69 --------
-barrier_2 390 99 166 374 d5cdd8611c8f67b5f16a70d4a914ceae 12
-# Sending keys: ret
-key ret
-# -------- Step 12 recorded at time 98.21 --------
-barrier_2 106 227 451 244 9efb03fcfd6f3090687ea8f24aa47f55 8
-# Sending keys: ret
-key ret
-# -------- Step 13 recorded at time 100.06 --------
-barrier_2 104 173 453 300 967622edb621dc5dbea447277172fcfd 9
-# Sending keys: ret
-key ret
-# -------- Step 14 recorded at time 101.58 --------
-barrier_2 92 36 464 435 be7e0c10b0bfdbc1d6ea085eaa9d19b5 8
-# Sending keys: ret
-key ret
-# -------- Step 15 recorded at time 108.15 --------
-barrier_2 111 86 494 305 049635cb649c0ed661f329f3d3cff087 33
-# Sending keys: ret
-key ret
-# -------- Step 16 recorded at time 109.72 --------
-barrier_2 174 59 382 414 8ac57ae1bf1d20afdbf533cc6afd6011 8
-# Sending keys: ret
-key ret
-# -------- Step 17 recorded at time 143.90 --------
-barrier_2 99 26 301 405 02c115c2cf348fb2496d549fd58b65c2 171
diff --git a/client/tests/kvm/steps/Win2008-32-setuptelnet.steps b/client/tests/kvm/steps/Win2008-32-setuptelnet.steps
deleted file mode 100644
index abf8a48..0000000
--- a/client/tests/kvm/steps/Win2008-32-setuptelnet.steps
+++ /dev/null
@@ -1,86 +0,0 @@
-# Generated by stepmaker version 20090119
-# Generated on Tue Feb 3 12:52:06 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-92.1.17.el5 #1 SMP Wed Oct 22 04:19:38 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 40.51
-screendump 20080101_000001_7a0db57f6d01f839e830c034906e18ba.ppm
-barrier_2 470 64 167 217 6315f1c924edab4bff73403959131051 203
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 44.89
-screendump 20080101_000002_b48665cc639417d1c0534b06eff5afdb.ppm
-barrier_2 50 16 296 393 cebca0ab4704c6f674987b582e400c5f 22
-# Sending keys: 1 q 2 w 3 e shift-p ret
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key ret
-# --------------------------------
-step unknown
-screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
-barrier_2 46 45 375 290 b31d69288fc8d8b7661cfe5d5c93c117 292
-# --------------------------------
-step unknown
-screendump 20080101_000004_50cdcf315b19d33afb9db50d372cceb6.ppm
-barrier_2 135 24 51 7 a0df7c7658bb84b525c7da8276009b01 10 optional
-# Sending keys: alt-tab
-key alt-tab
-# --------------------------------
-step 103.36
-screendump 20080101_000005_b03322eea7573df6376dc46e1a4a3e40.ppm
-barrier_2 632 71 52 8 b7e1634f43b8946c38a310d3f22f6d40 32
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 115.07
-screendump 20080101_000006_f129917ff4d5a7601d0e835630c094f0.ppm
-barrier_2 148 31 27 11 c8d63f1f7ccb1b773369d69b8287c9b5 59
-# Sending keys: alt-f4
-key alt-f4
-# --------------------------------
-step 121.83
-screendump 20080101_000007_11a5b0ab13bcd2c799139d83a169fe1e.ppm
-barrier_2 101 69 353 275 55ee19bee94485dcb43f7aa885860573 34
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 126.14
-screendump 20080101_000008_a57c3b5af1ba282a60dac288215fed8a.ppm
-# start menu open; run setup
-barrier_2 66 25 259 396 571555d937fa806c5c70f3d1b9429918 22
-# Sending keys: shift-tab shift-tab shift-tab shift-tab
-key shift-tab
-key shift-tab
-key shift-tab
-key shift-tab
-# --------------------------------
-step 129.89
-screendump 20080101_000009_2e58fa03765a27441698397b17aa31e5.ppm
-barrier_2 47 22 262 397 b589a14b70828ce81e46f0a33736a2b1 19
-# Sending keys: ret
-key ret
-# --------------------------------
-step 132.34
-screendump 20080101_000010_fbb85586d6ae0a031d6eea173e3fd940.ppm
-# run "d:\setup"
-barrier_2 77 64 235 387 33f079c1edafedae18ef5275408d3ed2 12
-# Sending keys: d shift-0x27 0x2b s e t u p ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key ret
-# --------------------------------
-step 175.40
-screendump 20080101_000011_f0d6bdc0d1b7b0ca8b5740d0910a1051.ppm
-# all done!
-barrier_2 268 140 272 234 b9ee1abcff1420a287218902dbc0d5fb 215
diff --git a/client/tests/kvm/steps/Win2008-32.steps b/client/tests/kvm/steps/Win2008-32.steps
deleted file mode 100644
index 9b80d57..0000000
--- a/client/tests/kvm/steps/Win2008-32.steps
+++ /dev/null
@@ -1,139 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 174315210083)
-# Generated on Mon Dec 15 15:48:27 2008
-# uname -a: Linux pink-intel.qa.lab.tlv.redhat.com 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -cdrom /isos/windows/Windows2008-32-bit.iso -hda /vm/win2008-32-mytest.qcow2 -m 512 -nographic -monitor unix:/tmp/monitor_174315210083,server,nowait &
-# --------------------------------
-step 55.30
-screendump 20080101_000001_f7b5fa5f16be4e8c70b5c66f6190d174.ppm
-# Windows Server 2008 Welcome
-barrier_2 235 87 468 432 901754ad92bf482c9ad2a99b5a2a4a65 276
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 57.43
-screendump 20080101_000002_1b0617fddb82b759979a57daf194ede2.ppm
-# Windows Server 2008 Welcome 2
-barrier_2 53 61 430 270 54efa11e8549d2dd590a5a848b2800eb 11
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 94.61
-screendump 20080101_000003_1598a3d3e82d15605f926993ce96607d.ppm
-# Windows Server 2008 Edition (Datacenter)
-barrier_2 159 78 118 121 2aa8c32e399dc7fd29a37e3f5bd2f3b7 186
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 96.55
-screendump 20080101_000004_29640d0bb90061f1724a1920eed88886.ppm
-# Windows Server 2008 Edition (Datacenter) 2
-barrier_2 188 74 119 128 1c0c48e19d64f91044d67a30f125f197 10
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 99.68
-screendump 20080101_000005_dff71cc2748eac7d4aebc7a783083b11.ppm
-# License
-barrier_2 173 22 117 417 9dd593a9c9cb9eb330c5bb0550f0f0bb 16
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 100.75
-screendump 20080101_000006_73f9407ab72c0dd79746432f6cc0c399.ppm
-# License 2
-barrier_2 172 34 119 408 d5673358da49f6d8418ccb691f50a641 5
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 102.67
-screendump 20080101_000007_54bd914bcda88c737452b727adb37070.ppm
-# Install type (custom)
-barrier_2 136 17 196 220 67ea9e8ee3062f13fbfa1aa25327fd45 10
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 139.58
-screendump 20080101_000008_b872cee3ff340da4b9e361ae8b1e0f37.ppm
-# HDD Partitioning
-barrier_2 210 137 493 351 6284983cd22816c41b9bbf659002f6dd 185
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1279.21
-screendump 20080101_000009_9ac5497a8584aa1c1a16d0492f83352e.ppm
-# After install - User password
-barrier_2 431 42 179 394 11dd8e9279f45d393a998f176fb4a2ba 3600
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1281.94
-screendump 20080101_000010_1dfb1d7e8ea6f59cb6feb98bfdd0fa64.ppm
-# Admin Password
-barrier_2 86 18 292 347 739d6b98b9b81ab7237c1bdb33fd62ee 14
-# Sending keys: 1 q 2 w 3 e shift-p tab 1 q 2 w 3 e shift-p ret
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key tab
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key ret
-# --------------------------------
-step 1291.76
-screendump 20080101_000011_5bde035897738caeaf82e35d361a9b56.ppm
-# Admin Password changed
-barrier_2 193 38 301 410 ec50b0570b24b2cef0b407d74eb23755 49
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1353.58
-screendump 20080101_000012_8d16a062ac04e3cba3c19a65ef6bffa8.ppm
-# Windows 2008 Desktop
-barrier_2 27 35 0 565 6200d024e47a250768eb421367230e66 300
-# Sending keys: 0xdc
-key 0xdc
-# --------------------------------
-step 1357.47
-screendump 20080101_000013_c6022a18053487c73ab54137468b5a03.ppm
-# Windows 2008 Start Menu Opened
-barrier_2 41 12 35 545 37a9c06221d57350db82303ef1d6e3e4 19
-# Sending keys: tab tab right right
-key tab
-key tab
-key right
-key right
-# --------------------------------
-step 1360.03
-screendump 20080101_000014_6ff37b0bfe7220e8941406b09986053a.ppm
-# Windows 2008 Shutdown
-barrier_2 38 12 361 546 d973dae54b2330575e0ae0e73bbf4b69 13
-# Sending keys: u
-key u
-# --------------------------------
-step 1363.95
-screendump 20080101_000015_022cdcfeaacfc59fc8cb24ccaa323132.ppm
-# Windows 2008 Shutdown (planned)
-barrier_2 77 23 446 225 64a437d899d8df3e7498f49094c88864 20
-# Sending keys: tab tab m y c o m m e n t ret
-key tab
-key tab
-key m
-key y
-key c
-key o
-key m
-key m
-key e
-key n
-key t
-key ret
diff --git a/client/tests/kvm/steps/Win2008-64-rss.steps b/client/tests/kvm/steps/Win2008-64-rss.steps
deleted file mode 100644
index 0a72885..0000000
--- a/client/tests/kvm/steps/Win2008-64-rss.steps
+++ /dev/null
@@ -1,52 +0,0 @@
-# --------------------------------
-step 40.51
-screendump 20080101_000001_7a0db57f6d01f839e830c034906e18ba.ppm
-# (screendump taken from Win2008.32)
-barrier_2 61 56 379 287 40a28652310261533c6018439c58fb15 203
-# Sending keys: ctrl-alt-delete
-key ctrl-alt-delete
-# --------------------------------
-step 44.89
-screendump 20080101_000002_b48665cc639417d1c0534b06eff5afdb.ppm
-# (screendump taken from Win2008.32)
-barrier_2 44 33 418 385 c68f71048c2fc84e82ed7fa84abe62a3 22
-# Sending keys: 1 q 2 w 3 e shift-p ret
-key 1
-key q
-key 2
-key w
-key 3
-key e
-key shift-p
-key ret
-# --------------------------------
-step unknown
-screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
-# (screendump taken from Win2008.32)
-barrier_2 46 45 375 290 b31d69288fc8d8b7661cfe5d5c93c117 292
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 132.34
-screendump 20080101_000010_fbb85586d6ae0a031d6eea173e3fd940.ppm
-# run "d:\setuprss" (screendump taken from Win2008.32)
-barrier_2 37 34 313 431 1a110a076ce7a418294c007fa9070eee 12
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 175.40
-screendump 20080101_000003_50cdcf315b19d33afb9db50d372cceb6.ppm
-# all done! (screendump taken from Win2008.32)
-sleep 20
-barrier_2 53 48 369 289 17a327dc76e1e0b26a69350bbe31f2d6 90
diff --git a/client/tests/kvm/steps/Win2008-64.steps b/client/tests/kvm/steps/Win2008-64.steps
deleted file mode 100644
index e9e23be..0000000
--- a/client/tests/kvm/steps/Win2008-64.steps
+++ /dev/null
@@ -1,105 +0,0 @@
-# Generated by stepmaker 20081103 (instance: 98979202257)
-# Generated on Mon Nov 10 13:41:18 2008
-# Modified on Thu Nov 13 2008
-# uname -a: Linux pink-intel 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda ./Windows2008-x64-test.qcow2 -m 512 -cdrom /isos/windows/Windows2008-x64.iso -monitor unix:/tmp/monitor_98979202257,server,nowait -vnc :0 &
-# --------------------------------
-step 38.25
-screendump 20080101_000001_f8c302b90bb107f7d74a184d496bf92e.ppm
-# Install Windows 2008
-barrier_2 415 172 87 64 1004a9d0533fd25bfbde1bde9ef9cadd 191
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 42.57
-screendump 20080101_000002_d2ae2f0c68a9fb7c016b5d3015ebefa2.ppm
-# Install Windows 2008
-barrier_2 212 90 285 155 8998d9217c8c7f54db404f62571750f9 22
-key alt-i
-# --------------------------------
-step 111.16
-screendump 20080101_000003_9e1ca73f507e124acd10d29a8a0c3b9f.ppm
-# Select Edition (Datacenter)
-barrier_2 329 172 120 80 add41ee88018b81e5ce6225c717537c9 343
-key down
-key down
-key alt-n
-# --------------------------------
-step 115.28
-screendump 20080101_000004_289dfb0fa2b4ef0a879d4716fc08164c.ppm
-# License
-barrier_2 243 26 114 85 25714ad1d2525f2480d735135e0714cf 21
-key alt-a
-# --------------------------------
-step 120.18
-screendump 20080101_000005_bebb500768127de4f72af2ccb55b3ce3.ppm
-# License 2
-barrier_2 588 76 114 412 3c338a74000bad602968e7921cd5095c 24
-key alt-n
-# --------------------------------
-step 125.46
-screendump 20080101_000006_029b94eef13014d23e18f9c8b146a333.ppm
-# Type of Install (Custom)
-barrier_2 308 32 102 77 a780562c808033778f09eb1ca902e825 26
-key alt-c
-# --------------------------------
-step 136.15
-screendump 20080101_000007_e0597c70810cb3ebb2a318c0afbb0af2.ppm
-# HDD Partitioning
-barrier_2 303 24 113 85 e6d27fbc9662befc8453bda6db9d3e71 53
-key alt-n
-# --------------------------------
-step 1673.70
-screendump 20080101_000008_e3e45fbbb8c888adf512771ad73d3801.ppm
-# User Password
-barrier_2 484 167 151 368 b54c23fad3136775ec5c37dc51c83e4f 7200
-key ret
-# --------------------------------
-step 1679.51
-screendump 20080101_000009_28b9578abf26802854f522f0d18730d8.ppm
-# Admin Password
-#barrier_2 184 121 316 304 c8440e899896140ea1f814a1c144b24b 29
-barrier_2 107 17 291 379 b46876036f31846d61349be207523348 29
-var passwd
-key tab
-var passwd
-key ret
-# --------------------------------
-step 1686.00
-screendump 20080101_000010_9bb10ecc6eb609bab1063e527cafd81a.ppm
-# Password
-barrier_2 224 104 287 408 b71c055897bca48b49a338ae04e60324 32
-key ret
-# --------------------------------
-step 1732.47
-screendump 20080101_000011_b8ee0f8e288f7dd443605e0cf5d91c61.ppm
-# Desktop reached
-barrier_2 49 16 2 579 5bfe5b0a9fa7648373e9ad84d3119a5d 232
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 1732.47
-screendump 20090809_051015_fbb85586d6ae0a031d6eea173e3fd940.ppm
-# Shutdown (screendump taken from Win2008.32)
-barrier_2 38 35 312 430 684748292c757ae5eb7bf4299df70171 10
-# Sending keys: s h u t d o w n spc slash s spc slash f spc slash t spc 0 ret
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key slash
-key s
-key spc
-key slash
-key f
-key spc
-key slash
-key t
-key spc
-key 0
-key ret
diff --git a/client/tests/kvm/steps/Win7-64-rss.steps b/client/tests/kvm/steps/Win7-64-rss.steps
deleted file mode 100644
index 60cdf3f..0000000
--- a/client/tests/kvm/steps/Win7-64-rss.steps
+++ /dev/null
@@ -1,121 +0,0 @@
-# Generated by Step Maker
-# Generated on Fri Oct 9 12:19:22 2009
-# uname -a: Linux freedom 2.6.30.8-64.fc11.x86_64 #1 SMP Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 68.16
-screendump 20091009_122030_126edf17af893d63770a35b065ad9684.ppm
-# Full desktop reached
-barrier_2 204 20 394 569 5806a5dcc7f62a613257615904c52379 341
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 71.95
-screendump 20091009_122059_8d427a5f279dc8ae959e7de8ecb714d3.ppm
-# Open explorer on CDROM
-barrier_2 167 24 346 566 0ef2b2c38edceb443e25bc046a7484ff 18
-# Sending keys: d shift-0x27 0x2b ret
-key d
-key shift-0x27
-key 0x2b
-key ret
-# --------------------------------
-step 78.35
-screendump 20091009_122153_31bf8cb7ef6dc512627e7fcb904cd9e3.ppm
-barrier_2 189 21 374 570 cdbd57fb3e8b40d75c8efe8306ad8c67 27
-# Sending keys: ret
-key ret
-# --------------------------------
-step 85.00
-screendump 20091009_122208_7cccc3cbc6d27b0c9efa4a4d0f63008f.ppm
-# Choose setuprss on file manager
-barrier_2 157 20 396 569 1361ffa0712e61215804b2e2e5a5c7c4 32
-# Sending keys: down down down down down down down
-key down
-key down
-key down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 89.28
-screendump 20091009_122238_9ff5d6fe3a35b0a7cd0fe6adf4fde72e.ppm
-# Open right mouse click menu
-barrier_2 119 19 411 572 4e9ca5a404d1ab5df09a45f4a9733b3c 14
-# Sending keys: shift-f10
-key shift-f10
-# --------------------------------
-step 99.69
-screendump 20091009_122308_be27990919459a1ed090c74366f01828.ppm
-# Choose run as administrator
-barrier_2 132 19 374 568 b434b688de3177c65aafb8e1d589efdb 51
-# Sending keys: down down down down
-key down
-key down
-key down
-key down
-# --------------------------------
-step 103.73
-screendump 20091009_122331_46789aa2a09e35b81bf2c3501b3cecd5.ppm
-# Go for it
-barrier_2 146 25 351 566 8c7cf5bbbfc13bfc33ed4f1adf9f5de8 15
-# Sending keys: ret
-key ret
-# --------------------------------
-step 116.13
-screendump 20091009_122353_46ef6f6206c77f5769135843d83d1072.ppm
-barrier_2 146 23 343 569 77cde7c97517921a4552e50f56c7d3f0 61
-# Sending keys: tab tab
-key tab
-key tab
-# --------------------------------
-step 118.68
-screendump 20091009_122403_00c5eea0156c28529cfc0d6eaf04bad5.ppm
-barrier_2 185 23 332 570 eed8e4f0defad1bbad5304e13d028176 10
-# Sending keys: tab
-key tab
-# --------------------------------
-step 121.04
-screendump 20091009_122413_8f255650dc2c7a02b4300c4afb26aa72.ppm
-barrier_2 182 21 325 569 071cdab9fb85e618a960bcfd715377cd 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 139.18
-screendump 20091009_122446_a66159376c4ce1a58ccc9649867709eb.ppm
-barrier_2 114 21 395 570 b4361d16d8ff7de8b9e751f816a92fe5 90
-# Sending keys: alt+f4
-key alt+f4
-# --------------------------------
-step 143.81
-screendump 20091009_122446_a66159376c4ce1a58ccc9649867709eb.ppm
-# call exec
-barrier_2 121 27 433 566 f5f1b81e0c5eb28a6ff6446873b43138 22
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 149.24
-screendump 20091009_122620_750644b17fcca13bc20fceb876821ebf.ppm
-sleep 5
-barrier_2 86 20 469 569 ed4e8e74a2c641b7778fc482790848d2 26
-# Sending keys: s h u t d o w n spc slash s spc slash f spc slash t spc 0 ret
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key slash
-key s
-key spc
-key slash
-key f
-key spc
-key slash
-key t
-key spc
-key 0
-key ret
diff --git a/client/tests/kvm/steps/Win7-64.steps b/client/tests/kvm/steps/Win7-64.steps
deleted file mode 100644
index ee9d2b5..0000000
--- a/client/tests/kvm/steps/Win7-64.steps
+++ /dev/null
@@ -1,187 +0,0 @@
-# Generated by Step Maker
-# Generated on Thu Oct 8 11:26:50 2009
-# uname -a: Linux freedom 2.6.30.8-64.fc11.x86_64 #1 SMP Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 28.78
-screendump 20091006_141238_3057dcf031c3dfd2468a12fd7b6090f4.ppm
-# Initial screen
-barrier_2 223 131 291 138 c497b54e51a5742cb1121c2fce59ee75 144
-# Sending keys: tab tab tab ret
-key tab
-key tab
-key tab
-key ret
-# --------------------------------
-step 32.13
-screendump 20091006_142123_f8b055c0e526d77e81347352b34f2cc2.ppm
-# Install now
-barrier_2 213 127 296 137 0368e2f071d6b27ffa58b2cfce555d50 12
-# Sending keys: ret
-key ret
-# --------------------------------
-step 52.67
-screendump 20091006_142209_1e8e0575e08325cde87465fc7c7244ca.ppm
-# License agreement
-barrier_2 258 32 104 81 a503fa556aaebdccf5b5c985bcb9d3cb 102
-# Sending keys: spc tab ret
-key spc
-key tab
-key ret
-# --------------------------------
-step 55.79
-screendump 20091006_144429_32f79dedc8fb483261e97f9f9e37e1a1.ppm
-# Custom install
-barrier_2 296 41 119 75 b6b03a123ecf0850d36ee6392eabfe2d 12
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 61.04
-screendump 20091006_144459_fc54578a99d23b88333d0eace1f18205.ppm
-# Disk setup
-barrier_2 325 43 111 77 9e289cd7c1194efa40efdb43680e6540 24
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1493.86
-screendump 20091006_151248_fe2afaa324427608c3ac56163ebf7e9b.ppm
-# Username
-barrier_2 245 61 219 173 96efd46410b8cdd75fc63b50767240bf 7163
-# Sending keys: u s e r tab tab ret
-key u
-key s
-key e
-key r
-key tab
-key tab
-key ret
-# --------------------------------
-step 1498.71
-screendump 20091008_115352_71e62396870216bbd96bf157ca9b32a1.ppm
-# Password screen
-barrier_2 240 33 136 125 9ac832bef2bd1c48783a9ab53033394c 16
-# Sending keys: var passwd tab var passwd tab h i n t tab ret
-key var
-key passwd
-key tab
-key var
-key passwd
-key tab
-key h
-key i
-key n
-key t
-key tab
-key ret
-# --------------------------------
-step 1505.31
-screendump 20091008_115655_e603625ba5cfeb45e647f6efa1de5195.ppm
-# CD key
-barrier_2 259 34 129 125 e4e0e77830739bf8a556cea8cfdb346d 20
-# Sending keys: var cdkey tab tab ret
-key var
-key cdkey
-key tab
-key tab
-key ret
-# --------------------------------
-step 1511.18
-screendump 20091008_115853_4fdbc3ffe3293743239a81796ba8a0b6.ppm
-barrier_2 266 35 124 124 fa13542c12a3f3ba2b0c660dcf5dc4ac 24
-# Sending keys: alt+f4
-key alt+f4
-# --------------------------------
-step 1518.62
-screendump 20091008_115853_4fdbc3ffe3293743239a81796ba8a0b6.ppm
-barrier_2 266 32 127 124 15573a6a5679ab805265b06f92141f5a 36
-# Sending keys: esc
-key esc
-# --------------------------------
-step 1523.08
-screendump 20091008_120111_cc2e0cd9a72793e3fcddb7f494a246d0.ppm
-barrier_2 247 42 130 117 af29dd300f881f28f5e3706aca4fdb1e 21
-# Sending keys: tab tab ret
-key tab
-key tab
-key ret
-# --------------------------------
-step 1529.22
-screendump 20091008_120152_f8342b8812dba0e195834ec892048165.ppm
-barrier_2 479 33 132 124 71a7784af46b0aa7e414a887696c7469 27
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1537.58
-screendump 20091008_120213_3ffb0119b344026baba11e195aa7f20a.ppm
-# Time zone
-barrier_2 276 37 132 121 348adc44bb7b646bd43ca88c961fd99d 41
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1549.54
-screendump 20091008_120240_b9b68e66a5f357a96cede06d75eecf92.ppm
-# Choose nw
-barrier_2 301 33 133 127 7d93ea8ec144c1d1e9d5cd550cb0fb47 59
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 1556.86
-screendump 20091008_120307_19b608d6f6fe76c5102383a431073710.ppm
-barrier_2 278 47 128 118 0ccbdfe0db0ce66c7e08e8a4a0c17189 34
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1569.68
-screendump 20091008_120405_be6c767f63280ffe9a849762f99cc607.ppm
-barrier_2 295 34 130 122 4168f786d2df6907eba53de14b8ef04d 63
-# Sending keys: tab alt-n
-key tab
-key alt-n
-# --------------------------------
-step 1574.37
-screendump 20091008_120423_8ff37adb0aae6fe37fd45bb49f382421.ppm
-barrier_2 326 43 124 119 966661e5d43098bc8232004265255d40 21
-# Sending keys: tab alt-n
-key tab
-key alt-n
-# --------------------------------
-step 1577.79
-screendump 20091008_120446_c79e259c6edb991f032263bca9c1c289.ppm
-barrier_2 308 32 122 122 a64bda6d86d4ba8f219cc4751bc6da01 15
-# Sending keys: tab ret
-key tab
-key ret
-# --------------------------------
-step 1664.72
-screendump 20091008_120640_077bf3e02c8b9fd723558e0ba32fb88f.ppm
-# Desktop reached
-barrier_2 166 22 391 568 35580e686a5485450714ebcdb7178b7e 432
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 1671.01
-screendump 20091008_121857_af7ead153110c1220828490b5e89b33d.ppm
-sleep 10
-barrier_2 134 19 457 571 040eb9fb0b71cf5e21b692e0c5d506e1 30
-# Sending keys: s h u t d o w n spc slash s spc slash f spc slash t spc 0 ret
-key s
-key h
-key u
-key t
-key d
-key o
-key w
-key n
-key spc
-key slash
-key s
-key spc
-key slash
-key f
-key spc
-key slash
-key t
-key spc
-key 0
-key ret
diff --git a/client/tests/kvm/steps/WinVista-32-rss.steps b/client/tests/kvm/steps/WinVista-32-rss.steps
deleted file mode 100644
index 8d0aa4d..0000000
--- a/client/tests/kvm/steps/WinVista-32-rss.steps
+++ /dev/null
@@ -1,53 +0,0 @@
-# Generated by Step Maker
-# Generated on Tue Nov 3 14:17:33 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 87.91
-screendump 20091103_141901_8a894eeeb57395c0c148677922cfe404.ppm
-# Reached welcome screen
-barrier_2 82 26 336 249 695dc13173329b155e7ec6f7051ec59e 440
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 92.37
-screendump 20091103_141944_86b166a4d5d978c271b2d27015032738.ppm
-# Open d:\ in a file browser
-barrier_2 36 59 225 428 2ceabcaf10d637b6f6c82309d70972a1 21
-# Sending keys: d shift-0x27 0x2b ret
-key d
-key shift-0x27
-key 0x2b
-key ret
-# --------------------------------
-step 97.15
-screendump 20091103_142130_1136501f2ac6c8a1e8bcabda42b34126.ppm
-# Select setuprss.bat
-barrier_2 86 20 170 468 cf5e40c2969c78d266c3d05aacd628c5 19
-# Sending keys: s e t u p r s s menu
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key menu
-# --------------------------------
-step 103.84
-screendump 20091103_142159_45c9e2fe113811477bba4408c6abb96e.ppm
-# Run as administrator
-sleep 15
-# Sending keys: a
-key a
-# --------------------------------
-step 108.32
-screendump 20091103_142215_419d87101ea2204c7eb2f7a997b4792a.ppm
-# Continue
-barrier_2 31 42 462 316 52bc2803827bd4b931bc44a693f81763 90
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 116.77
-screendump 20091103_142350_c002f223bec9032582be98c095440550.ppm
-sleep 20
diff --git a/client/tests/kvm/steps/WinVista-64-rss.steps b/client/tests/kvm/steps/WinVista-64-rss.steps
deleted file mode 100644
index 51cd03e..0000000
--- a/client/tests/kvm/steps/WinVista-64-rss.steps
+++ /dev/null
@@ -1,53 +0,0 @@
-# Generated by Step Maker
-# Generated on Tue Nov 3 12:54:21 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 66.30
-screendump 20091103_125527_8c5790d596d390e608546b8fde43723a.ppm
-# Reached welcome screen
-barrier_2 105 26 323 248 372eed00e7cf592abd9449ab9a206805 332
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 72.79
-screendump 20091103_125556_a0481b7af349009d81956062e1027060.ppm
-# Open d:\ in a file browser
-barrier_2 31 60 234 429 7b73df710244d1da8442869ff838d202 31
-# Sending keys: d shift-0x27 0x2b ret
-key d
-key shift-0x27
-key 0x2b
-key ret
-# --------------------------------
-step 78.94
-screendump 20091103_125716_65a3f5e9b42d3abec7df1614a676230f.ppm
-# Select setuprss.bat
-barrier_2 47 19 172 468 1f4ad0e4e2d2226e9c3f0f71a847bf92 26
-# Sending keys: s e t u p r s s menu
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key menu
-# --------------------------------
-step 85.08
-screendump 20091103_130006_6f30a7856188691661ea1d1aa39ddf29.ppm
-# Run as administrator
-sleep 15
-# Sending keys: a
-key a
-# --------------------------------
-step 90.72
-screendump 20091103_130053_355335e40dcdb7858a99144e0847d8a3.ppm
-# Continue
-barrier_2 36 40 468 317 53db55cefd8f209788aea1f3221a6339 90
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 103.87
-screendump 20091103_130135_4b39cf719107dfc4c2ba0be47c200640.ppm
-sleep 20
diff --git a/client/tests/kvm/steps/WinXP-32-rss.steps b/client/tests/kvm/steps/WinXP-32-rss.steps
deleted file mode 100644
index 8adc8f5..0000000
--- a/client/tests/kvm/steps/WinXP-32-rss.steps
+++ /dev/null
@@ -1,31 +0,0 @@
-# --------------------------------
-step 24.72
-screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
-# desktop reached -- run command
-barrier_2 47 49 392 292 09453beafc5f60b6dcb9af1b27339ca1 124
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 29.87
-screendump 20080101_000003_3978b6f6e3cd2d7c4c4caaf6e1e35330.ppm
-# run "d:\setuprss"
-barrier_2 43 103 266 426 c5dc4e4ac4c50a90f35399cc126232ed 30
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 64.82
-screendump 20080101_000012_eccf0a634b6fc479327cf9cc165da7ae.ppm
-# done
-sleep 20
-barrier_2 92 133 395 244 ccda184de1b1d68eb091e2950792cb2f 90
diff --git a/client/tests/kvm/steps/WinXP-32-setupssh.steps b/client/tests/kvm/steps/WinXP-32-setupssh.steps
deleted file mode 100644
index ebb665f..0000000
--- a/client/tests/kvm/steps/WinXP-32-setupssh.steps
+++ /dev/null
@@ -1,98 +0,0 @@
-# Generated by stepmaker version 20090112
-# Generated on Sat Jan 17 13:42:41 2009
-# uname -a: Linux moof 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
-# --------------------------------
-step 24.72
-screendump 20080101_000001_5965948293222a6d6f3e545db40c23c1.ppm
-# 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
-# --------------------------------
-step 26.92
-screendump 20080101_000002_aa64609cbeeb8a008e71f5be8fe048e1.ppm
-# run...
-barrier_2 121 57 198 451 d7442cc8b482050cef14f26309f5b14b 11
-# Sending keys: r
-key r
-# --------------------------------
-step 29.87
-screendump 20080101_000003_3978b6f6e3cd2d7c4c4caaf6e1e35330.ppm
-# run "d:\setup"
-barrier_2 223 54 117 498 35813856dc83da58b6c136988eee27a2 15
-# Sending keys: d shift-0x27 0x2b s e t u p ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key ret
-# --------------------------------
-step 38.07
-screendump 20080101_000004_20613e1794e587f7fe8732cadb764d23.ppm
-# next
-barrier_2 113 56 443 415 a275dfe09dd3b6cc34df843bb04761ff 41
-# Sending keys: ret
-key ret
-# --------------------------------
-step 40.00
-screendump 20080101_000005_286cd32f4890ee2bd3f2bd0e81f48678.ppm
-# license
-barrier_2 92 42 165 379 e5716e71016d2e11553eeca830a097b1 10
-# Sending keys: alt-a
-key alt-a
-# --------------------------------
-step 41.78
-screendump 20080101_000006_20c0fb67bf89ee694cb50b9791961c5a.ppm
-barrier_2 388 93 167 379 73c024adb966dff45cae1f431d1da880 9
-# Sending keys: ret
-key ret
-# --------------------------------
-step 43.73
-screendump 20080101_000007_d915ab1707012859028a0747a8cbc161.ppm
-# choose components
-barrier_2 117 168 439 304 1f84cb325a5e1ddb57d4c10d16873c20 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 47.80
-screendump 20080101_000008_e89b46eb9d6dbcf4f2ea75e84572a92c.ppm
-# destination folder
-barrier_2 116 135 439 336 9f1f72ea9a1c186e7caf3b17e5279967 20
-# Sending keys: ret
-key ret
-# --------------------------------
-step 49.71
-screendump 20080101_000009_ba6a4bdfff3d2ed0f4897c7f0e8db3e2.ppm
-# start menu folder
-barrier_2 165 66 391 406 191ff86eaef0b5667c05c68b1590f658 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 55.04
-screendump 20080101_000010_1d48723bd2f11a760893bd2e203b1fa0.ppm
-# message
-barrier_2 97 37 351 341 2fa81a67269ca4c9cb29924cf43c2422 27
-# Sending keys: ret
-key ret
-# --------------------------------
-step 57.15
-screendump 20080101_000011_dd0d985d57fed3eb006c71f6f91905e9.ppm
-# finish
-barrier_2 170 55 386 418 0f5e2196ee4bbdff2eddd23e3bffc986 11
-# Sending keys: ret
-key ret
-# --------------------------------
-step 64.82
-screendump 20080101_000012_eccf0a634b6fc479327cf9cc165da7ae.ppm
-# done
-barrier_2 228 128 292 247 3d1a461e15cf87c21b2ab9a91896c544 38
diff --git a/client/tests/kvm/steps/WinXP-32.steps b/client/tests/kvm/steps/WinXP-32.steps
deleted file mode 100644
index dfac418..0000000
--- a/client/tests/kvm/steps/WinXP-32.steps
+++ /dev/null
@@ -1,175 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 899537338101)
-# Generated on Mon Nov 17 10:03:40 2008
-# Modified on Tue Nov 18 2008
-# uname -a: Linux pink-intel 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -m 512 -cdrom /isos/windows/WindowsXP-sp2-vlk.iso -hda ./xp2.qcow2 -nographic -monitor unix:/tmp/monitor_899537338101,server,nowait &
-# --------------------------------
-step 43.89
-screendump 20080101_000001_9bde6d1188d168a9e545db95b559cead.ppm
-# XP Setup
-barrier_2 261 37 8 0 bb9d5dc1756100141def00040d97b268 219
-# Sending keys: ret
-key ret
-# --------------------------------
-step 45.13
-screendump 20080101_000002_7ce7450bb32df22d16318cf51d2e53c0.ppm
-# License
-barrier_2 276 34 5 0 4e207caa7275fc47ae431c70b3afc465 6
-key f8
-# --------------------------------
-step 46.92
-screendump 20080101_000003_1551cc2f51d7305761a1c00e81b7d4f9.ppm
-# HDD Partitioning
-barrier_2 480 34 23 42 191ef02c7f6428f11d1630807012c2b4 9
-key ret
-# --------------------------------
-step 51.19
-screendump 20080101_000004_b68371b8aff4f2caee8ae042decce2f9.ppm
-# HDD Format
-barrier_2 560 58 25 200 96e20b287717b09603aa81aa302b4c8a 21
-key up
-key up
-key ret
-# --------------------------------
-step 1159.48
-screendump 20080101_000005_2061ff9205c02a0d7dd0e431d3072921.ppm
-# Regional and Language
-barrier_2 293 80 223 345 8a4601bd20b0d712b345cdc47e2d069e 1800
-key ret
-# --------------------------------
-step 1161.24
-screendump 20080101_000006_290af632957d4c3dd1a1c3901cb85cee.ppm
-# Name & Org
-barrier_2 71 71 229 188 cf6a05b950714f80a85aa852eb08cb81 9
-var user
-key ret
-# --------------------------------
-step 1163.74
-screendump 20080101_000007_7c13a56928b821b3d02a5ac98fd37178.ppm
-# CD-Key
-barrier_2 69 21 181 273 3994ba147019e1437c64ae15b1c5f04a 12
-var cdkey
-# --------------------------------
-step 1173.44
-screendump 20080101_000008_9e585166bbbeb3a893dcb6e2349538fc.ppm
-# CD-Key 2
-barrier_2 81 32 475 394 6366ea700470a0aa3bae93b9213cec0c 49
-key ret
-# --------------------------------
-step 1175.59
-screendump 20080101_000009_de9b06f05860c8d3859c8102d843e50f.ppm
-# Comp Name
-barrier_2 85 22 229 197 353bab533f3c12cf5ebe935a6da35713 11
-key ret
-# --------------------------------
-step 1180.09
-screendump 20080101_000010_4d9a8db872b6f34c49feb4cf68626708.ppm
-# Date & Time
-barrier_2 152 19 150 73 48a1c700fbb1786b0946f893e1f7373d 22
-key ret
-# --------------------------------
-step 1356.63
-screendump 20080101_000011_4fae74b4586cc00519f0a68d42116625.ppm
-# Network Settings
-barrier_2 130 24 220 186 450b90e080868099fa0971bbaf7200b9 883
-key ret
-# --------------------------------
-step 1358.47
-screendump 20080101_000012_66e97da6ba819bdb1f639312f069f6e6.ppm
-# Workgroup
-barrier_2 202 16 154 75 8e80e24fbf6610b4aa59b00b435c7411 9
-key ret
-# --------------------------------
-step 1888.22
-screendump 20080101_000013_7f7850671df83a6177d6fcadd10a0e6e.ppm
-# Display Settings - Resolution
-barrier_2 140 32 143 237 203acc9c423bafbf18c4987eaedcb324 2649
-key alt-tab
-# --------------------------------
-step 1890.62
-screendump 20080101_000014_5f31ac623c39e6a13dc150bd14724e9e.ppm
-# Display Settings - Resolution 2
-barrier_2 96 20 135 210 1d6c0c933b9b5b74e6098182cf295f79 12
-key ret
-# --------------------------------
-step 1893.71
-screendump 20080101_000015_3a424aa01fdc6098eebc9b6824bd4677.ppm
-# Display Settings - Resolution 3
-barrier_2 154 39 78 80 e923a55ab127958aeabf775e9d8c56bd 15
-key tab
-key ret
-# --------------------------------
-step 2234.26
-screendump 20080101_000016_1926aec04da764199212a33bfab4fbe2.ppm
-# Win XP Welcome
-barrier_2 67 37 716 554 64f1582e42c26f351f4618e305ca21b9 1703
-key alt-n
-# --------------------------------
-step 2238.11
-screendump 20080101_000017_8ad5153b98b140cba16eb65ab7a7873e.ppm
-# Help protect
-barrier_2 168 32 106 309 7924b4ef65a89e2adbd287cc97d4a2b8 19
-key alt-o
-# --------------------------------
-step 2240.33
-screendump 20080101_000018_c30e495a976db481501335aa0c53bdea.ppm
-barrier_2 113 40 646 555 0fbeedd2794b2c9bc42c7ecbdb7b6c29 11
-key alt-n
-# --------------------------------
-step 2244.55
-screendump 20080101_000019_c3c9b5d320bff6bdb5635e178d641eaa.ppm
-# Check connectivity (skip)
-barrier_2 165 42 625 551 88f92a423172d2e027c748f08a02632c 21
-key alt-s
-# --------------------------------
-step 2246.48
-screendump 20080101_000020_0b65db63d3474fdc717fc9b628f9d365.ppm
-# Register?
-barrier_2 143 60 72 181 61c7b5772a7712292d0192d436fcc12e 10
-key alt-o
-# --------------------------------
-step 2249.80
-screendump 20080101_000021_f16e63ebb39a415436b084744730e2bd.ppm
-barrier_2 66 32 715 558 5a08db217498ab072d2a4a62064cade3 17
-key alt-n
-# --------------------------------
-step 2251.56
-screendump 20080101_000022_dcdc2fe9606c044ce648422afe42e23d.ppm
-# User
-barrier_2 161 37 312 187 a941ecbeb73f9d73e3e9c38da9a4b743 9
-# Sending keys: $user alt-n
-var user
-key alt-n
-# --------------------------------
-step 2255.55
-screendump 20080101_000023_6a060b04a659c5efd2c61b6b41ddc721.ppm
-# Finish
-barrier_2 85 36 696 554 49fbd3d642865b0514289f0cd34cb8cb 20
-key alt-f
-# --------------------------------
-step 2279.61
-screendump 20080101_000024_51acae003d73d0f4a4c58fa0a053b471.ppm
-# Win XP desktop
-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 35 41 83 559 7a10415169663ceb4c1bbad9c966810d 5 optional
-# Sending keys: ctrl-esc
-key ctrl-esc
-# --------------------------------
-step 2279.61
-screendump 20080101_000024_51acae003d73d0f4a4c58fa0a053b471.ppm
-# Win XP Start Menu (open)
-barrier_2 244 39 90 511 e8634eb8712f6d0b4ca4a65289c1ac01 20
-# Sending keys: u
-key u
-# --------------------------------
-step 2283.13
-screendump 20080101_000025_65f5a5241d681facafbb1c1c666034eb.ppm
-# Turn off
-barrier_2 64 69 372 206 171d8ffc90b648c99add0cad610003ea 18
-# Sending keys: u
-key u
diff --git a/client/tests/kvm/steps/WinXP-64-rss.steps b/client/tests/kvm/steps/WinXP-64-rss.steps
deleted file mode 100644
index ebf32d6..0000000
--- a/client/tests/kvm/steps/WinXP-64-rss.steps
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated by Step Maker
-# Generated on Sat Aug 8 22:08:14 2009
-# uname -a: Linux dhcp-1-188.tlv.redhat.com 2.6.18-128.1.1.el5 #1 SMP Mon Jan 26 13:58:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
-# --------------------------------
-step 45.95
-screendump 20090808_220900_04a6bdc48c7e7b21c40da156b3c5e39a.ppm
-# desktop reached
-barrier_2 80 67 286 217 857ee08ee09b52e69e70189853da5b95 230
-# Sending keys: 0xdc-r
-key 0xdc-r
-# --------------------------------
-step 53.61
-screendump 20090808_221018_06c2ba8c6966a365906b77617c83d476.ppm
-# run "d:\setuprss"
-barrier_2 16 93 212 323 64761f230c3f6e00edb6b063aed94a4d 37
-# Sending keys: d shift-0x27 0x2b s e t u p r s s ret
-key d
-key shift-0x27
-key 0x2b
-key s
-key e
-key t
-key u
-key p
-key r
-key s
-key s
-key ret
-# --------------------------------
-step 69.47
-screendump 20090808_221132_2cd6b5b84c57818069a39edcd6598670.ppm
-# done
-sleep 20
-barrier_2 60 48 298 227 a69789a0554529572d8b721dc0a6bf9a 69
diff --git a/client/tests/kvm/steps/WinXP-64.steps b/client/tests/kvm/steps/WinXP-64.steps
deleted file mode 100644
index 91e6d0f..0000000
--- a/client/tests/kvm/steps/WinXP-64.steps
+++ /dev/null
@@ -1,111 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 661286036863)
-# Generated on Mon Dec 15 12:18:59 2008
-# uname -a: Linux pink-nehalem.qa.lab.tlv.redhat.com 2.6.27.5-117.fc10.x86_64 #1 SMP Tue Nov 18 11:58:53 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda /vm/xp64-test.qcow2 -cdrom /isos/windows/WindowsXP-x64.iso -m 512 -boot d -nographic -monitor unix:/tmp/monitor_661286036863,server,nowait &
-# --------------------------------
-step 37.42
-screendump 20080101_000001_4500e9fcd78ebaf293073b71a8e5d0fc.ppm
-# XP Welcome
-barrier_2 99 26 5 10 b3533344412ba9d6807187f58217e299 187
-# Sending keys: ret
-key ret
-# --------------------------------
-step 38.08
-screendump 20080101_000002_bfd529d5c8bd0e364f71701cf16d1d58.ppm
-# License
-barrier_2 256 32 7 8 7878cccd089fb5b4fcb31bec062c7336 5
-# Sending keys: f8
-key f8
-# --------------------------------
-step 39.07
-screendump 20080101_000003_aa97d02dbb567f96ec739b98bc3c7288.ppm
-# HDD Partitioning
-barrier_2 606 68 35 106 9589431786dfd07961819f6300d464de 5
-# Sending keys: ret
-key ret
-# --------------------------------
-step 39.94
-screendump 20080101_000004_66235ea61d2b6fa703dc6adeb29f4192.ppm
-# HDD Format
-barrier_2 530 74 39 197 c891d0bc3975320ad7e66627ad67dee3 5
-# Sending keys: up up ret
-key up
-key up
-key ret
-# --------------------------------
-step 269.68
-screendump 20080101_000005_7779995e280d166f53e6182dbde38b1f.ppm
-# Regional & Language
-barrier_2 195 19 156 72 719cccacc44ddeefdaebace117721ca8 1149
-# Sending keys: ret
-key ret
-# --------------------------------
-step 271.40
-screendump 20080101_000006_fd4018fb99458bae6a91d097873cedbd.ppm
-# Name & org
-barrier_2 75 62 225 196 2460b46c4281fc9141620df8a0e122de 9
-# Sending keys: u s e r ret
-key u
-key s
-key e
-key r
-key ret
-# --------------------------------
-step 274.69
-screendump 20080101_000007_34e1c0bc3357a5ef8eeff9b939d2e88f.ppm
-# CD-Key
-barrier_2 69 21 182 274 32bea723ba9510fbdfcfb0fd1ba2485f 16
-var cdkey
-key ret
-# --------------------------------
-step 282.44
-screendump 20080101_000008_a7e894aca70da04697bb62670a391090.ppm
-# Comp name
-barrier_2 85 20 230 198 ee725a5e95996aa2a520e638e9955614 39
-# Sending keys: ret
-key ret
-# --------------------------------
-step 284.95
-screendump 20080101_000009_abdccb421511e47d3a50b84e6b4b5755.ppm
-# Date & Time
-barrier_2 147 19 154 72 9a3a9141b807d975124322167b207ae7 13
-# Sending keys: ret
-key ret
-# --------------------------------
-step 286.86
-screendump 20080101_000010_bb878343930f948c0346f103a387157a.ppm
-# --------------------------------
-step 409.46
-screendump 20080101_000011_30db9777a7883a07e6e65bff74e1d98f.ppm
-# Network Settings
-barrier_2 123 16 159 73 a90619321e46fb63918dd6f890dd7758 613
-# Sending keys: ret
-key ret
-# --------------------------------
-step 410.91
-screendump 20080101_000012_46dcf24a3aa1dd519a0f24cee5de2863.ppm
-# Workgroup
-barrier_2 76 17 152 73 5fa6b8258e882a92e7fd2acb7764ad15 7
-# Sending keys: ret
-key ret
-# --------------------------------
-step 974.93
-screendump 20080101_000013_6833309ea27ceb912c6e43e2b8252126.ppm
-# Windows XP x64 Desktop
-barrier_2 74 24 7 455 a099dae90bbd59e79442af0975bb6a01 2400
-# Sending keys: 0xdc
-key 0xdc
-# --------------------------------
-step 978.02
-screendump 20080101_000014_213fbe6fa13bf32dfac6a00bf4205e45.ppm
-# Windows XP Start Menu Opened
-barrier_2 129 30 196 72 aae68af7e05e2312c707f2f4bd73f024 15
-# Sending keys: u
-key u
-# --------------------------------
-step 979.46
-screendump 20080101_000015_3f6a35dc7f1a46b10bd4e2dad45e74a1.ppm
-# Windows XP Shutdown
-barrier_2 60 61 291 172 ae1d8cf3b1bf0abbd74d4a2b55b17679 7
-# Sending keys: u
-key u
diff --git a/client/tests/kvm/steps/memtest86+.steps b/client/tests/kvm/steps/memtest86+.steps
deleted file mode 100644
index 3eb6288..0000000
--- a/client/tests/kvm/steps/memtest86+.steps
+++ /dev/null
@@ -1,9 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 127731285350)
-# Generated on Fri Nov 14 17:42:43 2008
-# uname -a: Linux moof 2.6.27.2-custom #2 SMP PREEMPT Thu Oct 30 09:53:02 IST 2008 i686 GNU/Linux
-# QEMU command line: qemu-system-x86_64 blank.qcow2 -cdrom /home/cyber/Installs/memtest86+-2.01.iso -m 256 -nographic -monitor unix:/tmp/monitor_127731285350,server,nowait &
-# --------------------------------
-step 262.60
-screendump 20080101_000001_70946ed3f2eaed54e0dd4cb65d994124.ppm
-# wait until a single pass is completed successfully
-barrier_2 403 29 154 282 42efd2354768c87253cdb1d2a8d418c6 1313
diff --git a/client/tests/kvm/steps/openSUSE-11.0-32.steps b/client/tests/kvm/steps/openSUSE-11.0-32.steps
deleted file mode 100644
index 7715a65..0000000
--- a/client/tests/kvm/steps/openSUSE-11.0-32.steps
+++ /dev/null
@@ -1,203 +0,0 @@
-# Generated by stepmaker version 20081110 (instance: 457516570734)
-# Generated on Wed Nov 12 17:29:27 2008
-# Modified on Thu Nov 13 2008
-# uname -a: Linux pink-intel 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda suse11.qcow2 -cdrom /isos/linux/openSUSE-11.0-DVD-i386.iso -m 512 -nographic -monitor unix:/tmp/monitor_457516570734,server,nowait &
-# --------------------------------
-step 16.47
-screendump 20080101_000001_5ab337725f70ec1070d9bfe3c5c6f42f.ppm
-barrier_2 354 21 226 202 f87a31dc21c08387d3e90d5b6f66d5d9 82
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 87.25
-screendump 20080101_000002_e3a66604c7e819f03c5a2f644b9b5caf.ppm
-# License
-barrier_2 75 33 197 483 5f9eb73ad157ac828723e191c03b78dd 1000
-# Sending keys: alt-a alt-n
-key alt-a
-key alt-n
-# --------------------------------
-step 118.40
-screendump 20080101_000003_7a53021ba41457610bdaaaffcbdc0b65.ppm
-# Mode (Non-Automatic Configuration)
-barrier_2 153 66 283 388 26863f4ecbcdedb853bb1fbf5c083866 500
-# Sending keys: alt-s alt-n
-key alt-s
-key alt-n
-# --------------------------------
-step 129.61
-screendump 20080101_000004_961801ab15559688819ea51a317bd022.ppm
-# Time Zone (HW Clock=UTC)
-barrier_2 178 30 230 19 666a5ec8f77609c6f25de8acda34dd98 56
-key alt-n
-# --------------------------------
-step 132.57
-screendump 20080101_000005_dd8b80ad5ec05dec0fc15e2943b9f159.ppm
-# Desktop (KDE3.5)
-barrier_2 99 60 213 350 2d8283d15c9a4a72aae4145a78a79de3 15
-# Sending keys: alt-d alt-n
-key alt-d
-key alt-n
-# --------------------------------
-step 140.51
-screendump 20080101_000006_d3590f5b32b5acecfe63a7e5d62f7570.ppm
-# Suggested Partitioning
-barrier_2 506 206 280 381 bb890930ab171b449468eae911407bbb 40
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 144.85
-screendump 20080101_000007_10940768462336e107852a49d6d2d054.ppm
-# User & Password
-barrier_2 68 34 392 112 e0ce3a1929d728094bfa6f2a90e10f13 22
-# Sending keys: u s e r tab tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key tab
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 151.20
-screendump 20080101_000008_67858d40991ae87ac56801040c9e3c75.ppm
-# Weak Password 1
-barrier_2 58 85 310 269 c44d7f9f0c8317924c493868c97a5ebb 32
-# Sending keys: ret
-key ret
-# --------------------------------
-step 155.41
-screendump 20080101_000009_e7542426796b80591ff7aaaba83fd969.ppm
-# Weak Password 2
-barrier_2 106 54 250 277 31864db2569ce6cf3fdb1b10b404d0ad 21
-# Sending keys: ret
-key ret
-# --------------------------------
-step 170.19
-screendump 20080101_000010_f24f622f2607acf3801af357f676a3f7.ppm
-# Install Settings
-barrier_2 351 71 432 511 5189fa90f2ca7aec19fce5175f1d8afd 74
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 174.08
-screendump 20080101_000011_85491cef946d0a6c9adb2fa0faa943d2.ppm
-# Confirm
-barrier_2 99 17 456 479 3183b15baf82014c8d5d6b0ce9a90ccb 19
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 1366.25
-screendump 20080101_000012_7c0322b06875c1023b1e49617a98093e.ppm
-# Hostname
-barrier_2 72 18 285 262 26ac858e010fb11c71694d80d0235fd5 5961
-key alt-n
-# --------------------------------
-step 1491.04
-screendump 20080101_000013_3a8597a1accdec7565549f6e8bd23004.ppm
-# Network Config (Firewall)
-barrier_2 193 66 246 221 6ffa4f7b45ea4f1d009dfbad468bbac8 624
-key alt-c
-# --------------------------------
-step 1495.63
-screendump 20080101_000014_8cdbfc98ba25c3eb91f296c5e07aef7f.ppm
-# Network Config (Firewall 2)
-barrier_2 75 20 452 517 8a8f1b9c1781f2459196aad38402d12c 23
-# Sending keys: f
-key f
-# --------------------------------
-step 1513.53
-screendump 20080101_000017_86b3453e451b1effbc377352f0afdab6.ppm
-# Network Config (Firewall = Disable)
-barrier_2 210 35 474 72 ec85c1b7b96e464d2caf9a6de12cc140 32
-key alt-d
-key alt-o
-# --------------------------------
-step 1522.15
-screendump 20080101_000018_3af69a0c9a8fb4797c89a82260e3361f.ppm
-# Network Config (Firewall Disabled)
-barrier_2 180 24 269 250 87f4f67f1d5390802dd2e5234eb24b20 43
-key alt-n
-# --------------------------------
-step 1547.17
-screendump 20080101_000019_165b01e9d2c901d7a7c0646ddb8ff0e5.ppm
-# Internet Connection
-barrier_2 137 24 265 413 db759a60c17d5b56d8b98eb04729c36c 125
-key alt-o
-key alt-n
-# --------------------------------
-step 1664.93
-screendump 20080101_000020_17c6aad8d25a8b2c7444db936c022b20.ppm
-# openSUSE 11.0 Release Notes
-barrier_2 297 36 219 125 bcec45f24b66b4ac15543ec33e4f8a33 589
-key alt-n
-# --------------------------------
-step 1697.65
-screendump 20080101_000021_11edbe93e1a123046e581d4b76b66df1.ppm
-# Hardware Configuration
-barrier_2 41 17 731 555 73941d7fa74bb7b64258cafd5d9678be 164
-key alt-n
-# --------------------------------
-step 1709.41
-screendump 20080101_000022_aed50df8770463e0c64c4359253dc267.ppm
-# Finish
-barrier_2 49 23 724 552 461d25cc9ecc0980462bb62c0d3f1b70 60
-key alt-f
-# --------------------------------
-step 1762.61
-screendump 20080101_000023_9a479645532879ce141ed8e94ccde585.ppm
-# SUSE Desktop taskbar
-barrier_2 83 39 0 561 b9b2982e57653d3a54b4af81ae1a2274 350
-# Sending keys: alt-ctrl-f1
-key alt-ctrl-f1
-# --------------------------------
-step 1771.98
-screendump 20080101_000024_8ab5e526361c954a7b99525c353cff9f.ppm
-# openSUSE 11.0 CLI
-barrier_2 39 22 17 569 50b8713bbe3d889d223cca87d8ad6ad5 30
-# Sending keys: r o o t ret
-key r
-key o
-key o
-key t
-key ret
-# --------------------------------
-step unknown
-# password
-sleep 5
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 1777.51
-screendump 20080101_000026_ec91c3bc417e0ce1c0776a9fa24e77f2.ppm
-# openSUSE 11.0 Shutdown
-barrier_2 178 17 17 555 8ed77060ce891c495fdcebce199a4ac8 28
-# Sending keys: i n i t spc 0 ret
-key i
-key n
-key i
-key t
-key spc
-key 0
-key ret
diff --git a/client/tests/kvm/steps/openSUSE-11.1-32-and-64.steps b/client/tests/kvm/steps/openSUSE-11.1-32-and-64.steps
deleted file mode 100644
index a2ec083..0000000
--- a/client/tests/kvm/steps/openSUSE-11.1-32-and-64.steps
+++ /dev/null
@@ -1,321 +0,0 @@
-# Generated by stepmaker version 20081113 (instance: 843967570730)
-# Generated on Wed Feb 11 14:39:05 2009
-# manually edited by Alexey Eromenko, 16.4.2009.
-# uname -a: Linux pink-intel.qa.lab.tlv.redhat.com 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-# QEMU command line: ../qemu-kvm -hda /vm/suse111-64.steps -m 512 -cdrom /isos/linux/openSUSE-11.1-DVD-x86_64.iso -nographic -monitor unix:/tmp/monitor_843967570730,server,nowait &
-# --------------------------------
-step 8.16
-screendump 20080101_000001_c80d29ee17de0d30b1351567501a8f0e.ppm
-# GRUB
-barrier_2 203 61 248 162 913c62e30880100fbc3e85016487972e 41
-# Sending keys: down ret
-key down
-key ret
-# --------------------------------
-step 63.31
-screendump 20080101_000002_e964438bedd7f69dcc975c3e8acbdb12.ppm
-# License
-barrier_2 151 84 258 202 f8f9616ad47504e2e58bb06b3e370a70 276
-# --------------------------------
-step 65.49
-screendump 20080101_000002_e964438bedd7f69dcc975c3e8acbdb12.ppm
-# License 2
-barrier_2 64 97 719 487 ed51645c48eeedfaf51c5ab67c87f785 11
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 84.74
-screendump 20080101_000004_53baeaf13328f021a116a2b8d0edc7de.ppm
-# Install Mode
-barrier_2 191 20 320 450 8fab03d41669ba391f209e80ddd11949 150
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
-step 89.06
-screendump 20080101_000005_502706f6d4dbd769d1cfc3ba8f9dca8a.ppm
-# Install Mode 2
-barrier_2 182 24 323 449 84c96ae3c3cb8dd96289dceca774a66a 22
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 95.10
-screendump 20080101_000006_6248f39bf503193d4d84ae6dfa75e6f3.ppm
-# Time Zone
-barrier_2 268 38 262 18 d3ffd2b1cfeb7f5c6e2148a70712b14f 30
-# --------------------------------
-step 96.92
-screendump 20080101_000007_7407cae7def7f37629c4a224e1a121a8.ppm
-# Time Zone 2
-barrier_2 56 41 722 544 4928e7424956f5f5456c0d9e2598d21d 9
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 100.55
-screendump 20080101_000008_bc8865d4772a0dccc1d04758ec18e9e4.ppm
-# KDE3 - 1
-barrier_2 89 112 275 299 a8253ca9120b679f70d85424974dfea6 18
-# Sending keys: alt-o
-key alt-o
-# --------------------------------
-step 102.42
-screendump 20080101_000009_066cc2253d75595136ba7370e8f29f57.ppm
-# KDE3 - 2
-barrier_2 44 29 277 356 3a255e8688d735c4ca2e65df7bf3c0de 9
-# Sending keys: alt-d alt-n
-key alt-d
-key alt-n
-# --------------------------------
-step 107.05
-screendump 20080101_000010_89ea7c5e9762291ca8b8fb0d1437aa19.ppm
-# HDD Partitioning
-barrier_2 288 27 268 24 87af37cc49c1a4f32b918c0b4aa22efb 23
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 109.80
-screendump 20080101_000011_618a50140766a1b25ddace6d7f57d8e2.ppm
-# user name
-barrier_2 93 17 398 117 806838de5bfe687835950b5f196904fc 14
-# Sending keys: u s e r tab u s e r tab 1 2 3 4 5 6 tab 1 2 3 4 5 6 alt-n
-key u
-key s
-key e
-key r
-key tab
-key u
-key s
-key e
-key r
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key tab
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key alt-n
-# --------------------------------
-step 117.34
-screendump 20080101_000012_e1be43910decb30d104036985eea5b6c.ppm
-# Password Warning
-barrier_2 142 16 348 268 434742a9f67cc4908696574a31505723 38
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 118.89
-screendump 20080101_000013_bb0e6753dbf5cbe1a16eee337fe8268a.ppm
-# Password Warning 2
-barrier_2 94 42 268 269 62779fa08e6f47419299cf76382c2aba 8
-# Sending keys: alt-y
-key alt-y
-# --------------------------------
-step 133.95
-screendump 20080101_000014_38b22f50875fed9e23f230ff1eb9da83.ppm
-# Install Settings
-barrier_2 224 31 293 24 bfbd9c41c6475d46b2212888b52d1e7b 75
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 138.63
-screendump 20080101_000015_68fa3bfe3dd5b6a41431beb10a473404.ppm
-# Install Settings 2
-barrier_2 87 34 402 468 443b5078618640e03ff6a11a35108cc5 23
-# Sending keys: alt-i
-key alt-i
-# --------------------------------
-step 1653.17
-screendump 20080101_000016_8ce42b0bf3aaa1f5a828d048982a169d.ppm
-# Hostname & Domain Name (Hostname=localhost)
-barrier_2 166 45 282 240 12f111620985e8c5411a387f739cb274 3600
-# Sending keys: alt-h
-key alt-h
-# --------------------------------
-step 1656.08
-screendump 20080101_000017_15390f273d88a92acf44cbacc1b4c0c0.ppm
-sleep 2
-# Sending keys: l o c a l h o s t
-key l
-key o
-key c
-key a
-key l
-key h
-key o
-key s
-key t
-# --------------------------------
-step 1659.45
-screendump 20080101_000018_31e426174e6bd347afa3464dc1a5573a.ppm
-# Hostname & Domain Name (Hostname=localhost) 2
-barrier_2 66 107 287 245 173600897a937b9b361dba39b3858d6c 17
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1707.45
-screendump 20080101_000019_c4409d0b61bdff9e09de9b3fd96255ce.ppm
-barrier_2 225 33 264 20 87e262bb97eeaf3198b1058d8f49eb98 240
-# --------------------------------
-step 1708.69
-screendump 20080101_000019_c4409d0b61bdff9e09de9b3fd96255ce.ppm
-barrier_2 170 29 282 142 9bd4515a4393be7b74def6f86508e9c1 60
-# --------------------------------
-step 1709.39
-screendump 20080101_000019_c4409d0b61bdff9e09de9b3fd96255ce.ppm
-# Network Configuration 3
-barrier_2 274 46 463 509 26f76959582cb1d43725c066cd809b50 60
-# Sending keys: alt-c
-key alt-c
-# --------------------------------
-step 1724.36
-screendump 20080101_000022_0c69806812617c0c97623817b842cdaa.ppm
-barrier_2 75 18 471 516 aec15e97eb8ae0544dc9fcc3e658b081 26
-# Sending keys: down down
-key down
-key down
-# --------------------------------
-step 1727.60
-screendump 20080101_000025_544d2f9472b3ffc220c03a498356dd5d.ppm
-barrier_2 59 17 484 345 48cccd12dae22ad75dfe3e977912785b 10
-# Sending keys: ret
-key ret
-# --------------------------------
-step 1733.52
-screendump 20080101_000026_ca126a84cbf060abefe790ba8ea93433.ppm
-# Firewall
-barrier_2 250 58 510 21 8f44226c0a37fb9a072f548890a8019a 30
-# Sending keys: alt-d alt-o
-key alt-d
-key alt-o
-# --------------------------------
-step 1738.96
-screendump 20080101_000027_b8965ed06f08ccdce436c4412fd327bb.ppm
-# Network Configuration Final
-barrier_2 168 24 591 532 7403ed42e1920dfcd49286a28f797460 20
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 1766.28
-screendump 20080101_000028_c580262a21a4cc25b6ecbfb82110a2e7.ppm
-# Test Internet
-barrier_2 226 24 293 339 2e82bc020cee7c2554df18e4e57f2f21 137
-# Sending keys: alt-o alt-n
-key alt-o
-key alt-n
-# --------------------------------
-step 2114.07
-screendump 20080101_000029_36cf2a6c2488b4a1796f9fc48a5e7dd2.ppm
-# skip update
-barrier_2 133 72 232 265 c4d37a34b1321d89cb6e8d2f7e70839e 600
-# Sending keys: alt-s
-key alt-s
-# --------------------------------
-step 2115.60
-screendump 20080101_000030_97e2ecccc9333e81a24e4bee46cc9bc4.ppm
-barrier_2 127 66 236 270 03afb4c6f909b29df2ed0cc86483c020 8
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2209.03
-screendump 20080101_000031_1473aec600eeaf9f7e4df4bff931d245.ppm
-# relnotes
-barrier_2 305 29 248 137 2898bdec240cbfdcd7661aba75af5dcf 467
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2224.90
-screendump 20080101_000032_87aceb37e786244be7671716365c2018.ppm
-# --------------------------------
-step 2259.87
-screendump 20080101_000033_28e03666bf82d9b8a051bf6fcfe37b08.ppm
-# Hardware Configuration
-barrier_2 273 146 226 23 03641da1c6a0ca8649c14309dda17ac8 175
-# --------------------------------
-step 2261.59
-screendump 20080101_000033_28e03666bf82d9b8a051bf6fcfe37b08.ppm
-# Hardware Configuration 2
-barrier_2 279 45 460 509 bebd4931243da451c48d1a610b9e892d 40
-# Sending keys: alt-n
-key alt-n
-# --------------------------------
-step 2270.63
-screendump 20080101_000035_856f5e6fed98228e7669eccff4700954.ppm
-# Finish
-barrier_2 224 35 261 19 2cca5d4fd1e71163dd95a26862cad94d 45
-# Sending keys: alt-f
-key alt-f
-# --------------------------------
-step 2343.54
-screendump 20080101_000036_864f27ba9cd37edb2294ca71de0edba4.ppm
-# KDE3 Desktop
-barrier_2 88 55 3 538 fc11d0bd57d4d379bbf0d46feb621fad 365
-# Sending keys: alt-f2
-key alt-f2
-# --------------------------------
-step 2348.05
-screendump 20080101_000037_2b44b9a706c2ccbff902fc8ede34efa5.ppm
-# KDE3 Desktop - Run Command
-barrier_2 119 76 180 174 a83f2bc83deab257bfaf2c345dbd774a 23
-# Sending keys: k o n s o l e ret
-key k
-key o
-key n
-key s
-key o
-key l
-key e
-key ret
-# --------------------------------
-step 2359.31
-screendump 20080101_000038_d4b6da473f3b32392ef0046c816b033d.ppm
-# Konsole 1
-barrier_2 153 15 10 63 073f579d4f0c561afcf93d84500e0c6c 56
-# Sending keys: minus ret
-#key s
-#key u
-#key spc
-key minus
-key ret
-# --------------------------------
-step 2364.48
-screendump 20080101_000039_bd8a6691695c752a72fca367532b6798.ppm
-# Konsole 2
-barrier_2 156 12 9 95 fcf32408823475d09845fe26c10422aa 26
-# Sending keys: s u spc minus ret
-key s
-key u
-key spc
-key minus
-key ret
-# --------------------------------
-step 2372.89
-screendump 20080101_000040_de603924c814af16b56d1fe61d1d1f8f.ppm
-# Konsole 3 (password)
-barrier_2 83 18 9 106 78507c737a0f71e9e063cc337736bce9 42
-# Sending keys: 1 2 3 4 5 6 ret
-key 1
-key 2
-key 3
-key 4
-key 5
-key 6
-key ret
-# --------------------------------
-step 2377.23
-screendump 20080101_000041_ca0b3b1c9fab1b00bb81cda271a19ab1.ppm
-# Konsole 4 - shutdown
-barrier_2 119 16 10 121 3ed9c499d19ba7d54778e22dd891c331 22
-# Sending keys: i n i t spc 0 ret
-key i
-key n
-key i
-key t
-key spc
-key 0
-key ret
diff --git a/client/tests/kvm/subtests.cfg.sample b/client/tests/kvm/subtests.cfg.sample
deleted file mode 100644
index 9d9dbba..0000000
--- a/client/tests/kvm/subtests.cfg.sample
+++ /dev/null
@@ -1,1122 +0,0 @@
-# Copy this file to subtests.cfg and edit it.
-#
-# Subtests
-variants:
- - install:
- type = steps
- fail_if_stuck_for = 300
- stuck_detection_history = 2
- keep_screendump_history = yes
- force_create_image = yes
- kill_vm = yes
- kill_vm_timeout = 60
- kill_vm_timeout_on_error = 0
-
- - setup: install
- type = steps
- fail_if_stuck_for = 300
- stuck_detection_history = 2
- kill_vm_on_error = yes
- keep_screendump_history = yes
-
- - image_copy:
- type = image_copy
- vms = ''
- parallel = no
- profilers =
-
- - unattended_install:
- type = unattended_install
- start_vm = no
- kill_vm = yes
- kill_vm_gracefully = yes
- kill_vm_on_error = yes
- shutdown_cleanly = yes
- shutdown_cleanly_timeout = 120
- force_create_image = yes
- extra_params += " -boot d"
- guest_port_unattended_install = 12323
- kernel = vmlinuz
- initrd = initrd.img
- # Set migrate_background to yes to run migration in parallel
- migrate_background = no
-
- variants:
- # Install guest from cdrom
- - cdrom:
- medium = cdrom
- redirs += " unattended_install"
- # Install guest from http/ftp url
- - url:
- only Linux
- medium = url
- url = REPLACE_THIS_WITH_TREE_URL
- # Install guest from nfs nfs_server:nfs_dir
- - nfs:
- only Linux
- medium = nfs
- nfs_server = REPLACE_THIS_WITH_NFS_SERVER
- nfs_dir = REPLACE_THIS_WITH_NFS_DIRECTORY
- # Install guest with a remote kickstart
- - remote_ks:
- only Linux
- medium = url
- extra_params = " --append ks=REPLACE_THIS_WITH_URL_OF_KS"
- url = REPLACE_THIS_WITH_TREE_URL
-
- - qemu_img:
- type = qemu_img
- vms = ''
- profilers = ''
- take_regular_screendumps = no
- variants:
- - check:
- subcommand = check
- image_name_dd = dd_created_image
- force_create_image_dd = no
- remove_image_dd = yes
- create_image_cmd = "dd if=/dev/zero of=%s bs=1G count=1"
- # Test the convertion from 'dd_image_name' to specified format
- supported_image_formats = qcow2 raw
- - create:
- subcommand = create
- images += " large"
- force_create_image_large = yes
- image_size_large = 1G
- image_name_large = create_large_image
- remove_image_large = yes
- - convert:
- subcommand = convert
- variants:
- - to_qcow2:
- dest_image_format = qcow2
- compressed = no
- encrypted = no
- - to_raw:
- dest_image_format = raw
- - snapshot:
- subcommand = snapshot
- - info:
- subcommand = info
- - rebase:
- subcommand = rebase
- rebase_mode = unsafe
- image_name_snapshot1 = sn1
- image_name_snapshot2 = sn2
-
- - pxe:
- type = pxe
- images = pxe
- image_name_pxe = pxe-test
- image_size_pxe = 1G
- force_create_image_pxe = yes
- remove_image_pxe = yes
- extra_params += ' -boot n'
- kill_vm_on_error = yes
- network = bridge
- restart_vm = yes
- pxe_timeout = 60
-
- - module_probe:
- type = module_probe
- # You can specify your own module list, though it is not needed usually.
- # mod_list = kvm
- load_count = 100
- vms = ''
- profilers = ''
- take_regular_screendumps = no
-
-# Tests that do need installed guests to run
- - boot: install setup image_copy unattended_install.cdrom
- type = boot
- restart_vm = yes
- kill_vm_on_error = yes
- login_timeout = 240
-
- - reboot: install setup image_copy unattended_install.cdrom
- type = boot
- reboot_method = shell
- kill_vm_on_error = yes
- login_timeout = 240
-
- - migrate: install setup image_copy unattended_install.cdrom
- type = migration
- migration_test_command = help
- migration_bg_command = "cd /tmp; nohup tcpdump -q -t ip host localhost"
- migration_bg_check_command = pgrep tcpdump
- migration_bg_kill_command = pkill tcpdump
- kill_vm_on_error = yes
- iterations = 2
- used_mem = 1024
- mig_timeout = 3600
- # you can uncomment the following line to enable the state
- # check
- # vmstate_check = yes
- variants:
- - tcp:
- migration_protocol = "tcp"
- - unix:
- migration_protocol = "unix"
- - exec:
- migration_protocol = "exec"
- - mig_cancel:
- migration_protocol = "tcp"
- mig_cancel = yes
- variants:
- - @default:
- - with_set_speed:
- mig_speed = 1G
- pre_migrate = "mig_set_speed"
- - with_reboot:
- iterations = 1
- type = migration_with_reboot
- - with_file_transfer:
- iterations = 1
- type = migration_with_file_transfer
- - with_autotest:
- only Linux
- type = autotest
- migrate_background = yes
- test_timeout = 1800
- variants:
- - dbench:
- test_control_file = dbench.control
- - stress:
- test_control_file = stress.control
- - monotonic_time:
- test_control_file = monotonic_time.control
-
- - migrate_multi_host: install setup image_copy unattended_install.cdrom
- type = migration_multi_host
- migration_test_command = help
- migration_bg_command = "cd /tmp; nohup tcpdump -q -t ip host localhost"
- migration_bg_check_command = pgrep tcpdump
- migration_bg_kill_command = pkill tcpdump
- kill_vm_on_error = yes
- iterations = 2
- used_mem = 1024
- mig_timeout = 3600
- comm_port = 13234
- regain_ip_cmd = dhclient
-
- - boot_savevm: install setup image_copy unattended_install.cdrom
- type = boot_savevm
- savevm_delay = 0.3
- savevm_login_delay = 120
- savevm_timeout = 2000
- kill_vm_on_error = yes
- kill_vm_gracefully = yes
- kill_vm = yes
-
- - autotest: install setup image_copy unattended_install.cdrom
- only Linux
- type = autotest
- test_timeout = 1800
- variants:
- - sleeptest:
- test_timeout = 120
- test_control_file = sleeptest.control
- - dbench:
- test_control_file = dbench.control
- - bonnie:
- test_control_file = bonnie.control
- - ebizzy:
- test_control_file = ebizzy.control
- - ffsb:
- test_control_file = ffsb.control
- - stress:
- test_control_file = stress.control
- - disktest:
- test_control_file = disktest.control
- - ctcs:
- # If you think this is too lengthy, please change the cerberus
- # control file and set this timeout appropriately.
- test_timeout = 3900
- test_control_file = ctcs.control
- - npb:
- test_control_file = npb.control
- - hackbench:
- test_control_file = hackbench.control
- - cpu_hotplug:
- test_control_file = cpu_hotplug.control
- - monotonic_time:
- test_control_file = monotonic_time.control
- - tsc:
- test_control_file = tsc.control
- - scrashme:
- test_control_file = scrashme.control
- - hwclock:
- test_control_file = hwclock.control
- - rtc:
- test_control_file = rtc.control
- - iozone:
- test_control_file = iozone.control
- - flail:
- test_control_file = flail.control
- - systemtap:
- test_control_file = systemtap.control
-
- - qemu_img_commit: install setup image_copy unattended_install.cdrom
- type = qemu_img
- subcommand = commit
-
- - stop_continue: install setup image_copy unattended_install.cdrom
- type = stop_continue
- kill_vm_on_error = yes
-
- - linux_s3: install setup image_copy unattended_install.cdrom
- only Linux
- type = linux_s3
-
- - timedrift: install setup image_copy unattended_install.cdrom
- variants:
- - ntp:
- variants:
- - with_load:
- type = timedrift
- # Pin the VM and host load to CPU #0
- cpu_mask = 0x1
- # Set the load and rest durations
- load_duration = 20
- rest_duration = 20
- # Fail if the drift after load is higher than 50%
- drift_threshold = 50
- # Fail if the drift after the rest period is higher than 10%
- drift_threshold_after_rest = 10
- # For now, make sure this test is executed alone
- used_cpus = 100
- - with_migration:
- type = timedrift_with_migration
- migration_iterations = 3
- drift_threshold = 10
- drift_threshold_single = 3
- - with_reboot:
- type = timedrift_with_reboot
- reboot_iterations = 1
- drift_threshold = 10
- drift_threshold_single = 3
- - with_stop:
- type = timedrift_with_stop
- stop_interations = 1
- drift_threshold = 10
- drift_threshold_single = 3
- - date:
- variants:
- - with_load:
- type = timedrift
- # Pin the VM and host load to CPU #0
- cpu_mask = 0x1
- # Set the load and rest durations
- load_duration = 20
- rest_duration = 20
- # Fail if the drift after load is higher than 50%
- drift_threshold = 50
- # Fail if the drift after the rest period is higher than 10%
- drift_threshold_after_rest = 10
- # For now, make sure this test is executed alone
- used_cpus = 100
- - with_migration:
- type = timedrift_with_migration
- migration_iterations = 3
- drift_threshold = 10
- drift_threshold_single = 3
- - with_reboot:
- type = timedrift_with_reboot
- reboot_iterations = 1
- drift_threshold = 10
- drift_threshold_single = 3
- - with_stop:
- type = timedrift_with_stop
- stop_interations = 1
- drift_threshold = 10
- drift_threshold_single = 3
-
- - balloon_check: install setup image_copy unattended_install.cdrom
- no Win2000, Fedora.8, Fedora.9, Fedora.10, RHEL.3, RHEL.4, Unix, livecd
- type = balloon_check
- extra_params += " -balloon virtio"
- iterations = 5
-
- - watchdog: install setup image_copy unattended_install.cdrom
- only RHEL.5, RHEL.6
- type = watchdog
- extra_params += " -watchdog i6300esb -watchdog-action reset"
- relogin_timeout = 240
-
- - smbios_table: install setup image_copy unattended_install.cdrom
- only Linux
- type = smbios_table
- start_vm = no
-
- - softlockup: install setup unattended_install.cdrom
- only Linux
- type = softlockup
- softlockup_files = stress-1.0.4.tar.gz
- stress_setup_cmd = "cd %s && tar xvf stress-1.0.4.tar.gz && cd stress-1.0.4 && ./configure && make && cd src"
- server_setup_cmd = "%s/heartbeat_slu.py --server --threshold %s --file %s --port %s --verbose --check-drift"
- client_setup_cmd = "%s/heartbeat_slu.py --client --address %s --file %s --port %s --interval 1"
- stress_cmd = "cd %s && cd stress-1.0.4 && cd src && nohup ./stress -c %s > /dev/null 2>&1&"
- kill_monitor_cmd = "ps aux | grep heart | grep -v grep | awk '{print$2}' | xargs kill -9 > /dev/null 2>&1"
- kill_stress_cmd = "pkill -f stress > /dev/null 2>&1"
- drift_cmd = "tail -1 %s | awk '{print $7}'"
- monitor_log_file_server = /tmp/heartbeat_server.log
- monitor_log_file_client = /tmp/heartbeat_client.log
- monitor_port = 13330
- stress_threshold = 10
- # time_to_run (hours) = 12, 18, 24, 48 hours
- test_length = 0.10
-
- - stress_boot: install setup image_copy unattended_install.cdrom
- type = stress_boot
- max_vms = 5
- alive_test_cmd = uname -a
- login_timeout = 240
- kill_vm = yes
- kill_vm_vm1 = no
- kill_vm_gracefully = no
- extra_params += " -snapshot"
- used_cpus = 5
- used_mem = 2560
-
- - guest_test: install setup image_copy unattended_install.cdrom
- only Windows
- type = guest_test
- login_timeout = 360
- test_timeout = 600
- script_params =
- reboot = yes
- variants:
- - autoit:
- interpreter = "cmd /c D:\AutoIt3.exe"
- variants:
- - notepad:
- guest_script = autoit/notepad1.au3
- dst_rsc_path = "C:\script.au3"
- - stub:
- download = yes
- download_cmd = "git clone"
- rsc_server = "git://the.resource.server/autoit"
- dst_rsc_dir = "C:\"
- dst_rsc_path = "C:\autoit\stub\stub.au3"
- - powershell:
- interpreter = "cmd /c powershell.exe -File"
- variants:
- - stub:
- download = yes
- download_cmd = "git clone"
- rsc_server = "git://the.resource.server/powershell"
- dst_rsc_dir = "C:\"
- dst_rsc_path = "C:\powershell\stub\stub.ps1"
-
- - iozone_windows: install setup image_copy unattended_install.cdrom
- only Windows
- type = iozone_windows
- iozone_cmd = "D:\IOzone\iozone.exe -a"
- iozone_timeout = 3600
-
- - whql: install setup image_copy unattended_install.cdrom
- only Windows
- nic_mode = tap
- # Replace this with the address of an installed DTM server
- server_address = 10.20.30.40
- # The server should run rss.exe like a regular Windows VM, preferably
- # with administrator privileges (or at least with permission to write
- # to the DTM studio directory)
- server_shell_port = 10022
- server_file_transfer_port = 10023
- server_studio_path = %programfiles%\Microsoft Driver Test Manager\Studio
- dsso_test_binary = deps/whql_submission_15.exe
- dsso_delete_machine_binary = deps/whql_delete_machine_15.exe
- wtt_services = wttsvc
- variants:
- - support_vm_install:
- # The support VM is identical to the tested VM in every way
- # except for the image name which ends with '-supportvm'.
- type = unattended_install
- image_name += -supportvm
- extra_params += " -boot d"
- force_create_image = yes
- kill_vm = yes
- nic_mode = user
- redirs += " unattended_install"
- guest_port_unattended_install = 12323
- medium = cdrom
- kernel =
- initrd =
- - client_install: support_vm_install
- type = whql_client_install
- # The username and password are required for accessing the DTM client
- # installer binary shared by the server
- server_username = administrator
- server_password = 1q2w3eP
- # This path refers to a shared directory on the server
- # (the final cmd will be something like \\servername\DTMInstall\...)
- install_cmd = \DTMInstall\Client\Setup.exe /passive
- install_timeout = 3600
- # The test will setup auto logon on the client machine using the
- # following username and password:
- client_username = DTMLLUAdminUser
- client_password = Testpassword,1
- # (These are created by the DTM client installer and should probably not
- # be changed.)
- variants:
- - @original:
- - support_vm:
- image_name += -supportvm
- - submission: client_install support_vm_install
- type = whql_submission
- extra_params += " -snapshot"
- restart_vm = yes
- cdroms =
- test_timeout = 3600
- device_data = cat0 cat1 cat2 cat3 prog desc virt filter logoarch logoos whqlos whqlqual
- descriptors = desc1 desc2 desc3
- # DeviceData names
- dd_name_cat0 = Category
- dd_name_cat1 = Category
- dd_name_cat2 = Category
- dd_name_cat3 = Category
- dd_name_logoarch = LogoProcessorArchitecture
- dd_name_logoos = LogoOperatingSystem
- dd_name_whqlos = WhqlOs
- dd_name_whqlqual = WhqlQualification
- dd_name_prog = LogoProgramId
- dd_name_desc = LogoProgramDescription
- dd_name_filter = WDKFilterAttribute
- dd_name_virt = ParaVirtualizationDriver
- # Common DeviceData data
- dd_data_filter = FilterIfNoInf
- dd_data_virt = True
- # Exclude jobs that have '(Manual)' in their names
- job_filter = ^((?!\(Manual\)).)*$
- variants:
- - unclassified:
- dd_data_cat0 = Device Fundamentals
- dd_data_cat1 = System Fundamentals\Dynamic Partitioning
- dd_data_prog = Unclassified
- dd_data_desc = Unclassified
- dd_data_whqlqual = Unclassified Signature
- variants:
- - tablet:
- submission_name = tablet
- extra_params += " -usbdevice tablet"
- test_device = HID-compliant mouse
- test_timeout = 36000
- - device:
- variants:
- - keyboard:
- submission_name = keyboard
- # test_device is a regular expression that should match a device's
- # name as it appears in device manager. The first device that matches
- # is used.
- test_device = keyboard
- # Set timeout to 10 hours
- test_timeout = 36000
- dd_data_cat0 = Input\Keyboard
- dd_data_cat1 = Device Fundamentals
- dd_data_cat2 = System Fundamentals\Dynamic Partitioning
- dd_data_prog = InputKbd
- dd_data_desc = Input > Keyboard
- - net:
- submission_name = net
- # Add a support machine and extra NICs
- vms += " supportvm"
- nics += " nic2 nic3"
- test_device = RTL8139.*NIC$
- test_timeout = 86400
- dd_data_cat0 = Network\LAN (Ethernet)
- dd_data_cat1 = Device Fundamentals
- dd_data_cat2 = System Fundamentals\Dynamic Partitioning
- dd_data_prog = NetLan
- dd_data_desc = Network > LAN (Ethernet)
- # Machine dimensions
- dimensions = testrole
- dim_name_testrole = NetDevice\TestRole
- dim_value_testrole_vm1 = NdistestLanClient
- dim_value_testrole_supportvm = NdistestLanServer
- # Device selection for the NDISTest client machine
- device_params_vm1 = testdev clientmsgdev clientsupportdev
- dp_name_testdev = NdistestLanClientTestDevice
- dp_regex_testdev = RTL8139.*NIC$
- dp_name_clientmsgdev = NdistestLanClientMessageDevice
- dp_regex_clientmsgdev = RTL8139.*NIC #2$
- dp_name_clientsupportdev = NdistestLanClientSupportDevice0
- dp_regex_clientsupportdev = RTL8139.*NIC #3$
- # Device selection for the NDISTest server machine
- device_params_supportvm = servermsgdev serversupportdev
- dp_name_servermsgdev = NdistestLanServerMessageDevice
- dp_regex_servermsgdev = RTL8139.*NIC$
- dp_name_serversupportdev = NdistestLanServerSupportDevice0
- dp_regex_serversupportdev = RTL8139.*NIC #2$
- - hdd:
- submission_name = hdd
- # Run the tests on a non-system drive
- # (match device names that contain 'QEMU HARDDISK' and do not contain '[C]')
- test_device = ^(?=.*?\bQEMU HARDDISK\b)((?!\[C\]).)*$
- device_data += " ex0 ex1 ex2 ex3"
- dd_data_cat0 = Storage\Device Class\Disk\Disk
- dd_data_cat1 = Storage\Device Class\Disk\Fixed
- dd_data_cat2 = Storage\Device Class\Disk\Bus\ATA
- dd_data_cat3 = Device Fundamentals
- dd_data_prog = StorHDD
- dd_data_desc = Storage > Hard Disk Drive (HDD)
- dd_name_ex0 = Storage_bus_type
- dd_data_ex0 = ATA/ATAPI
- dd_name_ex1 = Hybrid_HDD_Support
- dd_data_ex1 = 0
- dd_name_ex2 = Non_Rotating_Media
- dd_data_ex2 = 0
- dd_name_ex3 = Secure_Storage
- dd_data_ex3 = 0
- # Add a 2nd disk which will become D:
- images += " tmp"
- image_name_tmp = tmp
- image_size_tmp = 4G
- force_create_image_tmp = yes
- # Run diskpart to partition the 2nd disk
- whql_pre_command = "echo select disk=1 > dp.txt && "
- whql_pre_command += "echo create partition primary >> dp.txt && "
- whql_pre_command += "echo assign letter=d >> dp.txt && "
- whql_pre_command += "diskpart /s dp.txt & "
- whql_pre_command += "format d: /fs:ntfs /q /y"
- variants:
- - full:
- # Yes, 100 hours, this is not a mistake
- test_timeout = 360000
- - syscache_test:
- job_filter = syscache test
- test_timeout = 7200
-
- - guest_s4: install setup image_copy unattended_install.cdrom
- type = guest_s4
- check_s4_support_cmd = grep -q disk /sys/power/state
- test_s4_cmd = "cd /tmp; nohup tcpdump -q -t ip host localhost"
- check_s4_cmd = pgrep tcpdump
- set_s4_cmd = echo disk > /sys/power/state
- kill_test_s4_cmd = pkill tcpdump
- services_up_timeout = 30
- relogin_timeout = 240
-
- - nic_hotplug: install setup image_copy unattended_install.cdrom
- pci_type = nic
- reference_cmd = lspci
- find_pci_cmd = 'lspci | tail -n1'
- pci_test_cmd = 'nslookup www.redhat.com'
- wait_secs_for_hook_up = 3
- variants:
- - nic_8139:
- pci_model = rtl8139
- match_string = "8139"
- - nic_virtio:
- pci_model = virtio
- match_string = "Virtio network device"
- - nic_e1000:
- pci_model = e1000
- match_string = "Gigabit Ethernet Controller"
- variants:
- - default:
- type = pci_hotplug
- - additional:
- type = nic_hotplug
-
-
- - block_hotplug: install setup image_copy unattended_install.cdrom
- type = pci_hotplug
- pci_type = block
- reference_cmd = lspci
- find_pci_cmd = 'lspci | tail -n1'
- images += " stg"
- boot_drive_stg = no
- image_name_stg = storage
- image_size_stg = 1G
- remove_image_stg = yes
- force_create_image_stg = yes
- pci_test_cmd = "yes | mke2fs `fdisk -l 2>&1 | awk '/\/dev\/[sv]d[a-z] doesn/ {print $2}'`"
- wait_secs_for_hook_up = 3
- kill_vm_on_error = yes
- variants:
- - block_virtio:
- pci_model = virtio
- match_string = "Virtio block device"
- - block_scsi:
- pci_model = scsi
- match_string = "LSI Logic"
- variants:
- - fmt_qcow2:
- image_format_stg = qcow2
- - fmt_raw:
- image_format_stg = raw
-
- - enospc: install setup image_copy unattended_install.cdrom
- type = enospc
- start_vm = no
- images += " stg"
- drive_werror = stop
- drive_cache = none
- image_name_stg = enospc
- image_format_stg = qcow2
- image_boot_stg = no
- image_snapshot_stg = no
- check_image_stg = no
- vgtest_name = vg_kvm_test_enospc
- lvtest_name = lv_kvm_test_enospc
- background_cmd = "nohup dd if=/dev/zero of=%s bs=1024 &"
- kill_vm = yes
-
- - qmp_basic: install setup image_copy unattended_install.cdrom
- type = qmp_basic
-
- - qmp_basic_rhel6: install setup image_copy unattended_install.cdrom
- type = qmp_basic_rhel6
-
- - vlan: install setup image_copy unattended_install.cdrom
- only Linux
- type = vlan
- # subnet should not be used by host
- subnet = "192.168"
- vlan_num = 5
- file_size = 10
- maximal = 4094
- listen_cmd = "nc -l %s > %s"
- send_cmd = "nc %s %s < %s"
- nic_mode = tap
- vms += " vm2"
- image_snapshot = yes
- kill_vm_vm2 = yes
- kill_vm_gracefully_vm2 = no
-
- - ping: install setup image_copy unattended_install.cdrom
- type = ping
- counts = 100
- flood_minutes = 10
- nics += ' nic2'
-
- - jumbo: install setup image_copy unattended_install.cdrom
- only Linux
- type = jumbo
-
- - file_transfer: install setup image_copy unattended_install.cdrom
- type = file_transfer
- filesize = 4000
- transfer_timeout = 1000
- variants:
- - remote:
- transfer_type = remote
-
- - nicdriver_unload: install setup image_copy unattended_install.cdrom
- only Linux
- type = nicdriver_unload
- nic_mode = tap
- filesize = 100
- transfer_timeout = 100
- transfer_type = remote
- sessions_num = 10
-
- - nic_promisc: install setup image_copy unattended_install.cdrom
- only Linux
- type = nic_promisc
- filesize = 400
- transfer_timeout = 100
- transfer_type = remote
-
- - multicast: install setup image_copy unattended_install.cdrom
- only Linux
- type = multicast
- nic_mode = tap
- mcast = 225.0.0.1
- mgroup_count = 20
- flood_minutes = 1
-
- - mac_change: install setup image_copy unattended_install.cdrom
- only Linux
- type = mac_change
- kill_vm = yes
-
- - netperf: install setup image_copy unattended_install.cdrom
- only Linux
- type = netperf
- nics += ' nic2 nic3 nic4'
- nic_mode = tap
- netperf_files = netperf-2.4.5.tar.bz2 wait_before_data.patch
- packet_size = 1500
- setup_cmd = "cd %s && tar xvfj netperf-2.4.5.tar.bz2 && cd netperf-2.4.5 && patch -p0 < ../wait_before_data.patch && ./configure && make"
- netserver_cmd = %s/netperf-2.4.5/src/netserver
- variants:
- - stream:
- netperf_cmd = %s/netperf-2.4.5/src/netperf -t %s -H %s -l 60 -- -m %s
- protocols = "TCP_STREAM TCP_MAERTS TCP_SENDFILE UDP_STREAM"
- - rr:
- netperf_cmd = %s/netperf-2.4.5/src/netperf -t %s -H %s -l 60 -- -r %s
- protocols = "TCP_RR TCP_CRR UDP_RR"
-
- - ethtool: install setup image_copy unattended_install.cdrom
- only Linux
- type = ethtool
- filesize = 512
- nic_mode = tap
-
- - nic_bonding: install setup image_copy unattended_install.cdrom
- only Linux
- type = nic_bonding
- nics += ' nic2 nic3 nic4'
- image_snapshot = yes
- serial_login = yes
- test_timeout = 1000
- filesize = 4000
- transfer_timeout = 1000
- transfer_type = remote
- kill_vm = yes
- # you can specify the parameters of bonding module here
- # bonding_params = "mode=active-backup"
-
- - set_link: install setup image_copy unattended_install.cdrom
- type = set_link
- test_timeout = 1000
- filesize = 4000
- transfer_timeout = 1000
- transfer_type = remote
- kill_vm =yes
-
- - netstress_kill_guest: install setup unattended_install.cdrom
- only Linux
- type = netstress_kill_guest
- image_snapshot = yes
- nic_mode = tap
- # There should be enough vms for build topology.
- variants:
- -driver:
- mode = driver
- -load:
- mode = load
- netperf_files = netperf-2.4.5.tar.bz2 wait_before_data.patch
- packet_size = 1500
- setup_cmd = "cd %s && tar xvfj netperf-2.4.5.tar.bz2 && cd netperf-2.4.5 && patch -p0 < ../wait_before_data.patch && ./configure && make"
- clean_cmd = " while killall -9 netserver; do True test; done;"
- netserver_cmd = %s/netperf-2.4.5/src/netserver
- netperf_cmd = %s/netperf-2.4.5/src/netperf -t %s -H %s -l 60 -- -m %s
-
- - physical_resources_check: install setup image_copy unattended_install.cdrom
- type = physical_resources_check
- catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}'
-
- - ksm_overcommit: install setup image_copy unattended_install.cdrom
- only Linux
- # Don't preprocess any vms as we need to change its params
- vms = ''
- image_snapshot = yes
- kill_vm_gracefully = no
- type = ksm_overcommit
- # Make host use swap (a value of 'no' will turn off host swap)
- ksm_swap = yes
- no hugepages
- # Overcommit of host memmory
- ksm_overcommit_ratio = 3
- # Max paralel runs machine
- ksm_parallel_ratio = 4
- # Host memory reserve (default - best fit for used mem)
- # ksm_host_reserve = 512
- # ksm_guest_reserve = 1024
- variants:
- - ksm_serial:
- ksm_mode = "serial"
- - ksm_parallel:
- ksm_mode = "parallel"
-
- - iofuzz: install setup image_copy unattended_install.cdrom
- only Linux
- type = iofuzz
-
- - virtio_console: install setup image_copy unattended_install.cdrom
- only Linux
- vms = ''
- type = virtio_console
- # Default number of consoles
- virtio_console_no_serialports = 0
- virtio_console_no_consoles = 0
-
- # smoke params - $console_type:data_string
- # FIXME: test_smoke doesn't work with console yet (virtio_console bug)
- # "serialport;console:Custom data"
- smoke_test = yes
- virtio_console_smoke = "serialport"
- # loopback params - '$source_console_type@buffer_length:$destination_console_type1@buffer_length:...:$loopback_buffer_length;...'
- loopback_test = yes
- virtio_console_loopback = "serialport:serialport;serialport@1024:serialport@32:console@1024:console@8:16"
- # perf params - $console_type@buffer_length:$test_duration
- # FIXME: test_perf doesn't work with console yet (virtio_console bug)
- # virtio_console_perf = "serialport;serialport@1000000:120;console@1024:60"
- perf_test = yes
- virtio_console_perf = "serialport;serialport@1000000:120"
- # Enable destructive tests: "test_name = yes"
- # Disable test: change yes or delete key.
- rmmod_test = yes
- max_ports_test = yes
- shutdown_test = yes
-
- # Offline migration params - '$console_type:$no_migrations:$send-:$recv-$loopback-buffer_length'
- migrate_offline_test = yes
- virtio_console_migration_offline = "serialport:1:2048:2048:2048;serialport:5:4096:4096:4096"
-
- # Online migration params - '$console_type:$no_migrations:$send-:$recv-$loopback-buffer_length'
- migrate_online_test = yes
- virtio_console_migration_online = "serialport:1:2048:2048:2048;serialport:5:4096:4096:4096"
-
- hotplug_test = yes
- hotplug_serial_test = yes
- hotplug_console_test = no
-
- # This unit test module is for older branches of KVM that use the
- # kvmctl test harness (such as the code shipped with RHEL 5.x)
- - unit_test_kvmctl:
- type = unit_test
- vms = ''
- profilers = ''
- variants:
- - access:
- case = access
- - apic:
- case = apic
- - emulator:
- case = emulator
- - hypercall:
- case = hypercall
- - msr:
- case = msr
- - port80:
- case = port80
- - realmode:
- case = realmode
- - sieve:
- case = sieve
- - smptest:
- case = smptest
- - tsc:
- case = tsc
- - stringio:
- case = stringio
- - vmexit:
- case = vmexit
-
- - fillup_disk: install setup image_copy unattended_install.cdrom
- only Linux
- only qcow2
- type = fillup_disk
- fillup_timeout = 120
- fillup_size = 200
- fillup_cmd = "dd if=/dev/zero of=/%s/fillup.%d bs=%dM count=1 oflag=direct"
- kill_vm = yes
-
- - lvm: install setup image_copy unattended_install.cdrom
- only Linux
- images += ' stg1 stg2'
- image_name_stg1 = storage_4k
- image_cluster_size_stg1 = 4096
- image_size_stg1 = 1G
- image_format_stg1 = qcow2
- image_name_stg2 = storage_64k
- image_cluster_size_stg2 = 65536
- image_size_stg2 = 1G
- image_format_stg2 = qcow2
- guest_testdir = /mnt
- disks = "/dev/sdb /dev/sdc"
- kill_vm = no
- post_command_noncritical = no
- variants:
- lvm_create:
- type = lvm
- force_create_image_stg1 = yes
- force_create_image_stg2 = yes
- clean = no
- lvm_fill: lvm_create
- type = fillup_disk
- force_create_image_stg1 = no
- force_create_image_stg2 = no
- guest_testdir = /mnt/kvm_test_lvm
- fillup_timeout = 120
- fillup_size = 20
- fillup_cmd = "dd if=/dev/zero of=%s/fillup.%d bs=%dM count=1 oflag=direct"
- lvm_ioquit: lvm_create
- type = ioquit
- force_create_image_stg1 = no
- force_create_image_stg2 = no
- kill_vm = yes
- background_cmd = "for i in 1 2 3 4; do (dd if=/dev/urandom of=/mnt/kvm_test_lvm/file bs=102400 count=10000000 &); done"
- check_cmd = pgrep dd
- clean = yes
- remove_image_stg1 = yes
- remove_image_stg2 = yes
-
- - ioquit: install setup image_copy unattended_install.cdrom
- only Linux
- type = ioquit
- background_cmd = "for i in 1 2 3 4; do (dd if=/dev/urandom of=/tmp/file bs=102400 count=10000000 &); done"
- check_cmd = ps -a |grep dd
- login_timeout = 360
-
- - multi_disk: install setup image_copy unattended_install.cdrom
- type = multi_disk
- force_create_image = yes
- force_create_image_image1 = no
- remove_image = yes
- remove_image_image1 = no
- cmd_timeout = 1000
- block_list = C: D: vda vda1 vda2 hda hda1 hda2 sda sda1 sda2
- variants:
- - signal_repeat:
- images += " stg"
- image_format_stg = qcow2
- image_name_stg = storage
- image_size_stg = 1G
- n_repeat = 10
- - max_disk:
- only virtio_blk
- images += " stg stg2 stg3 stg4 stg5 stg6 stg7 stg8 stg9 stg10 stg11 stg12 stg13 stg14 stg15 stg16 stg17 stg18 stg19 stg20 stg21 stg22 stg23"
- image_name_stg = storage
- image_name_stg2 = storage2
- image_name_stg3 = storage3
- image_name_stg4 = storage4
- image_name_stg5 = storage5
- image_name_stg6 = storage6
- image_name_stg7 = storage7
- image_name_stg8 = storage8
- image_name_stg9 = storage9
- image_name_stg10 = storage10
- image_name_stg11 = storage11
- image_name_stg12 = storage12
- image_name_stg13 = storage13
- image_name_stg14 = storage14
- image_name_stg15 = storage15
- image_name_stg16 = storage16
- image_name_stg17 = storage17
- image_name_stg18 = storage18
- image_name_stg19 = storage19
- image_name_stg20 = storage20
- image_name_stg21 = storage21
- image_name_stg22 = storage22
- image_name_stg23 = storage23
-
- - clock_getres: install setup image_copy unattended_install.cdrom
- only Linux
- type = clock_getres
-
- - yum_update: install setup image_copy unattended_install.cdrom
- only Fedora, RHEL
- type = yum_update
- shell_prompt = "Is this ok"
-
- - kdump: install setup image_copy unattended_install.cdrom
- only RHEL.5, RHEL.6
- type = kdump
- # time waited for the completion of crash dump
- # crash_timeout = 360
- # command to add the crashkernel=X@Y to kernel cmd line
- # kernel_param_cmd = "grubby --update-kernel=`grubby --default-kernel` --args=crashkernel=128M@64M"
- # command to enable kdump service
- # kdump_enable_cmd = chkconfig kdump on && service kdump start
- # command to probe the crash kernel
- # crash_kernel_prob_cmd = "grep -q 1 /sys/kernel/kexec_crash_loaded"
-
- - vmstop: install setup image_copy unattended_install.cdrom
- type = vmstop
- # the path used to store the saved vm state
- # save_path = /tmp
- # clean the state file?
- clean_save = yes
-
- - cdrom_test: install setup image_copy unattended_install.cdrom
- only Linux
- start_vm = no
- type = cdrom
- cdrom_cd1 = orig.iso
- max_times = 20
-
- - nmi_watchdog: install setup image_copy unattended_install.cdrom
- type = nmi_watchdog
- get_nmi_cmd = grep NMI /proc/interrupts
- nmi_watchdog_type = 1
- image_snapshot = yes
- only Linux
-
- - floppy: install setup image_copy unattended_install.cdrom
- type = floppy
- start_vm = no
- floppy = images/test_floppy.img
-
- - trans_hugepage: install setup image_copy unattended_install.cdrom
- thp_test_config = ""
- kill_vm = yes
- login_timeout = 360
- variants:
- - base:
- type = trans_hugepage
- dd_timeout = 900
- - defrag:
- type = trans_hugepage_defrag
- - swapping:
- type = trans_hugepage_swapping
- dd_timeout = 900
- check_cmd_timeout = 900
-
- - cpu_hotplug_test:
- type = cpu_hotplug
- cpu_hotplug_timeout = 600
- n_cpus_add = 1
- kill_vm = yes
- iterations = 5
- onoff_iterations = 100
-
- - usb: install setup image_copy unattended_install.cdrom
- only Linux
- type = usb
- kill_vm = yes
- format_timeout = 400
- images += " stg"
- image_name_stg = "usbdevice"
- image_format_stg = "qcow2"
- image_boot_stg = no
- drive_format_stg = "usb2"
- drive_index_stg = 1
- create_image_stg = yes
- image_size_stg = 10M
- fdisk_string = "10 MB, 10485760 bytes"
-
- - hdparm:
- only Linux
- type = hdparm
- get_disk_cmd = \ls /dev/[vhs]da
- low_status_cmd = hdparm -a64 -d0 -u0 %s
- device_cache_read_cmd = hdparm -tT %s
- high_status_cmd = hdparm -a256 -d1 -u1 %s
- cmd_timeout = 540
- virtio_blk:
- get_disk_cmd = \ls /dev/vda
- low_status_cmd = hdparm -a32 -r0 %s
- high_status_cmd = hdparm -a256 -r1 %s
-
- # system_powerdown, system_reset and shutdown *must* be the last ones
- # defined (in this order), since the effect of such tests can leave
- # the VM on a bad state.
- - system_powerdown: install setup image_copy unattended_install.cdrom
- type = shutdown
- shutdown_method = system_powerdown
- sleep_before_powerdown = 20
- kill_vm = yes
-
- - system_reset: install setup image_copy unattended_install.cdrom
- type = boot
- reboot_method = system_reset
- sleep_before_reset = 20
- kill_vm_on_error = yes
-
- - system_reset_bootable: install setup image_copy unattended_install.cdrom
- type = system_reset_bootable
- interval = 1
- reset_times = 20
- wait_time_for_reset = 120
- kill_vm_on_error = yes
-
- - shutdown: install setup image_copy unattended_install.cdrom
- type = shutdown
- shutdown_method = shell
- kill_vm = yes
- kill_vm_gracefully = no
diff --git a/client/tests/kvm/tests.cfg.sample b/client/tests/kvm/tests.cfg.sample
deleted file mode 100644
index e260166..0000000
--- a/client/tests/kvm/tests.cfg.sample
+++ /dev/null
@@ -1,142 +0,0 @@
-# Copy this file to tests.cfg and edit it.
-#
-# This file contains the test set definitions. Define your test sets here.
-
-# Include the base config files.
-include base.cfg
-include subtests.cfg
-include guest-os.cfg
-include cdkeys.cfg
-include virtio-win.cfg
-
-# Here you can override the image name for our custom linux and windows guests
-#
-CustomGuestLinux:
- # Here you can override the default login credentials for your custom guest
- username = root
- password = 123456
- image_name = custom_image_linux
- image_size = 10G
- # If you want to use a block device as the vm disk, uncomment the 2 lines
- # below, pointing the image name for the device you want
- #image_name = /dev/mapper/vg_linux_guest
- #image_raw_device = yes
-
-CustomGuestWindows:
- image_name = custom_image_windows
- image_size = 10G
- # If you want to use a block device as the vm disk, uncomment the 2 lines
- # below, pointing the image name for the device you want
- #image_name = /dev/mapper/vg_windows_guest
- #image_raw_device = yes
-
-# Modify/comment the following lines if you wish to modify the paths of the
-# image files, ISO files or qemu binaries.
-#
-# As for the defaults:
-# * qemu and qemu-img are expected to be found under /usr/bin/qemu-kvm and
-# /usr/bin/qemu-img respectively.
-# * All image files are expected under /tmp/kvm_autotest_root/images/
-# * All install iso files are expected under /tmp/kvm_autotest_root/isos/
-# * The parameters cdrom_unattended, floppy, kernel and initrd are generated
-# by KVM autotest, so remember to put them under a writable location
-# (for example, the cdrom share can be read only)
-image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/
-cdrom(_.*)? ?<= /tmp/kvm_autotest_root/
-floppy ?<= /tmp/kvm_autotest_root/
-Linux..unattended_install:
- kernel ?<= /tmp/kvm_autotest_root/
- initrd ?<= /tmp/kvm_autotest_root/
-
-# Here are the test sets variants. The variant 'qemu_kvm_windows_quick' is
-# fully commented, the following ones have comments only on noteworthy points
-variants:
- # Runs all variants defined. HUGE test set.
- - @full:
-
- # Runs qemu-kvm, Windows Vista 64 bit guest OS, install, boot, shutdown
- - @qemu_kvm_windows_quick:
- # We want qemu-kvm for this run
- qemu_binary = /usr/bin/qemu-kvm
- qemu_img_binary = /usr/bin/qemu-img
- # Only qcow2 file format
- only qcow2
- # Only rtl8139 for nw card (default on qemu-kvm)
- only rtl8139
- # Only ide hard drives
- only ide
- # qemu-kvm will start only with -smp 2 (2 processors)
- only smp2
- # No PCI assignable devices
- only no_pci_assignable
- # No large memory pages
- only smallpages
- # Operating system choice
- only Win7.64
- # Subtest choice. You can modify that line to add more subtests
- only unattended_install.cdrom, boot, shutdown
-
- # Runs qemu, f15 64 bit guest OS, install, boot, shutdown
- - @qemu_f15_quick:
- # We want qemu for this run
- qemu_binary = /usr/bin/qemu
- qemu_img_binary = /usr/bin/qemu-img
- only qcow2
- # The default nw card for qemu is e1000
- only e1000
- only ide
- # qemu using kvm doesn't support smp yet
- only up
- only no_pci_assignable
- only smallpages
- only Fedora.15.64
- only unattended_install.cdrom, boot, shutdown
- # qemu needs -enable-kvm on the cmdline
- extra_params += ' -enable-kvm'
-
- # Runs qemu-kvm, f15 64 bit guest OS, install, boot, shutdown
- - @qemu_kvm_f15_quick:
- # We want qemu-kvm for this run
- qemu_binary = /usr/bin/qemu-kvm
- qemu_img_binary = /usr/bin/qemu-img
- only qcow2
- only rtl8139
- only ide
- only smp2
- only no_pci_assignable
- only smallpages
- only Fedora.15.64
- only unattended_install.cdrom, boot, shutdown
-
- # Runs your own guest image (qcow2, can be adjusted), all migration tests
- # (on a core2 duo laptop with HD and 4GB RAM, F15 host took 3 hours to run)
- # Be warned, disk stress + migration can corrupt your image, so make sure
- # you have proper backups
- - @qemu_kvm_custom_migrate:
- # We want qemu-kvm for this run
- qemu_binary = /usr/bin/qemu-kvm
- qemu_img_binary = /usr/bin/qemu-img
- only qcow2
- only rtl8139
- only ide
- only smp2
- only no_pci_assignable
- only smallpages
- only CustomGuestLinux
- only migrate
-
-# You may provide information about the DTM server for WHQL tests here:
-#whql:
-# server_address = 10.20.30.40
-# server_shell_port = 10022
-# server_file_transfer_port = 10023
-# Note that the DTM server must run rss.exe (available under deps/),
-# preferably with administrator privileges.
-
-# Uncomment the following lines to enable abort-on-error mode:
-#abort_on_error = yes
-#kill_vm.* ?= no
-#kill_unresponsive_vms.* ?= no
-
-# Choose your test list from the testsets defined
-only qemu_kvm_f15_quick
diff --git a/client/tests/kvm/tests/__init__.py b/client/tests/kvm/tests/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/client/tests/kvm/tests/__init__.py
+++ /dev/null
diff --git a/client/tests/kvm/tests/balloon_check.py b/client/tests/kvm/tests/balloon_check.py
deleted file mode 100644
index 0b7f0f4..0000000
--- a/client/tests/kvm/tests/balloon_check.py
+++ /dev/null
@@ -1,107 +0,0 @@
-import re, logging, random, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor
-
-
-def run_balloon_check(test, params, env):
- """
- Check Memory ballooning:
- 1) Boot a guest
- 2) Change the memory between 60% to 95% of memory of guest using ballooning
- 3) check memory info
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- def check_ballooned_memory():
- """
- Verify the actual memory reported by monitor command info balloon. If
- the operation failed, increase the failure counter.
-
- @return: Number of failures occurred during operation.
- """
- fail = 0
- try:
- output = vm.monitor.info("balloon")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- fail += 1
- return 0
- return int(re.findall("\d+", output)[0]), fail
-
-
- def balloon_memory(new_mem):
- """
- Baloon memory to new_mem and verifies on both qemu monitor and
- guest OS if change worked.
-
- @param new_mem: New desired memory.
- @return: Number of failures occurred during operation.
- """
- fail = 0
- logging.info("Changing VM memory to %s", new_mem)
- # This should be replaced by proper monitor method call
- vm.monitor.cmd("balloon %s" % new_mem)
- time.sleep(20)
-
- ballooned_mem, cfail = check_ballooned_memory()
- fail += cfail
- # Verify whether the VM machine reports the correct new memory
- if ballooned_mem != new_mem:
- logging.error("Memory ballooning failed while changing memory "
- "to %s", new_mem)
- fail += 1
-
- # Verify whether the guest OS reports the correct new memory
- current_mem_guest = vm.get_current_memory_size()
-
- # Current memory figures will allways be a little smaller than new
- # memory. If they are higher, ballooning failed on guest perspective
- if current_mem_guest > new_mem:
- logging.error("Guest OS reports %s of RAM, but new ballooned RAM "
- "is %s", current_mem_guest, new_mem)
- fail += 1
- return fail
-
-
- fail = 0
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Upper limit that we can raise the memory
- vm_assigned_mem = int(params.get("mem"))
-
- # Check memory size
- logging.info("Memory check")
- boot_mem = vm.get_memory_size()
- if boot_mem != vm_assigned_mem:
- logging.error("Memory size mismatch:")
- logging.error(" Assigned to VM: %s", vm_assigned_mem)
- logging.error(" Reported by guest OS at boot: %s", boot_mem)
- fail += 1
-
- # Check if info balloon works or not
- current_vm_mem, cfail = check_ballooned_memory()
- if cfail:
- fail += cfail
- if current_vm_mem:
- logging.info("Current VM memory according to ballooner: %s",
- current_vm_mem)
-
- # Reduce memory to random size between 60% to 95% of max memory size
- percent = random.uniform(0.6, 0.95)
- new_mem = int(percent * vm_assigned_mem)
- fail += balloon_memory(new_mem)
-
- # Reset memory value to original memory assigned on qemu. This will ensure
- # we won't trigger guest OOM killer while running multiple iterations
- fail += balloon_memory(vm_assigned_mem)
-
- # Close stablished session
- session.close()
- # Check if any failures happen during the whole test
- if fail != 0:
- raise error.TestFail("Memory ballooning test failed")
diff --git a/client/tests/kvm/tests/boot_savevm.py b/client/tests/kvm/tests/boot_savevm.py
deleted file mode 100644
index b5da338..0000000
--- a/client/tests/kvm/tests/boot_savevm.py
+++ /dev/null
@@ -1,60 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor
-
-
-def run_boot_savevm(test, params, env):
- """
- KVM boot savevm test:
- 1) Start guest
- 2) Periodically savevm/loadvm
- 4) Log into the guest to verify it's up, fail after timeout seconds
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- savevm_delay = float(params.get("savevm_delay"))
- savevm_login_delay = float(params.get("savevm_login_delay"))
- logging.info("savevm_delay = %f", savevm_delay)
- login_expire = time.time() + savevm_login_delay
- end_time = time.time() + float(params.get("savevm_timeout"))
-
- while time.time() < end_time:
- time.sleep(savevm_delay)
-
- try:
- vm.monitor.cmd("stop")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- try:
- # This should be replaced by a proper monitor method call
- vm.monitor.cmd("savevm 1")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- try:
- vm.monitor.cmd("system_reset")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- try:
- # This should be replaced by a proper monitor method call
- vm.monitor.cmd("loadvm 1")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- try:
- vm.monitor.cmd("cont")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
-
- # Log in
- if (time.time() > login_expire):
- login_expire = time.time() + savevm_login_delay
- logging.info("Logging in after loadvm...")
- session = vm.login()
- logging.info("Logged in to guest!")
- break
-
- if (time.time() > end_time):
- raise error.TestFail("fail: timeout")
diff --git a/client/tests/kvm/tests/build.py b/client/tests/kvm/tests/build.py
deleted file mode 100644
index cfebcd6..0000000
--- a/client/tests/kvm/tests/build.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from autotest_lib.client.virt import kvm_installer
-
-
-def run_build(test, params, env):
- """
- Installs KVM using the selected install mode. Most install methods will
- take kvm source code, build it and install it to a given location.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Test environment.
- """
- srcdir = params.get("srcdir", test.srcdir)
- params["srcdir"] = srcdir
-
- try:
- installer_object = kvm_installer.make_installer(params)
- installer_object.set_install_params(test, params)
- installer_object.install()
- env.register_installer(installer_object)
- except Exception, e:
- # if the build/install fails, don't allow other tests
- # to get a installer.
- msg = "KVM install failed: %s" % (e)
- env.register_installer(kvm_installer.FailedInstaller(msg))
- raise
diff --git a/client/tests/kvm/tests/cdrom.py b/client/tests/kvm/tests/cdrom.py
deleted file mode 100644
index ebd3e8c..0000000
--- a/client/tests/kvm/tests/cdrom.py
+++ /dev/null
@@ -1,190 +0,0 @@
-import logging, re, time, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils, aexpect, kvm_monitor
-
-
[email protected]_aware
-def run_cdrom(test, params, env):
- """
- KVM cdrom test:
-
- 1) Boot up a VM with one iso.
- 2) Check if VM identifies correctly the iso file.
- 3) Eject cdrom and change with another iso several times.
- 4) Try to format cdrom and check the return string.
- 5) Mount cdrom device.
- 6) Copy file from cdrom and compare files using diff.
- 7) Umount and mount several times.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- def master_cdroms(params):
- error.context("creating test cdrom")
- os.chdir(test.tmpdir)
- cdrom_cd1 = params.get("cdrom_cd1")
- cdrom_dir = os.path.dirname(cdrom_cd1)
- utils.run("dd if=/dev/urandom of=orig bs=10M count=1")
- utils.run("dd if=/dev/urandom of=new bs=10M count=1")
- utils.run("mkisofs -o %s/orig.iso orig" % cdrom_dir)
- utils.run("mkisofs -o %s/new.iso new" % cdrom_dir)
- return "%s/new.iso" % cdrom_dir
-
-
- def cleanup_cdroms(cdrom_dir):
- error.context("cleaning up temp cdrom images")
- os.remove("%s/orig.iso" % cdrom_dir)
- os.remove("%s/new.iso" % cdrom_dir)
-
-
- def get_cdrom_info():
- blocks = vm.monitor.info("block")
- (device, file) = (None, None)
- if isinstance(blocks, str):
- try:
- device = re.findall("(ide\d+-cd\d+): .*", blocks)[0]
- except IndexError:
- device = None
- try:
- file = re.findall("ide\d+-cd\d+: .*file=(\S*) ", blocks)[0]
- except IndexError:
- file = None
- else:
- for block in blocks:
- d = block['device']
- try:
- device = re.findall("(ide\d+-cd\d+)", d)[0]
- except IndexError:
- device = None
- continue
- try:
- file = block['inserted']['file']
- except KeyError:
- file = None
- break
- logging.debug("Device name: %s, ISO: %s" % (device, file))
- return (device, file)
-
-
- def check_cdrom_locked(cdrom):
- blocks = vm.monitor.info("block")
- if isinstance(blocks, str):
- lock_str = "locked=1"
- for block in blocks.splitlines():
- if cdrom in block and lock_str in block:
- return True
- else:
- for block in blocks:
- if ('inserted' in block.keys() and
- block['inserted']['file'] == cdrom):
- return block['locked']
- return False
-
-
- def eject_cdrom(device, monitor):
- if isinstance(monitor, kvm_monitor.HumanMonitor):
- monitor.cmd("eject %s" % device)
- elif isinstance(monitor, kvm_monitor.QMPMonitor):
- monitor.cmd("eject", args={'device': device})
-
-
- def change_cdrom(device, target, monitor):
- if isinstance(monitor, kvm_monitor.HumanMonitor):
- monitor.cmd("change %s %s" % (device, target))
- elif isinstance(monitor, kvm_monitor.QMPMonitor):
- monitor.cmd("change", args={'device': device, 'target': target})
-
-
- cdrom_new = master_cdroms(params)
- cdrom_dir = os.path.dirname(cdrom_new)
- vm = env.get_vm(params["main_vm"])
- vm.create()
-
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
- cdrom_orig = params.get("cdrom_cd1")
- cdrom = cdrom_orig
- output = session.get_command_output("ls /dev/cdrom*")
- cdrom_dev_list = re.findall("/dev/cdrom-\w+|/dev/cdrom\d*", output)
- logging.debug("cdrom_dev_list: %s" % cdrom_dev_list)
-
- cdrom_dev = ""
- test_cmd = "dd if=%s of=/dev/null bs=1 count=1"
- for d in cdrom_dev_list:
- try:
- output = session.cmd(test_cmd % d)
- cdrom_dev = d
- break
- except aexpect.ShellError:
- logging.error(output)
- if not cdrom_dev:
- raise error.TestFail("Could not find a valid cdrom device")
-
- error.context("Detecting the existence of a cdrom")
- (device, file) = get_cdrom_info()
- if file != cdrom:
- raise error.TestError("Could not find a valid cdrom device")
-
- session.get_command_output("umount %s" % cdrom_dev)
- if not virt_utils.wait_for(lambda: not check_cdrom_locked(file), 300):
- raise error.TestError("Device %s could not be unlocked" % device)
-
- max_times = int(params.get("max_times", 100))
- error.context("Eject the cdrom for %s times" % max_times)
- for i in range(1, max_times):
- eject_cdrom(device, vm.monitor)
- (device, file) = get_cdrom_info()
- if file is not None:
- raise error.TestFail("Device %s was not ejected" % cdrom)
-
- cdrom = cdrom_new
- # On even attempts, try to change the cdrom
- if i % 2 == 0:
- cdrom = cdrom_orig
- change_cdrom(device, cdrom, vm.monitor)
- time.sleep(10)
- (device, file) = get_cdrom_info()
- if file != cdrom:
- raise error.TestError("It wasn't possible to change cdrom %s" %
- cdrom)
-
- error.context("Check whether the cdrom is read-only")
- try:
- output = session.cmd("echo y | mkfs %s" % cdrom_dev)
- raise error.TestFail("Attempt to format cdrom %s succeeded" % cdrom_dev)
- except aexpect.ShellError:
- pass
-
- error.context("Mounting the cdrom under /mnt")
- session.cmd("mount %s %s" % (cdrom_dev, "/mnt"), timeout=30)
-
- filename = "new"
-
- error.context("File copying test")
- session.cmd("rm -f /tmp/%s" % filename)
- session.cmd("cp -f /mnt/%s /tmp/" % filename)
-
- error.context("Compare file on disk and on cdrom")
- f1_hash = session.cmd("md5sum /mnt/%s" % filename).split()[0].strip()
- f2_hash = session.cmd("md5sum /tmp/%s" % filename).split()[0].strip()
- if f1_hash != f2_hash:
- raise error.TestFail("On disk and on cdrom files are different, "
- "md5 mismatch")
-
- error.context("Mount/Unmount cdrom for %s times" % max_times)
- for i in range(1, max_times):
- try:
- session.cmd("umount %s" % cdrom_dev)
- session.cmd("mount %s /mnt" % cdrom_dev)
- except aexpect.ShellError:
- logging.debug(session.cmd("cat /etc/mtab"))
- raise
-
- session.cmd("umount %s" % cdrom_dev)
- (device, file) = get_cdrom_info()
- if device is not None:
- eject_cdrom(device, vm.monitor)
-
- session.close()
- cleanup_cdroms(cdrom_dir)
diff --git a/client/tests/kvm/tests/cpu_hotplug.py b/client/tests/kvm/tests/cpu_hotplug.py
deleted file mode 100644
index e4d79f8..0000000
--- a/client/tests/kvm/tests/cpu_hotplug.py
+++ /dev/null
@@ -1,111 +0,0 @@
-import os, logging, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils
-
-
[email protected]_aware
-def run_cpu_hotplug(test, params, env):
- """
- Runs CPU hotplug test:
-
- 1) Pick up a living guest
- 2) Send the monitor command cpu_set [cpu id] for each cpu we wish to have
- 3) Verify if guest has the additional CPUs showing up under
- /sys/devices/system/cpu
- 4) Try to bring them online by writing 1 to the 'online' file inside that dir
- 5) Run the CPU Hotplug test suite shipped with autotest inside guest
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- n_cpus_add = int(params.get("n_cpus_add", 1))
- current_cpus = int(params.get("smp", 1))
- onoff_iterations = int(params.get("onoff_iterations", 20))
- total_cpus = current_cpus + n_cpus_add
-
- error.context("getting guest dmesg before addition")
- dmesg_before = session.cmd("dmesg -c")
-
- error.context("Adding %d CPUs to guest" % n_cpus_add)
- for i in range(total_cpus):
- vm.monitor.cmd("cpu_set %s online" % i)
-
- output = vm.monitor.cmd("info cpus")
- logging.debug("Output of info cpus:\n%s", output)
-
- cpu_regexp = re.compile("CPU #(\d+)")
- total_cpus_monitor = len(cpu_regexp.findall(output))
- if total_cpus_monitor != total_cpus:
- raise error.TestFail("Monitor reports %s CPUs, when VM should have %s" %
- (total_cpus_monitor, total_cpus))
-
- dmesg_after = session.cmd("dmesg -c")
- logging.debug("Guest dmesg output after CPU add:\n%s" % dmesg_after)
-
- # Verify whether the new cpus are showing up on /sys
- error.context("verifying if new CPUs are showing on guest's /sys dir")
- n_cmd = 'find /sys/devices/system/cpu/cpu[0-99] -maxdepth 0 -type d | wc -l'
- output = session.cmd(n_cmd)
- logging.debug("List of cpus on /sys:\n%s" % output)
- try:
- cpus_after_addition = int(output)
- except ValueError:
- logging.error("Output of '%s': %s", n_cmd, output)
- raise error.TestFail("Unable to get CPU count after CPU addition")
-
- if cpus_after_addition != total_cpus:
- raise error.TestFail("%s CPUs are showing up under "
- "/sys/devices/system/cpu, was expecting %s" %
- (cpus_after_addition, total_cpus))
-
- error.context("locating online files for guest's new CPUs")
- r_cmd = 'find /sys/devices/system/cpu/cpu[1-99]/online -maxdepth 0 -type f'
- online_files = session.cmd(r_cmd)
- logging.debug("CPU online files detected: %s", online_files)
- online_files = online_files.split().sort()
-
- if not online_files:
- raise error.TestFail("Could not find CPUs that can be "
- "enabled/disabled on guest")
-
- for online_file in online_files:
- cpu_regexp = re.compile("cpu(\d+)", re.IGNORECASE)
- cpu_id = cpu_regexp.findall(online_file)[0]
- error.context("changing online status for CPU %s" % cpu_id)
- check_online_status = session.cmd("cat %s" % online_file)
- try:
- check_online_status = int(check_online_status)
- except ValueError:
- raise error.TestFail("Unable to get online status from CPU %s" %
- cpu_id)
- assert(check_online_status in [0, 1])
- if check_online_status == 0:
- error.context("Bringing CPU %s online" % cpu_id)
- session.cmd("echo 1 > %s" % online_file)
-
- # Now that all CPUs were onlined, let's execute the
- # autotest CPU Hotplug test
- control_path = os.path.join(test.bindir, "autotest_control",
- "cpu_hotplug.control")
-
- timeout = int(params.get("cpu_hotplug_timeout"), 300)
- error.context("running cpu_hotplug autotest after cpu addition")
- virt_test_utils.run_autotest(vm, session, control_path, timeout,
- test.outputdir, params)
-
- # Last, but not least, let's offline/online the CPUs in the guest
- # several times
- irq = 15
- irq_mask = "f0"
- for i in xrange(onoff_iterations):
- session.cmd("echo %s > /proc/irq/%s/smp_affinity" % (irq_mask, irq))
- for online_file in online_files:
- session.cmd("echo 0 > %s" % online_file)
- for online_file in online_files:
- session.cmd("echo 1 > %s" % online_file)
diff --git a/client/tests/kvm/tests/enospc.py b/client/tests/kvm/tests/enospc.py
deleted file mode 100644
index e6c894c..0000000
--- a/client/tests/kvm/tests/enospc.py
+++ /dev/null
@@ -1,169 +0,0 @@
-import logging, time, re, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_vm, virt_utils
-
-
-class EnospcConfig(object):
- """
- Performs setup for the test enospc. This is a borg class, similar to a
- singleton. The idea is to keep state in memory for when we call cleanup()
- on postprocessing.
- """
- __shared_state = {}
- def __init__(self, test, params):
- self.__dict__ = self.__shared_state
- root_dir = test.bindir
- self.tmpdir = test.tmpdir
- self.qemu_img_binary = params.get('qemu_img_binary')
- if not os.path.isfile(self.qemu_img_binary):
- self.qemu_img_binary = os.path.join(root_dir,
- self.qemu_img_binary)
- self.raw_file_path = os.path.join(self.tmpdir, 'enospc.raw')
- # Here we're trying to choose fairly explanatory names so it's less
- # likely that we run in conflict with other devices in the system
- self.vgtest_name = params.get("vgtest_name")
- self.lvtest_name = params.get("lvtest_name")
- self.lvtest_device = "/dev/%s/%s" % (self.vgtest_name, self.lvtest_name)
- image_dir = os.path.dirname(params.get("image_name"))
- self.qcow_file_path = os.path.join(image_dir, 'enospc.qcow2')
- try:
- getattr(self, 'loopback')
- except AttributeError:
- self.loopback = ''
-
- @error.context_aware
- def setup(self):
- logging.debug("Starting enospc setup")
- error.context("performing enospc setup")
- virt_utils.display_attributes(self)
- # Double check if there aren't any leftovers
- self.cleanup()
- try:
- utils.run("%s create -f raw %s 10G" %
- (self.qemu_img_binary, self.raw_file_path))
- # Associate a loopback device with the raw file.
- # Subject to race conditions, that's why try here to associate
- # it with the raw file as quickly as possible
- l_result = utils.run("losetup -f")
- utils.run("losetup -f %s" % self.raw_file_path)
- self.loopback = l_result.stdout.strip()
- # Add the loopback device configured to the list of pvs
- # recognized by LVM
- utils.run("pvcreate %s" % self.loopback)
- utils.run("vgcreate %s %s" % (self.vgtest_name, self.loopback))
- # Create an lv inside the vg with starting size of 200M
- utils.run("lvcreate -L 200M -n %s %s" %
- (self.lvtest_name, self.vgtest_name))
- # Create a 10GB qcow2 image in the logical volume
- utils.run("%s create -f qcow2 %s 10G" %
- (self.qemu_img_binary, self.lvtest_device))
- # Let's symlink the logical volume with the image name that autotest
- # expects this device to have
- os.symlink(self.lvtest_device, self.qcow_file_path)
- except Exception, e:
- self.cleanup()
- raise
-
- @error.context_aware
- def cleanup(self):
- error.context("performing enospc cleanup")
- if os.path.isfile(self.lvtest_device):
- utils.run("fuser -k %s" % self.lvtest_device)
- time.sleep(2)
- l_result = utils.run("lvdisplay")
- # Let's remove all volumes inside the volume group created
- if self.lvtest_name in l_result.stdout:
- utils.run("lvremove -f %s" % self.lvtest_device)
- # Now, removing the volume group itself
- v_result = utils.run("vgdisplay")
- if self.vgtest_name in v_result.stdout:
- utils.run("vgremove -f %s" % self.vgtest_name)
- # Now, if we can, let's remove the physical volume from lvm list
- if self.loopback:
- p_result = utils.run("pvdisplay")
- if self.loopback in p_result.stdout:
- utils.run("pvremove -f %s" % self.loopback)
- l_result = utils.run('losetup -a')
- if self.loopback and (self.loopback in l_result.stdout):
- try:
- utils.run("losetup -d %s" % self.loopback)
- except error.CmdError:
- logging.error("Failed to liberate loopback %s", self.loopback)
- if os.path.islink(self.qcow_file_path):
- os.remove(self.qcow_file_path)
- if os.path.isfile(self.raw_file_path):
- os.remove(self.raw_file_path)
-
-
-def run_enospc(test, params, env):
- """
- ENOSPC test
-
- 1) Create a virtual disk on lvm
- 2) Boot up guest with two disks
- 3) Continually write data to second disk
- 4) Check images and extend second disk when no space
- 5) Continue paused guest
- 6) Repeat step 3~5 several times
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- enospc_config = EnospcConfig(test, params)
- enospc_config.setup()
- vm = env.get_vm(params["main_vm"])
- vm.create()
- login_timeout = int(params.get("login_timeout", 360))
- session_serial = vm.wait_for_serial_login(timeout=login_timeout)
-
- vgtest_name = params.get("vgtest_name")
- lvtest_name = params.get("lvtest_name")
- logical_volume = "/dev/%s/%s" % (vgtest_name, lvtest_name)
-
- drive_format = params.get("drive_format")
- if drive_format == "virtio":
- devname = "/dev/vdb"
- elif drive_format == "ide":
- output = session_serial.cmd_output("dir /dev")
- devname = "/dev/" + re.findall("([sh]db)\s", output)[0]
- elif drive_format == "scsi":
- devname = "/dev/sdb"
- cmd = params.get("background_cmd")
- cmd %= devname
- logging.info("Sending background cmd '%s'", cmd)
- session_serial.sendline(cmd)
-
- iterations = int(params.get("repeat_time", 40))
- i = 0
- pause_n = 0
- while i < iterations:
- status = vm.monitor.cmd("info status")
- logging.debug(status)
- if "paused" in status:
- pause_n += 1
- logging.info("Checking all images in use by the VM")
- for image_name in vm.params.objects("images"):
- image_params = vm.params.object_params(image_name)
- try:
- virt_vm.check_image(image_params, test.bindir)
- except (virt_vm.VMError, error.TestWarn), e:
- logging.error(e)
- logging.info("Guest paused, extending Logical Volume size")
- try:
- utils.run("lvextend -L +200M %s" % logical_volume)
- except error.CmdError, e:
- logging.debug(e.result_obj.stdout)
- vm.monitor.cmd("cont")
- time.sleep(10)
- i += 1
-
- if pause_n == 0:
- raise error.TestFail("Guest didn't pause during loop")
- else:
- logging.info("Guest paused %s times from %s iterations",
- pause_n, iterations)
-
- logging.info("Final %s", vm.monitor.cmd("info status"))
- enospc_config.cleanup()
diff --git a/client/tests/kvm/tests/floppy.py b/client/tests/kvm/tests/floppy.py
deleted file mode 100644
index e868235..0000000
--- a/client/tests/kvm/tests/floppy.py
+++ /dev/null
@@ -1,71 +0,0 @@
-import logging, time, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-
-
[email protected]_aware
-def run_floppy(test, params, env):
- """
- Test virtual floppy of guest:
-
- 1) Create a floppy disk image on host
- 2) Start the guest with this floppy image.
- 3) Make a file system on guest virtual floppy.
- 4) Calculate md5sum value of a file and copy it into floppy.
- 5) Verify whether the md5sum does match.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- def master_floppy(params):
- error.context("creating test floppy")
- floppy = os.path.abspath(params.get("floppy"))
- utils.run("dd if=/dev/zero of=%s bs=512 count=2880" % floppy)
-
-
- master_floppy(params)
- vm = env.get_vm(params["main_vm"])
- vm.create()
-
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- dest_dir = params.get("mount_dir")
- # If mount_dir specified, treat guest as a Linux OS
- # Some Linux distribution does not load floppy at boot and Windows
- # needs time to load and init floppy driver
- if dest_dir:
- status = session.cmd("modprobe floppy")
- else:
- time.sleep(20)
-
- error.context("Formating floppy disk before using it")
- format_cmd = params.get("format_floppy_cmd")
- session.cmd(format_cmd, timeout=120)
- logging.info("Floppy disk formatted successfully")
-
- source_file = params.get("source_file")
- dest_file = params.get("dest_file")
-
- if dest_dir:
- error.context("Mounting floppy")
- session.cmd("mount /dev/fd0 %s" % dest_dir)
- error.context("Testing floppy")
- session.cmd(params.get("test_floppy_cmd"))
-
- try:
- error.context("Copying file to the floppy")
- session.cmd("%s %s %s" % (params.get("copy_cmd"), source_file,
- dest_file))
- logging.info("Succeed to copy file '%s' into floppy disk" % source_file)
-
- error.context("Checking if the file is unchanged after copy")
- session.cmd("%s %s %s" % (params.get("diff_file_cmd"), source_file,
- dest_file))
- finally:
- clean_cmd = "%s %s" % (params.get("clean_cmd"), dest_file)
- session.cmd(clean_cmd)
- if dest_dir:
- session.cmd("umount %s" % dest_dir)
- session.close()
diff --git a/client/tests/kvm/tests/hdparm.py b/client/tests/kvm/tests/hdparm.py
deleted file mode 100644
index 388049a..0000000
--- a/client/tests/kvm/tests/hdparm.py
+++ /dev/null
@@ -1,89 +0,0 @@
-import re, logging
-from autotest_lib.client.common_lib import error
-
-
[email protected]_aware
-def run_hdparm(test, params, env):
- """
- Test hdparm setting on linux guest os. This case will:
- 1) Set/record parameters value of hard disk to low performance status.
- 2) Perform device/cache read timings then record the results.
- 3) Set/record parameters value of hard disk to high performance status.
- 4) Perform device/cache read timings then compare two results.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- def check_setting_result(set_cmd, timeout):
- params = re.findall("(-[a-zA-Z])([0-9]*)", set_cmd)
- disk = re.findall("(\/+[a-z]*\/[a-z]*$)", set_cmd)[0]
- for (param, value) in params:
- cmd = "hdparm %s %s" % (param, disk)
- (s, output) = session.cmd_status_output(cmd, timeout)
- if s != 0:
- raise error.TestError("Fail to get %s parameter value. "
- "Output is:\n%s" % (param, output.strip()))
- if value not in output:
- raise error.TestFail("Fail to set %s parameter to value: %s"
- % (param, value))
-
-
- def perform_read_timing(disk, timeout, num=5):
- results = 0
- for i in range(num):
- cmd = params.get("device_cache_read_cmd") % disk
- (s, output) = session.cmd_status_output(cmd, timeout)
- if s != 0:
- raise error.TestFail("Fail to perform device/cache read"
- " timings \nOutput is: %s\n" % output)
- logging.info("Output of device/cache read timing check (%s of %s):"
- % (i + 1, num))
- for line in output.strip().splitlines():
- logging.info(line)
- (result, unit) = re.findall("= *([0-9]*.+[0-9]*) ([a-zA-Z]*)",
- output)[1]
- if unit == "kB":
- result = float(result)/1024.0
- results += float(result)
- return results/num
-
-
- vm = env.get_vm(params["main_vm"])
- vm.create()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
- try:
- timeout = float(params.get("cmd_timeout", 60))
- cmd = params.get("get_disk_cmd")
- output = session.cmd(cmd)
- disk = output.strip()
-
- error.context("Setting hard disk to lower performance")
- cmd = params.get("low_status_cmd") % disk
- session.cmd(cmd, timeout)
-
- error.context("Checking hard disk keyval under lower performance "
- "settings")
- check_setting_result(cmd, timeout)
- low_result = perform_read_timing(disk, timeout)
- logging.info("Average buffered disk read speed under low performance "
- "settings: %.2f MB/sec" % low_result)
-
- error.context("Setting hard disk to higher performance")
- cmd = params.get("high_status_cmd") % disk
- session.cmd(cmd, timeout)
-
- error.context("Checking hard disk keyval under higher performance "
- "settings")
- check_setting_result(cmd, timeout)
- high_result = perform_read_timing(disk, timeout)
- logging.info("Average buffered disk read speed under high performance "
- "settings: %.2f MB/sec" % high_result)
-
- if not float(high_result) > float(low_result):
- raise error.TestFail("High performance setting does not "
- "increase read speed\n")
-
- finally:
- if session:
- session.close()
diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/kvm/tests/ksm_overcommit.py
deleted file mode 100644
index c3b4cad..0000000
--- a/client/tests/kvm/tests/ksm_overcommit.py
+++ /dev/null
@@ -1,615 +0,0 @@
-import logging, time, random, math, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils, virt_test_utils, aexpect
-from autotest_lib.client.virt import virt_env_process
-
-
-def run_ksm_overcommit(test, params, env):
- """
- Test how KSM (Kernel Shared Memory) act when more than physical memory is
- used. In second part we also test how KVM handles a situation when the host
- runs out of memory (it is expected to pause the guest system, wait until
- some process returns memory and bring the guest back to life)
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test wnvironment.
- """
-
- def _start_allocator(vm, session, timeout):
- """
- Execute ksm_overcommit_guest.py on a guest, wait until it is initialized.
-
- @param vm: VM object.
- @param session: Remote session to a VM object.
- @param timeout: Timeout that will be used to verify if
- ksm_overcommit_guest.py started properly.
- """
- logging.debug("Starting ksm_overcommit_guest.py on guest %s", vm.name)
- session.sendline("python /tmp/ksm_overcommit_guest.py")
- try:
- session.read_until_last_line_matches(["PASS:", "FAIL:"], timeout)
- except aexpect.ExpectProcessTerminatedError, e:
- e_msg = ("Command ksm_overcommit_guest.py on vm '%s' failed: %s" %
- (vm.name, str(e)))
- raise error.TestFail(e_msg)
-
-
- def _execute_allocator(command, vm, session, timeout):
- """
- Execute a given command on ksm_overcommit_guest.py main loop,
- indicating the vm the command was executed on.
-
- @param command: Command that will be executed.
- @param vm: VM object.
- @param session: Remote session to VM object.
- @param timeout: Timeout used to verify expected output.
-
- @return: Tuple (match index, data)
- """
- logging.debug("Executing '%s' on ksm_overcommit_guest.py loop, "
- "vm: %s, timeout: %s", command, vm.name, timeout)
- session.sendline(command)
- try:
- (match, data) = session.read_until_last_line_matches(
- ["PASS:","FAIL:"],
- timeout)
- except aexpect.ExpectProcessTerminatedError, e:
- e_msg = ("Failed to execute command '%s' on "
- "ksm_overcommit_guest.py, vm '%s': %s" %
- (command, vm.name, str(e)))
- raise error.TestFail(e_msg)
- return (match, data)
-
-
- def get_ksmstat():
- """
- Return sharing memory by ksm in MB
-
- @return: memory in MB
- """
- f = open('/sys/kernel/mm/ksm/pages_sharing')
- ksm_pages = int(f.read())
- f.close()
- return ((ksm_pages*4096)/1e6)
-
-
- def initialize_guests():
- """
- Initialize guests (fill their memories with specified patterns).
- """
- logging.info("Phase 1: filling guest memory pages")
- for session in lsessions:
- vm = lvms[lsessions.index(session)]
-
- logging.debug("Turning off swap on vm %s", vm.name)
- session.cmd("swapoff -a", timeout=300)
-
- # Start the allocator
- _start_allocator(vm, session, 60 * perf_ratio)
-
- # Execute allocator on guests
- for i in range(0, vmsc):
- vm = lvms[i]
-
- a_cmd = "mem = MemFill(%d, %s, %s)" % (ksm_size, skeys[i], dkeys[i])
- _execute_allocator(a_cmd, vm, lsessions[i], 60 * perf_ratio)
-
- a_cmd = "mem.value_fill(%d)" % skeys[0]
- _execute_allocator(a_cmd, vm, lsessions[i], 120 * perf_ratio)
-
- # Let ksm_overcommit_guest.py do its job
- # (until shared mem reaches expected value)
- shm = 0
- j = 0
- logging.debug("Target shared meminfo for guest %s: %s", vm.name,
- ksm_size)
- while ((new_ksm and (shm < (ksm_size*(i+1)))) or
- (not new_ksm and (shm < (ksm_size)))):
- if j > 64:
- logging.debug(virt_test_utils.get_memory_info(lvms))
- raise error.TestError("SHM didn't merge the memory until "
- "the DL on guest: %s" % vm.name)
- st = ksm_size / 200 * perf_ratio
- logging.debug("Waiting %ds before proceeding...", st)
- time.sleep(st)
- if (new_ksm):
- shm = get_ksmstat()
- else:
- shm = vm.get_shared_meminfo()
- logging.debug("Shared meminfo for guest %s after "
- "iteration %s: %s", vm.name, j, shm)
- j += 1
-
- # Keep some reserve
- rt = ksm_size / 200 * perf_ratio
- logging.debug("Waiting %ds before proceeding...", rt)
- time.sleep(rt)
-
- logging.debug(virt_test_utils.get_memory_info(lvms))
- logging.info("Phase 1: PASS")
-
-
- def separate_first_guest():
- """
- Separate memory of the first guest by generating special random series
- """
- logging.info("Phase 2: Split the pages on the first guest")
-
- a_cmd = "mem.static_random_fill()"
- data = _execute_allocator(a_cmd, lvms[0], lsessions[0],
- 120 * perf_ratio)[1]
-
- r_msg = data.splitlines()[-1]
- logging.debug("Return message of static_random_fill: %s", r_msg)
- out = int(r_msg.split()[4])
- logging.debug("Performance: %dMB * 1000 / %dms = %dMB/s", ksm_size, out,
- (ksm_size * 1000 / out))
- logging.debug(virt_test_utils.get_memory_info(lvms))
- logging.debug("Phase 2: PASS")
-
-
- def split_guest():
- """
- Sequential split of pages on guests up to memory limit
- """
- logging.info("Phase 3a: Sequential split of pages on guests up to "
- "memory limit")
- last_vm = 0
- session = None
- vm = None
- for i in range(1, vmsc):
- # Check VMs
- for j in range(0, vmsc):
- if not lvms[j].is_alive:
- e_msg = ("VM %d died while executing static_random_fill in "
- "VM %d on allocator loop" % (j, i))
- raise error.TestFail(e_msg)
- vm = lvms[i]
- session = lsessions[i]
- a_cmd = "mem.static_random_fill()"
- logging.debug("Executing %s on ksm_overcommit_guest.py loop, "
- "vm: %s", a_cmd, vm.name)
- session.sendline(a_cmd)
-
- out = ""
- try:
- logging.debug("Watching host memory while filling vm %s memory",
- vm.name)
- while not out.startswith("PASS") and not out.startswith("FAIL"):
- if not vm.is_alive():
- e_msg = ("VM %d died while executing static_random_fill"
- " on allocator loop" % i)
- raise error.TestFail(e_msg)
- free_mem = int(utils.read_from_meminfo("MemFree"))
- if (ksm_swap):
- free_mem = (free_mem +
- int(utils.read_from_meminfo("SwapFree")))
- logging.debug("Free memory on host: %d", free_mem)
-
- # We need to keep some memory for python to run.
- if (free_mem < 64000) or (ksm_swap and
- free_mem < (450000 * perf_ratio)):
- vm.monitor.cmd("stop")
- for j in range(0, i):
- lvms[j].destroy(gracefully = False)
- time.sleep(20)
- vm.monitor.cmd("c")
- logging.debug("Only %s free memory, killing %d guests",
- free_mem, (i - 1))
- last_vm = i
- break
- out = session.read_nonblocking(0.1)
- time.sleep(2)
- except OSError:
- logging.debug("Only %s host free memory, killing %d guests",
- free_mem, (i - 1))
- logging.debug("Stopping %s", vm.name)
- vm.monitor.cmd("stop")
- for j in range(0, i):
- logging.debug("Destroying %s", lvms[j].name)
- lvms[j].destroy(gracefully = False)
- time.sleep(20)
- vm.monitor.cmd("c")
- last_vm = i
-
- if last_vm != 0:
- break
- logging.debug("Memory filled for guest %s", vm.name)
-
- logging.info("Phase 3a: PASS")
-
- logging.info("Phase 3b: Check if memory in max loading guest is right")
- for i in range(last_vm + 1, vmsc):
- lsessions[i].close()
- if i == (vmsc - 1):
- logging.debug(virt_test_utils.get_memory_info([lvms[i]]))
- logging.debug("Destroying guest %s", lvms[i].name)
- lvms[i].destroy(gracefully = False)
-
- # Verify last machine with randomly generated memory
- a_cmd = "mem.static_random_verify()"
- _execute_allocator(a_cmd, lvms[last_vm], lsessions[last_vm],
- (mem / 200 * 50 * perf_ratio))
- logging.debug(virt_test_utils.get_memory_info([lvms[last_vm]]))
-
- lsessions[i].cmd_output("die()", 20)
- lvms[last_vm].destroy(gracefully = False)
- logging.info("Phase 3b: PASS")
-
-
- def split_parallel():
- """
- Parallel page spliting
- """
- logging.info("Phase 1: parallel page spliting")
- # We have to wait until allocator is finished (it waits 5 seconds to
- # clean the socket
-
- session = lsessions[0]
- vm = lvms[0]
- for i in range(1, max_alloc):
- lsessions.append(vm.wait_for_login(timeout=360))
-
- session.cmd("swapoff -a", timeout=300)
-
- for i in range(0, max_alloc):
- # Start the allocator
- _start_allocator(vm, lsessions[i], 60 * perf_ratio)
-
- logging.info("Phase 1: PASS")
-
- logging.info("Phase 2a: Simultaneous merging")
- logging.debug("Memory used by allocator on guests = %dMB",
- (ksm_size / max_alloc))
-
- for i in range(0, max_alloc):
- a_cmd = "mem = MemFill(%d, %s, %s)" % ((ksm_size / max_alloc),
- skeys[i], dkeys[i])
- _execute_allocator(a_cmd, vm, lsessions[i], 60 * perf_ratio)
-
- a_cmd = "mem.value_fill(%d)" % (skeys[0])
- _execute_allocator(a_cmd, vm, lsessions[i], 90 * perf_ratio)
-
- # Wait until ksm_overcommit_guest.py merges the pages (3 * ksm_size / 3)
- shm = 0
- i = 0
- logging.debug("Target shared memory size: %s", ksm_size)
- while (shm < ksm_size):
- if i > 64:
- logging.debug(virt_test_utils.get_memory_info(lvms))
- raise error.TestError("SHM didn't merge the memory until DL")
- wt = ksm_size / 200 * perf_ratio
- logging.debug("Waiting %ds before proceed...", wt)
- time.sleep(wt)
- if (new_ksm):
- shm = get_ksmstat()
- else:
- shm = vm.get_shared_meminfo()
- logging.debug("Shared meminfo after attempt %s: %s", i, shm)
- i += 1
-
- logging.debug(virt_test_utils.get_memory_info([vm]))
- logging.info("Phase 2a: PASS")
-
- logging.info("Phase 2b: Simultaneous spliting")
- # Actual splitting
- for i in range(0, max_alloc):
- a_cmd = "mem.static_random_fill()"
- data = _execute_allocator(a_cmd, vm, lsessions[i],
- 90 * perf_ratio)[1]
-
- data = data.splitlines()[-1]
- logging.debug(data)
- out = int(data.split()[4])
- logging.debug("Performance: %dMB * 1000 / %dms = %dMB/s",
- (ksm_size / max_alloc), out,
- (ksm_size * 1000 / out / max_alloc))
- logging.debug(virt_test_utils.get_memory_info([vm]))
- logging.info("Phase 2b: PASS")
-
- logging.info("Phase 2c: Simultaneous verification")
- for i in range(0, max_alloc):
- a_cmd = "mem.static_random_verify()"
- data = _execute_allocator(a_cmd, vm, lsessions[i],
- (mem / 200 * 50 * perf_ratio))[1]
- logging.info("Phase 2c: PASS")
-
- logging.info("Phase 2d: Simultaneous merging")
- # Actual splitting
- for i in range(0, max_alloc):
- a_cmd = "mem.value_fill(%d)" % skeys[0]
- data = _execute_allocator(a_cmd, vm, lsessions[i],
- 120 * perf_ratio)[1]
- logging.debug(virt_test_utils.get_memory_info([vm]))
- logging.info("Phase 2d: PASS")
-
- logging.info("Phase 2e: Simultaneous verification")
- for i in range(0, max_alloc):
- a_cmd = "mem.value_check(%d)" % skeys[0]
- data = _execute_allocator(a_cmd, vm, lsessions[i],
- (mem / 200 * 50 * perf_ratio))[1]
- logging.info("Phase 2e: PASS")
-
- logging.info("Phase 2f: Simultaneous spliting last 96B")
- for i in range(0, max_alloc):
- a_cmd = "mem.static_random_fill(96)"
- data = _execute_allocator(a_cmd, vm, lsessions[i],
- 60 * perf_ratio)[1]
-
- data = data.splitlines()[-1]
- out = int(data.split()[4])
- logging.debug("Performance: %dMB * 1000 / %dms = %dMB/s",
- ksm_size/max_alloc, out,
- (ksm_size * 1000 / out / max_alloc))
-
- logging.debug(virt_test_utils.get_memory_info([vm]))
- logging.info("Phase 2f: PASS")
-
- logging.info("Phase 2g: Simultaneous verification last 96B")
- for i in range(0, max_alloc):
- a_cmd = "mem.static_random_verify(96)"
- (match, data) = _execute_allocator(a_cmd, vm, lsessions[i],
- (mem / 200 * 50 * perf_ratio))
- logging.debug(virt_test_utils.get_memory_info([vm]))
- logging.info("Phase 2g: PASS")
-
- logging.debug("Cleaning up...")
- for i in range(0, max_alloc):
- lsessions[i].cmd_output("die()", 20)
- session.close()
- vm.destroy(gracefully = False)
-
-
- # Main test code
- logging.info("Starting phase 0: Initialization")
- new_ksm = False
- if (os.path.exists("/sys/kernel/mm/ksm/run")):
- utils.run("echo 50 > /sys/kernel/mm/ksm/sleep_millisecs")
- utils.run("echo 5000 > /sys/kernel/mm/ksm/pages_to_scan")
- utils.run("echo 1 > /sys/kernel/mm/ksm/run")
-
- e_up = "/sys/kernel/mm/transparent_hugepage/enabled"
- e_rh = "/sys/kernel/mm/redhat_transparent_hugepage/enabled"
- if os.path.exists(e_up):
- utils.run("echo 'never' > %s" % e_up)
- if os.path.exists(e_rh):
- utils.run("echo 'never' > %s" % e_rh)
- new_ksm = True
- else:
- try:
- utils.run("modprobe ksm")
- utils.run("ksmctl start 5000 100")
- except error.CmdError, e:
- raise error.TestFail("Failed to load KSM: %s" % e)
-
- # host_reserve: mem reserve kept for the host system to run
- host_reserve = int(params.get("ksm_host_reserve", -1))
- if (host_reserve == -1):
- # default host_reserve = MemAvailable + one_minimal_guest(128MB)
- # later we add 64MB per additional guest
- host_reserve = ((utils.memtotal() - utils.read_from_meminfo("MemFree"))
- / 1024 + 128)
- # using default reserve
- _host_reserve = True
- else:
- _host_reserve = False
-
- # guest_reserve: mem reserve kept to avoid guest OS to kill processes
- guest_reserve = int(params.get("ksm_guest_reserve", -1))
- if (guest_reserve == -1):
- # default guest_reserve = minimal_system_mem(256MB)
- # later we add tmpfs overhead
- guest_reserve = 256
- # using default reserve
- _guest_reserve = True
- else:
- _guest_reserve = False
-
- max_vms = int(params.get("max_vms", 2))
- overcommit = float(params.get("ksm_overcommit_ratio", 2.0))
- max_alloc = int(params.get("ksm_parallel_ratio", 1))
-
- # vmsc: count of all used VMs
- vmsc = int(overcommit) + 1
- vmsc = max(vmsc, max_vms)
-
- if (params['ksm_mode'] == "serial"):
- max_alloc = vmsc
- if _host_reserve:
- # First round of additional guest reserves
- host_reserve += vmsc * 64
- _host_reserve = vmsc
-
- host_mem = (int(utils.memtotal()) / 1024 - host_reserve)
-
- ksm_swap = False
- if params.get("ksm_swap") == "yes":
- ksm_swap = True
-
- # Performance ratio
- perf_ratio = params.get("ksm_perf_ratio")
- if perf_ratio:
- perf_ratio = float(perf_ratio)
- else:
- perf_ratio = 1
-
- if (params['ksm_mode'] == "parallel"):
- vmsc = 1
- overcommit = 1
- mem = host_mem
- # 32bit system adjustment
- if not params['image_name'].endswith("64"):
- logging.debug("Probably i386 guest architecture, "
- "max allocator mem = 2G")
- # Guest can have more than 2G but
- # kvm mem + 1MB (allocator itself) can't
- if (host_mem > 3100):
- mem = 3100
-
- if os.popen("uname -i").readline().startswith("i386"):
- logging.debug("Host is i386 architecture, max guest mem is 2G")
- # Guest system with qemu overhead (64M) can't have more than 2G
- if mem > 3100 - 64:
- mem = 3100 - 64
-
- else:
- # mem: Memory of the guest systems. Maximum must be less than
- # host's physical ram
- mem = int(overcommit * host_mem / vmsc)
-
- # 32bit system adjustment
- if not params['image_name'].endswith("64"):
- logging.debug("Probably i386 guest architecture, "
- "max allocator mem = 2G")
- # Guest can have more than 2G but
- # kvm mem + 1MB (allocator itself) can't
- if mem - guest_reserve - 1 > 3100:
- vmsc = int(math.ceil((host_mem * overcommit) /
- (3100 + guest_reserve)))
- if _host_reserve:
- host_reserve += (vmsc - _host_reserve) * 64
- host_mem -= (vmsc - _host_reserve) * 64
- _host_reserve = vmsc
- mem = int(math.floor(host_mem * overcommit / vmsc))
-
- if os.popen("uname -i").readline().startswith("i386"):
- logging.debug("Host is i386 architecture, max guest mem is 2G")
- # Guest system with qemu overhead (64M) can't have more than 2G
- if mem > 3100 - 64:
- vmsc = int(math.ceil((host_mem * overcommit) /
- (3100 - 64.0)))
- if _host_reserve:
- host_reserve += (vmsc - _host_reserve) * 64
- host_mem -= (vmsc - _host_reserve) * 64
- _host_reserve = vmsc
- mem = int(math.floor(host_mem * overcommit / vmsc))
-
- # 0.055 represents OS + TMPFS additional reserve per guest ram MB
- if _guest_reserve:
- guest_reserve += math.ceil(mem * 0.055)
-
- swap = int(utils.read_from_meminfo("SwapTotal")) / 1024
-
- logging.debug("Overcommit = %f", overcommit)
- logging.debug("True overcommit = %f ", (float(vmsc * mem) /
- float(host_mem)))
- logging.debug("Host memory = %dM", host_mem)
- logging.debug("Guest memory = %dM", mem)
- logging.debug("Using swap = %s", ksm_swap)
- logging.debug("Swap = %dM", swap)
- logging.debug("max_vms = %d", max_vms)
- logging.debug("Count of all used VMs = %d", vmsc)
- logging.debug("Performance_ratio = %f", perf_ratio)
-
- # Generate unique keys for random series
- skeys = []
- dkeys = []
- for i in range(0, max(vmsc, max_alloc)):
- key = random.randrange(0, 255)
- while key in skeys:
- key = random.randrange(0, 255)
- skeys.append(key)
-
- key = random.randrange(0, 999)
- while key in dkeys:
- key = random.randrange(0, 999)
- dkeys.append(key)
-
- logging.debug("skeys: %s", skeys)
- logging.debug("dkeys: %s", dkeys)
-
- lvms = []
- lsessions = []
-
- # As we don't know the number and memory amount of VMs in advance,
- # we need to specify and create them here
- vm_name = params.get("main_vm")
- params['mem'] = mem
- params['vms'] = vm_name
- # Associate pidfile name
- params['pid_' + vm_name] = virt_utils.generate_tmp_file_name(vm_name,
- 'pid')
- if not params.get('extra_params'):
- params['extra_params'] = ' '
- params['extra_params_' + vm_name] = params.get('extra_params')
- params['extra_params_' + vm_name] += (" -pidfile %s" %
- (params.get('pid_' + vm_name)))
- params['extra_params'] = params.get('extra_params_'+vm_name)
-
- # ksm_size: amount of memory used by allocator
- ksm_size = mem - guest_reserve
- logging.debug("Memory used by allocator on guests = %dM", ksm_size)
-
- # Creating the first guest
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- lvms.append(env.get_vm(vm_name))
- if not lvms[0]:
- raise error.TestError("VM object not found in environment")
- if not lvms[0].is_alive():
- raise error.TestError("VM seems to be dead; Test requires a living "
- "VM")
-
- logging.debug("Booting first guest %s", lvms[0].name)
-
- lsessions.append(lvms[0].wait_for_login(timeout=360))
- # Associate vm PID
- try:
- tmp = open(params.get('pid_' + vm_name), 'r')
- params['pid_' + vm_name] = int(tmp.readline())
- except:
- raise error.TestFail("Could not get PID of %s" % (vm_name))
-
- # Creating other guest systems
- for i in range(1, vmsc):
- vm_name = "vm" + str(i + 1)
- params['pid_' + vm_name] = virt_utils.generate_tmp_file_name(vm_name,
- 'pid')
- params['extra_params_' + vm_name] = params.get('extra_params')
- params['extra_params_' + vm_name] += (" -pidfile %s" %
- (params.get('pid_' + vm_name)))
- params['extra_params'] = params.get('extra_params_' + vm_name)
-
- # Last VM is later used to run more allocators simultaneously
- lvms.append(lvms[0].clone(vm_name, params))
- env.register_vm(vm_name, lvms[i])
- params['vms'] += " " + vm_name
-
- logging.debug("Booting guest %s", lvms[i].name)
- lvms[i].create()
- if not lvms[i].is_alive():
- raise error.TestError("VM %s seems to be dead; Test requires a"
- "living VM" % lvms[i].name)
-
- lsessions.append(lvms[i].wait_for_login(timeout=360))
- try:
- tmp = open(params.get('pid_' + vm_name), 'r')
- params['pid_' + vm_name] = int(tmp.readline())
- except:
- raise error.TestFail("Could not get PID of %s" % (vm_name))
-
- # Let guests rest a little bit :-)
- st = vmsc * 2 * perf_ratio
- logging.debug("Waiting %ds before proceed", st)
- time.sleep(vmsc * 2 * perf_ratio)
- logging.debug(virt_test_utils.get_memory_info(lvms))
-
- # Copy ksm_overcommit_guest.py into guests
- pwd = os.path.join(os.environ['AUTODIR'],'tests/kvm')
- vksmd_src = os.path.join(pwd, "scripts/ksm_overcommit_guest.py")
- dst_dir = "/tmp"
- for vm in lvms:
- vm.copy_files_to(vksmd_src, dst_dir)
- logging.info("Phase 0: PASS")
-
- if params['ksm_mode'] == "parallel":
- logging.info("Starting KSM test parallel mode")
- split_parallel()
- logging.info("KSM test parallel mode: PASS")
- elif params['ksm_mode'] == "serial":
- logging.info("Starting KSM test serial mode")
- initialize_guests()
- separate_first_guest()
- split_guest()
- logging.info("KSM test serial mode: PASS")
diff --git a/client/tests/kvm/tests/migration.py b/client/tests/kvm/tests/migration.py
deleted file mode 100644
index 7e877fe..0000000
--- a/client/tests/kvm/tests/migration.py
+++ /dev/null
@@ -1,110 +0,0 @@
-import logging, time, types
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-
-def run_migration(test, params, env):
- """
- KVM migration test:
- 1) Get a live VM and clone it.
- 2) Verify that the source VM supports migration. If it does, proceed with
- the test.
- 3) Send a migration command to the source VM and wait until it's finished.
- 4) Kill off the source VM.
- 3) Log into the destination VM after the migration is finished.
- 4) Compare the output of a reference command executed on the source with
- the output of the same command on the destination machine.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- def get_functions(func_names, locals_dict):
- """
- Find sub function(s) in this function with the given name(s).
- """
- if not func_names:
- return []
- funcs = []
- for f in func_names.split():
- f = locals_dict.get(f)
- if isinstance(f, types.FunctionType):
- funcs.append(f)
- return funcs
-
- def mig_set_speed():
- mig_speed = params.get("mig_speed", "1G")
- return vm.monitor.migrate_set_speed(mig_speed)
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
- mig_cancel_delay = int(params.get("mig_cancel") == "yes") * 2
- offline = params.get("offline", "no") == "yes"
- check = params.get("vmstate_check", "no") == "yes"
-
- # Get the output of migration_test_command
- test_command = params.get("migration_test_command")
- reference_output = session.cmd_output(test_command)
-
- # Start some process in the background (and leave the session open)
- background_command = params.get("migration_bg_command", "")
- session.sendline(background_command)
- time.sleep(5)
-
- # Start another session with the guest and make sure the background
- # process is running
- session2 = vm.wait_for_login(timeout=timeout)
-
- try:
- check_command = params.get("migration_bg_check_command", "")
- session2.cmd(check_command, timeout=30)
- session2.close()
-
- # run some functions before migrate start.
- pre_migrate = get_functions(params.get("pre_migrate"), locals())
- for func in pre_migrate:
- func()
-
- # Migrate the VM
- vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay, offline, check)
-
- # run some functions after migrate finish.
- post_migrate = get_functions(params.get("post_migrate"), locals())
- for func in post_migrate:
- func()
-
- # Log into the guest again
- logging.info("Logging into guest after migration...")
- session2 = vm.wait_for_login(timeout=30)
- logging.info("Logged in after migration")
-
- # Make sure the background process is still running
- session2.cmd(check_command, timeout=30)
-
- # Get the output of migration_test_command
- output = session2.cmd_output(test_command)
-
- # Compare output to reference output
- if output != reference_output:
- logging.info("Command output before migration differs from "
- "command output after migration")
- logging.info("Command: %s", test_command)
- logging.info("Output before:" +
- virt_utils.format_str_for_message(reference_output))
- logging.info("Output after:" +
- virt_utils.format_str_for_message(output))
- raise error.TestFail("Command '%s' produced different output "
- "before and after migration" % test_command)
-
- finally:
- # Kill the background process
- if session2 and session2.is_alive():
- session2.cmd_output(params.get("migration_bg_kill_command", ""))
-
- session2.close()
- session.close()
diff --git a/client/tests/kvm/tests/migration_multi_host.py b/client/tests/kvm/tests/migration_multi_host.py
deleted file mode 100644
index 30e3ecc..0000000
--- a/client/tests/kvm/tests/migration_multi_host.py
+++ /dev/null
@@ -1,107 +0,0 @@
-import logging, socket
-from autotest_lib.client.common_lib import error
-
-
-def run_migration_multi_host(test, params, env):
- """
- KVM multi-host migration test:
-
- Migration execution progress:
-
- source host dest host
- ----------------------------------------------------------------------------
- log into guest
- ----------------------------------------------------------------------------
- start socket server
-
- wait 30 secs -------------------- wait login_timeout+30 secs ---------------
-
- accept connection connect to socket server,send mig_port
- ----------------------------------------------------------------------------
- start migration
-
- wait 30 secs -------------------- wait mig_timeout+30 secs -----------------
-
- try to log into migrated guest check VM's status via monitor cmd
- ----------------------------------------------------------------------------
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- def guest_active(vm):
- o = vm.monitor.info("status")
- if isinstance(o, str):
- return "status: running" in o
- else:
- return o.get("status") == "running"
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- role = params.get("role")
- srchost = params.get("srchost")
- dsthost = params.get("dsthost")
- mig_timeout = int(params.get("mig_timeout"))
- # Port used to communicate info between source and destination
- comm_port = int(params.get("comm_port", 12324))
- regain_ip_cmd = params.get("regain_ip_cmd", "dhclient")
- if role == 'source':
- session = vm.wait_for_login(timeout=login_timeout)
-
- # Listen on a port to get the migration port received from
- # dest machine
- s_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s_socket.bind(('', comm_port))
- s_socket.listen(1)
-
- # Wait 30 seconds for source and dest to reach this point
- test.job.barrier(srchost, 'socket_started', 30).rendezvous(srchost,
- dsthost)
-
- c_socket = s_socket.accept()[0]
- mig_port = int(c_socket.recv(6))
- logging.info("Received from destination the migration port %s",
- mig_port)
- c_socket.close()
-
- logging.info("Start migrating now...")
- vm.migrate(dest_host=dsthost, remote_port=mig_port)
-
- # Wait up to 30 seconds for dest to reach this point
- test.job.barrier(srchost, 'mig_finished', 30).rendezvous(srchost,
- dsthost)
-
- elif role == 'destination':
- # Wait up to login_timeout + 30 seconds for the source to
- # reach this point
- test.job.barrier(dsthost, 'socket_started',
- login_timeout + 30).rendezvous(srchost,
- dsthost)
-
- c_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- c_socket.connect((srchost, comm_port))
- logging.info("Communicating to source migration port %s",
- vm.migration_port)
- c_socket.send("%d" % vm.migration_port)
- c_socket.close()
-
- # Wait up to mig_timeout + 30 seconds for the source to
- # reach this point: migration finished
- test.job.barrier(dsthost, 'mig_finished',
- mig_timeout + 30).rendezvous(srchost,
- dsthost)
-
- if not guest_active(vm):
- raise error.TestFail("Guest not active after migration")
-
- logging.info("Migrated guest appears to be running")
-
- # Log into the guest again
- logging.info("Logging into migrated guest after migration...")
- session_serial = vm.wait_for_serial_login(timeout=login_timeout)
- session_serial.cmd(regain_ip_cmd)
- session = vm.wait_for_login(timeout=login_timeout)
-
- else:
- raise error.TestError('Invalid role specified')
diff --git a/client/tests/kvm/tests/migration_with_file_transfer.py b/client/tests/kvm/tests/migration_with_file_transfer.py
deleted file mode 100644
index 25ada82..0000000
--- a/client/tests/kvm/tests/migration_with_file_transfer.py
+++ /dev/null
@@ -1,85 +0,0 @@
-import logging, time, os
-from autotest_lib.client.common_lib import utils, error
-from autotest_lib.client.bin import utils as client_utils
-from autotest_lib.client.virt import virt_utils
-
-
[email protected]_aware
-def run_migration_with_file_transfer(test, params, env):
- """
- KVM migration test:
- 1) Get a live VM and clone it.
- 2) Verify that the source VM supports migration. If it does, proceed with
- the test.
- 3) Transfer file from host to guest.
- 4) Repeatedly migrate VM and wait until transfer's finished.
- 5) Transfer file from guest back to host.
- 6) Repeatedly migrate VM and wait until transfer's finished.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
-
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
- mig_cancel_delay = int(params.get("mig_cancel") == "yes") * 2
-
- host_path = "/tmp/file-%s" % virt_utils.generate_random_string(6)
- host_path_returned = "%s-returned" % host_path
- guest_path = params.get("guest_path", "/tmp/file")
- file_size = params.get("file_size", "500")
- transfer_timeout = int(params.get("transfer_timeout", "240"))
-
- try:
- utils.run("dd if=/dev/urandom of=%s bs=1M count=%s" % (host_path,
- file_size))
-
- def run_and_migrate(bg):
- bg.start()
- try:
- while bg.isAlive():
- logging.info("File transfer not ended, starting a round of "
- "migration...")
- vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay)
- except:
- # If something bad happened in the main thread, ignore
- # exceptions raised in the background thread
- bg.join(suppress_exception=True)
- raise
- else:
- bg.join()
-
- error.context("transferring file to guest while migrating",
- logging.info)
- bg = virt_utils.Thread(vm.copy_files_to, (host_path, guest_path),
- dict(verbose=True, timeout=transfer_timeout))
- run_and_migrate(bg)
-
- error.context("transferring file back to host while migrating",
- logging.info)
- bg = virt_utils.Thread(vm.copy_files_from,
- (guest_path, host_path_returned),
- dict(verbose=True, timeout=transfer_timeout))
- run_and_migrate(bg)
-
- # Make sure the returned file is identical to the original one
- error.context("comparing hashes", logging.info)
- orig_hash = client_utils.hash_file(host_path)
- returned_hash = client_utils.hash_file(host_path_returned)
- if orig_hash != returned_hash:
- raise error.TestFail("Returned file hash (%s) differs from "
- "original one (%s)" % (returned_hash,
- orig_hash))
- error.context()
-
- finally:
- session.close()
- if os.path.isfile(host_path):
- os.remove(host_path)
- if os.path.isfile(host_path_returned):
- os.remove(host_path_returned)
diff --git a/client/tests/kvm/tests/migration_with_reboot.py b/client/tests/kvm/tests/migration_with_reboot.py
deleted file mode 100644
index 5dddb12..0000000
--- a/client/tests/kvm/tests/migration_with_reboot.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from autotest_lib.client.virt import virt_utils
-
-
-def run_migration_with_reboot(test, params, env):
- """
- KVM migration test:
- 1) Get a live VM and clone it.
- 2) Verify that the source VM supports migration. If it does, proceed with
- the test.
- 3) Reboot the VM
- 4) Send a migration command to the source VM and wait until it's finished.
- 5) Kill off the source VM.
- 6) Log into the destination VM after the migration is finished.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
-
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
- mig_cancel_delay = int(params.get("mig_cancel") == "yes") * 2
-
- try:
- # Reboot the VM in the background
- bg = virt_utils.Thread(vm.reboot, (session,))
- bg.start()
- try:
- while bg.isAlive():
- vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay)
- except:
- # If something bad happened in the main thread, ignore exceptions
- # raised in the background thread
- bg.join(suppress_exception=True)
- raise
- else:
- session = bg.join()
- finally:
- session.close()
diff --git a/client/tests/kvm/tests/module_probe.py b/client/tests/kvm/tests/module_probe.py
deleted file mode 100644
index b192b6d..0000000
--- a/client/tests/kvm/tests/module_probe.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import re, commands, logging, os
-from autotest_lib.client.common_lib import error, utils
-from autotest_lib.client.virt import kvm_installer
-
-
-def run_module_probe(test, params, env):
- """
- load/unload KVM modules several times.
-
- The test can run in two modes:
-
- - based on previous 'build' test: in case KVM modules were installed by a
- 'build' test, we used the modules installed by the previous test.
-
- - based on own params: if no previous 'build' test was run,
- we assume a pre-installed KVM module. Some parameters that
- work for the 'build' can be used, then, such as 'extra_modules'.
- """
-
- installer_object = env.previous_installer()
- if installer_object is None:
- installer_object = kvm_installer.PreInstalledKvm()
- installer_object.set_install_params(test, params)
-
- logging.debug('installer object: %r', installer_object)
-
- mod_str = params.get("mod_list")
- if mod_str:
- mod_list = re.split("[, ]", mod_str)
- logging.debug("mod list will be: %r", mod_list)
- else:
- mod_list = installer_object.full_module_list()
- logging.debug("mod list from installer: %r", mod_list)
-
- # unload the modules before starting:
- installer_object._unload_modules(mod_list)
-
- load_count = int(params.get("load_count", 100))
- try:
- for i in range(load_count):
- try:
- installer_object.load_modules(mod_list)
- except Exception,e:
- raise error.TestFail("Failed to load modules [%r]: %s" %
- (installer_object.full_module_list, e))
-
- # unload using rmmod directly because utils.unload_module() (used by
- # installer) does too much (runs lsmod, checks for dependencies),
- # and we want to run the loop as fast as possible.
- for mod in reversed(mod_list):
- r = utils.system("rmmod %s" % (mod), ignore_status=True)
- if r <> 0:
- raise error.TestFail("Failed to unload module %s. "
- "exit status: %d" % (mod, r))
- finally:
- installer_object.load_modules()
diff --git a/client/tests/kvm/tests/multi_disk.py b/client/tests/kvm/tests/multi_disk.py
deleted file mode 100644
index c7368ca..0000000
--- a/client/tests/kvm/tests/multi_disk.py
+++ /dev/null
@@ -1,111 +0,0 @@
-import logging, re, random
-from autotest_lib.client.common_lib import error
-
-
[email protected]_aware
-def run_multi_disk(test, params, env):
- """
- Test multi disk suport of guest, this case will:
- 1) Create disks image in configuration file.
- 2) Start the guest with those disks.
- 3) Format those disks.
- 4) Copy file into / out of those disks.
- 5) Compare the original file and the copied file using md5 or fc comand.
- 6) Repeat steps 3-5 if needed.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
-
- images = params.get("images").split()
- n_repeat = int(params.get("n_repeat", "1"))
- image_num = len(images)
- disk_num = 0
- file_system = params.get("file_system").split()
- fs_num = len(file_system)
- cmd_timeout = float(params.get("cmd_timeout", 360))
- re_str = params.get("re_str")
- block_list = params.get("block_list").split()
-
- try:
- if params.get("clean_cmd"):
- cmd = params.get("clean_cmd")
- session.cmd_status_output(cmd)
- if params.get("pre_cmd"):
- cmd = params.get("pre_cmd")
- error.context("creating partition on test disk")
- session.cmd(cmd, timeout=cmd_timeout)
- cmd = params.get("list_volume_command")
- output = session.cmd_output(cmd, timeout=cmd_timeout)
- disks = re.findall(re_str, output)
- disks.sort()
- logging.debug("Volume list that meets regular expressions: %s", disks)
- if len(disks) < image_num:
- raise error.TestFail("Fail to list all the volumes!")
-
- tmp_list = []
- for disk in disks:
- if disk.strip() in block_list:
- tmp_list.append(disk)
- for disk in tmp_list:
- logging.info("No need to check volume %s", disk)
- disks.remove(disk)
-
- for i in range(n_repeat):
- logging.info("iterations: %s", (i + 1))
- for disk in disks:
- disk = disk.strip()
-
- logging.info("Format disk: %s..." % disk)
- index = random.randint(0, fs_num - 1)
-
- # Random select one file system from file_system
- fs = file_system[index].strip()
- cmd = params.get("format_command") % (fs, disk)
- error.context("formatting test disk")
- session.cmd(cmd, timeout=cmd_timeout)
- if params.get("mount_command"):
- cmd = params.get("mount_command") % (disk, disk, disk)
- session.cmd(cmd, timeout=cmd_timeout)
-
- for disk in disks:
- disk = disk.strip()
-
- logging.info("Performing I/O on disk: %s...", disk)
- cmd_list = params.get("cmd_list").split()
- for cmd_l in cmd_list:
- if params.get(cmd_l):
- cmd = params.get(cmd_l) % disk
- session.cmd(cmd, timeout=cmd_timeout)
-
- cmd = params.get("compare_command")
- output = session.cmd_output(cmd)
- key_word = params.get("check_result_key_word")
- if key_word and key_word in output:
- logging.debug("Guest's virtual disk %s works fine", disk)
- elif key_word:
- raise error.TestFail("Files on guest os root fs and disk "
- "differ")
- else:
- raise error.TestError("Param check_result_key_word was not "
- "specified! Please check your config")
-
- if params.get("umount_command"):
- cmd = params.get("show_mount_cmd")
- output = session.cmd_output(cmd)
- disks = re.findall(re_str, output)
- disks.sort()
- for disk in disks:
- disk = disk.strip()
- cmd = params.get("umount_command") % (disk, disk)
- error.context("unmounting test disk")
- session.cmd(cmd)
- finally:
- if params.get("post_cmd"):
- cmd = params.get("post_cmd")
- session.cmd(cmd)
- session.close()
diff --git a/client/tests/kvm/tests/nic_bonding.py b/client/tests/kvm/tests/nic_bonding.py
deleted file mode 100644
index e290190..0000000
--- a/client/tests/kvm/tests/nic_bonding.py
+++ /dev/null
@@ -1,62 +0,0 @@
-import logging, time, threading
-from autotest_lib.client.virt.tests import file_transfer
-from autotest_lib.client.virt import virt_test_utils, virt_utils
-
-
-def run_nic_bonding(test, params, env):
- """
- Nic bonding test in guest.
-
- 1) Start guest with four nic models.
- 2) Setup bond0 in guest by script nic_bonding_guest.py.
- 3) Execute file transfer test between guest and host.
- 4) Repeatedly put down/up interfaces by set_link
- 5) Execute file transfer test between guest and host.
-
- @param test: Kvm test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- timeout = int(params.get("login_timeout", 1200))
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session_serial = vm.wait_for_serial_login(timeout=timeout)
-
- # get params of bonding
- modprobe_cmd = "modprobe bonding"
- bonding_params = params.get("bonding_params")
- if bonding_params:
- modprobe_cmd += " %s" % bonding_params
- session_serial.cmd(modprobe_cmd)
-
- session_serial.cmd("ifconfig bond0 up")
- ifnames = [virt_test_utils.get_linux_ifname(session_serial,
- vm.get_mac_address(vlan))
- for vlan, nic in enumerate(params.get("nics").split())]
- setup_cmd = "ifenslave bond0 " + " ".join(ifnames)
- session_serial.cmd(setup_cmd)
- session_serial.cmd("dhclient bond0")
-
- try:
- logging.info("Test file transfering:")
- file_transfer.run_file_transfer(test, params, env)
-
- logging.info("Failover test with file transfer")
- transfer_thread = virt_utils.Thread(file_transfer.run_file_transfer,
- (test, params, env))
- try:
- transfer_thread.start()
- while transfer_thread.isAlive():
- for vlan, nic in enumerate(params.get("nics").split()):
- device_id = vm.get_peer(vm.netdev_id[vlan])
- vm.monitor.cmd("set_link %s down" % device_id)
- time.sleep(1)
- vm.monitor.cmd("set_link %s up" % device_id)
- except:
- transfer_thread.join(suppress_exception=True)
- raise
- else:
- transfer_thread.join()
- finally:
- session_serial.sendline("ifenslave -d bond0 " + " ".join(ifnames))
- session_serial.sendline("kill -9 `pgrep dhclient`")
diff --git a/client/tests/kvm/tests/nic_hotplug.py b/client/tests/kvm/tests/nic_hotplug.py
deleted file mode 100644
index 059277e..0000000
--- a/client/tests/kvm/tests/nic_hotplug.py
+++ /dev/null
@@ -1,149 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils, virt_utils
-
-
-def run_nic_hotplug(test, params, env):
- """
- Test hotplug of NIC devices
-
- 1) Boot up guest with one nic
- 2) Add a host network device through monitor cmd and check if it's added
- 3) Add nic device through monitor cmd and check if it's added
- 4) Check if new interface gets ip address
- 5) Disable primary link of guest
- 6) Ping guest new ip from host
- 7) Delete nic device and netdev
- 8) Re-enable primary link of guest
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
- timeout = int(params.get("login_timeout", 360))
- guest_delay = int(params.get("guest_delay", 20))
- session = virt_test_utils.wait_for_login(vm, timeout=timeout)
- romfile = params.get("romfile")
-
- # Modprobe the module if specified in config file
- module = params.get("modprobe_module")
- if module:
- session.get_command_output("modprobe %s" % module)
-
- def netdev_add(vm):
- netdev_id = virt_utils.generate_random_id()
- attach_cmd = ("netdev_add tap,id=%s" % netdev_id)
- nic_script = params.get("nic_script")
- if nic_script:
- attach_cmd += ",script=%s" % virt_utils.get_path(vm.root_dir,
- nic_script)
- netdev_extra_params = params.get("netdev_extra_params")
- if netdev_extra_params:
- attach_cmd += ",%s" % netdev_extra_params
- logging.info("Adding netdev through %s", attach_cmd)
- vm.monitor.cmd(attach_cmd)
-
- network = vm.monitor.info("network")
- if netdev_id not in network:
- logging.error(network)
- raise error.TestError("Fail to add netdev: %s" % netdev_id)
- else:
- return netdev_id
-
- def netdev_del(vm, n_id):
- vm.monitor.cmd("netdev_del %s" % n_id)
-
- network = vm.monitor.info("network")
- if n_id in network:
- logging.error(network)
- raise error.TestError("Fail to remove netdev %s" % n_id)
-
- def nic_add(vm, model, netdev_id, mac, rom=None):
- """
- Add a nic to virtual machine
-
- @vm: VM object
- @model: nic model
- @netdev_id: id of netdev
- @mac: Mac address of new nic
- @rom: Rom file
- """
- nic_id = virt_utils.generate_random_id()
- if model == "virtio":
- model = "virtio-net-pci"
- device_add_cmd = "device_add %s,netdev=%s,mac=%s,id=%s" % (model,
- netdev_id,
- mac, nic_id)
- if rom:
- device_add_cmd += ",romfile=%s" % rom
- logging.info("Adding nic through %s", device_add_cmd)
- vm.monitor.cmd(device_add_cmd)
-
- qdev = vm.monitor.info("qtree")
- if not nic_id in qdev:
- logging.error(qdev)
- raise error.TestFail("Device %s was not plugged into qdev"
- "tree" % nic_id)
- else:
- return nic_id
-
- def nic_del(vm, nic_id, wait=True):
- """
- Remove the nic from pci tree.
-
- @vm: VM object
- @id: the nic id
- @wait: Whether need to wait for the guest to unplug the device
- """
- nic_del_cmd = "device_del %s" % nic_id
- vm.monitor.cmd(nic_del_cmd)
- if wait:
- logging.info("waiting for the guest to finish the unplug")
- if not virt_utils.wait_for(lambda: nic_id not in
- vm.monitor.info("qtree"),
- guest_delay, 5 ,1):
- logging.error(vm.monitor.info("qtree"))
- raise error.TestError("Device is not unplugged by "
- "guest, please check whether the "
- "hotplug module was loaded in guest")
-
- logging.info("Attach a virtio nic to vm")
- mac = virt_utils.generate_mac_address(vm.instance, 1)
- if not mac:
- mac = "00:00:02:00:00:02"
- netdev_id = netdev_add(vm)
- device_id = nic_add(vm, "virtio", netdev_id, mac, romfile)
-
- if "Win" not in params.get("guest_name", ""):
- session.sendline("dhclient %s &" %
- virt_test_utils.get_linux_ifname(session, mac))
-
- logging.info("Shutting down the primary link")
- vm.monitor.cmd("set_link %s down" % vm.netdev_id[0])
-
- try:
- logging.info("Waiting for new nic's ip address acquisition...")
- if not virt_utils.wait_for(lambda: (vm.address_cache.get(mac) is
- not None), 10, 1):
- raise error.TestFail("Could not get ip address of new nic")
- ip = vm.address_cache.get(mac)
- if not virt_utils.verify_ip_address_ownership(ip, mac):
- raise error.TestFail("Could not verify the ip address of new nic")
- else:
- logging.info("Got the ip address of new nic: %s", ip)
-
- logging.info("Ping test the new nic ...")
- s, o = virt_test_utils.ping(ip, 100)
- if s != 0:
- logging.error(o)
- raise error.TestFail("New nic failed ping test")
-
- logging.info("Detaching a virtio nic from vm")
- nic_del(vm, device_id)
- netdev_del(vm, netdev_id)
-
- finally:
- vm.free_mac_address(1)
- logging.info("Re-enabling the primary link")
- vm.monitor.cmd("set_link %s up" % vm.netdev_id[0])
diff --git a/client/tests/kvm/tests/nmi_watchdog.py b/client/tests/kvm/tests/nmi_watchdog.py
deleted file mode 100644
index a4b2349..0000000
--- a/client/tests/kvm/tests/nmi_watchdog.py
+++ /dev/null
@@ -1,60 +0,0 @@
-import time, logging
-from autotest_lib.client.common_lib import error
-
-
[email protected]_aware
-def run_nmi_watchdog(test, params, env):
- """
- Test the function of nmi injection and verify the response of guest
-
- 1) Log in the guest
- 2) Add 'watchdog=1' to boot option
- 2) Check if guest's NMI counter augment after injecting nmi
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout=int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- get_nmi_cmd= params.get("get_nmi_cmd")
- kernel_version = session.get_command_output("uname -r").strip()
- nmi_watchdog_type = int(params.get("nmi_watchdog_type"))
- update_kernel_cmd = ("grubby --update-kernel=/boot/vmlinuz-%s "
- "--args='nmi_watchdog=%d'" %
- (kernel_version, nmi_watchdog_type))
-
- error.context("Add 'nmi_watchdog=%d' to guest kernel cmdline and reboot"
- % nmi_watchdog_type)
- session.cmd(update_kernel_cmd)
- time.sleep(int(params.get("sleep_before_reset", 10)))
- session = vm.reboot(session, method='shell', timeout=timeout)
- try:
- error.context("Getting guest's number of vcpus")
- guest_cpu_num = session.cmd(params.get("cpu_chk_cmd"))
-
- error.context("Getting guest's NMI counter")
- output = session.cmd(get_nmi_cmd)
- logging.debug(output.strip())
- nmi_counter1 = output.split()[1:]
-
- logging.info("Waiting 60 seconds to see if guest's NMI counter "
- "increases")
- time.sleep(60)
-
- error.context("Getting guest's NMI counter 2nd time")
- output = session.cmd(get_nmi_cmd)
- logging.debug(output.strip())
- nmi_counter2 = output.split()[1:]
-
- error.context("")
- for i in range(int(guest_cpu_num)):
- logging.info("vcpu: %s, nmi_counter1: %s, nmi_counter2: %s" %
- (i, nmi_counter1[i], nmi_counter2[i]))
- if int(nmi_counter2[i]) <= int(nmi_counter1[i]):
- raise error.TestFail("Guest's NMI counter did not increase "
- "after 60 seconds")
- finally:
- session.close()
diff --git a/client/tests/kvm/tests/pci_hotplug.py b/client/tests/kvm/tests/pci_hotplug.py
deleted file mode 100644
index 5800fc5..0000000
--- a/client/tests/kvm/tests/pci_hotplug.py
+++ /dev/null
@@ -1,203 +0,0 @@
-import re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_vm, aexpect
-
-
-def run_pci_hotplug(test, params, env):
- """
- Test hotplug of PCI devices.
-
- (Elements between [] are configurable test parameters)
- 1) PCI add a deivce (NIC / block)
- 2) Compare output of monitor command 'info pci'.
- 3) Compare output of guest command [reference_cmd].
- 4) Verify whether pci_model is shown in [pci_find_cmd].
- 5) Check whether the newly added PCI device works fine.
- 6) PCI delete the device, verify whether could remove the PCI device.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Modprobe the module if specified in config file
- module = params.get("modprobe_module")
- if module:
- session.cmd("modprobe %s" % module)
-
- # Get output of command 'info pci' as reference
- info_pci_ref = vm.monitor.info("pci")
-
- # Get output of command as reference
- reference = session.cmd_output(params.get("reference_cmd"))
-
- tested_model = params.get("pci_model")
- test_type = params.get("pci_type")
- image_format = params.get("image_format_stg")
-
- # Probe qemu to verify what is the supported syntax for PCI hotplug
- cmd_output = vm.monitor.cmd("?")
- if len(re.findall("\ndevice_add", cmd_output)) > 0:
- cmd_type = "device_add"
- elif len(re.findall("\npci_add", cmd_output)) > 0:
- cmd_type = "pci_add"
- else:
- raise error.TestError("Unknow version of qemu")
-
- # Determine syntax of drive hotplug
- # __com.redhat_drive_add == qemu-kvm-0.12 on RHEL 6
- if len(re.findall("\n__com.redhat_drive_add", cmd_output)) > 0:
- drive_cmd_type = "__com.redhat_drive_add"
- # drive_add == qemu-kvm-0.13 onwards
- elif len(re.findall("\ndrive_add", cmd_output)) > 0:
- drive_cmd_type = "drive_add"
- else:
- raise error.TestError("Unknow version of qemu")
-
- # Probe qemu for a list of supported devices
- devices_support = vm.monitor.cmd("%s ?" % cmd_type)
-
- if cmd_type == "pci_add":
- if test_type == "nic":
- pci_add_cmd = "pci_add pci_addr=auto nic model=%s" % tested_model
- elif test_type == "block":
- image_params = params.object_params("stg")
- image_filename = virt_vm.get_image_filename(image_params,
- test.bindir)
- pci_add_cmd = ("pci_add pci_addr=auto storage file=%s,if=%s" %
- (image_filename, tested_model))
- # Execute pci_add (should be replaced by a proper monitor method call)
- add_output = vm.monitor.cmd(pci_add_cmd)
- if not "OK domain" in add_output:
- raise error.TestFail("Add PCI device failed. "
- "Monitor command is: %s, Output: %r" %
- (pci_add_cmd, add_output))
- after_add = vm.monitor.info("pci")
-
- elif cmd_type == "device_add":
- driver_id = test_type + "-" + virt_utils.generate_random_id()
- device_id = test_type + "-" + virt_utils.generate_random_id()
- if test_type == "nic":
- if tested_model == "virtio":
- tested_model = "virtio-net-pci"
- pci_add_cmd = "device_add id=%s,driver=%s" % (device_id,
- tested_model)
-
- elif test_type == "block":
- image_params = params.object_params("stg")
- image_filename = virt_vm.get_image_filename(image_params,
- test.bindir)
- controller_model = None
- if tested_model == "virtio":
- tested_model = "virtio-blk-pci"
-
- if tested_model == "scsi":
- tested_model = "scsi-disk"
- controller_model = "lsi53c895a"
- if len(re.findall(controller_model, devices_support)) == 0:
- raise error.TestError("scsi controller device (%s) not "
- "supported by qemu" %
- controller_model)
-
- if controller_model is not None:
- controller_id = "controller-" + device_id
- controller_add_cmd = ("device_add %s,id=%s" %
- (controller_model, controller_id))
- vm.monitor.cmd(controller_add_cmd)
-
- if drive_cmd_type == "drive_add":
- driver_add_cmd = ("drive_add auto "
- "file=%s,if=none,id=%s,format=%s" %
- (image_filename, driver_id, image_format))
- elif drive_cmd_type == "__com.redhat_drive_add":
- driver_add_cmd = ("__com.redhat_drive_add "
- "file=%s,format=%s,id=%s" %
- (image_filename, image_format, driver_id))
-
- pci_add_cmd = ("device_add id=%s,driver=%s,drive=%s" %
- (device_id, tested_model, driver_id))
- vm.monitor.cmd(driver_add_cmd)
-
- # Check if the device is support in qemu
- if len(re.findall(tested_model, devices_support)) > 0:
- add_output = vm.monitor.cmd(pci_add_cmd)
- else:
- raise error.TestError("%s doesn't support device: %s" %
- (cmd_type, tested_model))
- after_add = vm.monitor.info("pci")
-
- if not device_id in after_add:
- raise error.TestFail("Add device failed. Monitor command is: %s"
- ". Output: %r" % (pci_add_cmd, add_output))
-
- # Define a helper function to delete the device
- def pci_del(ignore_failure=False):
- if cmd_type == "pci_add":
- result_domain, bus, slot, function = add_output.split(',')
- domain = int(result_domain.split()[2])
- bus = int(bus.split()[1])
- slot = int(slot.split()[1])
- pci_addr = "%x:%x:%x" % (domain, bus, slot)
- cmd = "pci_del pci_addr=%s" % pci_addr
- elif cmd_type == "device_add":
- cmd = "device_del %s" % device_id
- # This should be replaced by a proper monitor method call
- vm.monitor.cmd(cmd)
-
- def device_removed():
- after_del = vm.monitor.info("pci")
- return after_del != after_add
-
- if (not virt_utils.wait_for(device_removed, 10, 0, 1)
- and not ignore_failure):
- raise error.TestFail("Failed to hot remove PCI device: %s. "
- "Monitor command: %s" %
- (tested_model, cmd))
-
- try:
- # Compare the output of 'info pci'
- if after_add == info_pci_ref:
- raise error.TestFail("No new PCI device shown after executing "
- "monitor command: 'info pci'")
-
- # Define a helper function to compare the output
- def new_shown():
- o = session.cmd_output(params.get("reference_cmd"))
- return o != reference
-
- secs = int(params.get("wait_secs_for_hook_up"))
- if not virt_utils.wait_for(new_shown, 30, secs, 3):
- raise error.TestFail("No new device shown in output of command "
- "executed inside the guest: %s" %
- params.get("reference_cmd"))
-
- # Define a helper function to catch PCI device string
- def find_pci():
- o = session.cmd_output(params.get("find_pci_cmd"))
- return params.get("match_string") in o
-
- if not virt_utils.wait_for(find_pci, 30, 3, 3):
- raise error.TestFail("PCI %s %s device not found in guest. "
- "Command was: %s" %
- (tested_model, test_type,
- params.get("find_pci_cmd")))
-
- # Test the newly added device
- try:
- session.cmd(params.get("pci_test_cmd"))
- except aexpect.ShellError, e:
- raise error.TestFail("Check for %s device failed after PCI "
- "hotplug. Output: %r" % (test_type, e.output))
-
- session.close()
-
- except:
- pci_del(ignore_failure=True)
- raise
-
- else:
- pci_del()
diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py
deleted file mode 100644
index 4e83814..0000000
--- a/client/tests/kvm/tests/physical_resources_check.py
+++ /dev/null
@@ -1,182 +0,0 @@
-import re, string, logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor, virt_vm
-
-
-def run_physical_resources_check(test, params, env):
- """
- Check physical resources assigned to KVM virtual machines:
- 1) Log into the guest
- 2) Verify whether cpu counts ,memory size, nics' model,
- count and drives' format & count, drive_serial, UUID
- reported by the guest OS matches what has been assigned
- to the VM (qemu command line)
- 3) Verify all MAC addresses for guest NICs
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- # Define a function for checking number of hard drivers & NICs
- def check_num(devices, info_cmd, check_str):
- f_fail = []
- expected_num = params.objects(devices).__len__()
- o = ""
- try:
- o = vm.monitor.info(info_cmd)
- except kvm_monitor.MonitorError, e:
- fail_log = e + "\n"
- fail_log += "info/query monitor command failed (%s)" % info_cmd
- f_fail.append(fail_log)
- logging.error(fail_log)
-
- actual_num = string.count(o, check_str)
- if expected_num != actual_num:
- fail_log = "%s number mismatch:\n" % str(devices)
- fail_log += " Assigned to VM: %d\n" % expected_num
- fail_log += " Reported by OS: %d" % actual_num
- f_fail.append(fail_log)
- logging.error(fail_log)
- return expected_num, f_fail
-
- # Define a function for checking hard drives & NICs' model
- def chk_fmt_model(device, fmt_model, info_cmd, regexp):
- f_fail = []
- devices = params.objects(device)
- for chk_device in devices:
- expected = params.object_params(chk_device).get(fmt_model)
- if not expected:
- expected = "rtl8139"
- o = ""
- try:
- o = vm.monitor.info(info_cmd)
- except kvm_monitor.MonitorError, e:
- fail_log = e + "\n"
- fail_log += "info/query monitor command failed (%s)" % info_cmd
- f_fail.append(fail_log)
- logging.error(fail_log)
-
- device_found = re.findall(regexp, o)
- logging.debug("Found devices: %s", device_found)
- found = False
- for fm in device_found:
- if expected in fm:
- found = True
-
- if not found:
- fail_log = "%s model mismatch:\n" % str(device)
- fail_log += " Assigned to VM: %s\n" % expected
- fail_log += " Reported by OS: %s" % device_found
- f_fail.append(fail_log)
- logging.error(fail_log)
- return f_fail
-
- # Define a function to verify UUID & Serial number
- def verify_device(expect, name, verify_cmd):
- f_fail = []
- if verify_cmd:
- actual = session.cmd_output(verify_cmd)
- if not string.upper(expect) in actual:
- fail_log = "%s mismatch:\n" % name
- fail_log += " Assigned to VM: %s\n" % string.upper(expect)
- fail_log += " Reported by OS: %s" % actual
- f_fail.append(fail_log)
- logging.error(fail_log)
- return f_fail
-
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- logging.info("Starting physical resources check test")
- logging.info("Values assigned to VM are the values we expect "
- "to see reported by the Operating System")
- # Define a failure counter, as we want to check all physical
- # resources to know which checks passed and which ones failed
- n_fail = []
-
- # We will check HDs with the image name
- image_name = virt_vm.get_image_filename(params, test.bindir)
-
- # Check cpu count
- logging.info("CPU count check")
- expected_cpu_nr = int(params.get("smp"))
- actual_cpu_nr = vm.get_cpu_count()
- if expected_cpu_nr != actual_cpu_nr:
- fail_log = "CPU count mismatch:\n"
- fail_log += " Assigned to VM: %s \n" % expected_cpu_nr
- fail_log += " Reported by OS: %s" % actual_cpu_nr
- n_fail.append(fail_log)
- logging.error(fail_log)
-
- # Check memory size
- logging.info("Memory size check")
- expected_mem = int(params.get("mem"))
- actual_mem = vm.get_memory_size()
- if actual_mem != expected_mem:
- fail_log = "Memory size mismatch:\n"
- fail_log += " Assigned to VM: %s\n" % expected_mem
- fail_log += " Reported by OS: %s\n" % actual_mem
- n_fail.append(fail_log)
- logging.error(fail_log)
-
-
- logging.info("Hard drive count check")
- _, f_fail = check_num("images", "block", image_name)
- n_fail.extend(f_fail)
-
- logging.info("NIC count check")
- _, f_fail = check_num("nics", "network", "model=")
- n_fail.extend(f_fail)
-
- logging.info("NICs model check")
- f_fail = chk_fmt_model("nics", "nic_model", "network", "model=(.*),")
- n_fail.extend(f_fail)
-
- logging.info("Drive format check")
- f_fail = chk_fmt_model("images", "drive_format",
- "block", "(.*)\: .*%s" % image_name)
- n_fail.extend(f_fail)
-
- logging.info("Network card MAC check")
- o = ""
- try:
- o = vm.monitor.info("network")
- except kvm_monitor.MonitorError, e:
- fail_log = e + "\n"
- fail_log += "info/query monitor command failed (network)"
- n_fail.append(fail_log)
- logging.error(fail_log)
- found_mac_addresses = re.findall("macaddr=(\S+)", o)
- logging.debug("Found MAC adresses: %s", found_mac_addresses)
-
- num_nics = len(params.objects("nics"))
- for nic_index in range(num_nics):
- mac = vm.get_mac_address(nic_index)
- if not string.lower(mac) in found_mac_addresses:
- fail_log = "MAC address mismatch:\n"
- fail_log += " Assigned to VM (not found): %s" % mac
- n_fail.append(fail_log)
- logging.error(fail_log)
-
- logging.info("UUID check")
- if vm.get_uuid():
- f_fail = verify_device(vm.get_uuid(), "UUID",
- params.get("catch_uuid_cmd"))
- n_fail.extend(f_fail)
-
- logging.info("Hard Disk serial number check")
- catch_serial_cmd = params.get("catch_serial_cmd")
- f_fail = verify_device(params.get("drive_serial"), "Serial",
- catch_serial_cmd)
- n_fail.extend(f_fail)
-
- if n_fail:
- session.close()
- raise error.TestFail("Physical resources check test "
- "reported %s failures:\n%s" %
- (len(n_fail), "\n".join(n_fail)))
-
- session.close()
diff --git a/client/tests/kvm/tests/qemu_img.py b/client/tests/kvm/tests/qemu_img.py
deleted file mode 100644
index a4f63a4..0000000
--- a/client/tests/kvm/tests/qemu_img.py
+++ /dev/null
@@ -1,439 +0,0 @@
-import re, os, logging, commands
-from autotest_lib.client.common_lib import utils, error
-from autotest_lib.client.virt import virt_vm, virt_utils, virt_env_process
-
-
-def run_qemu_img(test, params, env):
- """
- 'qemu-img' functions test:
- 1) Judge what subcommand is going to be tested
- 2) Run subcommand test
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- cmd = virt_utils.get_path(test.bindir, params.get("qemu_img_binary"))
- if not os.path.exists(cmd):
- raise error.TestError("Binary of 'qemu-img' not found")
- image_format = params.get("image_format")
- image_size = params.get("image_size", "10G")
- image_name = virt_vm.get_image_filename(params, test.bindir)
-
-
- def _check(cmd, img):
- """
- Simple 'qemu-img check' function implementation.
-
- @param cmd: qemu-img base command.
- @param img: image to be checked
- """
- cmd += " check %s" % img
- logging.info("Checking image '%s'...", img)
- try:
- output = utils.system_output(cmd)
- except error.CmdError, e:
- if "does not support checks" in str(e):
- return (True, "")
- else:
- return (False, str(e))
- return (True, output)
-
-
- def check_test(cmd):
- """
- Subcommand 'qemu-img check' test.
-
- This tests will 'dd' to create a specified size file, and check it.
- Then convert it to supported image_format in each loop and check again.
-
- @param cmd: qemu-img base command.
- """
- test_image = virt_utils.get_path(test.bindir,
- params.get("image_name_dd"))
- print "test_image = %s" % test_image
- create_image_cmd = params.get("create_image_cmd")
- create_image_cmd = create_image_cmd % test_image
- print "create_image_cmd = %s" % create_image_cmd
- utils.system(create_image_cmd)
- s, o = _check(cmd, test_image)
- if not s:
- raise error.TestFail("Check image '%s' failed with error: %s" %
- (test_image, o))
- for fmt in params.get("supported_image_formats").split():
- output_image = test_image + ".%s" % fmt
- _convert(cmd, fmt, test_image, output_image)
- s, o = _check(cmd, output_image)
- if not s:
- raise error.TestFail("Check image '%s' got error: %s" %
- (output_image, o))
- os.remove(output_image)
- os.remove(test_image)
-
-
- def _create(cmd, img_name, fmt, img_size=None, base_img=None,
- base_img_fmt=None, encrypted="no"):
- """
- Simple wrapper of 'qemu-img create'
-
- @param cmd: qemu-img base command.
- @param img_name: name of the image file
- @param fmt: image format
- @param img_size: image size
- @param base_img: base image if create a snapshot image
- @param base_img_fmt: base image format if create a snapshot image
- @param encrypted: indicates whether the created image is encrypted
- """
- cmd += " create"
- if encrypted == "yes":
- cmd += " -e"
- if base_img:
- cmd += " -b %s" % base_img
- if base_img_fmt:
- cmd += " -F %s" % base_img_fmt
- cmd += " -f %s" % fmt
- cmd += " %s" % img_name
- if img_size:
- cmd += " %s" % img_size
- utils.system(cmd)
-
-
- def create_test(cmd):
- """
- Subcommand 'qemu-img create' test.
-
- @param cmd: qemu-img base command.
- """
- image_large = params.get("image_name_large")
- img = virt_utils.get_path(test.bindir, image_large)
- img += '.' + image_format
- _create(cmd, img_name=img, fmt=image_format,
- img_size=params.get("image_size_large"))
- os.remove(img)
-
-
- def _convert(cmd, output_fmt, img_name, output_filename,
- fmt=None, compressed="no", encrypted="no"):
- """
- Simple wrapper of 'qemu-img convert' function.
-
- @param cmd: qemu-img base command.
- @param output_fmt: the output format of converted image
- @param img_name: image name that to be converted
- @param output_filename: output image name that converted
- @param fmt: output image format
- @param compressed: whether output image is compressed
- @param encrypted: whether output image is encrypted
- """
- cmd += " convert"
- if compressed == "yes":
- cmd += " -c"
- if encrypted == "yes":
- cmd += " -e"
- if fmt:
- cmd += " -f %s" % fmt
- cmd += " -O %s" % output_fmt
- cmd += " %s %s" % (img_name, output_filename)
- logging.info("Converting '%s' from format '%s' to '%s'", img_name, fmt,
- output_fmt)
- utils.system(cmd)
-
-
- def convert_test(cmd):
- """
- Subcommand 'qemu-img convert' test.
-
- @param cmd: qemu-img base command.
- """
- dest_img_fmt = params.get("dest_image_format")
- output_filename = "%s.converted_%s" % (image_name, dest_img_fmt)
-
- _convert(cmd, dest_img_fmt, image_name, output_filename,
- image_format, params.get("compressed"), params.get("encrypted"))
-
- if dest_img_fmt == "qcow2":
- s, o = _check(cmd, output_filename)
- if s:
- os.remove(output_filename)
- else:
- raise error.TestFail("Check image '%s' failed with error: %s" %
- (output_filename, o))
- else:
- os.remove(output_filename)
-
-
- def _info(cmd, img, sub_info=None, fmt=None):
- """
- Simple wrapper of 'qemu-img info'.
-
- @param cmd: qemu-img base command.
- @param img: image file
- @param sub_info: sub info, say 'backing file'
- @param fmt: image format
- """
- cmd += " info"
- if fmt:
- cmd += " -f %s" % fmt
- cmd += " %s" % img
-
- try:
- output = utils.system_output(cmd)
- except error.CmdError, e:
- logging.error("Get info of image '%s' failed: %s", img, str(e))
- return None
-
- if not sub_info:
- return output
-
- sub_info += ": (.*)"
- matches = re.findall(sub_info, output)
- if matches:
- return matches[0]
- return None
-
-
- def info_test(cmd):
- """
- Subcommand 'qemu-img info' test.
-
- @param cmd: qemu-img base command.
- """
- img_info = _info(cmd, image_name)
- logging.info("Info of image '%s':\n%s", image_name, img_info)
- if not image_format in img_info:
- raise error.TestFail("Got unexpected format of image '%s'"
- " in info test" % image_name)
- if not image_size in img_info:
- raise error.TestFail("Got unexpected size of image '%s'"
- " in info test" % image_name)
-
-
- def snapshot_test(cmd):
- """
- Subcommand 'qemu-img snapshot' test.
-
- @param cmd: qemu-img base command.
- """
- cmd += " snapshot"
- for i in range(2):
- crtcmd = cmd
- sn_name = "snapshot%d" % i
- crtcmd += " -c %s %s" % (sn_name, image_name)
- s, o = commands.getstatusoutput(crtcmd)
- if s != 0:
- raise error.TestFail("Create snapshot failed via command: %s;"
- "Output is: %s" % (crtcmd, o))
- logging.info("Created snapshot '%s' in '%s'", sn_name, image_name)
- listcmd = cmd
- listcmd += " -l %s" % image_name
- s, o = commands.getstatusoutput(listcmd)
- if not ("snapshot0" in o and "snapshot1" in o and s == 0):
- raise error.TestFail("Snapshot created failed or missed;"
- "snapshot list is: \n%s" % o)
- for i in range(2):
- sn_name = "snapshot%d" % i
- delcmd = cmd
- delcmd += " -d %s %s" % (sn_name, image_name)
- s, o = commands.getstatusoutput(delcmd)
- if s != 0:
- raise error.TestFail("Delete snapshot '%s' failed: %s" %
- (sn_name, o))
-
-
- def commit_test(cmd):
- """
- Subcommand 'qemu-img commit' test.
- 1) Create a backing file of the qemu harddisk specified by image_name.
- 2) Start a VM using the backing file as its harddisk.
- 3) Touch a file "commit_testfile" in the backing_file, and shutdown the
- VM.
- 4) Make sure touching the file does not affect the original harddisk.
- 5) Commit the change to the original harddisk by executing
- "qemu-img commit" command.
- 6) Start the VM using the original harddisk.
- 7) Check if the file "commit_testfile" exists.
-
- @param cmd: qemu-img base command.
- """
- cmd += " commit"
-
- logging.info("Commit testing started!")
- image_name = params.get("image_name", "image")
- image_format = params.get("image_format", "qcow2")
- backing_file_name = "%s_bak" % (image_name)
-
- try:
- # Remove the existing backing file
- backing_file = "%s.%s" % (backing_file_name, image_format)
- if os.path.isfile(backing_file):
- os.remove(backing_file)
-
- # Create the new backing file
- create_cmd = "qemu-img create -b %s.%s -f %s %s.%s" % (image_name,
- image_format,
- image_format,
- backing_file_name,
- image_format)
- try:
- utils.system(create_cmd)
- except error.CmdError, e:
- raise error.TestFail("Could not create a backing file!")
- logging.info("backing_file created!")
-
- # Set the qemu harddisk to the backing file
- logging.info("Original image_name is: %s", params.get('image_name'))
- params['image_name'] = backing_file_name
- logging.info("Param image_name changed to: %s",
- params.get('image_name'))
-
- # Start a new VM, using backing file as its harddisk
- vm_name = params.get('main_vm')
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- vm = env.get_vm(vm_name)
- vm.create()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Do some changes to the backing_file harddisk
- try:
- output = session.cmd("touch /commit_testfile")
- logging.info("Output of touch /commit_testfile: %s", output)
- output = session.cmd("ls / | grep commit_testfile")
- logging.info("Output of ls / | grep commit_testfile: %s",
- output)
- except Exception, e:
- raise error.TestFail("Could not create commit_testfile in the "
- "backing file %s", e)
- vm.destroy()
-
- # Make sure there is no effect on the original harddisk
- # First, set the harddisk back to the original one
- logging.info("Current image_name is: %s", params.get('image_name'))
- params['image_name'] = image_name
- logging.info("Param image_name reverted to: %s",
- params.get('image_name'))
-
- # Second, Start a new VM, using image_name as its harddisk
- # Here, the commit_testfile should not exist
- vm_name = params.get('main_vm')
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- vm = env.get_vm(vm_name)
- vm.create()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- try:
- output = session.cmd("[ ! -e /commit_testfile ] && echo $?")
- logging.info("Output of [ ! -e /commit_testfile ] && echo $?: "
- "%s", output)
- except:
- output = session.cmd("rm -f /commit_testfile")
- raise error.TestFail("The commit_testfile exists on the "
- "original file")
- vm.destroy()
-
- # Excecute the commit command
- logging.info("Commiting image")
- cmitcmd = "%s -f %s %s.%s" % (cmd, image_format, backing_file_name,
- image_format)
- try:
- utils.system(cmitcmd)
- except error.CmdError, e:
- raise error.TestFail("Could not commit the backing file")
-
- # Start a new VM, using image_name as its harddisk
- vm_name = params.get('main_vm')
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- vm = env.get_vm(vm_name)
- vm.create()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- try:
- output = session.cmd("[ -e /commit_testfile ] && echo $?")
- logging.info("Output of [ -e /commit_testfile ] && echo $?: %s",
- output)
- session.cmd("rm -f /commit_testfile")
- except:
- raise error.TestFail("Could not find commit_testfile after a "
- "commit")
- vm.destroy()
-
- finally:
- # Remove the backing file
- if os.path.isfile(backing_file):
- os.remove(backing_file)
-
-
- def _rebase(cmd, img_name, base_img, backing_fmt, mode="unsafe"):
- """
- Simple wrapper of 'qemu-img rebase'.
-
- @param cmd: qemu-img base command.
- @param img_name: image name to be rebased
- @param base_img: indicates the base image
- @param backing_fmt: the format of base image
- @param mode: rebase mode: safe mode, unsafe mode
- """
- cmd += " rebase"
- if mode == "unsafe":
- cmd += " -u"
- cmd += " -b %s -F %s %s" % (base_img, backing_fmt, img_name)
- logging.info("Trying to rebase '%s' to '%s'...", img_name, base_img)
- s, o = commands.getstatusoutput(cmd)
- if s != 0:
- raise error.TestError("Failed to rebase '%s' to '%s': %s" %
- (img_name, base_img, o))
-
-
- def rebase_test(cmd):
- """
- Subcommand 'qemu-img rebase' test
-
- Change the backing file of a snapshot image in "unsafe mode":
- Assume the previous backing file had missed and we just have to change
- reference of snapshot to new one. After change the backing file of a
- snapshot image in unsafe mode, the snapshot should work still.
-
- @param cmd: qemu-img base command.
- """
- if not 'rebase' in utils.system_output(cmd + ' --help',
- ignore_status=True):
- raise error.TestNAError("Current kvm user space version does not"
- " support 'rebase' subcommand")
- sn_fmt = params.get("snapshot_format", "qcow2")
- sn1 = params.get("image_name_snapshot1")
- sn1 = virt_utils.get_path(test.bindir, sn1) + ".%s" % sn_fmt
- base_img = virt_vm.get_image_filename(params, test.bindir)
- _create(cmd, sn1, sn_fmt, base_img=base_img, base_img_fmt=image_format)
-
- # Create snapshot2 based on snapshot1
- sn2 = params.get("image_name_snapshot2")
- sn2 = virt_utils.get_path(test.bindir, sn2) + ".%s" % sn_fmt
- _create(cmd, sn2, sn_fmt, base_img=sn1, base_img_fmt=sn_fmt)
-
- rebase_mode = params.get("rebase_mode")
- if rebase_mode == "unsafe":
- os.remove(sn1)
-
- _rebase(cmd, sn2, base_img, image_format, mode=rebase_mode)
-
- # Check sn2's format and backing_file
- actual_base_img = _info(cmd, sn2, "backing file")
- base_img_name = os.path.basename(params.get("image_name"))
- if not base_img_name in actual_base_img:
- raise error.TestFail("After rebase the backing_file of 'sn2' is "
- "'%s' which is not expected as '%s'"
- % (actual_base_img, base_img_name))
- s, o = _check(cmd, sn2)
- if not s:
- raise error.TestFail("Check image '%s' failed after rebase;"
- "got error: %s" % (sn2, o))
- try:
- os.remove(sn2)
- os.remove(sn1)
- except:
- pass
-
-
- # Here starts test
- subcommand = params.get("subcommand")
- eval("%s_test(cmd)" % subcommand)
diff --git a/client/tests/kvm/tests/qmp_basic.py b/client/tests/kvm/tests/qmp_basic.py
deleted file mode 100644
index 8e94fe9..0000000
--- a/client/tests/kvm/tests/qmp_basic.py
+++ /dev/null
@@ -1,407 +0,0 @@
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor
-
-
-def run_qmp_basic(test, params, env):
- """
- QMP Specification test-suite: this checks if the *basic* protocol conforms
- to its specification, which is file QMP/qmp-spec.txt in QEMU's source tree.
-
- IMPORTANT NOTES:
-
- o Most tests depend heavily on QMP's error information (eg. classes),
- this might have bad implications as the error interface is going to
- change in QMP
-
- o Command testing is *not* covered in this suite. Each command has its
- own specification and should be tested separately
-
- o We use the same terminology as used by the QMP specification,
- specially with regard to JSON types (eg. a Python dict is called
- a json-object)
-
- o This is divided in sub test-suites, please check the bottom of this
- file to check the order in which they are run
-
- TODO:
-
- o Finding which test failed is not as easy as it should be
-
- o Are all those check_*() functions really needed? Wouldn't a
- specialized class (eg. a Response class) do better?
- """
- def fail_no_key(qmp_dict, key):
- if not isinstance(qmp_dict, dict):
- raise error.TestFail("qmp_dict is not a dict (it's '%s')" %
- type(qmp_dict))
- if not key in qmp_dict:
- raise error.TestFail("'%s' key doesn't exist in dict ('%s')" %
- (key, str(qmp_dict)))
-
-
- def check_dict_key(qmp_dict, key, keytype):
- """
- Performs the following checks on a QMP dict key:
-
- 1. qmp_dict is a dict
- 2. key exists in qmp_dict
- 3. key is of type keytype
-
- If any of these checks fails, error.TestFail is raised.
- """
- fail_no_key(qmp_dict, key)
- if not isinstance(qmp_dict[key], keytype):
- raise error.TestFail("'%s' key is not of type '%s', it's '%s'" %
- (key, keytype, type(qmp_dict[key])))
-
-
- def check_key_is_dict(qmp_dict, key):
- check_dict_key(qmp_dict, key, dict)
-
-
- def check_key_is_list(qmp_dict, key):
- check_dict_key(qmp_dict, key, list)
-
-
- def check_key_is_str(qmp_dict, key):
- check_dict_key(qmp_dict, key, unicode)
-
-
- def check_str_key(qmp_dict, keyname, value=None):
- check_dict_key(qmp_dict, keyname, unicode)
- if value and value != qmp_dict[keyname]:
- raise error.TestFail("'%s' key value '%s' should be '%s'" %
- (keyname, str(qmp_dict[keyname]), str(value)))
-
-
- def check_key_is_int(qmp_dict, key):
- fail_no_key(qmp_dict, key)
- try:
- value = int(qmp_dict[key])
- except:
- raise error.TestFail("'%s' key is not of type int, it's '%s'" %
- (key, type(qmp_dict[key])))
-
-
- def check_bool_key(qmp_dict, keyname, value=None):
- check_dict_key(qmp_dict, keyname, bool)
- if value and value != qmp_dict[keyname]:
- raise error.TestFail("'%s' key value '%s' should be '%s'" %
- (keyname, str(qmp_dict[keyname]), str(value)))
-
-
- def check_success_resp(resp, empty=False):
- """
- Check QMP OK response.
-
- @param resp: QMP response
- @param empty: if True, response should not contain data to return
- """
- check_key_is_dict(resp, "return")
- if empty and len(resp["return"]) > 0:
- raise error.TestFail("success response is not empty ('%s')" %
- str(resp))
-
-
- def check_error_resp(resp, classname=None, datadict=None):
- """
- Check QMP error response.
-
- @param resp: QMP response
- @param classname: Expected error class name
- @param datadict: Expected error data dictionary
- """
- check_key_is_dict(resp, "error")
- check_key_is_str(resp["error"], "class")
- if classname and resp["error"]["class"] != classname:
- raise error.TestFail("got error class '%s' expected '%s'" %
- (resp["error"]["class"], classname))
- check_key_is_dict(resp["error"], "data")
- if datadict and resp["error"]["data"] != datadict:
- raise error.TestFail("got data dict '%s' expected '%s'" %
- (resp["error"]["data"], datadict))
-
-
- def test_version(version):
- """
- Check the QMP greeting message version key which, according to QMP's
- documentation, should be:
-
- { "qemu": { "major": json-int, "minor": json-int, "micro": json-int }
- "package": json-string }
- """
- check_key_is_dict(version, "qemu")
- for key in [ "major", "minor", "micro" ]:
- check_key_is_int(version["qemu"], key)
- check_key_is_str(version, "package")
-
-
- def test_greeting(greeting):
- check_key_is_dict(greeting, "QMP")
- check_key_is_dict(greeting["QMP"], "version")
- check_key_is_list(greeting["QMP"], "capabilities")
-
-
- def greeting_suite(monitor):
- """
- Check the greeting message format, as described in the QMP
- specfication section '2.2 Server Greeting'.
-
- { "QMP": { "version": json-object, "capabilities": json-array } }
- """
- greeting = monitor.get_greeting()
- test_greeting(greeting)
- test_version(greeting["QMP"]["version"])
-
-
- def json_parsing_errors_suite(monitor):
- """
- Check that QMP's parser is able to recover from parsing errors, please
- check the JSON spec for more info on the JSON syntax (RFC 4627).
- """
- # We're quite simple right now and the focus is on parsing errors that
- # have already biten us in the past.
- #
- # TODO: The following test-cases are missing:
- #
- # - JSON numbers, strings and arrays
- # - More invalid characters or malformed structures
- # - Valid, but not obvious syntax, like zillion of spaces or
- # strings with unicode chars (different suite maybe?)
- bad_json = []
-
- # A JSON value MUST be an object, array, number, string, true, false,
- # or null
- #
- # NOTE: QMP seems to ignore a number of chars, like: | and ?
- bad_json.append(":")
- bad_json.append(",")
-
- # Malformed json-objects
- #
- # NOTE: sending only "}" seems to break QMP
- # NOTE: Duplicate keys are accepted (should it?)
- bad_json.append("{ \"execute\" }")
- bad_json.append("{ \"execute\": \"query-version\", }")
- bad_json.append("{ 1: \"query-version\" }")
- bad_json.append("{ true: \"query-version\" }")
- bad_json.append("{ []: \"query-version\" }")
- bad_json.append("{ {}: \"query-version\" }")
-
- for cmd in bad_json:
- resp = monitor.cmd_raw(cmd)
- check_error_resp(resp, "JSONParsing")
-
-
- def test_id_key(monitor):
- """
- Check that QMP's "id" key is correctly handled.
- """
- # The "id" key must be echoed back in error responses
- id_key = "kvm-autotest"
- resp = monitor.cmd_qmp("eject", { "foobar": True }, id=id_key)
- check_error_resp(resp)
- check_str_key(resp, "id", id_key)
-
- # The "id" key must be echoed back in success responses
- resp = monitor.cmd_qmp("query-status", id=id_key)
- check_success_resp(resp)
- check_str_key(resp, "id", id_key)
-
- # The "id" key can be any json-object
- for id_key in [ True, 1234, "string again!", [1, [], {}, True, "foo"],
- { "key": {} } ]:
- resp = monitor.cmd_qmp("query-status", id=id_key)
- check_success_resp(resp)
- if resp["id"] != id_key:
- raise error.TestFail("expected id '%s' but got '%s'" %
- (str(id_key), str(resp["id"])))
-
-
- def test_invalid_arg_key(monitor):
- """
- Currently, the only supported keys in the input object are: "execute",
- "arguments" and "id". Although expansion is supported, invalid key
- names must be detected.
- """
- resp = monitor.cmd_obj({ "execute": "eject", "foobar": True })
- check_error_resp(resp, "QMPExtraInputObjectMember",
- { "member": "foobar" })
-
-
- def test_bad_arguments_key_type(monitor):
- """
- The "arguments" key must be an json-object.
-
- We use the eject command to perform the tests, but that's a random
- choice, any command that accepts arguments will do, as the command
- doesn't get called.
- """
- for item in [ True, [], 1, "foo" ]:
- resp = monitor.cmd_obj({ "execute": "eject", "arguments": item })
- check_error_resp(resp, "QMPBadInputObjectMember",
- { "member": "arguments", "expected": "object" })
-
-
- def test_bad_execute_key_type(monitor):
- """
- The "execute" key must be a json-string.
- """
- for item in [ False, 1, {}, [] ]:
- resp = monitor.cmd_obj({ "execute": item })
- check_error_resp(resp, "QMPBadInputObjectMember",
- { "member": "execute", "expected": "string" })
-
-
- def test_no_execute_key(monitor):
- """
- The "execute" key must exist, we also test for some stupid parsing
- errors.
- """
- for cmd in [ {}, { "execut": "qmp_capabilities" },
- { "executee": "qmp_capabilities" }, { "foo": "bar" }]:
- resp = monitor.cmd_obj(cmd)
- check_error_resp(resp) # XXX: check class and data dict?
-
-
- def test_bad_input_obj_type(monitor):
- """
- The input object must be... an json-object.
- """
- for cmd in [ "foo", [], True, 1 ]:
- resp = monitor.cmd_obj(cmd)
- check_error_resp(resp, "QMPBadInputObject", { "expected":"object" })
-
-
- def test_good_input_obj(monitor):
- """
- Basic success tests for issuing QMP commands.
- """
- # NOTE: We don't use the cmd_qmp() method here because the command
- # object is in a 'random' order
- resp = monitor.cmd_obj({ "execute": "query-version" })
- check_success_resp(resp)
-
- resp = monitor.cmd_obj({ "arguments": {}, "execute": "query-version" })
- check_success_resp(resp)
-
- id = "1234foo"
- resp = monitor.cmd_obj({ "id": id, "execute": "query-version",
- "arguments": {} })
- check_success_resp(resp)
- check_str_key(resp, "id", id)
-
- # TODO: would be good to test simple argument usage, but we don't have
- # a read-only command that accepts arguments.
-
-
- def input_object_suite(monitor):
- """
- Check the input object format, as described in the QMP specfication
- section '2.3 Issuing Commands'.
-
- { "execute": json-string, "arguments": json-object, "id": json-value }
- """
- test_good_input_obj(monitor)
- test_bad_input_obj_type(monitor)
- test_no_execute_key(monitor)
- test_bad_execute_key_type(monitor)
- test_bad_arguments_key_type(monitor)
- test_id_key(monitor)
- test_invalid_arg_key(monitor)
-
-
- def argument_checker_suite(monitor):
- """
- Check that QMP's argument checker is detecting all possible errors.
-
- We use a number of different commands to perform the checks, but the
- command used doesn't matter much as QMP performs argument checking
- _before_ calling the command.
- """
- # stop doesn't take arguments
- resp = monitor.cmd_qmp("stop", { "foo": 1 })
- check_error_resp(resp, "InvalidParameter", { "name": "foo" })
-
- # required argument omitted
- resp = monitor.cmd_qmp("screendump")
- check_error_resp(resp, "MissingParameter", { "name": "filename" })
-
- # 'bar' is not a valid argument
- resp = monitor.cmd_qmp("screendump", { "filename": "outfile",
- "bar": "bar" })
- check_error_resp(resp, "InvalidParameter", { "name": "bar"})
-
- # test optional argument: 'force' is omitted, but it's optional, so
- # the handler has to be called. Test this happens by checking an
- # error that is generated by the handler itself.
- resp = monitor.cmd_qmp("eject", { "device": "foobar" })
- check_error_resp(resp, "DeviceNotFound")
-
- # filename argument must be a json-string
- for arg in [ {}, [], 1, True ]:
- resp = monitor.cmd_qmp("screendump", { "filename": arg })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "filename", "expected": "string" })
-
- # force argument must be a json-bool
- for arg in [ {}, [], 1, "foo" ]:
- resp = monitor.cmd_qmp("eject", { "force": arg, "device": "foo" })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "force", "expected": "bool" })
-
- # val argument must be a json-int
- for arg in [ {}, [], True, "foo" ]:
- resp = monitor.cmd_qmp("memsave", { "val": arg, "filename": "foo",
- "size": 10 })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "val", "expected": "int" })
-
- # value argument must be a json-number
- for arg in [ {}, [], True, "foo" ]:
- resp = monitor.cmd_qmp("migrate_set_speed", { "value": arg })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "value", "expected": "number" })
-
- # qdev-type commands have their own argument checker, all QMP does
- # is to skip its checking and pass arguments through. Check this
- # works by providing invalid options to device_add and expecting
- # an error message from qdev
- resp = monitor.cmd_qmp("device_add", { "driver": "e1000",
- "foo": "bar" })
- check_error_resp(resp, "PropertyNotFound",
- {"device": "e1000", "property": "foo"})
-
-
- def unknown_commands_suite(monitor):
- """
- Check that QMP handles unknown commands correctly.
- """
- # We also call a HMP-only command, to be sure it will fail as expected
- for cmd in [ "bar", "query-", "query-foo", "q", "help" ]:
- resp = monitor.cmd_qmp(cmd)
- check_error_resp(resp, "CommandNotFound", { "name": cmd })
-
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
-
- # Look for the first qmp monitor available, otherwise, fail the test
- qmp_monitor = None
- for m in vm.monitors:
- if isinstance(m, kvm_monitor.QMPMonitor):
- qmp_monitor = m
-
- if qmp_monitor is None:
- raise error.TestError('Could not find a QMP monitor, aborting test')
-
- # Run all suites
- greeting_suite(qmp_monitor)
- input_object_suite(qmp_monitor)
- argument_checker_suite(qmp_monitor)
- unknown_commands_suite(qmp_monitor)
- json_parsing_errors_suite(qmp_monitor)
-
- # check if QMP is still alive
- if not qmp_monitor.is_responsive():
- raise error.TestFail('QMP monitor is not responsive after testing')
diff --git a/client/tests/kvm/tests/qmp_basic_rhel6.py b/client/tests/kvm/tests/qmp_basic_rhel6.py
deleted file mode 100644
index 2ecad39..0000000
--- a/client/tests/kvm/tests/qmp_basic_rhel6.py
+++ /dev/null
@@ -1,389 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor
-
-
-def run_qmp_basic_rhel6(test, params, env):
- """
- QMP Specification test-suite: this checks if the *basic* protocol conforms
- to its specification, which is file QMP/qmp-spec.txt in QEMU's source tree.
-
- IMPORTANT NOTES:
-
- o Most tests depend heavily on QMP's error information (eg. classes),
- this might have bad implications as the error interface is going to
- change in QMP
-
- o Command testing is *not* covered in this suite. Each command has its
- own specification and should be tested separately
-
- o We use the same terminology as used by the QMP specification,
- specially with regard to JSON types (eg. a Python dict is called
- a json-object)
-
- o This is divided in sub test-suites, please check the bottom of this
- file to check the order in which they are run
-
- TODO:
-
- o Finding which test failed is not as easy as it should be
-
- o Are all those check_*() functions really needed? Wouldn't a
- specialized class (eg. a Response class) do better?
- """
- def fail_no_key(qmp_dict, key):
- if not isinstance(qmp_dict, dict):
- raise error.TestFail("qmp_dict is not a dict (it's '%s')" %
- type(qmp_dict))
- if not key in qmp_dict:
- raise error.TestFail("'%s' key doesn't exist in dict ('%s')" %
- (key, str(qmp_dict)))
-
-
- def check_dict_key(qmp_dict, key, keytype):
- """
- Performs the following checks on a QMP dict key:
-
- 1. qmp_dict is a dict
- 2. key exists in qmp_dict
- 3. key is of type keytype
-
- If any of these checks fails, error.TestFail is raised.
- """
- fail_no_key(qmp_dict, key)
- if not isinstance(qmp_dict[key], keytype):
- raise error.TestFail("'%s' key is not of type '%s', it's '%s'" %
- (key, keytype, type(qmp_dict[key])))
-
-
- def check_key_is_dict(qmp_dict, key):
- check_dict_key(qmp_dict, key, dict)
-
-
- def check_key_is_list(qmp_dict, key):
- check_dict_key(qmp_dict, key, list)
-
-
- def check_key_is_str(qmp_dict, key):
- check_dict_key(qmp_dict, key, unicode)
-
-
- def check_str_key(qmp_dict, keyname, value=None):
- check_dict_key(qmp_dict, keyname, unicode)
- if value and value != qmp_dict[keyname]:
- raise error.TestFail("'%s' key value '%s' should be '%s'" %
- (keyname, str(qmp_dict[keyname]), str(value)))
-
-
- def check_key_is_int(qmp_dict, key):
- fail_no_key(qmp_dict, key)
- try:
- int(qmp_dict[key])
- except:
- raise error.TestFail("'%s' key is not of type int, it's '%s'" %
- (key, type(qmp_dict[key])))
-
-
- def check_bool_key(qmp_dict, keyname, value=None):
- check_dict_key(qmp_dict, keyname, bool)
- if value and value != qmp_dict[keyname]:
- raise error.TestFail("'%s' key value '%s' should be '%s'" %
- (keyname, str(qmp_dict[keyname]), str(value)))
-
-
- def check_success_resp(resp, empty=False):
- """
- Check QMP OK response.
-
- @param resp: QMP response
- @param empty: if True, response should not contain data to return
- """
- check_key_is_dict(resp, "return")
- if empty and len(resp["return"]) > 0:
- raise error.TestFail("success response is not empty ('%s')" %
- str(resp))
-
-
- def check_error_resp(resp, classname=None, datadict=None):
- """
- Check QMP error response.
-
- @param resp: QMP response
- @param classname: Expected error class name
- @param datadict: Expected error data dictionary
- """
- logging.debug("resp %s", str(resp))
- check_key_is_dict(resp, "error")
- check_key_is_str(resp["error"], "class")
- if classname and resp["error"]["class"] != classname:
- raise error.TestFail("got error class '%s' expected '%s'" %
- (resp["error"]["class"], classname))
- check_key_is_dict(resp["error"], "data")
- if datadict and resp["error"]["data"] != datadict:
- raise error.TestFail("got data dict '%s' expected '%s'" %
- (resp["error"]["data"], datadict))
-
-
- def test_version(version):
- """
- Check the QMP greeting message version key which, according to QMP's
- documentation, should be:
-
- { "qemu": { "major": json-int, "minor": json-int, "micro": json-int }
- "package": json-string }
- """
- check_key_is_str(version, "qemu")
- check_key_is_str(version, "package")
-
-
- def test_greeting(greeting):
- check_key_is_dict(greeting, "QMP")
- check_key_is_dict(greeting["QMP"], "version")
- check_key_is_list(greeting["QMP"], "capabilities")
-
-
- def greeting_suite(monitor):
- """
- Check the greeting message format, as described in the QMP
- specfication section '2.2 Server Greeting'.
-
- { "QMP": { "version": json-object, "capabilities": json-array } }
- """
- greeting = monitor.get_greeting()
- test_greeting(greeting)
- test_version(greeting["QMP"]["version"])
-
-
- def json_parsing_errors_suite(monitor):
- """
- Check that QMP's parser is able to recover from parsing errors, please
- check the JSON spec for more info on the JSON syntax (RFC 4627).
- """
- # We're quite simple right now and the focus is on parsing errors that
- # have already biten us in the past.
- #
- # TODO: The following test-cases are missing:
- #
- # - JSON numbers, strings and arrays
- # - More invalid characters or malformed structures
- # - Valid, but not obvious syntax, like zillion of spaces or
- # strings with unicode chars (different suite maybe?)
- bad_json = []
-
- # A JSON value MUST be an object, array, number, string, true, false,
- # or null
- #
- # NOTE: QMP seems to ignore a number of chars, like: | and ?
- bad_json.append(":")
- bad_json.append(",")
-
- # Malformed json-objects
- #
- # NOTE: sending only "}" seems to break QMP
- # NOTE: Duplicate keys are accepted (should it?)
- bad_json.append("{ \"execute\" }")
- bad_json.append("{ \"execute\": \"query-version\", }")
- bad_json.append("{ 1: \"query-version\" }")
- bad_json.append("{ true: \"query-version\" }")
- bad_json.append("{ []: \"query-version\" }")
- bad_json.append("{ {}: \"query-version\" }")
-
- for cmd in bad_json:
- resp = monitor.cmd_raw(cmd)
- check_error_resp(resp, "JSONParsing")
-
-
- def test_id_key(monitor):
- """
- Check that QMP's "id" key is correctly handled.
- """
- # The "id" key must be echoed back in error responses
- id_key = "kvm-autotest"
- resp = monitor.cmd_qmp("eject", { "foobar": True }, id=id_key)
- check_error_resp(resp)
- check_str_key(resp, "id", id_key)
-
- # The "id" key must be echoed back in success responses
- resp = monitor.cmd_qmp("query-status", id=id_key)
- check_success_resp(resp)
- check_str_key(resp, "id", id_key)
-
- # The "id" key can be any json-object
- for id_key in [ True, 1234, "string again!", [1, [], {}, True, "foo"],
- { "key": {} } ]:
- resp = monitor.cmd_qmp("query-status", id=id_key)
- check_success_resp(resp)
- if resp["id"] != id_key:
- raise error.TestFail("expected id '%s' but got '%s'" %
- (str(id_key), str(resp["id"])))
-
-
- def test_invalid_arg_key(monitor):
- """
- Currently, the only supported keys in the input object are: "execute",
- "arguments" and "id". Although expansion is supported, invalid key
- names must be detected.
- """
- resp = monitor.cmd_obj({ "execute": "eject", "foobar": True })
- expected_error = "MissingParameter"
- data_dict = {"name": "device"}
- check_error_resp(resp, expected_error, data_dict)
-
-
- def test_bad_arguments_key_type(monitor):
- """
- The "arguments" key must be an json-object.
-
- We use the eject command to perform the tests, but that's a random
- choice, any command that accepts arguments will do, as the command
- doesn't get called.
- """
- for item in [ True, [], 1, "foo" ]:
- resp = monitor.cmd_obj({ "execute": "eject", "arguments": item })
- check_error_resp(resp, "QMPBadInputObjectMember",
- { "member": "arguments", "expected": "object" })
-
-
- def test_bad_execute_key_type(monitor):
- """
- The "execute" key must be a json-string.
- """
- for item in [ False, 1, {}, [] ]:
- resp = monitor.cmd_obj({ "execute": item })
- check_error_resp(resp, "QMPBadInputObjectMember",
- { "member": "execute", "expected": "string" })
-
-
- def test_no_execute_key(monitor):
- """
- The "execute" key must exist, we also test for some stupid parsing
- errors.
- """
- for cmd in [ {}, { "execut": "qmp_capabilities" },
- { "executee": "qmp_capabilities" }, { "foo": "bar" }]:
- resp = monitor.cmd_obj(cmd)
- check_error_resp(resp) # XXX: check class and data dict?
-
-
- def test_bad_input_obj_type(monitor):
- """
- The input object must be... an json-object.
- """
- for cmd in [ "foo", [], True, 1 ]:
- resp = monitor.cmd_obj(cmd)
- check_error_resp(resp, "QMPBadInputObject", { "expected":"object" })
-
-
- def test_good_input_obj(monitor):
- """
- Basic success tests for issuing QMP commands.
- """
- # NOTE: We don't use the cmd_qmp() method here because the command
- # object is in a 'random' order
- resp = monitor.cmd_obj({ "execute": "query-version" })
- check_success_resp(resp)
-
- resp = monitor.cmd_obj({ "arguments": {}, "execute": "query-version" })
- check_success_resp(resp)
-
- id_key = "1234foo"
- resp = monitor.cmd_obj({ "id": id_key, "execute": "query-version",
- "arguments": {} })
- check_success_resp(resp)
- check_str_key(resp, "id", id_key)
-
- # TODO: would be good to test simple argument usage, but we don't have
- # a read-only command that accepts arguments.
-
-
- def input_object_suite(monitor):
- """
- Check the input object format, as described in the QMP specfication
- section '2.3 Issuing Commands'.
-
- { "execute": json-string, "arguments": json-object, "id": json-value }
- """
- test_good_input_obj(monitor)
- test_bad_input_obj_type(monitor)
- test_no_execute_key(monitor)
- test_bad_execute_key_type(monitor)
- test_bad_arguments_key_type(monitor)
- test_id_key(monitor)
- test_invalid_arg_key(monitor)
-
-
- def argument_checker_suite(monitor):
- """
- Check that QMP's argument checker is detecting all possible errors.
-
- We use a number of different commands to perform the checks, but the
- command used doesn't matter much as QMP performs argument checking
- _before_ calling the command.
- """
- # qmp in RHEL6 is different from 0.13.*:
- # 1. 'stop' command just return {} evenif stop have arguments.
- # 2. there is no 'screendump' command.
- # 3. argument isn't checked in 'device' command.
- # so skip these tests in RHEL6.
-
- # test optional argument: 'force' is omitted, but it's optional, so
- # the handler has to be called. Test this happens by checking an
- # error that is generated by the handler itself.
- resp = monitor.cmd_qmp("eject", { "device": "foobar" })
- check_error_resp(resp, "DeviceNotFound")
-
- # val argument must be a json-int
- for arg in [ {}, [], True, "foo" ]:
- resp = monitor.cmd_qmp("memsave", { "val": arg, "filename": "foo",
- "size": 10 })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "val", "expected": "int" })
-
- # value argument must be a json-number
- for arg in [ {}, [], True, "foo" ]:
- resp = monitor.cmd_qmp("migrate_set_speed", { "value": arg })
- check_error_resp(resp, "InvalidParameterType",
- { "name": "value", "expected": "number" })
-
- # qdev-type commands have their own argument checker, all QMP does
- # is to skip its checking and pass arguments through. Check this
- # works by providing invalid options to device_add and expecting
- # an error message from qdev
- resp = monitor.cmd_qmp("device_add", {"driver": "e1000",
- "foo": "bar" })
- check_error_resp(resp, "PropertyNotFound",
- {"device": "e1000", "property": "foo"})
-
-
- def unknown_commands_suite(monitor):
- """
- Check that QMP handles unknown commands correctly.
- """
- # We also call a HMP-only command, to be sure it will fail as expected
- for cmd in [ "bar", "query-", "query-foo", "q", "help" ]:
- resp = monitor.cmd_qmp(cmd)
- check_error_resp(resp, "CommandNotFound", { "name": cmd })
-
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
-
- # Look for the first qmp monitor available, otherwise, fail the test
- qmp_monitor = None
- for m in vm.monitors:
- if isinstance(m, kvm_monitor.QMPMonitor):
- qmp_monitor = m
-
- if qmp_monitor is None:
- raise error.TestError('Could not find a QMP monitor, aborting test')
-
- # Run all suites
- greeting_suite(qmp_monitor)
- input_object_suite(qmp_monitor)
- argument_checker_suite(qmp_monitor)
- unknown_commands_suite(qmp_monitor)
- json_parsing_errors_suite(qmp_monitor)
-
- # check if QMP is still alive
- if not qmp_monitor.is_responsive():
- raise error.TestFail('QMP monitor is not responsive after testing')
diff --git a/client/tests/kvm/tests/set_link.py b/client/tests/kvm/tests/set_link.py
deleted file mode 100644
index ef34c71..0000000
--- a/client/tests/kvm/tests/set_link.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt.tests import file_transfer
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_set_link(test, params, env):
- """
- KVM guest link test:
- 1) Boot up guest with one nic
- 2) Ping guest from host
- 3) Disable guest link and ping guest from host
- 4) Re-enable guest link and ping guest from host
- 5) Do file transfer test
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
- timeout = float(params.get("login_timeout", 360))
- session = virt_test_utils.wait_for_login(vm, 0, timeout, 0, 2)
-
- def set_link_test(linkid):
- """
- Issue set_link commands and test its function
-
- @param linkid: id of netdev or devices to be tested
- """
- ip = vm.get_address(0)
-
- vm.monitor.cmd("set_link %s down" % linkid)
- s, o = virt_test_utils.ping(ip, count=10, timeout=20)
- if virt_test_utils.get_loss_ratio(o) != 100:
- raise error.TestFail("Still can ping the %s after down %s" %
- (ip, linkid))
-
- vm.monitor.cmd("set_link %s up" % linkid)
- s, o = virt_test_utils.ping(ip, count=10, timeout=20)
- # we use 100% here as the notification of link status changed may be
- # delayed in guest driver
- if virt_test_utils.get_loss_ratio(o) == 100:
- raise error.TestFail("Packet loss during ping %s after up %s" %
- (ip, linkid))
-
- netdev_id = vm.netdev_id[0]
- device_id = vm.get_peer(netdev_id)
- logging.info("Issue set_link commands for netdevs")
- set_link_test(netdev_id)
- logging.info("Issue set_link commands for network devics")
- set_link_test(device_id)
-
- file_transfer.run_file_transfer(test, params, env)
- session.close()
diff --git a/client/tests/kvm/tests/smbios_table.py b/client/tests/kvm/tests/smbios_table.py
deleted file mode 100644
index 5d5a1ad..0000000
--- a/client/tests/kvm/tests/smbios_table.py
+++ /dev/null
@@ -1,67 +0,0 @@
-import commands, logging
-from autotest_lib.client.common_lib import utils, error
-from autotest_lib.client.virt import virt_env_process, virt_test_utils
-
-
[email protected]_aware
-def run_smbios_table(test, params, env):
- """
- Check smbios table :
- 1) Boot a guest with smbios options
- 2) verify if host bios options have been emulated
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vendor_cmd = "dmidecode --type 0 | grep Vendor | awk '{print $2}'"
- date_cmd = "dmidecode --type 0 | grep Date | awk '{print $3}'"
- version_cmd = "dmidecode --type 0 | grep Version | awk '{print $2}'"
-
- error.context("getting smbios table on host")
- host_vendor = utils.system_output(vendor_cmd)
- host_date = utils.system_output(date_cmd)
- host_version = utils.system_output(version_cmd)
-
- smbios = (" -smbios type=0,vendor=%s,version=%s,date=%s" %
- (host_vendor, host_version, host_date))
-
- extra_params = params.get("extra_params", "")
- params["extra_params"] = extra_params + smbios
-
- logging.debug("Booting guest %s", params.get("main_vm"))
- virt_env_process.preprocess_vm(test, params, env, params.get("main_vm"))
- vm = env.get_vm(params["main_vm"])
- vm.create()
- login_timeout = float(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
-
- error.context("getting smbios table on guest")
- guest_vendor = session.cmd(vendor_cmd).strip()
- guest_date = session.cmd(date_cmd).strip()
- guest_version = session.cmd(version_cmd).strip()
-
- failures = []
-
- if host_vendor != guest_vendor:
- e_msg = ("Vendor str mismatch -> host: %s guest: %s" %
- (guest_vendor, host_vendor))
- logging.error(e_msg)
- failures.append(e_msg)
-
- if host_date != guest_date:
- e_msg = ("Date str mismatch -> host: %s guest: %s" %
- (guest_date, host_date))
- logging.error(e_msg)
- failures.append(e_msg)
-
- if host_version != guest_version:
- e_msg = ("Version str mismatch -> host: %s guest: %s" %
- (guest_version, host_version))
- logging.error(e_msg)
- failures.append(e_msg)
-
- error.context("")
- if failures:
- raise error.TestFail("smbios table test reported %s failures:\n%s" %
- (len(failures), "\n".join(failures)))
diff --git a/client/tests/kvm/tests/stepmaker.py b/client/tests/kvm/tests/stepmaker.py
deleted file mode 100755
index d698ade..0000000
--- a/client/tests/kvm/tests/stepmaker.py
+++ /dev/null
@@ -1,356 +0,0 @@
-#!/usr/bin/python
-"""
-Step file creator/editor.
-
-@copyright: Red Hat Inc 2009
-@author: [email protected] (Michael Goldish)
-@version: "20090401"
-"""
-
-import pygtk, gtk, gobject, time, os, commands, logging
-import common
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, ppm_utils, virt_step_editor
-from autotest_lib.client.virt import kvm_monitor
-pygtk.require('2.0')
-
-
-class StepMaker(virt_step_editor.StepMakerWindow):
- """
- Application used to create a step file. It will grab your input to the
- virtual machine and record it on a 'step file', that can be played
- making it possible to do unattended installs.
- """
- # Constructor
- def __init__(self, vm, steps_filename, tempdir, params):
- virt_step_editor.StepMakerWindow.__init__(self)
-
- self.vm = vm
- self.steps_filename = steps_filename
- self.steps_data_dir = ppm_utils.get_data_dir(steps_filename)
- self.tempdir = tempdir
- self.screendump_filename = os.path.join(tempdir, "scrdump.ppm")
- self.params = params
-
- if not os.path.exists(self.steps_data_dir):
- os.makedirs(self.steps_data_dir)
-
- self.steps_file = open(self.steps_filename, "w")
- self.vars_file = open(os.path.join(self.steps_data_dir, "vars"), "w")
-
- self.step_num = 1
- self.run_time = 0
- self.update_delay = 1000
- self.prev_x = 0
- self.prev_y = 0
- self.vars = {}
- self.timer_id = None
-
- self.time_when_done_clicked = time.time()
- self.time_when_actions_completed = time.time()
-
- self.steps_file.write("# Generated by Step Maker\n")
- self.steps_file.write("# Generated on %s\n" % time.asctime())
- self.steps_file.write("# uname -a: %s\n" %
- commands.getoutput("uname -a"))
- self.steps_file.flush()
-
- self.vars_file.write("# This file lists the vars used during recording"
- " with Step Maker\n")
- self.vars_file.flush()
-
- # Done/Break HBox
- hbox = gtk.HBox(spacing=10)
- self.user_vbox.pack_start(hbox)
- hbox.show()
-
- self.button_break = gtk.Button("Break")
- self.button_break.connect("clicked", self.event_break_clicked)
- hbox.pack_start(self.button_break)
- self.button_break.show()
-
- self.button_done = gtk.Button("Done")
- self.button_done.connect("clicked", self.event_done_clicked)
- hbox.pack_start(self.button_done)
- self.button_done.show()
-
- # Set window title
- self.window.set_title("Step Maker")
-
- # Connect "capture" button
- self.button_capture.connect("clicked", self.event_capture_clicked)
-
- # Switch to run mode
- self.switch_to_run_mode()
-
-
- def destroy(self, widget):
- self.vm.monitor.cmd("cont")
- self.steps_file.close()
- self.vars_file.close()
- virt_step_editor.StepMakerWindow.destroy(self, widget)
-
-
- # Utilities
- def redirect_timer(self, delay=0, func=None):
- if self.timer_id != None:
- gobject.source_remove(self.timer_id)
- self.timer_id = None
- if func != None:
- self.timer_id = gobject.timeout_add(delay, func,
- priority=gobject.PRIORITY_LOW)
-
-
- def switch_to_run_mode(self):
- # Set all widgets to their default states
- self.clear_state(clear_screendump=False)
- # Enable/disable some widgets
- self.button_break.set_sensitive(True)
- self.button_done.set_sensitive(False)
- self.data_vbox.set_sensitive(False)
- # Give focus to the Break button
- self.button_break.grab_focus()
- # Start the screendump timer
- self.redirect_timer(100, self.update)
- # Resume the VM
- self.vm.monitor.cmd("cont")
-
-
- def switch_to_step_mode(self):
- # Set all widgets to their default states
- self.clear_state(clear_screendump=False)
- # Enable/disable some widgets
- self.button_break.set_sensitive(False)
- self.button_done.set_sensitive(True)
- self.data_vbox.set_sensitive(True)
- # Give focus to the keystrokes entry widget
- self.entry_keys.grab_focus()
- # Start the screendump timer
- self.redirect_timer()
- # Stop the VM
- self.vm.monitor.cmd("stop")
-
-
- # Events in step mode
- def update(self):
- self.redirect_timer()
-
- if os.path.exists(self.screendump_filename):
- os.unlink(self.screendump_filename)
-
- try:
- self.vm.monitor.screendump(self.screendump_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- else:
- self.set_image_from_file(self.screendump_filename)
-
- self.redirect_timer(self.update_delay, self.update)
- return True
-
-
- def event_break_clicked(self, widget):
- if not self.vm.is_alive():
- self.message("The VM doesn't seem to be alive.", "Error")
- return
- # Switch to step mode
- self.switch_to_step_mode()
- # Compute time elapsed since last click on "Done" and add it
- # to self.run_time
- self.run_time += time.time() - self.time_when_done_clicked
- # Set recording time widget
- self.entry_time.set_text("%.2f" % self.run_time)
- # Update screendump ID
- self.update_screendump_id(self.steps_data_dir)
- # By default, check the barrier checkbox
- self.check_barrier.set_active(True)
- # Set default sleep and barrier timeout durations
- time_delta = time.time() - self.time_when_actions_completed
- if time_delta < 1.0: time_delta = 1.0
- self.spin_sleep.set_value(round(time_delta))
- self.spin_barrier_timeout.set_value(round(time_delta * 5))
- # Set window title
- self.window.set_title("Step Maker -- step %d at time %.2f" %
- (self.step_num, self.run_time))
-
-
- def event_done_clicked(self, widget):
- # Get step lines and screendump
- lines = self.get_step_lines(self.steps_data_dir)
- if lines == None:
- return
-
- # Get var values from user and write them to vars file
- vars = {}
- for line in lines.splitlines():
- words = line.split()
- if words and words[0] == "var":
- varname = words[1]
- if varname in self.vars.keys():
- val = self.vars[varname]
- elif varname in vars.keys():
- val = vars[varname]
- elif varname in self.params.keys():
- val = self.params[varname]
- vars[varname] = val
- else:
- val = self.inputdialog("$%s =" % varname, "Variable")
- if val == None:
- return
- vars[varname] = val
- for varname in vars.keys():
- self.vars_file.write("%s=%s\n" % (varname, vars[varname]))
- self.vars.update(vars)
-
- # Write step lines to file
- self.steps_file.write("# " + "-" * 32 + "\n")
- self.steps_file.write(lines)
-
- # Flush buffers of both files
- self.steps_file.flush()
- self.vars_file.flush()
-
- # Remember the current time
- self.time_when_done_clicked = time.time()
-
- # Switch to run mode
- self.switch_to_run_mode()
-
- # Send commands to VM
- for line in lines.splitlines():
- words = line.split()
- if not words:
- continue
- elif words[0] == "key":
- self.vm.send_key(words[1])
- elif words[0] == "var":
- val = self.vars.get(words[1])
- if not val:
- continue
- self.vm.send_string(val)
- elif words[0] == "mousemove":
- self.vm.monitor.mouse_move(-8000, -8000)
- time.sleep(0.5)
- self.vm.monitor.mouse_move(words[1], words[2])
- time.sleep(0.5)
- elif words[0] == "mouseclick":
- self.vm.monitor.mouse_button(words[1])
- time.sleep(0.1)
- self.vm.monitor.mouse_button(0)
-
- # Remember the current time
- self.time_when_actions_completed = time.time()
-
- # Move on to next step
- self.step_num += 1
-
- def event_capture_clicked(self, widget):
- self.message("Mouse actions disabled (for now).", "Sorry")
- return
-
- self.image_width_backup = self.image_width
- self.image_height_backup = self.image_height
- self.image_data_backup = self.image_data
-
- gtk.gdk.pointer_grab(self.event_box.window, False,
- gtk.gdk.BUTTON_PRESS_MASK |
- gtk.gdk.BUTTON_RELEASE_MASK)
- # Create empty cursor
- pix = gtk.gdk.Pixmap(self.event_box.window, 1, 1, 1)
- color = gtk.gdk.Color()
- cursor = gtk.gdk.Cursor(pix, pix, color, color, 0, 0)
- self.event_box.window.set_cursor(cursor)
- gtk.gdk.display_get_default().warp_pointer(gtk.gdk.screen_get_default(),
- self.prev_x, self.prev_y)
- self.redirect_event_box_input(
- self.event_capture_button_press,
- self.event_capture_button_release,
- self.event_capture_scroll)
- self.redirect_timer(10, self.update_capture)
- self.vm.monitor.cmd("cont")
-
- # Events in mouse capture mode
-
- def update_capture(self):
- self.redirect_timer()
-
- (screen, x, y, flags) = gtk.gdk.display_get_default().get_pointer()
- self.mouse_click_coords[0] = int(x * self.spin_sensitivity.get_value())
- self.mouse_click_coords[1] = int(y * self.spin_sensitivity.get_value())
-
- delay = self.spin_latency.get_value() / 1000
- if (x, y) != (self.prev_x, self.prev_y):
- self.vm.monitor.mouse_move(-8000, -8000)
- time.sleep(delay)
- self.vm.monitor.mouse_move(self.mouse_click_coords[0],
- self.mouse_click_coords[1])
- time.sleep(delay)
-
- self.prev_x = x
- self.prev_y = y
-
- if os.path.exists(self.screendump_filename):
- os.unlink(self.screendump_filename)
-
- try:
- self.vm.monitor.screendump(self.screendump_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- else:
- self.set_image_from_file(self.screendump_filename)
-
- self.redirect_timer(int(self.spin_latency.get_value()),
- self.update_capture)
- return True
-
- def event_capture_button_press(self, widget,event):
- pass
-
- def event_capture_button_release(self, widget,event):
- gtk.gdk.pointer_ungrab()
- self.event_box.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.CROSSHAIR))
- self.redirect_event_box_input(
- self.event_button_press,
- self.event_button_release,
- None,
- None,
- self.event_expose)
- self.redirect_timer()
- self.vm.monitor.cmd("stop")
- self.mouse_click_captured = True
- self.mouse_click_button = event.button
- self.set_image(self.image_width_backup, self.image_height_backup,
- self.image_data_backup)
- self.check_mousemove.set_sensitive(True)
- self.check_mouseclick.set_sensitive(True)
- self.check_mousemove.set_active(True)
- self.check_mouseclick.set_active(True)
- self.update_mouse_click_info()
-
- def event_capture_scroll(self, widget, event):
- if event.direction == gtk.gdk.SCROLL_UP:
- direction = 1
- else:
- direction = -1
- self.spin_sensitivity.set_value(self.spin_sensitivity.get_value() +
- direction)
- pass
-
-
-def run_stepmaker(test, params, env):
- vm = env.get_vm(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; Step Maker requires a"
- " living VM")
-
- steps_filename = params.get("steps")
- if not steps_filename:
- raise error.TestError("Steps filename not specified")
- steps_filename = virt_utils.get_path(test.bindir, steps_filename)
- if os.path.exists(steps_filename):
- raise error.TestError("Steps file %s already exists" % steps_filename)
-
- StepMaker(vm, steps_filename, test.debugdir, params)
- gtk.main()
diff --git a/client/tests/kvm/tests/steps.py b/client/tests/kvm/tests/steps.py
deleted file mode 100644
index 30aed3f..0000000
--- a/client/tests/kvm/tests/steps.py
+++ /dev/null
@@ -1,247 +0,0 @@
-"""
-Utilities to perform automatic guest installation using step files.
-
-@copyright: Red Hat 2008-2009
-"""
-
-import os, time, shutil, logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, ppm_utils, kvm_monitor
-
-try:
- import PIL.Image
-except ImportError:
- logging.warning('No python imaging library installed. PPM image '
- 'conversion to JPEG disabled. In order to enable it, '
- 'please install python-imaging or the equivalent for your '
- 'distro.')
-
-
-def handle_var(vm, params, varname):
- var = params.get(varname)
- if not var:
- return False
- vm.send_string(var)
- return True
-
-
-def barrier_2(vm, words, params, debug_dir, data_scrdump_filename,
- current_step_num):
- if len(words) < 7:
- logging.error("Bad barrier_2 command line")
- return False
-
- # Parse barrier command line
- cmd, dx, dy, x1, y1, md5sum, timeout = words[:7]
- dx, dy, x1, y1, timeout = map(int, [dx, dy, x1, y1, timeout])
-
- # Define some paths
- scrdump_filename = os.path.join(debug_dir, "scrdump.ppm")
- cropped_scrdump_filename = os.path.join(debug_dir, "cropped_scrdump.ppm")
- expected_scrdump_filename = os.path.join(debug_dir, "scrdump_expected.ppm")
- expected_cropped_scrdump_filename = os.path.join(debug_dir,
- "cropped_scrdump_expected.ppm")
- comparison_filename = os.path.join(debug_dir, "comparison.ppm")
- history_dir = os.path.join(debug_dir, "barrier_history")
-
- # Collect a few parameters
- timeout_multiplier = float(params.get("timeout_multiplier") or 1)
- fail_if_stuck_for = float(params.get("fail_if_stuck_for") or 1e308)
- stuck_detection_history = int(params.get("stuck_detection_history") or 2)
- keep_screendump_history = params.get("keep_screendump_history") == "yes"
- keep_all_history = params.get("keep_all_history") == "yes"
-
- # Multiply timeout by the timeout multiplier
- timeout *= timeout_multiplier
-
- # Timeout/5 is the time it took stepmaker to complete this step.
- # Divide that number by 10 to poll 10 times, just in case
- # current machine is stronger then the "stepmaker machine".
- # Limit to 1 (min) and 10 (max) seconds between polls.
- sleep_duration = float(timeout) / 50.0
- if sleep_duration < 1.0: sleep_duration = 1.0
- if sleep_duration > 10.0: sleep_duration = 10.0
-
- end_time = time.time() + timeout
- end_time_stuck = time.time() + fail_if_stuck_for
- start_time = time.time()
-
- prev_whole_image_md5sums = []
-
- failure_message = None
-
- # Main loop
- while True:
- # Check for timeouts
- if time.time() > end_time:
- failure_message = "regular timeout"
- break
- if time.time() > end_time_stuck:
- failure_message = "guest is stuck"
- break
-
- # Make sure vm is alive
- if not vm.is_alive():
- failure_message = "VM is dead"
- break
-
- # Request screendump
- try:
- vm.monitor.screendump(scrdump_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- continue
-
- # Read image file
- (w, h, data) = ppm_utils.image_read_from_ppm_file(scrdump_filename)
-
- # Make sure image is valid
- if not ppm_utils.image_verify_ppm_file(scrdump_filename):
- logging.warning("Got invalid screendump: dimensions: %dx%d, "
- "data size: %d", w, h, len(data))
- continue
-
- # Compute md5sum of whole image
- whole_image_md5sum = ppm_utils.image_md5sum(w, h, data)
-
- # Write screendump to history_dir (as JPG) if requested
- # and if the screendump differs from the previous one
- if (keep_screendump_history and
- whole_image_md5sum not in prev_whole_image_md5sums[:1]):
- try:
- os.makedirs(history_dir)
- except:
- pass
- history_scrdump_filename = os.path.join(history_dir,
- "scrdump-step_%s-%s.jpg" % (current_step_num,
- time.strftime("%Y%m%d-%H%M%S")))
- try:
- image = PIL.Image.open(scrdump_filename)
- image.save(history_scrdump_filename, format = 'JPEG',
- quality = 30)
- except NameError:
- pass
-
- # Compare md5sum of barrier region with the expected md5sum
- calced_md5sum = ppm_utils.get_region_md5sum(w, h, data, x1, y1, dx, dy,
- cropped_scrdump_filename)
- if calced_md5sum == md5sum:
- # Success -- remove screendump history unless requested not to
- if keep_screendump_history and not keep_all_history:
- shutil.rmtree(history_dir)
- # Report success
- return True
-
- # Insert image md5sum into queue of last seen images:
- # If md5sum is already in queue...
- if whole_image_md5sum in prev_whole_image_md5sums:
- # Remove md5sum from queue
- prev_whole_image_md5sums.remove(whole_image_md5sum)
- else:
- # Otherwise extend 'stuck' timeout
- end_time_stuck = time.time() + fail_if_stuck_for
- # Insert md5sum at beginning of queue
- prev_whole_image_md5sums.insert(0, whole_image_md5sum)
- # Limit queue length to stuck_detection_history
- prev_whole_image_md5sums = \
- prev_whole_image_md5sums[:stuck_detection_history]
-
- # Sleep for a while
- time.sleep(sleep_duration)
-
- # Failure
- message = ("Barrier failed at step %s after %.2f seconds (%s)" %
- (current_step_num, time.time() - start_time, failure_message))
-
- # What should we do with this failure?
- if words[-1] == "optional":
- logging.info(message)
- return False
- else:
- # Collect information and put it in debug_dir
- if data_scrdump_filename and os.path.exists(data_scrdump_filename):
- # Read expected screendump image
- (ew, eh, edata) = \
- ppm_utils.image_read_from_ppm_file(data_scrdump_filename)
- # Write it in debug_dir
- ppm_utils.image_write_to_ppm_file(expected_scrdump_filename,
- ew, eh, edata)
- # Write the cropped version as well
- ppm_utils.get_region_md5sum(ew, eh, edata, x1, y1, dx, dy,
- expected_cropped_scrdump_filename)
- # Perform comparison
- (w, h, data) = ppm_utils.image_read_from_ppm_file(scrdump_filename)
- if w == ew and h == eh:
- (w, h, data) = ppm_utils.image_comparison(w, h, data, edata)
- ppm_utils.image_write_to_ppm_file(comparison_filename, w, h,
- data)
- # Print error messages and fail the test
- long_message = message + "\n(see analysis at %s)" % debug_dir
- logging.error(long_message)
- raise error.TestFail, message
-
-
-def run_steps(test, params, env):
- vm = env.get_vm(params.get("main_vm"))
- if not vm:
- raise error.TestError("VM object not found in environment")
- if not vm.is_alive():
- e_msg = "VM seems to be dead. Guestwizard requires a living VM"
- raise error.TestError(e_msg)
-
- steps_filename = params.get("steps")
- if not steps_filename:
- raise error.TestError("Steps filename not specified")
- steps_filename = virt_utils.get_path(test.bindir, steps_filename)
- if not os.path.exists(steps_filename):
- raise error.TestError("Steps file not found: %s" % steps_filename)
-
- sf = open(steps_filename, "r")
- lines = sf.readlines()
- sf.close()
-
- vm.monitor.cmd("cont")
-
- current_step_num = 0
- current_screendump = None
- skip_current_step = False
-
- # Iterate over the lines in the file
- for line in lines:
- line = line.strip()
- if not line:
- continue
- logging.info(line)
-
- if line.startswith("#"):
- continue
-
- words = line.split()
- if words[0] == "step":
- current_step_num += 1
- current_screendump = None
- skip_current_step = False
- elif words[0] == "screendump":
- current_screendump = words[1]
- elif skip_current_step:
- continue
- elif words[0] == "sleep":
- timeout_multiplier = float(params.get("timeout_multiplier") or 1)
- time.sleep(float(words[1]) * timeout_multiplier)
- elif words[0] == "key":
- vm.send_key(words[1])
- elif words[0] == "var":
- if not handle_var(vm, params, words[1]):
- logging.error("Variable not defined: %s", words[1])
- elif words[0] == "barrier_2":
- if current_screendump:
- scrdump_filename = os.path.join(
- ppm_utils.get_data_dir(steps_filename),
- current_screendump)
- else:
- scrdump_filename = None
- if not barrier_2(vm, words, params, test.debugdir,
- scrdump_filename, current_step_num):
- skip_current_step = True
- else:
- vm.send_key(words[0])
diff --git a/client/tests/kvm/tests/stop_continue.py b/client/tests/kvm/tests/stop_continue.py
deleted file mode 100644
index 62df48e..0000000
--- a/client/tests/kvm/tests/stop_continue.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-
-
-def run_stop_continue(test, params, env):
- """
- Suspend a running Virtual Machine and verify its state.
-
- 1) Boot the vm
- 2) Suspend the vm through stop command
- 3) Verify the state through info status command
- 4) Check is the ssh session to guest is still responsive,
- if succeed, fail the test.
-
- @param test: Kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = float(params.get("login_timeout", 240))
- session = vm.wait_for_login(timeout=timeout)
-
- try:
- logging.info("Stop the VM")
- vm.monitor.cmd("stop")
- logging.info("Verifying the status of VM is 'paused'")
- vm.verify_status("paused")
-
- logging.info("Check the session is responsive")
- if session.is_responsive():
- raise error.TestFail("Session is still responsive after stop")
-
- logging.info("Try to resume the guest")
- vm.monitor.cmd("cont")
- logging.info("Verifying the status of VM is 'running'")
- vm.verify_status("running")
-
- logging.info("Try to re-log into guest")
- session = vm.wait_for_login(timeout=timeout)
-
- finally:
- session.close()
diff --git a/client/tests/kvm/tests/system_reset_bootable.py b/client/tests/kvm/tests/system_reset_bootable.py
deleted file mode 100644
index 54536dc..0000000
--- a/client/tests/kvm/tests/system_reset_bootable.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-
-def run_system_reset_bootable(test, params, env):
- """
- KVM reset test:
- 1) Boot guest.
- 2) Reset system by monitor command for several times.
- 3) Log into the guest to verify it could normally boot.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = float(params.get("login_timeout", 240))
- reset_times = int(params.get("reset_times",20))
- interval = int(params.get("reset_interval",10))
- wait_time = int(params.get("wait_time_for_reset",60))
-
- logging.info("Wait for %d seconds before reset" % wait_time)
- time.sleep(wait_time)
-
- for i in range(reset_times):
- logging.info("Reset the system by monitor cmd")
- vm.monitor.cmd("system_reset")
- time.sleep(interval)
-
- logging.info("Try to login guest after reset")
- session = vm.wait_for_login(timeout=timeout)
diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
deleted file mode 100644
index 123a111..0000000
--- a/client/tests/kvm/tests/timedrift.py
+++ /dev/null
@@ -1,181 +0,0 @@
-import logging, time, commands
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils, aexpect
-
-
-def run_timedrift(test, params, env):
- """
- Time drift test (mainly for Windows guests):
-
- 1) Log into a guest.
- 2) Take a time reading from the guest and host.
- 3) Run load on the guest and host.
- 4) Take a second time reading.
- 5) Stop the load and rest for a while.
- 6) Take a third time reading.
- 7) If the drift immediately after load is higher than a user-
- specified value (in %), fail.
- If the drift after the rest period is higher than a user-specified value,
- fail.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- # Helper functions
- def set_cpu_affinity(pid, mask):
- """
- Set the CPU affinity of all threads of the process with PID pid.
- Do this recursively for all child processes as well.
-
- @param pid: The process ID.
- @param mask: The CPU affinity mask.
- @return: A dict containing the previous mask for each thread.
- """
- tids = commands.getoutput("ps -L --pid=%s -o lwp=" % pid).split()
- prev_masks = {}
- for tid in tids:
- prev_mask = commands.getoutput("taskset -p %s" % tid).split()[-1]
- prev_masks[tid] = prev_mask
- commands.getoutput("taskset -p %s %s" % (mask, tid))
- children = commands.getoutput("ps --ppid=%s -o pid=" % pid).split()
- for child in children:
- prev_masks.update(set_cpu_affinity(child, mask))
- return prev_masks
-
- def restore_cpu_affinity(prev_masks):
- """
- Restore the CPU affinity of several threads.
-
- @param prev_masks: A dict containing TIDs as keys and masks as values.
- """
- for tid, mask in prev_masks.items():
- commands.getoutput("taskset -p %s %s" % (mask, tid))
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Collect test parameters:
- # Command to run to get the current time
- time_command = params.get("time_command")
- # Filter which should match a string to be passed to time.strptime()
- time_filter_re = params.get("time_filter_re")
- # Time format for time.strptime()
- time_format = params.get("time_format")
- guest_load_command = params.get("guest_load_command")
- guest_load_stop_command = params.get("guest_load_stop_command")
- host_load_command = params.get("host_load_command")
- guest_load_instances = int(params.get("guest_load_instances", "1"))
- host_load_instances = int(params.get("host_load_instances", "0"))
- # CPU affinity mask for taskset
- cpu_mask = params.get("cpu_mask", "0xFF")
- load_duration = float(params.get("load_duration", "30"))
- rest_duration = float(params.get("rest_duration", "10"))
- drift_threshold = float(params.get("drift_threshold", "200"))
- drift_threshold_after_rest = float(params.get("drift_threshold_after_rest",
- "200"))
-
- guest_load_sessions = []
- host_load_sessions = []
-
- try:
- # Set the VM's CPU affinity
- prev_affinity = set_cpu_affinity(vm.get_shell_pid(), cpu_mask)
-
- try:
- # Open shell sessions with the guest
- logging.info("Starting load on guest...")
- for i in range(guest_load_instances):
- load_session = vm.login()
- # Set output func to None to stop it from being called so we
- # can change the callback function and the parameters it takes
- # with no problems
- load_session.set_output_func(None)
- load_session.set_output_params(())
- 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) = virt_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)
-
- # Run some load on the host
- logging.info("Starting load on host...")
- for i in range(host_load_instances):
- host_load_sessions.append(
- aexpect.run_bg(host_load_command,
- output_func=logging.debug,
- output_prefix="(host load %d) " % i,
- timeout=0.5))
- # Set the CPU affinity of the load process
- pid = host_load_sessions[-1].get_pid()
- set_cpu_affinity(pid, cpu_mask)
-
- # Sleep for a while (during load)
- logging.info("Sleeping for %s seconds...", load_duration)
- time.sleep(load_duration)
-
- # Get time delta after load
- (ht1, gt1) = virt_test_utils.get_time(session,
- time_command,
- time_filter_re,
- time_format)
-
- # Report results
- host_delta = ht1 - ht0
- guest_delta = gt1 - gt0
- drift = 100.0 * (host_delta - guest_delta) / host_delta
- logging.info("Host duration: %.2f", host_delta)
- logging.info("Guest duration: %.2f", guest_delta)
- logging.info("Drift: %.2f%%", drift)
-
- finally:
- logging.info("Cleaning up...")
- # Restore the VM's CPU affinity
- restore_cpu_affinity(prev_affinity)
- # Stop the guest load
- if guest_load_stop_command:
- session.cmd_output(guest_load_stop_command)
- # Close all load shell sessions
- for load_session in guest_load_sessions:
- load_session.close()
- for load_session in host_load_sessions:
- load_session.close()
-
- # Sleep again (rest)
- logging.info("Sleeping for %s seconds...", rest_duration)
- time.sleep(rest_duration)
-
- # Get time after rest
- (ht2, gt2) = virt_test_utils.get_time(session,
- time_command,
- time_filter_re,
- time_format)
-
- finally:
- session.close()
-
- # Report results
- host_delta_total = ht2 - ht0
- guest_delta_total = gt2 - gt0
- drift_total = 100.0 * (host_delta_total - guest_delta_total) / host_delta
- logging.info("Total host duration including rest: %.2f", host_delta_total)
- logging.info("Total guest duration including rest: %.2f", guest_delta_total)
- logging.info("Total drift after rest: %.2f%%", drift_total)
-
- # Fail the test if necessary
- if abs(drift) > drift_threshold:
- raise error.TestFail("Time drift too large: %.2f%%" % drift)
- if abs(drift_total) > drift_threshold_after_rest:
- raise error.TestFail("Time drift too large after rest period: %.2f%%"
- % drift_total)
diff --git a/client/tests/kvm/tests/timedrift_with_migration.py b/client/tests/kvm/tests/timedrift_with_migration.py
deleted file mode 100644
index eb4cb4a..0000000
--- a/client/tests/kvm/tests/timedrift_with_migration.py
+++ /dev/null
@@ -1,96 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_timedrift_with_migration(test, params, env):
- """
- Time drift test with migration:
-
- 1) Log into a guest.
- 2) Take a time reading from the guest and host.
- 3) Migrate the guest.
- 4) Take a second time reading.
- 5) If the drift (in seconds) is higher than a user specified value, fail.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Collect test parameters:
- # Command to run to get the current time
- time_command = params.get("time_command")
- # Filter which should match a string to be passed to time.strptime()
- time_filter_re = params.get("time_filter_re")
- # Time format for time.strptime()
- time_format = params.get("time_format")
- drift_threshold = float(params.get("drift_threshold", "10"))
- drift_threshold_single = float(params.get("drift_threshold_single", "3"))
- migration_iterations = int(params.get("migration_iterations", 1))
-
- try:
- # Get initial time
- # (ht stands for host time, gt stands for guest time)
- (ht0, gt0) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- # Migrate
- for i in range(migration_iterations):
- # Get time before current iteration
- (ht0_, gt0_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- session.close()
- # Run current iteration
- logging.info("Migrating: iteration %d of %d...",
- (i + 1), migration_iterations)
- vm.migrate()
- # Log in
- logging.info("Logging in after migration...")
- session = vm.wait_for_login(timeout=30)
- logging.info("Logged in after migration")
- # Get time after current iteration
- (ht1_, gt1_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- # Report iteration results
- host_delta = ht1_ - ht0_
- guest_delta = gt1_ - gt0_
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (iteration %d): %.2f",
- (i + 1), host_delta)
- logging.info("Guest duration (iteration %d): %.2f",
- (i + 1), guest_delta)
- logging.info("Drift at iteration %d: %.2f seconds",
- (i + 1), drift)
- # Fail if necessary
- if drift > drift_threshold_single:
- raise error.TestFail("Time drift too large at iteration %d: "
- "%.2f seconds" % (i + 1, drift))
-
- # Get final time
- (ht1, gt1) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- finally:
- if session:
- session.close()
-
- # Report results
- host_delta = ht1 - ht0
- guest_delta = gt1 - gt0
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (%d migrations): %.2f",
- migration_iterations, host_delta)
- logging.info("Guest duration (%d migrations): %.2f",
- migration_iterations, guest_delta)
- logging.info("Drift after %d migrations: %.2f seconds",
- migration_iterations, drift)
-
- # Fail if necessary
- if drift > drift_threshold:
- raise error.TestFail("Time drift too large after %d migrations: "
- "%.2f seconds" % (migration_iterations, drift))
diff --git a/client/tests/kvm/tests/timedrift_with_reboot.py b/client/tests/kvm/tests/timedrift_with_reboot.py
deleted file mode 100644
index 2562163..0000000
--- a/client/tests/kvm/tests/timedrift_with_reboot.py
+++ /dev/null
@@ -1,91 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_timedrift_with_reboot(test, params, env):
- """
- Time drift test with reboot:
-
- 1) Log into a guest.
- 2) Take a time reading from the guest and host.
- 3) Reboot the guest.
- 4) Take a second time reading.
- 5) If the drift (in seconds) is higher than a user specified value, fail.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Collect test parameters:
- # Command to run to get the current time
- time_command = params.get("time_command")
- # Filter which should match a string to be passed to time.strptime()
- time_filter_re = params.get("time_filter_re")
- # Time format for time.strptime()
- time_format = params.get("time_format")
- drift_threshold = float(params.get("drift_threshold", "10"))
- drift_threshold_single = float(params.get("drift_threshold_single", "3"))
- reboot_iterations = int(params.get("reboot_iterations", 1))
-
- try:
- # Get initial time
- # (ht stands for host time, gt stands for guest time)
- (ht0, gt0) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- # Reboot
- for i in range(reboot_iterations):
- # Get time before current iteration
- (ht0_, gt0_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- # Run current iteration
- logging.info("Rebooting: iteration %d of %d...",
- (i + 1), reboot_iterations)
- session = vm.reboot(session)
- # Get time after current iteration
- (ht1_, gt1_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- # Report iteration results
- host_delta = ht1_ - ht0_
- guest_delta = gt1_ - gt0_
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (iteration %d): %.2f",
- (i + 1), host_delta)
- logging.info("Guest duration (iteration %d): %.2f",
- (i + 1), guest_delta)
- logging.info("Drift at iteration %d: %.2f seconds",
- (i + 1), drift)
- # Fail if necessary
- if drift > drift_threshold_single:
- raise error.TestFail("Time drift too large at iteration %d: "
- "%.2f seconds" % (i + 1, drift))
-
- # Get final time
- (ht1, gt1) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- finally:
- if session:
- session.close()
-
- # Report results
- host_delta = ht1 - ht0
- guest_delta = gt1 - gt0
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (%d reboots): %.2f",
- reboot_iterations, host_delta)
- logging.info("Guest duration (%d reboots): %.2f",
- reboot_iterations, guest_delta)
- logging.info("Drift after %d reboots: %.2f seconds",
- reboot_iterations, drift)
-
- # Fail if necessary
- if drift > drift_threshold:
- raise error.TestFail("Time drift too large after %d reboots: "
- "%.2f seconds" % (reboot_iterations, drift))
diff --git a/client/tests/kvm/tests/timedrift_with_stop.py b/client/tests/kvm/tests/timedrift_with_stop.py
deleted file mode 100644
index c2b0402..0000000
--- a/client/tests/kvm/tests/timedrift_with_stop.py
+++ /dev/null
@@ -1,103 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_timedrift_with_stop(test, params, env):
- """
- Time drift test with stop/continue the guest:
-
- 1) Log into a guest.
- 2) Take a time reading from the guest and host.
- 3) Stop the running of the guest
- 4) Sleep for a while
- 5) Continue the guest running
- 6) Take a second time reading.
- 7) If the drift (in seconds) is higher than a user specified value, fail.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- login_timeout = int(params.get("login_timeout", 360))
- sleep_time = int(params.get("sleep_time", 30))
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=login_timeout)
-
- # Collect test parameters:
- # Command to run to get the current time
- time_command = params.get("time_command")
- # Filter which should match a string to be passed to time.strptime()
- time_filter_re = params.get("time_filter_re")
- # Time format for time.strptime()
- time_format = params.get("time_format")
- drift_threshold = float(params.get("drift_threshold", "10"))
- drift_threshold_single = float(params.get("drift_threshold_single", "3"))
- stop_iterations = int(params.get("stop_iterations", 1))
- stop_time = int(params.get("stop_time", 60))
-
- try:
- # Get initial time
- # (ht stands for host time, gt stands for guest time)
- (ht0, gt0) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- # Stop the guest
- for i in range(stop_iterations):
- # Get time before current iteration
- (ht0_, gt0_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- # Run current iteration
- logging.info("Stop %s second: iteration %d of %d...",
- stop_time, (i + 1), stop_iterations)
-
- vm.monitor.cmd("stop")
- time.sleep(stop_time)
- vm.monitor.cmd("cont")
-
- # Sleep for a while to wait the interrupt to be reinjected
- logging.info("Waiting for the interrupt to be reinjected ...")
- time.sleep(sleep_time)
-
- # Get time after current iteration
- (ht1_, gt1_) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
- # Report iteration results
- host_delta = ht1_ - ht0_
- guest_delta = gt1_ - gt0_
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (iteration %d): %.2f",
- (i + 1), host_delta)
- logging.info("Guest duration (iteration %d): %.2f",
- (i + 1), guest_delta)
- logging.info("Drift at iteration %d: %.2f seconds",
- (i + 1), drift)
- # Fail if necessary
- if drift > drift_threshold_single:
- raise error.TestFail("Time drift too large at iteration %d: "
- "%.2f seconds" % (i + 1, drift))
-
- # Get final time
- (ht1, gt1) = virt_test_utils.get_time(session, time_command,
- time_filter_re, time_format)
-
- finally:
- if session:
- session.close()
-
- # Report results
- host_delta = ht1 - ht0
- guest_delta = gt1 - gt0
- drift = abs(host_delta - guest_delta)
- logging.info("Host duration (%d stops): %.2f",
- stop_iterations, host_delta)
- logging.info("Guest duration (%d stops): %.2f",
- stop_iterations, guest_delta)
- logging.info("Drift after %d stops: %.2f seconds",
- stop_iterations, drift)
-
- # Fail if necessary
- if drift > drift_threshold:
- raise error.TestFail("Time drift too large after %d stops: "
- "%.2f seconds" % (stop_iterations, drift))
diff --git a/client/tests/kvm/tests/trans_hugepage.py b/client/tests/kvm/tests/trans_hugepage.py
deleted file mode 100644
index a533496..0000000
--- a/client/tests/kvm/tests/trans_hugepage.py
+++ /dev/null
@@ -1,127 +0,0 @@
-import logging, time, commands, os, string, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.virt import virt_test_utils, aexpect, virt_test_setup
-
-
[email protected]_aware
-def run_trans_hugepage(test, params, env):
- """
- KVM kernel hugepages user side test:
- 1) Smoke test
- 2) Stress test
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- def get_mem_status(params, type):
- if type == "host":
- info = utils.system_output("cat /proc/meminfo")
- else:
- info = session.cmd("cat /proc/meminfo")
- for h in re.split("\n+", info):
- if h.startswith("%s" % params):
- output = re.split('\s+', h)[1]
- return output
-
- dd_timeout = float(params.get("dd_timeout", 900))
- nr_ah = []
- mem = params['mem']
- failures = []
-
- debugfs_flag = 1
- debugfs_path = os.path.join(test.tmpdir, 'debugfs')
- mem_path = os.path.join("/tmp", 'thp_space')
-
- login_timeout = float(params.get("login_timeout", "3600"))
-
- error.context("smoke test setup")
- if not os.path.ismount(debugfs_path):
- if not os.path.isdir(debugfs_path):
- os.makedirs(debugfs_path)
- utils.run("mount -t debugfs none %s" % debugfs_path)
-
- test_config = virt_test_setup.TransparentHugePageConfig(test, params)
- vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
- session = virt_test_utils.wait_for_login(vm, timeout=login_timeout)
-
- try:
- # Check khugepage is used by guest
- test_config.setup()
-
- logging.info("Smoke test start")
- error.context("smoke test")
-
- nr_ah_before = get_mem_status('AnonHugePages', 'host')
- if nr_ah_before <= 0:
- e_msg = 'smoke: Host is not using THP'
- logging.error(e_msg)
- failures.append(e_msg)
-
- # Protect system from oom killer
- if int(get_mem_status('MemFree', 'guest')) / 1024 < mem :
- mem = int(get_mem_status('MemFree', 'guest')) / 1024
-
- session.cmd("mkdir -p %s" % mem_path)
-
- session.cmd("mount -t tmpfs -o size=%sM none %s" % (str(mem), mem_path))
-
- count = mem / 4
- session.cmd("dd if=/dev/zero of=%s/1 bs=4000000 count=%s" %
- (mem_path, count), timeout=dd_timeout)
-
- nr_ah_after = get_mem_status('AnonHugePages', 'host')
-
- if nr_ah_after <= nr_ah_before:
- e_msg = ('smoke: Host did not use new THP during dd')
- logging.error(e_msg)
- failures.append(e_msg)
-
- if debugfs_flag == 1:
- if int(open('%s/kvm/largepages' % debugfs_path, 'r').read()) <= 0:
- e_msg = 'smoke: KVM is not using THP'
- logging.error(e_msg)
- failures.append(e_msg)
-
- logging.info("Smoke test finished")
-
- # Use parallel dd as stress for memory
- count = count / 3
- logging.info("Stress test start")
- error.context("stress test")
- cmd = "rm -rf %s/*; for i in `seq %s`; do dd " % (mem_path, count)
- cmd += "if=/dev/zero of=%s/$i bs=4000000 count=1& done;wait" % mem_path
- output = session.cmd_output(cmd, timeout=dd_timeout)
-
- if len(re.findall("No space", output)) > count * 0.05:
- e_msg = "stress: Too many dd instances failed in guest"
- logging.error(e_msg)
- failures.append(e_msg)
-
- try:
- output = session.cmd('pidof dd')
- except Exception:
- output = None
-
- if output is not None:
- for i in re.split('\n+', output):
- session.cmd('kill -9 %s' % i)
-
- session.cmd("umount %s" % mem_path)
-
- logging.info("Stress test finished")
-
- finally:
- error.context("all tests cleanup")
- if os.path.ismount(debugfs_path):
- utils.run("umount %s" % debugfs_path)
- if os.path.isdir(debugfs_path):
- os.removedirs(debugfs_path)
- session.close()
- test_config.cleanup()
-
- error.context("")
- if failures:
- raise error.TestFail("THP base test reported %s failures:\n%s" %
- (len(failures), "\n".join(failures)))
diff --git a/client/tests/kvm/tests/trans_hugepage_defrag.py b/client/tests/kvm/tests/trans_hugepage_defrag.py
deleted file mode 100644
index bf81362..0000000
--- a/client/tests/kvm/tests/trans_hugepage_defrag.py
+++ /dev/null
@@ -1,86 +0,0 @@
-import logging, time, commands, os, string, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_test_utils, virt_test_setup
-
-
[email protected]_aware
-def run_trans_hugepage_defrag(test, params, env):
- """
- KVM khugepage userspace side test:
- 1) Verify that the host supports kernel hugepages.
- If it does proceed with the test.
- 2) Verify that the kernel hugepages can be used in host.
- 3) Verify that the kernel hugepages can be used in guest.
- 4) Migrate guest while using hugepages.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- def get_mem_status(params):
- for line in file('/proc/meminfo', 'r').readlines():
- if line.startswith("%s" % params):
- output = re.split('\s+', line)[1]
- return output
-
-
- def set_libhugetlbfs(number):
- f = file("/proc/sys/vm/nr_hugepages", "w+")
- f.write(number)
- f.seek(0)
- ret = f.read()
- return int(ret)
-
- test_config = virt_test_setup.TransparentHugePageConfig(test, params)
- # Test the defrag
- logging.info("Defrag test start")
- login_timeout = float(params.get("login_timeout", 360))
- vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
- session = virt_test_utils.wait_for_login(vm, timeout=login_timeout)
- mem_path = os.path.join("/tmp", "thp_space")
-
- try:
- test_config.setup()
- error.context("Fragmenting guest memory")
- try:
- if not os.path.isdir(mem_path):
- os.makedirs(mem_path)
- if os.system("mount -t tmpfs none %s" % mem_path):
- raise error.TestError("Can not mount tmpfs")
-
- # Try to fragment the memory a bit
- cmd = ("for i in `seq 262144`; do dd if=/dev/urandom of=%s/$i "
- "bs=4K count=1 & done" % mem_path)
- utils.run(cmd)
- finally:
- utils.run("umount %s" % mem_path)
-
- total = int(get_mem_status('MemTotal'))
- hugepagesize = int(get_mem_status('Hugepagesize'))
- nr_full = str(total / hugepagesize)
-
- error.context("activating khugepaged defrag functionality")
- # Allocate hugepages for libhugetlbfs before and after enable defrag,
- # and check out the difference.
- nr_hp_before = set_libhugetlbfs(nr_full)
- try:
- defrag_path = os.path.join(test_config.thp_path, 'khugepaged',
- 'defrag')
- file(str(defrag_path), 'w').write('yes')
- except IOError, e:
- raise error.TestFail("Can not start defrag on khugepaged: %s" % e)
- # TODO: Is sitting an arbitrary amount of time appropriate? Aren't there
- # better ways to do this?
- time.sleep(1)
- nr_hp_after = set_libhugetlbfs(nr_full)
-
- if nr_hp_before >= nr_hp_after:
- raise error.TestFail("There was no memory defragmentation on host: "
- "%s huge pages allocated before turning "
- "khugepaged defrag on, %s allocated after it" %
- (nr_hp_before, nr_hp_after))
- logging.info("Defrag test succeeded")
- session.close()
- finally:
- test_config.cleanup()
diff --git a/client/tests/kvm/tests/trans_hugepage_swapping.py b/client/tests/kvm/tests/trans_hugepage_swapping.py
deleted file mode 100644
index 10600b0..0000000
--- a/client/tests/kvm/tests/trans_hugepage_swapping.py
+++ /dev/null
@@ -1,115 +0,0 @@
-import logging, time, commands, os, string, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils, virt_test_utils
-from autotest_lib.client.virt import virt_test_setup, virt_env_process
-
-
[email protected]_aware
-def run_trans_hugepage_swapping(test, params, env):
- """
- KVM khugepage user side test:
- 1) Verify that the hugepages can be swapped in/out.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- def get_args(args_list):
- """
- Get the memory arguments from system
- """
- args_list_tmp = args_list.copy()
- for line in file('/proc/meminfo', 'r').readlines():
- for key in args_list_tmp.keys():
- if line.startswith("%s" % args_list_tmp[key]):
- args_list_tmp[key] = int(re.split('\s+', line)[1])
- return args_list_tmp
-
- test_config = virt_test_setup.TransparentHugePageConfig(test, params)
- try:
- test_config.setup()
- # Swapping test
- logging.info("Swapping test start")
- # Parameters of memory information
- # @total: Memory size
- # @free: Free memory size
- # @swap_size: Swap size
- # @swap_free: Free swap size
- # @hugepage_size: Page size of one hugepage
- # @page_size: The biggest page size that app can ask for
- args_dict_check = {"free" : "MemFree", "swap_size" : "SwapTotal",
- "swap_free" : "SwapFree", "total" : "MemTotal",
- "hugepage_size" : "Hugepagesize",}
- args_dict = get_args(args_dict_check)
- swap_free = []
- total = int(args_dict['total']) / 1024
- free = int(args_dict['free']) / 1024
- swap_size = int(args_dict['swap_size']) / 1024
- swap_free.append(int(args_dict['swap_free'])/1024)
- hugepage_size = int(args_dict['hugepage_size']) / 1024
- dd_timeout = float(params.get("dd_timeout", 900))
- login_timeout = float(params.get("login_timeout", 360))
- check_cmd_timeout = float(params.get("check_cmd_timeout", 900))
- mem_path = os.path.join(test.tmpdir, 'thp_space')
- tmpfs_path = "/space"
-
- # If swap is enough fill all memory with dd
- if swap_free > (total - free):
- count = total / hugepage_size
- tmpfs_size = total
- else:
- count = free / hugepage_size
- tmpfs_size = free
-
- if swap_size <= 0:
- raise logging.info("Host does not have swap enabled")
- session = None
- try:
- if not os.path.isdir(mem_path):
- os.makedirs(mem_path)
- utils.run("mount -t tmpfs -o size=%sM none %s" % (tmpfs_size,
- mem_path))
-
- # Set the memory size of vm
- # To ignore the oom killer set it to the free swap size
- vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
- if int(params['mem']) > swap_free[0]:
- vm.destroy()
- vm_name = 'vmsw'
- vm0 = params.get("main_vm")
- vm0_key = virt_utils.env_get_vm(env, vm0)
- params['vms'] = params['vms'] + " " + vm_name
- params['mem'] = str(swap_free[0])
- vm_key = vm0_key.clone(vm0, params)
- virt_utils.env_register_vm(env, vm_name, vm_key)
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- vm_key.create()
- session = virt_utils.wait_for(vm_key.remote_login,
- timeout=login_timeout)
- else:
- session = virt_test_utils.wait_for_login(vm,
- timeout=login_timeout)
-
- error.context("making guest to swap memory")
- cmd = ("dd if=/dev/zero of=%s/zero bs=%s000000 count=%s" %
- (mem_path, hugepage_size, count))
- utils.run(cmd)
-
- args_dict = get_args(args_dict_check)
- swap_free.append(int(args_dict['swap_free'])/1024)
-
- if swap_free[1] - swap_free[0] >= 0:
- raise error.TestFail("No data was swapped to memory")
-
- # Try harder to make guest memory to be swapped
- session.cmd("find / -name \"*\"", timeout=check_cmd_timeout)
- finally:
- if session is not None:
- utils.run("umount %s" % mem_path)
-
- logging.info("Swapping test succeed")
-
- finally:
- session.close()
- test_config.cleanup()
diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py
deleted file mode 100644
index 1ff73af..0000000
--- a/client/tests/kvm/tests/unattended_install.py
+++ /dev/null
@@ -1,643 +0,0 @@
-import logging, time, socket, re, os, shutil, tempfile, glob, ConfigParser
-import xml.dom.minidom
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_vm, virt_utils
-
-
[email protected]_aware
-def cleanup(dir):
- """
- If dir is a mountpoint, do what is possible to unmount it. Afterwards,
- try to remove it.
-
- @param dir: Directory to be cleaned up.
- """
- error.context("cleaning up unattended install directory %s" % dir)
- if os.path.ismount(dir):
- utils.run('fuser -k %s' % dir, ignore_status=True)
- utils.run('umount %s' % dir)
- if os.path.isdir(dir):
- shutil.rmtree(dir)
-
-
[email protected]_aware
-def clean_old_image(image):
- """
- Clean a leftover image file from previous processes. If it contains a
- mounted file system, do the proper cleanup procedures.
-
- @param image: Path to image to be cleaned up.
- """
- error.context("cleaning up old leftover image %s" % image)
- if os.path.exists(image):
- mtab = open('/etc/mtab', 'r')
- mtab_contents = mtab.read()
- mtab.close()
- if image in mtab_contents:
- utils.run('fuser -k %s' % image, ignore_status=True)
- utils.run('umount %s' % image)
- os.remove(image)
-
-
-class Disk(object):
- """
- Abstract class for Disk objects, with the common methods implemented.
- """
- def __init__(self):
- self.path = None
-
-
- def get_answer_file_path(self, filename):
- return os.path.join(self.mount, filename)
-
-
- def copy_to(self, src):
- logging.debug("Copying %s to disk image mount", src)
- dst = os.path.join(self.mount, os.path.basename(src))
- if os.path.isdir(src):
- shutil.copytree(src, dst)
- elif os.path.isfile(src):
- shutil.copyfile(src, dst)
-
-
- def close(self):
- os.chmod(self.path, 0755)
- cleanup(self.mount)
- logging.debug("Disk %s successfuly set", self.path)
-
-
-class FloppyDisk(Disk):
- """
- Represents a 1.44 MB floppy disk. We can copy files to it, and setup it in
- convenient ways.
- """
- @error.context_aware
- def __init__(self, path, qemu_img_binary, tmpdir):
- error.context("Creating unattended install floppy image %s" % path)
- self.tmpdir = tmpdir
- self.mount = tempfile.mkdtemp(prefix='floppy_', dir=self.tmpdir)
- self.virtio_mount = None
- self.path = path
- clean_old_image(path)
- if not os.path.isdir(os.path.dirname(path)):
- os.makedirs(os.path.dirname(path))
-
- try:
- c_cmd = '%s create -f raw %s 1440k' % (qemu_img_binary, path)
- utils.run(c_cmd)
- f_cmd = 'mkfs.msdos -s 1 %s' % path
- utils.run(f_cmd)
- m_cmd = 'mount -o loop,rw %s %s' % (path, self.mount)
- utils.run(m_cmd)
- except error.CmdError, e:
- cleanup(self.mount)
- raise
-
-
- def _copy_virtio_drivers(self, virtio_floppy):
- """
- Copy the virtio drivers on the virtio floppy to the install floppy.
-
- 1) Mount the floppy containing the viostor drivers
- 2) Copy its contents to the root of the install floppy
- """
- virtio_mount = tempfile.mkdtemp(prefix='virtio_floppy_',
- dir=self.tmpdir)
-
- pwd = os.getcwd()
- try:
- m_cmd = 'mount -o loop,ro %s %s' % (virtio_floppy, virtio_mount)
- utils.run(m_cmd)
- os.chdir(virtio_mount)
- path_list = glob.glob('*')
- for path in path_list:
- self.copy_to(path)
- finally:
- os.chdir(pwd)
- cleanup(virtio_mount)
-
-
- def setup_virtio_win2003(self, virtio_floppy, virtio_oemsetup_id):
- """
- Setup the install floppy with the virtio storage drivers, win2003 style.
-
- Win2003 and WinXP depend on the file txtsetup.oem file to install
- the virtio drivers from the floppy, which is a .ini file.
- Process:
-
- 1) Copy the virtio drivers on the virtio floppy to the install floppy
- 2) Parse the ini file with config parser
- 3) Modify the identifier of the default session that is going to be
- executed on the config parser object
- 4) Re-write the config file to the disk
- """
- self._copy_virtio_drivers(virtio_floppy)
- txtsetup_oem = os.path.join(self.mount, 'txtsetup.oem')
- if not os.path.isfile(txtsetup_oem):
- raise IOError('File txtsetup.oem not found on the install '
- 'floppy. Please verify if your floppy virtio '
- 'driver image has this file')
- parser = ConfigParser.ConfigParser()
- parser.read(txtsetup_oem)
- if not parser.has_section('Defaults'):
- raise ValueError('File txtsetup.oem does not have the session '
- '"Defaults". Please check txtsetup.oem')
- default_driver = parser.get('Defaults', 'SCSI')
- if default_driver != virtio_oemsetup_id:
- parser.set('Defaults', 'SCSI', virtio_oemsetup_id)
- fp = open(txtsetup_oem, 'w')
- parser.write(fp)
- fp.close()
-
-
- def setup_virtio_win2008(self, virtio_floppy):
- """
- Setup the install floppy with the virtio storage drivers, win2008 style.
-
- Win2008, Vista and 7 require people to point out the path to the drivers
- on the unattended file, so we just need to copy the drivers to the
- driver floppy disk. Important to note that it's possible to specify
- drivers from a CDROM, so the floppy driver copy is optional.
- Process:
-
- 1) Copy the virtio drivers on the virtio floppy to the install floppy,
- if there is one available
- """
- if os.path.isfile(virtio_floppy):
- self._copy_virtio_drivers(virtio_floppy)
- else:
- logging.debug("No virtio floppy present, not needed for this OS anyway")
-
-
-class CdromDisk(Disk):
- """
- Represents a CDROM disk that we can master according to our needs.
- """
- def __init__(self, path, tmpdir):
- self.mount = tempfile.mkdtemp(prefix='cdrom_unattended_', dir=tmpdir)
- self.path = path
- clean_old_image(path)
- if not os.path.isdir(os.path.dirname(path)):
- os.makedirs(os.path.dirname(path))
-
-
- @error.context_aware
- def close(self):
- error.context("Creating unattended install CD image %s" % self.path)
- g_cmd = ('mkisofs -o %s -max-iso9660-filenames '
- '-relaxed-filenames -D --input-charset iso8859-1 '
- '%s' % (self.path, self.mount))
- utils.run(g_cmd)
-
- os.chmod(self.path, 0755)
- cleanup(self.mount)
- logging.debug("unattended install CD image %s successfuly created",
- self.path)
-
-
-class UnattendedInstallConfig(object):
- """
- Creates a floppy disk image that will contain a config file for unattended
- OS install. The parameters to the script are retrieved from environment
- variables.
- """
- def __init__(self, test, params):
- """
- Sets class atributes from test parameters.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- """
- root_dir = test.bindir
- images_dir = os.path.join(root_dir, 'images')
- self.deps_dir = os.path.join(root_dir, 'deps')
- self.unattended_dir = os.path.join(root_dir, 'unattended')
-
- attributes = ['kernel_args', 'finish_program', 'cdrom_cd1',
- 'unattended_file', 'medium', 'url', 'kernel', 'initrd',
- 'nfs_server', 'nfs_dir', 'install_virtio', 'floppy',
- 'cdrom_unattended', 'boot_path', 'extra_params',
- 'qemu_img_binary', 'cdkey', 'finish_program']
-
- for a in attributes:
- setattr(self, a, params.get(a, ''))
-
- if self.install_virtio == 'yes':
- v_attributes = ['virtio_floppy', 'virtio_storage_path',
- 'virtio_network_path', 'virtio_oemsetup_id',
- 'virtio_network_installer']
- for va in v_attributes:
- setattr(self, va, params.get(va, ''))
-
- self.tmpdir = test.tmpdir
-
- if getattr(self, 'unattended_file'):
- self.unattended_file = os.path.join(root_dir, self.unattended_file)
-
- if getattr(self, 'finish_program'):
- self.finish_program = os.path.join(root_dir, self.finish_program)
-
- if getattr(self, 'qemu_img_binary'):
- if not os.path.isfile(getattr(self, 'qemu_img_binary')):
- self.qemu_img_binary = os.path.join(root_dir,
- self.qemu_img_binary)
-
- if getattr(self, 'cdrom_cd1'):
- self.cdrom_cd1 = os.path.join(root_dir, self.cdrom_cd1)
- self.cdrom_cd1_mount = tempfile.mkdtemp(prefix='cdrom_cd1_',
- dir=self.tmpdir)
- if self.medium == 'nfs':
- self.nfs_mount = tempfile.mkdtemp(prefix='nfs_',
- dir=self.tmpdir)
-
- if getattr(self, 'floppy'):
- self.floppy = os.path.join(root_dir, self.floppy)
- if not os.path.isdir(os.path.dirname(self.floppy)):
- os.makedirs(os.path.dirname(self.floppy))
-
- self.image_path = os.path.dirname(self.kernel)
-
-
- def answer_kickstart(self, answer_path):
- """
- Replace KVM_TEST_CDKEY (in the unattended file) with the cdkey
- provided for this test and replace the KVM_TEST_MEDIUM with
- the tree url or nfs address provided for this test.
-
- @return: Answer file contents
- """
- contents = open(self.unattended_file).read()
-
- dummy_cdkey_re = r'\bKVM_TEST_CDKEY\b'
- if re.search(dummy_cdkey_re, contents):
- if self.cdkey:
- contents = re.sub(dummy_cdkey_re, self.cdkey, contents)
-
- dummy_medium_re = r'\bKVM_TEST_MEDIUM\b'
- if self.medium == "cdrom":
- content = "cdrom"
- elif self.medium == "url":
- content = "url --url %s" % self.url
- elif self.medium == "nfs":
- content = "nfs --server=%s --dir=%s" % (self.nfs_server,
- self.nfs_dir)
- else:
- raise ValueError("Unexpected installation medium %s" % self.url)
-
- contents = re.sub(dummy_medium_re, content, contents)
-
- logging.debug("Unattended install contents:")
- for line in contents.splitlines():
- logging.debug(line)
-
- utils.open_write_close(answer_path, contents)
-
-
- def answer_windows_ini(self, answer_path):
- parser = ConfigParser.ConfigParser()
- parser.read(self.unattended_file)
- # First, replacing the CDKEY
- if self.cdkey:
- parser.set('UserData', 'ProductKey', self.cdkey)
- else:
- logging.error("Param 'cdkey' required but not specified for "
- "this unattended installation")
-
- # Now, replacing the virtio network driver path, under double quotes
- if self.install_virtio == 'yes':
- parser.set('Unattended', 'OemPnPDriversPath',
- '"%s"' % self.virtio_nework_path)
- else:
- parser.remove_option('Unattended', 'OemPnPDriversPath')
-
- # Last, replace the virtio installer command
- if self.install_virtio == 'yes':
- driver = self.virtio_network_installer_path
- else:
- driver = 'dir'
-
- dummy_re = 'KVM_TEST_VIRTIO_NETWORK_INSTALLER'
- installer = parser.get('GuiRunOnce', 'Command0')
- if dummy_re in installer:
- installer = re.sub(dummy_re, driver, installer)
- parser.set('GuiRunOnce', 'Command0', installer)
-
- # Now, writing the in memory config state to the unattended file
- fp = open(answer_path, 'w')
- parser.write(fp)
-
- # Let's read it so we can debug print the contents
- fp = open(answer_path, 'r')
- contents = fp.read()
- logging.debug("Unattended install contents:")
- for line in contents.splitlines():
- logging.debug(line)
- fp.close()
-
-
- def answer_windows_xml(self, answer_path):
- doc = xml.dom.minidom.parse(self.unattended_file)
-
- if self.cdkey:
- # First, replacing the CDKEY
- product_key = doc.getElementsByTagName('ProductKey')[0]
- key = product_key.getElementsByTagName('Key')[0]
- key_text = key.childNodes[0]
- assert key_text.nodeType == doc.TEXT_NODE
- key_text.data = self.cdkey
- else:
- logging.error("Param 'cdkey' required but not specified for "
- "this unattended installation")
-
- # Now, replacing the virtio driver paths or removing the entire
- # component PnpCustomizationsWinPE Element Node
- if self.install_virtio == 'yes':
- paths = doc.getElementsByTagName("Path")
- values = [self.virtio_storage_path, self.virtio_network_path]
- for path, value in zip(paths, values):
- path_text = path.childNodes[0]
- assert key_text.nodeType == doc.TEXT_NODE
- path_text.data = value
- else:
- settings = doc.getElementsByTagName("settings")
- for s in settings:
- for c in s.getElementsByTagName("component"):
- if (c.getAttribute('name') ==
- "Microsoft-Windows-PnpCustomizationsWinPE"):
- s.removeChild(c)
-
- # Last but not least important, replacing the virtio installer command
- command_lines = doc.getElementsByTagName("CommandLine")
- for command_line in command_lines:
- command_line_text = command_line.childNodes[0]
- assert command_line_text.nodeType == doc.TEXT_NODE
- dummy_re = 'KVM_TEST_VIRTIO_NETWORK_INSTALLER'
- if (self.install_virtio == 'yes' and
- hasattr(self, 'virtio_network_installer_path')):
- driver = self.virtio_network_installer_path
- else:
- driver = 'dir'
- if driver.endswith("msi"):
- driver = 'msiexec /passive /package ' + driver
- if dummy_re in command_line_text.data:
- t = command_line_text.data
- t = re.sub(dummy_re, driver, t)
- command_line_text.data = t
-
- contents = doc.toxml()
- logging.debug("Unattended install contents:")
- for line in contents.splitlines():
- logging.debug(line)
-
- fp = open(answer_path, 'w')
- doc.writexml(fp)
-
-
- def answer_suse_xml(self, answer_path):
- # There's nothing to replace on SUSE files to date. Yay!
- doc = xml.dom.minidom.parse(self.unattended_file)
-
- contents = doc.toxml()
- logging.debug("Unattended install contents:")
- for line in contents.splitlines():
- logging.debug(line)
-
- fp = open(answer_path, 'w')
- doc.writexml(fp)
-
-
- def setup_boot_disk(self):
- if self.unattended_file.endswith('.sif'):
- dest_fname = 'winnt.sif'
- setup_file = 'winnt.bat'
- boot_disk = FloppyDisk(self.floppy, self.qemu_img_binary,
- self.tmpdir)
- answer_path = boot_disk.get_answer_file_path(dest_fname)
- self.answer_windows_ini(answer_path)
- setup_file_path = os.path.join(self.unattended_dir, setup_file)
- boot_disk.copy_to(setup_file_path)
- if self.install_virtio == "yes":
- boot_disk.setup_virtio_win2003(self.virtio_floppy,
- self.virtio_oemsetup_id)
- boot_disk.copy_to(self.finish_program)
-
- elif self.unattended_file.endswith('.ks'):
- # Red Hat kickstart install
- dest_fname = 'ks.cfg'
- if self.cdrom_unattended:
- boot_disk = CdromDisk(self.cdrom_unattended, self.tmpdir)
- elif self.floppy:
- boot_disk = FloppyDisk(self.floppy, self.qemu_img_binary,
- self.tmpdir)
- else:
- raise ValueError("Neither cdrom_unattended nor floppy set "
- "on the config file, please verify")
- answer_path = boot_disk.get_answer_file_path(dest_fname)
- self.answer_kickstart(answer_path)
-
- elif self.unattended_file.endswith('.xml'):
- if "autoyast" in self.extra_params:
- # SUSE autoyast install
- dest_fname = "autoinst.xml"
- if self.cdrom_unattended:
- boot_disk = CdromDisk(self.cdrom_unattended, self.tmpdir)
- elif self.floppy:
- boot_disk = FloppyDisk(self.floppy, self.qemu_img_binary,
- self.tmpdir)
- else:
- raise ValueError("Neither cdrom_unattended nor floppy set "
- "on the config file, please verify")
- answer_path = boot_disk.get_answer_file_path(dest_fname)
- self.answer_suse_xml(answer_path)
-
- else:
- # Windows unattended install
- dest_fname = "autounattend.xml"
- boot_disk = FloppyDisk(self.floppy, self.qemu_img_binary,
- self.tmpdir)
- answer_path = boot_disk.get_answer_file_path(dest_fname)
- self.answer_windows_xml(answer_path)
-
- if self.install_virtio == "yes":
- boot_disk.setup_virtio_win2008(self.virtio_floppy)
- boot_disk.copy_to(self.finish_program)
-
- else:
- raise ValueError('Unknown answer file type: %s' %
- self.unattended_file)
-
- boot_disk.close()
-
-
- @error.context_aware
- def setup_cdrom(self):
- """
- Mount cdrom and copy vmlinuz and initrd.img.
- """
- error.context("Copying vmlinuz and initrd.img from install cdrom %s" %
- self.cdrom_cd1)
- m_cmd = ('mount -t iso9660 -v -o loop,ro %s %s' %
- (self.cdrom_cd1, self.cdrom_cd1_mount))
- utils.run(m_cmd)
-
- try:
- if not os.path.isdir(self.image_path):
- os.makedirs(self.image_path)
- kernel_fetch_cmd = ("cp %s/%s/%s %s" %
- (self.cdrom_cd1_mount, self.boot_path,
- os.path.basename(self.kernel), self.kernel))
- utils.run(kernel_fetch_cmd)
- initrd_fetch_cmd = ("cp %s/%s/%s %s" %
- (self.cdrom_cd1_mount, self.boot_path,
- os.path.basename(self.initrd), self.initrd))
- utils.run(initrd_fetch_cmd)
- finally:
- cleanup(self.cdrom_cd1_mount)
-
-
- @error.context_aware
- def setup_url(self):
- """
- Download the vmlinuz and initrd.img from URL.
- """
- error.context("downloading vmlinuz and initrd.img from %s" % self.url)
- os.chdir(self.image_path)
- kernel_fetch_cmd = "wget -q %s/%s/%s" % (self.url, self.boot_path,
- os.path.basename(self.kernel))
- initrd_fetch_cmd = "wget -q %s/%s/%s" % (self.url, self.boot_path,
- os.path.basename(self.initrd))
-
- if os.path.exists(self.kernel):
- os.remove(self.kernel)
- if os.path.exists(self.initrd):
- os.remove(self.initrd)
-
- utils.run(kernel_fetch_cmd)
- utils.run(initrd_fetch_cmd)
-
-
- def setup_nfs(self):
- """
- Copy the vmlinuz and initrd.img from nfs.
- """
- error.context("copying the vmlinuz and initrd.img from NFS share")
-
- m_cmd = ("mount %s:%s %s -o ro" %
- (self.nfs_server, self.nfs_dir, self.nfs_mount))
- utils.run(m_cmd)
-
- try:
- kernel_fetch_cmd = ("cp %s/%s/%s %s" %
- (self.nfs_mount, self.boot_path,
- os.path.basename(self.kernel), self.image_path))
- utils.run(kernel_fetch_cmd)
- initrd_fetch_cmd = ("cp %s/%s/%s %s" %
- (self.nfs_mount, self.boot_path,
- os.path.basename(self.initrd), self.image_path))
- utils.run(initrd_fetch_cmd)
- finally:
- cleanup(self.nfs_mount)
-
-
- def setup(self):
- """
- Configure the environment for unattended install.
-
- Uses an appropriate strategy according to each install model.
- """
- logging.info("Starting unattended install setup")
- virt_utils.display_attributes(self)
-
- if self.unattended_file and (self.floppy or self.cdrom_unattended):
- self.setup_boot_disk()
- if self.medium == "cdrom":
- if self.kernel and self.initrd:
- self.setup_cdrom()
- elif self.medium == "url":
- self.setup_url()
- elif self.medium == "nfs":
- self.setup_nfs()
- else:
- raise ValueError("Unexpected installation method %s" %
- self.medium)
-
-
[email protected]_aware
-def run_unattended_install(test, params, env):
- """
- Unattended install test:
- 1) Starts a VM with an appropriated setup to start an unattended OS install.
- 2) Wait until the install reports to the install watcher its end.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- unattended_install_config = UnattendedInstallConfig(test, params)
- unattended_install_config.setup()
- vm = env.get_vm(params["main_vm"])
- vm.create()
-
- install_timeout = int(params.get("timeout", 3000))
- post_install_delay = int(params.get("post_install_delay", 0))
- port = vm.get_port(int(params.get("guest_port_unattended_install")))
-
- migrate_background = params.get("migrate_background") == "yes"
- if migrate_background:
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
-
- logging.info("Waiting for installation to finish. Timeout set to %d s "
- "(%d min)", install_timeout, install_timeout/60)
- error.context("waiting for installation to finish")
-
- start_time = time.time()
- while (time.time() - start_time) < install_timeout:
- try:
- vm.verify_alive()
- except virt_vm.VMDeadError, e:
- if params.get("wait_no_ack", "no") == "yes":
- break
- else:
- raise e
- vm.verify_kernel_crash()
- if params.get("wait_no_ack", "no") == "no":
- client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- try:
- client.connect((vm.get_address(), port))
- if client.recv(1024) == "done":
- break
- except (socket.error, virt_vm.VMAddressError):
- pass
-
- if migrate_background:
- # Drop the params which may break the migration
- # Better method is to use dnsmasq to do the
- # unattended installation
- if vm.params.get("initrd"):
- vm.params["initrd"] = None
- if vm.params.get("kernel"):
- vm.params["kernel"] = None
- if vm.params.get("extra_params"):
- vm.params["extra_params"] = re.sub("--append '.*'", "",
- vm.params["extra_params"])
- vm.migrate(timeout=mig_timeout, protocol=mig_protocol)
- else:
- time.sleep(1)
- if params.get("wait_no_ack", "no") == "no":
- client.close()
- else:
- raise error.TestFail("Timeout elapsed while waiting for install to "
- "finish")
-
- time_elapsed = time.time() - start_time
- logging.info("Guest reported successful installation after %d s (%d min)",
- time_elapsed, time_elapsed/60)
-
- if params.get("shutdown_cleanly", "yes") == "yes":
- shutdown_cleanly_timeout = int(params.get("shutdown_cleanly_timeout",
- 120))
- logging.info("Wait for guest to shutdown cleanly")
- if virt_utils.wait_for(vm.is_dead, shutdown_cleanly_timeout, 1, 1):
- logging.info("Guest managed to shutdown cleanly")
diff --git a/client/tests/kvm/tests/unittest.py b/client/tests/kvm/tests/unittest.py
deleted file mode 100644
index 16168fe..0000000
--- a/client/tests/kvm/tests/unittest.py
+++ /dev/null
@@ -1,121 +0,0 @@
-import logging, os, shutil, glob, ConfigParser
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_env_process
-
-
-def run_unittest(test, params, env):
- """
- KVM RHEL-6 style unit test:
- 1) Resume a stopped VM
- 2) Wait for VM to terminate
- 3) If qemu exited with code = 0, the unittest passed. Otherwise, it failed
- 4) Collect all logs generated
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment
- """
- unittest_dir = os.path.join(test.bindir, 'unittests')
- if not os.path.isdir(unittest_dir):
- raise error.TestError("No unittest dir %s available (did you run the "
- "build test first?)" % unittest_dir)
- os.chdir(unittest_dir)
- unittest_list = glob.glob('*.flat')
- if not unittest_list:
- raise error.TestError("No unittest files available (did you run the "
- "build test first?)")
- logging.debug('Flat file list: %s', unittest_list)
-
- unittest_cfg = os.path.join(unittest_dir, 'unittests.cfg')
- parser = ConfigParser.ConfigParser()
- parser.read(unittest_cfg)
- test_list = parser.sections()
-
- if not test_list:
- raise error.TestError("No tests listed on config file %s" %
- unittest_cfg)
- logging.debug('Unit test list: %s', test_list)
-
- if params.get('test_list'):
- test_list = params.get('test_list').split()
- logging.info('Original test list overriden by user')
- logging.info('User defined unit test list: %s', test_list)
-
- nfail = 0
- tests_failed = []
-
- timeout = int(params.get('unittest_timeout', 600))
-
- extra_params_original = params['extra_params']
-
- for t in test_list:
- logging.info('Running %s', t)
-
- flat_file = None
- if parser.has_option(t, 'file'):
- flat_file = parser.get(t, 'file')
-
- if flat_file is None:
- nfail += 1
- tests_failed.append(t)
- logging.error('Unittest config file %s has section %s but no '
- 'mandatory option file', unittest_cfg, t)
- continue
-
- if flat_file not in unittest_list:
- nfail += 1
- tests_failed.append(t)
- logging.error('Unittest file %s referenced in config file %s but '
- 'was not find under the unittest dir', flat_file,
- unittest_cfg)
- continue
-
- smp = None
- if parser.has_option(t, 'smp'):
- smp = int(parser.get(t, 'smp'))
- params['smp'] = smp
-
- extra_params = None
- if parser.has_option(t, 'extra_params'):
- extra_params = parser.get(t, 'extra_params')
- params['extra_params'] += ' %s' % extra_params
-
- vm_name = params.get("main_vm")
- params['kernel'] = os.path.join(unittest_dir, flat_file)
- testlog_path = os.path.join(test.debugdir, "%s.log" % t)
-
- try:
- try:
- vm_name = params.get('main_vm')
- virt_env_process.preprocess_vm(test, params, env, vm_name)
- vm = env.get_vm(vm_name)
- vm.create()
- vm.monitor.cmd("cont")
- logging.info("Waiting for unittest %s to complete, timeout %s, "
- "output in %s", t, timeout,
- vm.get_testlog_filename())
- if not virt_utils.wait_for(vm.is_dead, timeout):
- raise error.TestFail("Timeout elapsed (%ss)" % timeout)
- # Check qemu's exit status
- status = vm.process.get_status()
- if status != 0:
- nfail += 1
- tests_failed.append(t)
- logging.error("Unit test %s failed", t)
- except Exception, e:
- nfail += 1
- tests_failed.append(t)
- logging.error('Exception happened during %s: %s', t, str(e))
- finally:
- try:
- shutil.copy(vm.get_testlog_filename(), testlog_path)
- logging.info("Unit test log collected and available under %s",
- testlog_path)
- except (NameError, IOError):
- logging.error("Not possible to collect logs")
-
- # Restore the extra params so other tests can run normally
- params['extra_params'] = extra_params_original
-
- if nfail != 0:
- raise error.TestFail("Unit tests failed: %s" % " ".join(tests_failed))
diff --git a/client/tests/kvm/tests/unittest_kvmctl.py b/client/tests/kvm/tests/unittest_kvmctl.py
deleted file mode 100644
index dd72cb2..0000000
--- a/client/tests/kvm/tests/unittest_kvmctl.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import os
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-
-
-def run_unittest_kvmctl(test, params, env):
- """
- This is kvm userspace unit test, use kvm test harness kvmctl load binary
- test case file to test various functions of the kvm kernel module.
- The output of all unit tests can be found in the test result dir.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- case = params.get("case")
- srcdir = params.get("srcdir", test.srcdir)
- unit_dir = os.path.join(srcdir, "kvm_userspace", "kvm", "user")
- os.chdir(unit_dir)
-
- cmd = "./kvmctl test/x86/bootstrap test/x86/%s.flat" % case
- try:
- results = utils.system_output(cmd)
- except error.CmdError:
- raise error.TestFail("Unit test %s failed" % case)
-
- result_file = os.path.join(test.resultsdir, case)
- utils.open_write_close(result_file, results)
diff --git a/client/tests/kvm/tests/usb.py b/client/tests/kvm/tests/usb.py
deleted file mode 100644
index 4d4aa30..0000000
--- a/client/tests/kvm/tests/usb.py
+++ /dev/null
@@ -1,90 +0,0 @@
-import logging, os
-from autotest_lib.client.common_lib import error
-
-
[email protected]_aware
-def run_usb(test, params, env):
- """
- Test usb device of guest
-
- 1) create a image file by qemu-img
- 2) boot up a guest add this file as a usb device
- 3) check usb device information by execute monitor/guest command
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.create()
-
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
-
- output = vm.monitor.cmd("info usb")
- if "Product QEMU USB MSD" not in output:
- logging.debug(output)
- raise error.TestFail("Could not find mass storage device")
-
- output = session.cmd("lsusb -v")
- # No bus specified, default using "usb.0" for "usb-storage"
- for i in ["ID 0000:0000", "Mass Storage", "SCSI", "QEMU USB HARDDRIVE"]:
- if i not in output:
- logging.debug(output)
- raise error.TestFail("No '%s' in the output of 'lsusb -v'" % i)
-
- output = session.cmd("fdisk -l")
- if params.get("fdisk_string") not in output:
- for line in output.splitlines():
- logging.debug(line)
- raise error.TestFail("Could not detect the usb device on fdisk output")
-
- error.context("Formatting USB disk")
- devname = session.cmd("ls /dev/disk/by-path/* | grep usb").strip()
- session.cmd("yes | mkfs %s" % devname,
- timeout=int(params.get("format_timeout")))
-
- error.context("Mounting USB disk")
- session.cmd("mount %s /mnt" % devname)
-
- error.context("Creating comparison file")
- c_file = '/tmp/usbfile'
- session.cmd("dd if=/dev/random of=%s bs=1M count=1" % c_file)
-
- error.context("Copying %s to USB disk" % c_file)
- session.cmd("cp %s /mnt" % c_file)
-
- error.context("Unmounting USB disk before file comparison")
- session.cmd("umount %s" % devname)
-
- error.context("Mounting USB disk for file comparison")
- session.cmd("mount %s /mnt" % devname)
-
- error.context("Determining md5sum for file on root fs and in USB disk")
- md5_root = session.cmd("md5sum %s" % c_file).strip()
- md5_usb = session.cmd("md5sum /mnt/%s" % os.path.basename(c_file)).strip()
- md5_root = md5_root.split()[0]
- md5_usb = md5_usb.split()[0]
-
- error.context("")
- if md5_root != md5_usb:
- raise error.TestError("MD5 mismatch between file on root fs and on "
- "USB disk")
-
- error.context("Unmounting USB disk after file comparison")
- session.cmd("umount %s" % devname)
-
- error.context("Checking if there are I/O error messages in dmesg")
- output = session.get_command_output("dmesg")
- io_error_msg = []
- for line in output.splitlines():
- if "Buffer I/O error" in line:
- io_error_msg.append(line)
-
- if io_error_msg:
- e_msg = "IO error found on guest's dmesg when formatting USB device"
- logging.error(e_msg)
- for line in io_error_msg:
- logging.error(line)
- raise error.TestFail(e_msg)
-
- session.close()
diff --git a/client/tests/kvm/tests/virtio_console.py b/client/tests/kvm/tests/virtio_console.py
deleted file mode 100644
index a9e980c..0000000
--- a/client/tests/kvm/tests/virtio_console.py
+++ /dev/null
@@ -1,2174 +0,0 @@
-"""
-virtio_console test
-
-@copyright: 2010 Red Hat, Inc.
-"""
-import array, logging, os, random, re, select, shutil, socket, sys, tempfile
-import threading, time, traceback
-from collections import deque
-from threading import Thread
-
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils, virt_test_utils, kvm_monitor
-from autotest_lib.client.virt import virt_env_process, aexpect
-
-
-def run_virtio_console(test, params, env):
- """
- KVM virtio_console test
-
- 1) Starts VMs with the specified number of virtio console devices
- 2) Start smoke test
- 3) Start loopback test
- 4) Start performance test
-
- This test uses an auxiliary script, virtio_console_guest.py, that is copied
- to guests. This script has functions to send and write data to virtio
- console ports. Details of each test can be found on the docstrings for the
- test_* functions.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment
- """
- class SubTest(object):
- """
- Collect result of subtest of main test.
- """
- def __init__(self):
- """
- Initialize object
- """
- self.result = []
- self.passed = 0
- self.failed = 0
- self.cleanup_func = None
- self.cleanup_args = None
-
-
- def set_cleanup_func(self, func, args):
- """
- Set cleanup function which is called when subtest fails.
-
- @param func: Function which should be called when test fails.
- @param args: Arguments of cleanup function.
- """
- self.cleanup_func = func
- self.cleanup_args = args
-
-
- def get_cleanup_func(self):
- """
- Returns the tupple of cleanup_func and clenaup_args
-
- @return: Tupple of self.cleanup_func and self.cleanup_args
- """
- return (self.cleanup_func, self.cleanup_args)
-
-
- def do_test(self, function, args=None, fatal=False, cleanup=True):
- """
- Execute subtest function.
-
- @param function: Object of function.
- @param args: List of arguments of function.
- @param fatal: If true exception is forwarded to main test.
- @param cleanup: If true call cleanup function after crash of test.
- @return: Return what returned executed subtest.
- @raise TestError: If collapse of test is fatal raise forward
- exception from subtest.
- """
- if args is None:
- args = []
- res = [None, function.func_name, args]
- try:
- logging.info("Starting test %s" % function.func_name)
- ret = function(*args)
- res[0] = True
- logging.info(self.result_to_string(res))
- self.result.append(res)
- self.passed += 1
- return ret
- except:
- exc_type, exc_value, exc_traceback = sys.exc_info()
- logging.error("In function (" + function.func_name + "):")
- logging.error("Call from:\n" +
- traceback.format_stack()[-2][:-1])
- logging.error("Exception from:\n" +
- "".join(traceback.format_exception(
- exc_type, exc_value,
- exc_traceback.tb_next)))
- # Clean up environment after subTest crash
- res[0] = False
- logging.info(self.result_to_string(res))
- self.result.append(res)
- self.failed += 1
-
- if cleanup:
- try:
- self.cleanup_func(*self.cleanup_args)
- except:
- error.TestFail("Cleanup function crashed as well")
- if fatal:
- raise
-
-
- def is_failed(self):
- """
- @return: If any of subtest not pass return True.
- """
- if self.failed > 0:
- return True
- else:
- return False
-
-
- def get_result(self):
- """
- @return: Result of subtests.
- Format:
- tuple(pass/fail,function_name,call_arguments)
- """
- return self.result
-
-
- def result_to_string_debug(self, result):
- """
- @param result: Result of test.
- """
- sargs = ""
- for arg in result[2]:
- sargs += str(arg) + ","
- sargs = sargs[:-1]
- if result[0]:
- status = "PASS"
- else:
- status = "FAIL"
- return ("Subtest (%s(%s)): --> %s") % (result[1], sargs, status)
-
-
- def result_to_string(self, result):
- """
- @param result: Result of test.
- """
- if result[0]:
- status = "PASS"
- else:
- status = "FAIL"
- return ("Subtest (%s): --> %s") % (result[1], status)
-
-
- def headline(self, msg):
- """
- Add headline to result output.
-
- @param msg: Test of headline
- """
- self.result.append([msg])
-
-
- def _gen_res(self, format_func):
- """
- Format result with formatting function
-
- @param format_func: Func for formating result.
- """
- result = ""
- for res in self.result:
- if (len(res) == 3):
- result += format_func(res) + "\n"
- else:
- result += res[0] + "\n"
- return result
-
-
- def get_full_text_result(self):
- """
- @return string with text form of result
- """
- return self._gen_res(lambda str: self.result_to_string_debug(str))
-
-
- def get_text_result(self):
- """
- @return string with text form of result
- """
- return self._gen_res(lambda str: self.result_to_string(str))
-
-
- class Port(object):
- """
- Define structure to keep information about used port.
- """
- def __init__(self, sock, name, port_type, path):
- """
- @param vm: virtual machine object that port owned
- @param sock: Socket of port if port is open.
- @param name: Name of port for guest side.
- @param port_type: Type of port yes = console, no= serialport.
- @param path: Path to port on host side.
- """
- self.sock = sock
- self.name = name
- self.port_type = port_type
- self.path = path
- self.is_open = False
-
-
- def for_guest(self):
- """
- Format data for communication with guest side.
- """
- return [self.name, self.port_type]
-
-
- def open(self):
- """
- Open port on host side.
- """
- attempt = 11
- while attempt > 0:
- try:
- self.sock = socket.socket(socket.AF_UNIX,
- socket.SOCK_STREAM)
- self.sock.connect(self.path)
- self.sock.setsockopt(1,socket.SO_SNDBUF, 2048)
- self.is_open = True
- return
- except Exception, inst:
- attempt -= 1
- time.sleep(1)
- raise error.TestFail("Can't open the %s sock" % self.name)
-
-
- def clean_port(self):
- """
- Clean all data from opened port on host side.
- """
- if self.is_open:
- self.close()
- self.open()
- ret = select.select([self.sock], [], [], 1.0)
- if ret[0]:
- buf = self.sock.recv(1024)
- logging.debug("Rest in socket: " + buf)
-
-
- def close(self):
- """
- Close port.
- """
- self.sock.shutdown(socket.SHUT_RDWR)
- self.sock.close()
- self.is_open = False
-
-
- def __str__(self):
- """
- Convert to text.
- """
- return ("%s,%s,%s,%s,%d" % ("Socket", self.name, self.port_type,
- self.path, self.is_open))
-
-
- class ThSend(Thread):
- """
- Random data sender thread.
- """
- def __init__(self, port, data, event, quiet=False):
- """
- @param port: Destination port.
- @param data: The data intend to be send in a loop.
- @param event: Exit event.
- @param quiet: If true don't raise event when crash.
- """
- Thread.__init__(self)
- self.port = port
- # FIXME: socket.send(data>>127998) without read blocks thread
- if len(data) > 102400:
- data = data[0:102400]
- logging.error("Data is too long, using only first %d bytes",
- len(data))
- self.data = data
- self.exitevent = event
- self.idx = 0
- self.quiet = quiet
-
-
- def run(self):
- logging.debug("ThSend %s: run", self.getName())
- try:
- while not self.exitevent.isSet():
- self.idx += self.port.send(self.data)
- logging.debug("ThSend %s: exit(%d)", self.getName(),
- self.idx)
- except Exception, ints:
- if not self.quiet:
- raise ints
- logging.debug(ints)
-
-
- class ThSendCheck(Thread):
- """
- Random data sender thread.
- """
- def __init__(self, port, event, queues, blocklen=1024):
- """
- @param port: Destination port
- @param event: Exit event
- @param queues: Queues for the control data (FIFOs)
- @param blocklen: Block length
- """
- Thread.__init__(self)
- self.port = port
- self.queues = queues
- # FIXME: socket.send(data>>127998) without read blocks thread
- if blocklen > 102400:
- blocklen = 102400
- logging.error("Data is too long, using blocklen = %d",
- blocklen)
- self.blocklen = blocklen
- self.exitevent = event
- self.idx = 0
-
-
- def run(self):
- logging.debug("ThSendCheck %s: run", self.getName())
- too_much_data = False
- while not self.exitevent.isSet():
- # FIXME: workaround the problem with qemu-kvm stall when too
- # much data is sent without receiving
- for queue in self.queues:
- while not self.exitevent.isSet() and len(queue) > 1048576:
- too_much_data = True
- time.sleep(0.1)
- ret = select.select([], [self.port.sock], [], 1.0)
- if ret[1]:
- # Generate blocklen of random data add them to the FIFO
- # and send them over virtio_console
- buf = ""
- for i in range(self.blocklen):
- ch = "%c" % random.randrange(255)
- buf += ch
- for queue in self.queues:
- queue.append(ch)
- target = self.idx + self.blocklen
- while not self.exitevent.isSet() and self.idx < target:
- try:
- idx = self.port.sock.send(buf)
- except Exception, inst:
- # Broken pipe
- if inst.errno == 32:
- logging.debug("ThSendCheck %s: Broken pipe "
- "(migration?), reconnecting",
- self.getName())
- attempt = 10
- while (attempt > 1
- and not self.exitevent.isSet()):
- self.port.is_open = False
- self.port.open()
- try:
- idx = self.port.sock.send(buf)
- except:
- attempt += 1
- time.sleep(10)
- else:
- attempt = 0
- buf = buf[idx:]
- self.idx += idx
- logging.debug("ThSendCheck %s: exit(%d)", self.getName(),
- self.idx)
- if too_much_data:
- logging.error("ThSendCheck: working around the 'too_much_data'"
- "bug")
-
-
- class ThRecv(Thread):
- """
- Recieves data and throws it away.
- """
- def __init__(self, port, event, blocklen=1024, quiet=False):
- """
- @param port: Data source port.
- @param event: Exit event.
- @param blocklen: Block length.
- @param quiet: If true don't raise event when crash.
- """
- Thread.__init__(self)
- self.port = port
- self._port_timeout = self.port.gettimeout()
- self.port.settimeout(0.1)
- self.exitevent = event
- self.blocklen = blocklen
- self.idx = 0
- self.quiet = quiet
-
-
- def run(self):
- logging.debug("ThRecv %s: run", self.getName())
- try:
- while not self.exitevent.isSet():
- # TODO: Workaround, it didn't work with select :-/
- try:
- self.idx += len(self.port.recv(self.blocklen))
- except socket.timeout:
- pass
- self.port.settimeout(self._port_timeout)
- logging.debug("ThRecv %s: exit(%d)", self.getName(), self.idx)
- except Exception, ints:
- if not self.quiet:
- raise ints
- logging.debug(ints)
-
-
- class ThRecvCheck(Thread):
- """
- Random data receiver/checker thread.
- """
- def __init__(self, port, buffer, event, blocklen=1024, sendlen=0):
- """
- @param port: Source port.
- @param buffer: Control data buffer (FIFO).
- @param length: Amount of data we want to receive.
- @param blocklen: Block length.
- @param sendlen: Block length of the send function (on guest)
- """
- Thread.__init__(self)
- self.port = port
- self.buffer = buffer
- self.exitevent = event
- self.blocklen = blocklen
- self.idx = 0
- self.sendlen = sendlen + 1 # >=
-
-
- def run(self):
- logging.debug("ThRecvCheck %s: run", self.getName())
- attempt = 10
- sendidx = -1
- minsendidx = self.sendlen
- while not self.exitevent.isSet():
- ret = select.select([self.port.sock], [], [], 1.0)
- if ret[0] and (not self.exitevent.isSet()):
- buf = self.port.sock.recv(self.blocklen)
- if buf:
- # Compare the received data with the control data
- for ch in buf:
- ch_ = self.buffer.popleft()
- if ch == ch_:
- self.idx += 1
- else:
- # TODO BUG: data from the socket on host can
- # be lost during migration
- while ch != ch_:
- if sendidx > 0:
- sendidx -= 1
- ch_ = self.buffer.popleft()
- else:
- self.exitevent.set()
- logging.error("ThRecvCheck %s: "
- "Failed to recv %dth "
- "character",
- self.getName(), self.idx)
- logging.error("ThRecvCheck %s: "
- "%s != %s",
- self.getName(),
- repr(ch), repr(ch_))
- logging.error("ThRecvCheck %s: "
- "Recv = %s",
- self.getName(), repr(buf))
- # sender might change the buffer :-(
- time.sleep(1)
- ch_ = ""
- for buf in self.buffer:
- ch_ += buf
- ch_ += ' '
- logging.error("ThRecvCheck %s: "
- "Queue = %s",
- self.getName(), repr(ch_))
- logging.info("ThRecvCheck %s: "
- "MaxSendIDX = %d",
- self.getName(),
- (self.sendlen - sendidx))
- raise error.TestFail("ThRecvCheck %s: "
- "incorrect data",
- self.getName())
- attempt = 10
- else: # ! buf
- # Broken socket
- if attempt > 0:
- attempt -= 1
- logging.debug("ThRecvCheck %s: Broken pipe "
- "(migration?), reconnecting. ",
- self.getName())
- # TODO BUG: data from the socket on host can be lost
- if sendidx >= 0:
- minsendidx = min(minsendidx, sendidx)
- logging.debug("ThRecvCheck %s: Previous data "
- "loss was %d.",
- self.getName(),
- (self.sendlen - sendidx))
- sendidx = self.sendlen
- self.port.is_open = False
- self.port.open()
- if sendidx >= 0:
- minsendidx = min(minsendidx, sendidx)
- if (self.sendlen - minsendidx):
- logging.error("ThRecvCheck %s: Data loss occured during socket"
- "reconnection. Maximal loss was %d per one "
- "migration.", self.getName(),
- (self.sendlen - minsendidx))
- logging.debug("ThRecvCheck %s: exit(%d)", self.getName(),
- self.idx)
-
-
- def process_stats(stats, scale=1.0):
- """
- Process and print the stats.
-
- @param stats: List of measured data.
- """
- if not stats:
- return None
- for i in range((len(stats) - 1), 0, -1):
- stats[i] = stats[i] - stats[i - 1]
- stats[i] /= scale
- stats[0] /= scale
- stats = sorted(stats)
- return stats
-
-
- def _init_guest(vm, timeout=10):
- """
- Execute virtio_console_guest.py on guest, wait until it is initialized.
-
- @param vm: Informations about the guest.
- @param timeout: Timeout that will be used to verify if the script
- started properly.
- """
- logging.debug("compile virtio_console_guest.py on guest %s",
- vm[0].name)
-
- (match, data) = _on_guest("python -OO /tmp/virtio_console_guest.py -c"
- "&& echo -n 'PASS: Compile virtio_guest finished' ||"
- "echo -n 'FAIL: Compile virtio_guest failed'",
- vm, timeout)
-
- if match != 0:
- raise error.TestFail("Command console_switch.py on guest %s "
- "failed.\nreturn code: %s\n output:\n%s" %
- (vm[0].name, match, data))
- logging.debug("Starting virtio_console_guest.py on guest %s",
- vm[0].name)
- vm[1].sendline()
- (match, data) = _on_guest("python /tmp/virtio_console_guest.pyo &&"
- "echo -n 'PASS: virtio_guest finished' ||"
- "echo -n 'FAIL: virtio_guest failed'",
- vm, timeout)
- if match != 0:
- raise error.TestFail("Command console_switch.py on guest %s "
- "failed.\nreturn code: %s\n output:\n%s" %
- (vm[0].name, match, data))
- # Let the system rest
- time.sleep(2)
-
-
- def init_guest(vm, consoles):
- """
- Prepares guest, executes virtio_console_guest.py and initializes test.
-
- @param vm: Informations about the guest.
- @param consoles: Informations about consoles.
- """
- conss = []
- for mode in consoles:
- for cons in mode:
- conss.append(cons.for_guest())
- _init_guest(vm, 10)
- on_guest("virt.init(%s)" % (conss), vm, 10)
-
-
- def _search_kernel_crashlog(vm_port, timeout=2):
- """
- Find kernel crash message.
-
- @param vm_port : Guest output port.
- @param timeout: Timeout used to verify expected output.
-
- @return: Kernel crash log or None.
- """
- data = vm_port.read_nonblocking()
- match = re.search("BUG:", data, re.MULTILINE)
- if match is None:
- return None
-
- match = re.search(r"BUG:.*---\[ end trace .* \]---",
- data, re.DOTALL |re.MULTILINE)
- if match is None:
- data += vm_port.read_until_last_line_matches(
- ["---\[ end trace .* \]---"],timeout)
-
- match = re.search(r"(BUG:.*---\[ end trace .* \]---)",
- data, re.DOTALL |re.MULTILINE)
- return match.group(0)
-
-
-
- def _on_guest(command, vm, timeout=2):
- """
- Execute given command inside the script's main loop, indicating the vm
- the command was executed on.
-
- @param command: Command that will be executed.
- @param vm: Informations about the guest.
- @param timeout: Timeout used to verify expected output.
-
- @return: Tuple (match index, data, kernel_crash)
- """
- logging.debug("Executing '%s' on virtio_console_guest.py loop," +
- " vm: %s, timeout: %s", command, vm[0].name, timeout)
- vm[1].sendline(command)
- try:
- (match, data) = vm[1].read_until_last_line_matches(["PASS:",
- "FAIL:"],
- timeout)
-
- except aexpect.ExpectError, e:
- match = None
- data = "Cmd process timeout. Data in console: " + e.output
-
- kcrash_data = _search_kernel_crashlog(vm[3])
- if kcrash_data is not None:
- logging.error(kcrash_data)
- vm[4] = True
-
- return (match, data)
-
-
- def on_guest(command, vm, timeout=2):
- """
- Wrapper around the _on_guest command which executes the command on
- guest. Unlike _on_guest command when the command fails it raises the
- test error.
-
- @param command: Command that will be executed.
- @param vm: Informations about the guest.
- @param timeout: Timeout used to verify expected output.
-
- @return: Tuple (match index, data)
- """
- match, data = _on_guest(command, vm, timeout)
- if match == 1 or match is None:
- raise error.TestFail("Failed to execute '%s' on"
- " virtio_console_guest.py, "
- "vm: %s, output:\n%s" %
- (command, vm[0].name, data))
-
- return (match, data)
-
-
- def _guest_exit_threads(vm, send_pts, recv_pts):
- """
- Safely executes on_guest("virt.exit_threads()") using workaround of
- the stuck thread in loopback in mode=virt.LOOP_NONE .
-
- @param vm: Informations about the guest.
- @param send_pts: list of possible send sockets we need to work around.
- @param recv_pts: list of possible recv sockets we need to read-out.
- """
- # in LOOP_NONE mode it might stuck in read/write
- match, tmp = _on_guest("virt.exit_threads()", vm, 10)
- if match is None:
- logging.debug("Workaround the stuck thread on guest")
- # Thread is stucked in read/write
- for send_pt in send_pts:
- send_pt.sock.sendall(".")
- elif match != 0:
- # Something else
- raise error.TestFail("Unexpected fail\nMatch: %s\nData:\n%s"
- % (match, tmp))
-
- # Read-out all remaining data
- for recv_pt in recv_pts:
- while select.select([recv_pt.sock], [], [], 0.1)[0]:
- recv_pt.sock.recv(1024)
-
- # This will cause fail in case anything went wrong.
- on_guest("print 'PASS: nothing'", vm, 10)
-
-
- def _vm_create(no_console=3, no_serialport=3, spread=True):
- """
- Creates the VM and connects the specified number of consoles and serial
- ports.
- Ports are allocated by 2 per 1 virtio-serial-pci device starting with
- console. (3+2 => CC|CS|S; 0+2 => SS; 3+4 => CC|CS|SS|S, ...) This way
- it's easy to test communication on the same or different
- virtio-serial-pci device.
- Further in tests the consoles are being picked always from the first
- available one (3+2: 2xC => CC|cs|s <communication on the same PCI>;
- 2xC,1xS => CC|cS|s <communication between 2 PCI devs)
-
- @param no_console: Number of desired virtconsoles.
- @param no_serialport: Number of desired virtserialports.
- @return: Tuple with (guest information, consoles information)
- guest informations = [vm, session, tmp_dir, kcrash]
- consoles informations = [consoles[], serialports[]]
- """
- consoles = []
- serialports = []
- tmp_dir = tempfile.mkdtemp(prefix="virtio-console-", dir="/tmp/")
- params['extra_params'] = standard_extra_params
-
- if not spread:
- pci = "virtio-serial-pci0"
- params['extra_params'] += (" -device virtio-serial-pci,id="
- + pci)
- pci += ".0"
- for i in range(0, no_console):
- # Spread consoles between multiple PCI devices (2 per a dev)
- if not i % 2 and spread:
- pci = "virtio-serial-pci%d" % (i / 2)
- params['extra_params'] += (" -device virtio-serial-pci,id="
- + pci)
- pci += ".0"
- params['extra_params'] += (" -chardev socket,path=%s/%d,id=vc%d,"
- "server,nowait" % (tmp_dir, i, i))
- params['extra_params'] += (" -device virtconsole,chardev=vc%d,"
- "name=console-%d,id=console-%d,bus=%s"
- % (i, i, i, pci))
-
- for i in range(no_console, no_console + no_serialport):
- # Spread serial ports between multiple PCI devices (2 per each dev)
- if not i % 2 and spread:
- pci = "virtio-serial-pci%d" % (i / 2)
- params['extra_params'] += (" -device virtio-serial-pci,id="
- + pci)
- pci += ".0"
- params['extra_params'] += (" -chardev socket,path=%s/%d,id=vs%d,"
- "server,nowait" % (tmp_dir, i, i))
- params['extra_params'] += (" -device virtserialport,chardev=vs%d,"
- "name=serialport-%d,id=serialport-%d,"
- "bus=%s" % (i, i, i, pci))
-
- (vm, session, sserial) = _restore_vm()
-
- # connect the sockets
- for i in range(0, no_console):
- consoles.append(Port(None ,"console-%d" % i,
- "yes", "%s/%d" % (tmp_dir, i)))
- for i in range(no_console, no_console + no_serialport):
- serialports.append(Port(None ,"serialport-%d" % i,
- "no", "%s/%d" % (tmp_dir, i)))
-
- kcrash = False
-
- return [vm, session, tmp_dir, sserial, kcrash], [consoles, serialports]
-
-
- def _restore_vm():
- """
- Restore old virtual machine when VM is destroyed.
- """
- logging.debug("Booting guest %s", params.get("main_vm"))
- virt_env_process.preprocess_vm(test, params, env,
- params.get("main_vm"))
-
- vm = env.get_vm(params.get("main_vm"))
-
- kernel_bug = None
- try:
- session = virt_test_utils.wait_for_login(vm, 0,
- float(params.get("boot_timeout", 100)),
- 0, 2)
- except (error.TestFail):
- kernel_bug = _search_kernel_crashlog(vm.serial_console, 10)
- if kernel_bug is not None:
- logging.error(kernel_bug)
- raise
-
- kernel_bug = _search_kernel_crashlog(vm.serial_console, 10)
- if kernel_bug is not None:
- logging.error(kernel_bug)
-
- sserial = virt_test_utils.wait_for_login(vm, 0,
- float(params.get("boot_timeout", 20)),
- 0, 2, serial=True)
- return [vm, session, sserial]
-
-
- def topen(vm, port):
- """
- Open virtioconsole port.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port identifier.
- """
- on_guest("virt.open('%s')" % (port.name), vm, 10)
- port.open()
-
-
- def tcheck_zero_sym(vm):
- """
- Check if port /dev/vport0p0 was created.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- """
- on_guest("virt.check_zero_sym()", vm, 10)
-
-
- def tmulti_open(vm, port):
- """
- Multiopen virtioconsole port.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port identifier.
- """
- on_guest("virt.close('%s')" % (port.name), vm, 10)
- on_guest("virt.open('%s')" % (port.name), vm, 10)
- (match, data) = _on_guest("virt.open('%s')" % (port.name), vm, 10)
- # Console is permitted to open the device multiple times
- if port.port_type == "yes": #is console?
- if match != 0: #Multiopen not pass
- raise error.TestFail("Unexpected fail of opening the console"
- " device for the 2nd time.\n%s" % data)
- else:
- if match != 1: #Multiopen not fail:
- raise error.TestFail("Unexpetded pass of opening the"
- " serialport device for the 2nd time.")
- elif not "[Errno 24]" in data:
- raise error.TestFail("Multiple opening fail but with another"
- " exception %s" % data)
- port.open()
-
-
- def tclose(vm, port):
- """
- Close socket.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port to open.
- """
- on_guest("virt.close('%s')" % (port.name), vm, 10)
- port.close()
-
-
- def tpolling(vm, port):
- """
- Test try polling function.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- # Poll (OUT)
- on_guest("virt.poll('%s', %s)" % (port.name, select.POLLOUT), vm,
- 2)
-
- # Poll (IN, OUT)
- port.sock.sendall("test")
- for test in [select.POLLIN, select.POLLOUT]:
- on_guest("virt.poll('%s', %s)" % (port.name, test), vm, 10)
-
- # Poll (IN HUP)
- # I store the socket informations and close the socket
- port.close()
- for test in [select.POLLIN, select.POLLHUP]:
- on_guest("virt.poll('%s', %s)" % (port.name, test), vm, 10)
-
- # Poll (HUP)
- on_guest("virt.recv('%s', 4, 1024, False)" % (port.name), vm, 10)
- on_guest("virt.poll('%s', %s)" % (port.name, select.POLLHUP), vm,
- 2)
-
- # Reconnect the socket
- port.open()
- # Redefine socket in consoles
- on_guest("virt.poll('%s', %s)" % (port.name, select.POLLOUT), vm,
- 2)
-
-
- def tsigio(vm, port):
- """
- Test try sigio function.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- if port.is_open:
- port.close()
-
- # Enable sigio on specific port
- on_guest("virt.async('%s', True, 0)" %
- (port.name) , vm, 10)
- on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
-
- #Test sigio when port open
- on_guest("virt.set_pool_want_return('%s', select.POLLOUT)" %
- (port.name), vm, 10)
- port.open()
- match = _on_guest("virt.get_sigio_poll_return('%s')" %
- (port.name) , vm, 10)[0]
- if match == 1:
- raise error.TestFail("Problem with HUP on console port.")
-
- #Test sigio when port receive data
- on_guest("virt.set_pool_want_return('%s', select.POLLOUT |"
- " select.POLLIN)" % (port.name), vm, 10)
- port.sock.sendall("0123456789")
- on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
-
- #Test sigio port close event
- on_guest("virt.set_pool_want_return('%s', select.POLLHUP |"
- " select.POLLIN)" % (port.name), vm, 10)
- port.close()
- on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
-
- #Test sigio port open event and persistence of written data on port.
- on_guest("virt.set_pool_want_return('%s', select.POLLOUT |"
- " select.POLLIN)" % (port.name), vm, 10)
- port.open()
- on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
-
- #Test event when erase data.
- on_guest("virt.clean_port('%s')" % (port.name), vm, 10)
- port.close()
- on_guest("virt.set_pool_want_return('%s', select.POLLOUT)"
- % (port.name), vm, 10)
- port.open()
- on_guest("virt.get_sigio_poll_return('%s')" % (port.name) , vm, 10)
-
- # Disable sigio on specific port
- on_guest("virt.async('%s', False, 0)" %
- (port.name) , vm, 10)
-
-
- def tlseek(vm, port):
- """
- Tests the correct handling of lseek (expected fail)
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- # The virt.lseek returns PASS when the seek fails
- on_guest("virt.lseek('%s', 0, 0)" % (port.name), vm, 10)
-
-
- def trw_host_offline(vm, port):
- """
- Guest read/write from host when host is disconnected.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- if port.is_open:
- port.close()
-
- on_guest("virt.recv('%s', 0, 1024, False)" % port.name, vm, 10)
- match, tmp = _on_guest("virt.send('%s', 10, True)" % port.name,
- vm, 10)
- if match is not None:
- raise error.TestFail("Write on guest while host disconnected "
- "didn't time out.\nOutput:\n%s"
- % tmp)
-
- port.open()
-
- if (port.sock.recv(1024) < 10):
- raise error.TestFail("Didn't received data from guest")
- # Now the _on_guest("virt.send('%s'... command should be finished
- on_guest("print('PASS: nothing')", vm, 10)
-
-
- def trw_host_offline_big_data(vm, port):
- """
- Guest read/write from host when host is disconnected.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- if port.is_open:
- port.close()
-
- port.clean_port()
- port.close()
- on_guest("virt.clean_port('%s'),1024" % port.name, vm, 10)
- match, tmp = _on_guest("virt.send('%s', (1024**3)*3, True, "
- "is_static=True)" % port.name, vm, 30)
- if match is None:
- raise error.TestFail("Write on guest while host disconnected "
- "didn't time out.\nOutput:\n%s"
- % tmp)
-
- time.sleep(20)
-
- port.open()
-
- rlen = 0
- while rlen < (1024**3*3):
- ret = select.select([port.sock], [], [], 10.0)
- if (ret[0] != []):
- rlen += len(port.sock.recv(((4096))))
- elif rlen != (1024**3*3):
- raise error.TestFail("Not all data was received,"
- "only %d from %d" % (rlen, 1024**3*3))
- on_guest("print('PASS: nothing')", vm, 10)
-
-
- def trw_notconnect_guest(vm, port, consoles):
- """
- Host send data to guest port and guest not read any data from port.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- vm[0].destroy(gracefully = False)
- (vm[0], vm[1], vm[3]) = _restore_vm()
- if not port.is_open:
- port.open()
- else:
- port.close()
- port.open()
-
- port.sock.settimeout(20.0)
-
- loads = utils.SystemLoad([(os.getpid(), 'autotest'),
- (vm[0].get_pid(), 'VM'), 0])
- loads.start()
-
- try:
- sent1 = 0
- for i in range(1000000):
- sent1 += port.sock.send("a")
- except socket.timeout:
- logging.info("Data sending to closed port timed out.")
-
- logging.info("Bytes sent to client: %d" % (sent1))
- logging.info("\n" + loads.get_cpu_status_string()[:-1])
-
- on_guest('echo -n "PASS:"', vm, 10)
-
- logging.info("Open and then close port %s" % (port.name))
- init_guest(vm, consoles)
- # Test of live and open and close port again
- _clean_ports(vm, consoles)
- on_guest("virt.close('%s')" % (port.name), vm, 10)
-
- # With serialport it is a different behavior
- on_guest("guest_exit()", vm, 10)
- port.sock.settimeout(20.0)
-
- loads.start()
- try:
- sent2 = 0
- for i in range(40000):
- sent2 = port.sock.send("a")
- except socket.timeout:
- logging.info("Data sending to closed port timed out.")
-
- logging.info("Bytes sent to client: %d" % (sent2))
- logging.info("\n" + loads.get_cpu_status_string()[:-1])
- loads.stop()
- if (sent1 != sent2):
- logging.warning("Inconsistent behavior: First sent %d bytes and "
- "second sent %d bytes" % (sent1, sent2))
-
- port.sock.settimeout(None)
- (vm[0], vm[1], vm[3]) = _restore_vm()
-
- init_guest(vm, consoles)
- _clean_ports(vm, consoles)
-
-
- def trw_blocking_mode(vm, port):
- """
- Guest read\write data in blocking mode.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- # Blocking mode
- if not port.is_open:
- port.open()
- on_guest("virt.blocking('%s', True)" % port.name, vm, 10)
- # Recv should timed out
- match, tmp = _on_guest("virt.recv('%s', 10, 1024, False)" %
- port.name, vm, 10)
- if match == 0:
- raise error.TestFail("Received data even when none was sent\n"
- "Data:\n%s" % tmp)
- elif match is not None:
- raise error.TestFail("Unexpected fail\nMatch: %s\nData:\n%s" %
- (match, tmp))
- port.sock.sendall("1234567890")
- # Now guest received the data end escaped from the recv()
- on_guest("print('PASS: nothing')", vm, 10)
-
-
- def trw_nonblocking_mode(vm, port):
- """
- Guest read\write data in nonblocking mode.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- # Non-blocking mode
- if not port.is_open:
- port.open()
- on_guest("virt.blocking('%s', False)" % port.name, vm, 10)
- # Recv should return FAIL with 0 received data
- match, tmp = _on_guest("virt.recv('%s', 10, 1024, False)" %
- port.name, vm, 10)
- if match == 0:
- raise error.TestFail("Received data even when none was sent\n"
- "Data:\n%s" % tmp)
- elif match is None:
- raise error.TestFail("Timed out, probably in blocking mode\n"
- "Data:\n%s" % tmp)
- elif match != 1:
- raise error.TestFail("Unexpected fail\nMatch: %s\nData:\n%s" %
- (match, tmp))
- port.sock.sendall("1234567890")
- on_guest("virt.recv('%s', 10, 1024, False)" % port.name, vm, 10)
-
-
- def tbasic_loopback(vm, send_port, recv_port, data="Smoke test data"):
- """
- Easy loop back test with loop over only two ports.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param port: Port used in test.
- """
- if not send_port.is_open:
- send_port.open()
- if not recv_port.is_open:
- recv_port.open()
- on_guest("virt.loopback(['%s'], ['%s'], 1024, virt.LOOP_NONE)" %
- (send_port.name, recv_port.name), vm, 10)
- send_port.sock.sendall(data)
- tmp = ""
- i = 0
- while i <= 10:
- i += 1
- ret = select.select([recv_port.sock], [], [], 1.0)
- if ret:
- tmp += recv_port.sock.recv(1024)
- if len(tmp) >= len(data):
- break
- if tmp != data:
- raise error.TestFail("Incorrect data: '%s' != '%s'",
- data, tmp)
- _guest_exit_threads(vm, [send_port], [recv_port])
-
-
- def trmmod(vm, consoles):
- """
- Remove and load virtio_console kernel modules.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- on_guest("guest_exit()", vm, 5)
-
- on_guest("rmmod -f virtio_console && echo -n PASS: rmmod "
- "|| echo -n FAIL: rmmod", vm, 10)
- on_guest("modprobe virtio_console "
- "&& echo -n PASS: modprobe || echo -n FAIL: modprobe",
- vm, 10)
-
- init_guest(vm, consoles)
- try:
- cname = consoles[0][0].name
- except (IndexError):
- cname = consoles[1][0].name
- on_guest("virt.clean_port('%s'),1024" % cname, vm, 2)
-
-
- def tmax_serial_ports(vm, consoles):
- """
- Test maximum count of ports in guest machine.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- logging.debug("Count of serial ports: 30")
- vm[0].destroy(gracefully = False)
- (vm, consoles) = _vm_create(0, 30, False)
- try:
- init_guest(vm, consoles)
- except error.TestFail, ints:
- logging.info("Count of serial ports: 30")
- raise ints
- clean_reload_vm(vm, consoles, expected=True)
-
-
- def tmax_console_ports(vm, consoles):
- """
- Test maximum count of ports in guest machine.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- logging.debug("Count of console ports: 30")
- vm[0].destroy(gracefully = False)
- (vm, consoles) = _vm_create(30, 0, False)
- try:
- init_guest(vm, consoles)
- except error.TestFail, ints:
- logging.info("Count of console ports: 30")
- raise ints
- clean_reload_vm(vm, consoles, expected=True)
-
-
- def tmax_mix_serial_conosle_port(vm, consoles):
- """
- Test maximim count of ports in guest machine.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- logging.debug("Count of ports (serial+console): 30")
- vm[0].destroy(gracefully = False)
- (vm, consoles) = _vm_create(15, 15, False)
- try:
- init_guest(vm, consoles)
- except error.TestFail, ints:
- logging.info("Count of ports (serial+console): 30")
- raise ints
- clean_reload_vm(vm, consoles, expected=True)
-
-
- def tshutdown(vm, consoles):
- """
- Try to gently shutdown the machine. Virtio_console shouldn't block this.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- ports = []
- for console in consoles[0]:
- ports.append(console)
- for console in consoles[1]:
- ports.append(console)
- for port in ports:
- port.open()
- # If more than one, send data on the other ports
- for port in ports[1:]:
- on_guest("virt.close('%s')" % (port.name), vm, 2)
- on_guest("virt.open('%s')" % (port.name), vm, 2)
- try:
- os.system("dd if=/dev/random of='%s' bs=4096 >/dev/null 2>&1 &"
- % port.path)
- except:
- pass
- # Just start sending, it won't finish anyway...
- _on_guest("virt.send('%s', 1024**3, True, is_static=True)"
- % ports[0].name, vm, 1)
-
- # Let the computer transfer some bytes :-)
- time.sleep(2)
-
- # Power off the computer
- vm[0].destroy(gracefully=True)
- clean_reload_vm(vm, consoles, expected=True)
-
-
- def __tmigrate(vm, consoles, parms, offline=True):
- """
- An actual migration test. It creates loopback on guest from first port
- to all remaining ports. Than it sends and validates the data.
- During this it tries to migrate the vm n-times.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param parms: [media, no_migration, send-, recv-, loopback-buffer_len]
- """
- # PREPARE
- send_pt = consoles[parms[0]][0]
- recv_pts = consoles[parms[0]][1:]
- # TODO BUG: sendlen = max allowed data to be lost per one migration
- # TODO BUG: using SMP the data loss is upto 4 buffers
- # 2048 = char. dev. socket size, parms[2] = host->guest send buffer size
- sendlen = 2*2*max(2048, parms[2])
- if not offline: # TODO BUG: online migration causes more loses
- # TODO: Online migration lose n*buffer. n depends on the console
- # troughput. FIX or analyse it's cause.
- sendlen = 1000 * sendlen
- for p in recv_pts:
- if not p.is_open:
- p.open()
-
- if not send_pt.is_open:
- send_pt.open()
-
- threads = []
- queues = []
- verified = []
- for i in range(0, len(recv_pts)):
- queues.append(deque())
- verified.append(0)
-
- tmp = "'%s'" % recv_pts[0].name
- for recv_pt in recv_pts[1:]:
- tmp += ", '%s'" % (recv_pt.name)
- on_guest("virt.loopback(['%s'], [%s], %d, virt.LOOP_POLL)"
- % (send_pt.name, tmp, parms[4]), vm, 10)
-
- exit_event = threading.Event()
-
- # TEST
- thread = ThSendCheck(send_pt, exit_event, queues,
- parms[2])
- thread.start()
- threads.append(thread)
-
- for i in range(len(recv_pts)):
- thread = ThRecvCheck(recv_pts[i], queues[i], exit_event,
- parms[3], sendlen=sendlen)
- thread.start()
- threads.append(thread)
-
- i=0
- while i < 6:
- tmp = "%d data sent; " % threads[0].idx
- for thread in threads[1:]:
- tmp += "%d, " % thread.idx
- logging.debug("test_loopback: %s data received and verified",
- tmp[:-2])
- i+=1
- time.sleep(2)
-
-
- for j in range(parms[1]):
- vm[0] = virt_test_utils.migrate(vm[0], env, 3600, "exec", 0,
- offline)
- if not vm[1]:
- raise error.TestFail("Could not log into guest after migration")
- vm[1] = virt_test_utils.wait_for_login(vm[0], 0,
- float(params.get("boot_timeout", 100)),
- 0, 2)
- # OS is sometime a bit dizzy. DL=30
- _init_guest(vm, 30)
-
- i=0
- while i < 6:
- tmp = "%d data sent; " % threads[0].idx
- for thread in threads[1:]:
- tmp += "%d, " % thread.idx
- logging.debug("test_loopback: %s data received and verified",
- tmp[:-2])
- i+=1
- time.sleep(2)
- if not threads[0].is_alive():
- if exit_event.isSet():
- raise error.TestFail("Exit event emited, check the log for"
- "send/recv thread failure.")
- else:
- raise error.TestFail("Send thread died unexpectedly in "
- "migration %d", (j+1))
- for i in range(0, len(recv_pts)):
- if not threads[i+1].is_alive():
- raise error.TestFail("Recv thread %d died unexpectedly in "
- "migration %d", i, (j+1))
- if verified[i] == threads[i+1].idx:
- raise error.TestFail("No new data in %d console were "
- "transfered after migration %d"
- , i, (j+1))
- verified[i] = threads[i+1].idx
- logging.info("%d out of %d migration(s) passed" % ((j+1), parms[1]))
- # TODO detect recv-thread failure and throw out whole test
-
- # FINISH
- exit_event.set()
- # Send thread might fail to exit when the guest stucks
- i = 30
- while threads[0].is_alive():
- if i <= 0:
- raise error.TestFail("Send thread did not finish")
- time.sleep(1)
- i -= 1
- tmp = "%d data sent; " % threads[0].idx
- for thread in threads[1:]:
- thread.join()
- tmp += "%d, " % thread.idx
- logging.info("test_loopback: %s data received and verified during %d "
- "migrations", tmp[:-2], parms[1])
-
- # CLEANUP
- _guest_exit_threads(vm, [send_pt], recv_pts)
- del exit_event
- del threads[:]
-
-
- def _tmigrate(vm, consoles, parms, offline):
- """
- Wrapper which parses the params for __migrate test.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param parms: test parameters, multiple recievers allowed.
- '[{serialport,console}]:$no_migrations:send_buf_len:recv_buf_len:
- loopback_buf_len;...'
- """
- for param in parms.split(';'):
- if not param:
- continue
- if offline:
- logging.info("test_migrate_offline: params: %s", param)
- else:
- logging.info("test_migrate_online: params: %s", param)
- param = param.split(':')
- media = 1
- if param[0].isalpha():
- if param[0] == "console":
- param[0] = 0
- else:
- param[0] = 1
- else:
- param = [0] + param
- for i in range(1,5):
- if not param[i].isdigit():
- param[i] = 1
- else:
- param[i] = int(param[i])
-
- __tmigrate(vm, consoles, param, offline=offline)
-
-
- def tmigrate_offline(vm, consoles, parms):
- """
- Tests whether the virtio-{console,port} are able to survive the offline
- migration.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param parms: test parameters, multiple recievers allowed.
- '[{serialport,console}]:$no_migrations:send_buf_len:recv_buf_len:
- loopback_buf_len;...'
- """
- _tmigrate(vm, consoles, parms, offline=True)
-
-
- def tmigrate_online(vm, consoles, parms):
- """
- Tests whether the virtio-{console,port} are able to survive the online
- migration.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param parms: test parameters, multiple recievers allowed.
- '[{serialport,console}]:$no_migrations:send_buf_len:recv_buf_len:
- loopback_buf_len;...'
- """
- _tmigrate(vm, consoles, parms, offline=False)
-
-
- def _virtio_dev_create(vm, ports_name, pciid, id, console="no"):
- """
- Add virtio serialport device.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param ports_name: Structure of ports.
- @param pciid: Id of virtio-serial-pci device.
- @param id: Id of port.
- @param console: if "yes" inicialize console.
- """
- port = "serialport-"
- port_type = "virtserialport"
- if console == "yes":
- port = "console-"
- port_type = "virtconsole"
- port += "%d%d" % (pciid, id)
- ret = vm[0].monitors[0].cmd("device_add %s,"
- "bus=virtio-serial-pci%d.0,"
- "id=%s,"
- "name=%s"
- % (port_type, pciid, port, port))
- ports_name.append([ port, console])
- if ret != "":
- logging.error(ret)
-
-
- def _virtio_dev_del(vm, ports_name, pciid, id):
- """
- Del virtio serialport device.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param ports_name: Structure of ports.
- @param pciid: Id of virtio-serial-pci device.
- @param id: Id of port.
- """
- port = filter(lambda x: x[0].endswith("-%d%d" % (pciid, id)),
- ports_name)
- ret = vm[0].monitors[0].cmd("device_del %s"
- % (port[0][0]))
- ports_name.remove(port[0])
- if ret != "":
- logging.error(ret)
-
-
- def thotplug(vm, consoles, console="no", timeout=1):
- """
- Try hotplug function of virtio-consoles ports.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles.
- @param console: If "yes" inicialize console.
- @param timeout: Timeout between hotplug operations.
- """
- logging.info("Timeout between hotplug operations t=%fs" % timeout)
- _reset_vm(vm, consoles, 1, 1)
- ports_name = []
- ports_name.append(['serialport-1','no'])
- ports_name.append(['console-0','yes'])
-
- logging.info("Test correct initialization of hotplug ports")
- for id in range(1,5): #count of pci device
- ret = vm[0].monitors[0].cmd("device_add virtio-serial-pci,"
- "id=virtio-serial-pci%d" % (id))
- if ret != "":
- logging.error(ret)
- for i in range(id*5+5): #max port 30
- _virtio_dev_create(vm, ports_name, id, i, console)
- time.sleep(timeout)
-
- # Test correct initialization of hotplug ports
- time.sleep(10) # Timeout for port initialization
- _init_guest(vm, 10)
- on_guest('virt.init(%s)' % (ports_name), vm, 10)
-
- logging.info("Delete ports when ports are used")
- # Delete ports when ports are used.
- if not consoles[0][0].is_open:
- consoles[0][0].open()
- if not consoles[1][0].is_open:
- consoles[1][0].open()
- on_guest("virt.loopback(['%s'], ['%s'], 1024,"
- "virt.LOOP_POLL)" % (consoles[0][0].name,
- consoles[1][0].name), vm, 10)
- exit_event = threading.Event()
- send = ThSend(consoles[0][0].sock, "Data", exit_event, quiet = True)
- recv = ThRecv(consoles[1][0].sock, exit_event, quiet = True)
- send.start()
- time.sleep(2)
- recv.start()
-
- # Try to delete ports under load
- ret = vm[0].monitors[0].cmd("device_del serialport-1")
- ret += vm[0].monitors[0].cmd("device_del console-0")
- ports_name.remove(['serialport-1','no'])
- ports_name.remove(['console-0','yes'])
- if ret != "":
- logging.error(ret)
-
- exit_event.set()
- send.join()
- recv.join()
- on_guest("virt.exit_threads()", vm, 10)
- on_guest('guest_exit()', vm, 10)
-
- logging.info("Trying to add maximum count of ports to one pci device")
- # Try to add ports
- for i in range(30): # max port 30
- _virtio_dev_create(vm, ports_name, 0, i, console)
- time.sleep(timeout)
- _init_guest(vm, 10)
- time.sleep(10)
- on_guest('virt.init(%s)' % (ports_name), vm, 20)
- on_guest('guest_exit()', vm, 10)
-
- logging.info("Trying delete and add again part of ports")
- # Try to delete ports
- for i in range(25): # max port 30
- _virtio_dev_del(vm, ports_name, 0, i)
- time.sleep(timeout)
- _init_guest(vm, 10)
- on_guest('virt.init(%s)' % (ports_name), vm, 10)
- on_guest('guest_exit()', vm, 10)
-
- # Try to add ports
- for i in range(5): # max port 30
- _virtio_dev_create(vm, ports_name, 0, i, console)
- time.sleep(timeout)
- _init_guest(vm, 10)
- on_guest('virt.init(%s)' % (ports_name), vm, 10)
- on_guest('guest_exit()', vm, 10)
-
- logging.info("Trying to add and delete one port 100 times")
- # Try 100 times add and delete one port.
- for i in range(100):
- _virtio_dev_del(vm, ports_name, 0, 0)
- time.sleep(timeout)
- _virtio_dev_create(vm, ports_name, 0, 0, console)
- time.sleep(timeout)
- _init_guest(vm, 10)
- on_guest('virt.init(%s)' % (ports_name), vm, 10)
- on_guest('guest_exit()', vm, 10)
-
-
- def thotplug_no_timeout(vm, consoles, console="no"):
- """
- Start hotplug test without any timeout.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- @param console: If "yes" inicialize console.
- """
- thotplug(vm, consoles, console, 0)
-
-
- def thotplug_virtio_pci(vm, consoles):
- """
- Test hotplug of virtio-serial-pci.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close before rmmod.
- """
- vm[0].destroy(gracefully = False)
- (vm, consoles) = _vm_create(1, 1, False)
- id = 1
- ret = vm[0].monitors[0].cmd("device_add virtio-serial-pci,"
- "id=virtio-serial-pci%d" % (id))
- time.sleep(10)
- ret += vm[0].monitors[0].cmd("device_del virtio-serial-pci%d" % (id))
- time.sleep(10)
- ret += vm[0].monitors[0].cmd("device_add virtio-serial-pci,"
- "id=virtio-serial-pci%d" % (id))
- if ret != "":
- logging.error(ret)
-
-
- def tloopback(vm, consoles, params):
- """
- Virtio console loopback subtest.
-
- Creates loopback on the vm machine between send_pt and recv_pts
- ports and sends length amount of data through this connection.
- It validates the correctness of the data sent.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param params: test parameters, multiple recievers allowed.
- '$source_console_type@buffer_length:
- $destination_console_type1@$buffer_length:...:
- $loopback_buffer_length;...'
- """
- # PREPARE
- for param in params.split(';'):
- if not param:
- continue
- logging.info("test_loopback: params: %s", param)
- param = param.split(':')
- idx_serialport = 0
- idx_console = 0
- buf_len = []
- if (param[0].startswith('console')):
- send_pt = consoles[0][idx_console]
- idx_console += 1
- else:
- send_pt = consoles[1][idx_serialport]
- idx_serialport += 1
- if (len(param[0].split('@')) == 2):
- buf_len.append(int(param[0].split('@')[1]))
- else:
- buf_len.append(1024)
- recv_pts = []
- for parm in param[1:]:
- if (parm.isdigit()):
- buf_len.append(int(parm))
- break # buf_len is the last portion of param
- if (parm.startswith('console')):
- recv_pts.append(consoles[0][idx_console])
- idx_console += 1
- else:
- recv_pts.append(consoles[1][idx_serialport])
- idx_serialport += 1
- if (len(parm[0].split('@')) == 2):
- buf_len.append(int(parm[0].split('@')[1]))
- else:
- buf_len.append(1024)
- # There must be sum(idx_*) consoles + last item as loopback buf_len
- if len(buf_len) == (idx_console + idx_serialport):
- buf_len.append(1024)
-
- for p in recv_pts:
- if not p.is_open:
- p.open()
-
- if not send_pt.is_open:
- send_pt.open()
-
- if len(recv_pts) == 0:
- raise error.TestFail("test_loopback: incorrect recv consoles"
- "definition")
-
- threads = []
- queues = []
- for i in range(0, len(recv_pts)):
- queues.append(deque())
-
- tmp = "'%s'" % recv_pts[0].name
- for recv_pt in recv_pts[1:]:
- tmp += ", '%s'" % (recv_pt.name)
- on_guest("virt.loopback(['%s'], [%s], %d, virt.LOOP_POLL)"
- % (send_pt.name, tmp, buf_len[-1]), vm, 10)
-
- exit_event = threading.Event()
-
- # TEST
- thread = ThSendCheck(send_pt, exit_event, queues,
- buf_len[0])
- thread.start()
- threads.append(thread)
-
- for i in range(len(recv_pts)):
- thread = ThRecvCheck(recv_pts[i], queues[i], exit_event,
- buf_len[i + 1])
- thread.start()
- threads.append(thread)
-
- time.sleep(60)
- exit_event.set()
- threads[0].join()
- tmp = "%d data sent; " % threads[0].idx
- for thread in threads[1:]:
- thread.join()
- tmp += "%d, " % thread.idx
- logging.info("test_loopback: %s data received and verified",
- tmp[:-2])
-
- # Read-out all remaining data
- for recv_pt in recv_pts:
- while select.select([recv_pt.sock], [], [], 0.1)[0]:
- recv_pt.sock.recv(1024)
-
- _guest_exit_threads(vm, [send_pt], recv_pts)
-
- del exit_event
- del threads[:]
-
-
- def tperf(vm, consoles, params):
- """
- Tests performance of the virtio_console tunel. First it sends the data
- from host to guest and than back. It provides informations about
- computer utilisation and statistic informations about the troughput.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param params: test parameters:
- '$console_type@$buffer_length:$test_duration;...'
- """
- for param in params.split(';'):
- if not param:
- continue
- logging.info("test_perf: params: %s", param)
- param = param.split(':')
- duration = 60.0
- if len(param) > 1:
- try:
- duration = float(param[1])
- except:
- pass
- param = param[0].split('@')
- if len(param) > 1 and param[1].isdigit():
- buf_len = int(param[1])
- else:
- buf_len = 1024
- param = (param[0] == 'serialport')
- port = consoles[param][0]
-
- if not port.is_open:
- port.open()
-
- data = ""
- for i in range(buf_len):
- data += "%c" % random.randrange(255)
-
- exit_event = threading.Event()
- time_slice = float(duration) / 100
-
- # HOST -> GUEST
- on_guest('virt.loopback(["%s"], [], %d, virt.LOOP_NONE)' %
- (port.name, buf_len), vm, 10)
- thread = ThSend(port.sock, data, exit_event)
- stats = array.array('f', [])
- loads = utils.SystemLoad([(os.getpid(), 'autotest'),
- (vm[0].get_pid(), 'VM'), 0])
- loads.start()
- _time = time.time()
- thread.start()
- for i in range(100):
- stats.append(thread.idx)
- time.sleep(time_slice)
- _time = time.time() - _time - duration
- logging.info("\n" + loads.get_cpu_status_string()[:-1])
- logging.info("\n" + loads.get_mem_status_string()[:-1])
- exit_event.set()
- thread.join()
-
- # Let the guest read-out all the remaining data
- while not _on_guest("virt.poll('%s', %s)" %
- (port.name, select.POLLIN), vm, 10)[0]:
- time.sleep(1)
-
- _guest_exit_threads(vm, [port], [])
-
- if (_time > time_slice):
- logging.error(
- "Test ran %fs longer which is more than one time slice", _time)
- else:
- logging.debug("Test ran %fs longer", _time)
- stats = process_stats(stats[1:], time_slice * 1048576)
- logging.debug("Stats = %s", stats)
- logging.info("Host -> Guest [MB/s] (min/med/max) = %.3f/%.3f/%.3f",
- stats[0], stats[len(stats) / 2], stats[-1])
-
- del thread
-
- # GUEST -> HOST
- exit_event.clear()
- stats = array.array('f', [])
- on_guest("virt.send_loop_init('%s', %d)" % (port.name, buf_len),
- vm, 30)
- thread = ThRecv(port.sock, exit_event, buf_len)
- thread.start()
- loads.start()
- on_guest("virt.send_loop()", vm, 10)
- _time = time.time()
- for i in range(100):
- stats.append(thread.idx)
- time.sleep(time_slice)
- _time = time.time() - _time - duration
- logging.info("\n" + loads.get_cpu_status_string()[:-1])
- logging.info("\n" + loads.get_mem_status_string()[:-1])
- on_guest("virt.exit_threads()", vm, 10)
- exit_event.set()
- thread.join()
- if (_time > time_slice): # Deviation is higher than 1 time_slice
- logging.error(
- "Test ran %fs longer which is more than one time slice", _time)
- else:
- logging.debug("Test ran %fs longer", _time)
- stats = process_stats(stats[1:], time_slice * 1048576)
- logging.debug("Stats = %s", stats)
- logging.info("Guest -> Host [MB/s] (min/med/max) = %.3f/%.3f/%.3f",
- stats[0], stats[len(stats) / 2], stats[-1])
-
- del thread
- del exit_event
-
-
- def _clean_ports(vm, consoles):
- """
- Read all data from all ports, in both sides of each port.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be clean.
- """
- for ctype in consoles:
- for port in ctype:
- openned = port.is_open
- port.clean_port()
- on_guest("virt.clean_port('%s'),1024" % port.name, vm, 10)
- if not openned:
- port.close()
- on_guest("virt.close('%s'),1024" % port.name, vm, 10)
-
-
- def clean_ports(vm, consoles):
- """
- Clean state of all ports and set port to default state.
- Default state:
- No data on port or in port buffer.
- Read mode = blocking.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be clean.
- """
- # Check if python is still alive
- logging.info("CLEANING")
- match, tmp = _on_guest("is_alive()", vm, 10)
- if (match is None) or (match != 0):
- logging.error("Python died/is stucked/have remaining threads")
- logging.debug(tmp)
- try:
- kernel_bug = _search_kernel_crashlog(vm[0].serial_console, 10)
- if kernel_bug is not None:
- logging.error(kernel_bug)
- raise error.TestFail("Kernel crash.")
-
- if vm[4] == True:
- raise error.TestFail("Kernel crash.")
- match, tmp = _on_guest("guest_exit()", vm, 10)
- if (match is None) or (match == 0):
- vm[1].close()
- vm[1] = virt_test_utils.wait_for_login(vm[0], 0,
- float(params.get("boot_timeout", 5)),
- 0, 10)
- on_guest("killall -9 python "
- "&& echo -n PASS: python killed"
- "|| echo -n PASS: python was already dead",
- vm, 10)
-
- init_guest(vm, consoles)
- _clean_ports(vm, consoles)
-
- except (error.TestFail, aexpect.ExpectError,
- Exception), inst:
- logging.error(inst)
- logging.error("Virtio-console driver is irreparably"
- " blocked. Every comd end with sig KILL."
- "Trying to reboot vm to continue testing...")
- try:
- vm[0].destroy(gracefully = True)
- (vm[0], vm[1], vm[3]) = _restore_vm()
- except (kvm_monitor.MonitorProtocolError):
- logging.error("Qemu is blocked. Monitor no longer "
- "communicates")
- vm[0].destroy(gracefully = False)
- os.system("kill -9 %d" % (vm[0].get_pid()))
- (vm[0], vm[1], vm[3]) = _restore_vm()
- init_guest(vm, consoles)
- cname = ""
- try:
- cname = consoles[0][0].name
- except (IndexError):
- cname = consoles[1][0].name
- match = _on_guest("virt.clean_port('%s'),1024" %
- cname, vm, 10)[0]
-
- if (match is None) or (match != 0):
- raise error.TestFail("Virtio-console driver is irreparably "
- "blocked. Every comd ended with sig "
- "KILL. The restart didn't help")
- _clean_ports(vm, consoles)
-
-
- def _reset_vm(vm, consoles, no_console=1, no_serialport=1):
- """
- Destroy and reload vm.
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be close and than renew.
- @param no_console: Number of desired virtconsoles.
- @param no_serialport: Number of desired virtserialports.
- """
- vm[0].destroy(gracefully=False)
- shutil.rmtree(vm[2]) # Remove virtio sockets tmp directory
- (_vm, _consoles) = _vm_create(no_console, no_serialport)
- consoles[:] = _consoles[:]
- vm[:] = _vm[:]
-
-
- def clean_reload_vm(vm, consoles, expected=False):
- """
- Reloads and boots the damaged vm
-
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Consoles which should be clean.
- """
- if expected:
- logging.info("Scheduled vm reboot")
- else:
- logging.info("SCHWARZENEGGER is CLEANING")
- _reset_vm(vm, consoles, len(consoles[0]), len(consoles[1]))
- init_guest(vm, consoles)
-
-
- def test_smoke(test, vm, consoles, params, global_params):
- """
- Virtio console smoke test.
-
- Tests the basic functionalities (poll, read/write with and without
- connected host, etc.
-
- @param test: Main test object.
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param params: Test parameters '$console_type:$data;...'
- @param global_params: Params defined by tests_base.conf.
- """
- # PREPARE
- if (global_params.get('smoke_test') == "yes"):
- for param in params.split(';'):
- if not param:
- continue
- headline = "test_smoke: params: %s" % (param)
- logging.info(headline)
- param = param.split(':')
- if len(param) > 1:
- data = param[1]
- else:
- data = "Smoke test data"
- param = (param[0] == 'serialport')
- send_pt = consoles[param][0]
- recv_pt = consoles[param][1]
- subtest.headline(headline)
- subtest.do_test(tcheck_zero_sym, [vm], cleanup=False)
- subtest.do_test(topen, [vm, send_pt], True)
- subtest.do_test(tclose, [vm, send_pt], True)
- subtest.do_test(tmulti_open, [vm, send_pt])
- subtest.do_test(tpolling, [vm, send_pt])
- subtest.do_test(tsigio, [vm, send_pt])
- subtest.do_test(tlseek, [vm, send_pt])
- subtest.do_test(trw_host_offline, [vm, send_pt])
- subtest.do_test(trw_host_offline_big_data, [vm, send_pt],
- cleanup=False)
- subtest.do_test(trw_notconnect_guest,
- [vm, send_pt, consoles])
- subtest.do_test(trw_nonblocking_mode, [vm, send_pt])
- subtest.do_test(trw_blocking_mode, [vm, send_pt])
- subtest.do_test(tbasic_loopback, [vm, send_pt, recv_pt, data],
- True)
-
-
- def test_multiport(test, vm, consoles, params, global_params):
- """
- This is group of test which test virtio_console in maximal load and
- with multiple ports.
-
- @param test: Main test object.
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param params: Test parameters '$console_type:$data;...'
- @param global_params: Params defined by tests_base.conf.
- """
- subtest.headline("test_multiport:")
- # Test Loopback
- if (global_params.get('loopback_test') == "yes"):
- subtest.do_test(tloopback, [vm, consoles, params[0]])
-
- # Test Performance
- if (global_params.get('perf_test') == "yes"):
- subtest.do_test(tperf, [vm, consoles, params[1]])
-
-
- def test_destructive(test, vm, consoles, global_params, params):
- """
- This is group of tests which might be destructive.
-
- @param test: Main test object.
- @param vm: Target virtual machine [vm, session, tmp_dir, ser_session].
- @param consoles: Field of virtio ports with the minimum of 2 items.
- @param global_params: Params defined by tests_base.conf.
- @param params: Dictionary of subtest params from tests_base.conf.
- """
- subtest.headline("test_destructive:")
- # Uses stronger clean up function
- (_cleanup_func, _cleanup_args) = subtest.get_cleanup_func()
- subtest.set_cleanup_func(clean_reload_vm, [vm, consoles])
-
- if (global_params.get('rmmod_test') == "yes"):
- subtest.do_test(trmmod,[vm, consoles])
- if (global_params.get('max_ports_test') == "yes"):
- subtest.do_test(tmax_serial_ports, [vm, consoles])
- subtest.do_test(tmax_console_ports, [vm, consoles])
- subtest.do_test(tmax_mix_serial_conosle_port, [vm, consoles])
- if (global_params.get('shutdown_test') == "yes"):
- subtest.do_test(tshutdown, [vm, consoles])
- if (global_params.get('migrate_offline_test') == "yes"):
- subtest.do_test(tmigrate_offline,
- [vm, consoles, params['tmigrate_offline_params']])
- if (global_params.get('migrate_online_test') == "yes"):
- subtest.do_test(tmigrate_online,
- [vm, consoles, params['tmigrate_online_params']])
- if (global_params.get('hotplug_serial_test') == "yes"):
- subtest.do_test(thotplug, [vm, consoles])
- subtest.do_test(thotplug_no_timeout, [vm, consoles])
- if (global_params.get('hotplug_console_test') == "yes"):
- subtest.do_test(thotplug, [vm, consoles, "yes"])
- subtest.do_test(thotplug_no_timeout, [vm, consoles, "yes"])
- if (global_params.get('hotplug_pci_test') == "yes"):
- subtest.do_test(thotplug_virtio_pci, [vm, consoles])
-
- subtest.set_cleanup_func(_cleanup_func, _cleanup_args)
-
-
- # INITIALIZE
- if "extra_params" in params:
- standard_extra_params = params['extra_params']
- else:
- standard_extra_params = ""
-
- tsmoke_params = params.get('virtio_console_smoke', '')
- tloopback_params = params.get('virtio_console_loopback', '')
- tperf_params = params.get('virtio_console_perf', '')
- tmigrate_offline_params = params.get('virtio_console_migration_offline', '')
- tmigrate_online_params = params.get('virtio_console_migration_online', '')
-
- # destructive params
- tdestructive_params = {}
- tdestructive_params['tmigrate_offline_params'] = tmigrate_offline_params
- tdestructive_params['tmigrate_online_params'] = tmigrate_online_params
-
- no_serialports = int(params.get('virtio_console_no_serialports', 0))
- no_consoles = int(params.get('virtio_console_no_consoles', 0))
- # consoles required for Smoke test
- if tsmoke_params.count('serialport'):
- no_serialports = max(2, no_serialports)
- if tsmoke_params.count('console'):
- no_consoles = max(2, no_consoles)
- # consoles required for Loopback test
- for param in tloopback_params.split(';'):
- no_serialports = max(no_serialports, param.count('serialport'))
- no_consoles = max(no_consoles, param.count('console'))
- # consoles required for Performance test
- if tperf_params.count('serialport'):
- no_serialports = max(1, no_serialports)
- if tperf_params.count('console'):
- no_consoles = max(1, no_consoles)
- # consoles required for Migration offline test
- if tmigrate_offline_params.count('serial'):
- no_serialports = max(2, no_serialports)
- if tmigrate_offline_params.count('console'):
- no_consoles = max(2, no_consoles)
- if tmigrate_online_params.count('serial'):
- no_serialports = max(2, no_serialports)
- if tmigrate_online_params.count('console'):
- no_consoles = max(2, no_consoles)
-
- if no_serialports + no_consoles == 0:
- raise error.TestFail("No tests defined, probably incorrect "
- "configuration in tests_base.cfg")
-
- vm, consoles = _vm_create(no_consoles, no_serialports)
-
- # Copy virtio_console_guest.py into guests
- pwd = os.path.join(os.environ['AUTODIR'], 'tests/kvm')
- vksmd_src = os.path.join(pwd, "scripts/virtio_console_guest.py")
- dst_dir = "/tmp"
-
- vm[0].copy_files_to(vksmd_src, dst_dir)
-
- # ACTUAL TESTING
- # Defines all available consoles; tests udev and sysfs
-
- subtest = SubTest()
- try:
- init_guest(vm, consoles)
-
- subtest.set_cleanup_func(clean_ports, [vm, consoles])
- # Test Smoke
- test_smoke(subtest, vm, consoles, tsmoke_params, params)
-
- # Test multiport functionality and performance.
- test_multiport(subtest, vm, consoles, [tloopback_params, tperf_params],
- params)
-
- #Test destructive test.
- test_destructive(subtest, vm, consoles, params, tdestructive_params)
- finally:
- logging.info(("Summary: %d tests passed %d test failed :\n" %
- (subtest.passed, subtest.failed)) +
- subtest.get_text_result())
-
- if subtest.is_failed():
- raise error.TestFail("%d out of %d virtio console tests failed" %
- (subtest.failed, (subtest.passed+subtest.failed)))
-
-
- # CLEANUP
- vm[1].close()
- vm[0].destroy(gracefully=False)
- shutil.rmtree(vm[2])
diff --git a/client/tests/kvm/tests/vmstop.py b/client/tests/kvm/tests/vmstop.py
deleted file mode 100644
index 441ddb9..0000000
--- a/client/tests/kvm/tests/vmstop.py
+++ /dev/null
@@ -1,83 +0,0 @@
-import logging, time, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils
-
-
-def run_vmstop(test, params, env):
- """
- KVM guest stop test:
- 1) Log into a guest
- 2) Copy a file into guest
- 3) Stop guest
- 4) Check the status through monitor
- 5) Check the session
- 6) Migrat the vm to a file twice and compare them.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = float(params.get("login_timeout", 240))
- session = vm.wait_for_login(timeout=timeout)
-
- save_path = params.get("save_path", "/tmp")
- clean_save = params.get("clean_save") == "yes"
- save1 = os.path.join(save_path, "save1")
- save2 = os.path.join(save_path, "save2")
-
- guest_path = params.get("guest_path", "/tmp")
- file_size = params.get("file_size", "1000")
-
- try:
- utils.run("dd if=/dev/zero of=/tmp/file bs=1M count=%s" % file_size)
- # Transfer file from host to guest, we didn't expect the finish of
- # transfer, we just let it to be a kind of stress in guest.
- bg = virt_utils.Thread(vm.copy_files_to, ("/tmp/file", guest_path),
- dict(verbose=True, timeout=60))
- logging.info("Start the background transfer")
- bg.start()
-
- try:
- # wait for the transfer start
- time.sleep(5)
- logging.info("Stop the VM")
- vm.monitor.cmd("stop")
-
- # check with monitor
- logging.info("Check the status through monitor")
- if "paused" not in vm.monitor.info("status"):
- raise error.TestFail("Guest did not pause after sending stop")
-
- # check through session
- logging.info("Check the session")
- if session.is_responsive():
- raise error.TestFail("Session still alive after sending stop")
-
- # Check with the migration file
- logging.info("Save and check the state files")
- for p in [save1, save2]:
- vm.save_to_file(p)
- time.sleep(1)
- if not os.path.isfile(p):
- raise error.TestFail("VM failed to save state file %s" % p)
-
- # Fail if we see deltas
- md5_save1 = utils.hash_file(save1)
- md5_save2 = utils.hash_file(save2)
- if md5_save1 != md5_save2:
- raise error.TestFail("The produced state files differ")
- finally:
- bg.join(suppress_exception=True)
-
- finally:
- session.close()
- if clean_save:
- logging.debug("Clean the state files")
- if os.path.isfile(save1):
- os.remove(save1)
- if os.path.isfile(save2):
- os.remove(save2)
- vm.monitor.cmd("cont")
diff --git a/client/tests/kvm/unattended/Fedora-10.ks b/client/tests/kvm/unattended/Fedora-10.ks
deleted file mode 100644
index 081d41a..0000000
--- a/client/tests/kvm/unattended/Fedora-10.ks
+++ /dev/null
@@ -1,39 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-keyboard us
-key --skip
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-reboot
-poweroff
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-
diff --git a/client/tests/kvm/unattended/Fedora-11.ks b/client/tests/kvm/unattended/Fedora-11.ks
deleted file mode 100644
index c339220..0000000
--- a/client/tests/kvm/unattended/Fedora-11.ks
+++ /dev/null
@@ -1,39 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-poweroff
-
-clearpart --all --initlabel
-autopart
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-%end
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-%end
diff --git a/client/tests/kvm/unattended/Fedora-12.ks b/client/tests/kvm/unattended/Fedora-12.ks
deleted file mode 100644
index c339220..0000000
--- a/client/tests/kvm/unattended/Fedora-12.ks
+++ /dev/null
@@ -1,39 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-poweroff
-
-clearpart --all --initlabel
-autopart
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-%end
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-%end
diff --git a/client/tests/kvm/unattended/Fedora-13.ks b/client/tests/kvm/unattended/Fedora-13.ks
deleted file mode 100644
index c339220..0000000
--- a/client/tests/kvm/unattended/Fedora-13.ks
+++ /dev/null
@@ -1,39 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-poweroff
-
-clearpart --all --initlabel
-autopart
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-%end
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-%end
diff --git a/client/tests/kvm/unattended/Fedora-14.ks b/client/tests/kvm/unattended/Fedora-14.ks
deleted file mode 100644
index e1323cd..0000000
--- a/client/tests/kvm/unattended/Fedora-14.ks
+++ /dev/null
@@ -1,40 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="rd_NO_PLYMOUTH console=tty0 console=ttyS0,115200"
-zerombr
-poweroff
-
-clearpart --all --initlabel
-autopart
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-dmidecode
-%end
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-%end
diff --git a/client/tests/kvm/unattended/Fedora-15.ks b/client/tests/kvm/unattended/Fedora-15.ks
deleted file mode 100644
index ea15d80..0000000
--- a/client/tests/kvm/unattended/Fedora-15.ks
+++ /dev/null
@@ -1,40 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-poweroff
-
-clearpart --all --initlabel
-autopart
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-dmidecode
-%end
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
-%end
diff --git a/client/tests/kvm/unattended/Fedora-8.ks b/client/tests/kvm/unattended/Fedora-8.ks
deleted file mode 100644
index 9403191..0000000
--- a/client/tests/kvm/unattended/Fedora-8.ks
+++ /dev/null
@@ -1,37 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-keyboard us
-key --skip
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-reboot
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/Fedora-9.ks b/client/tests/kvm/unattended/Fedora-9.ks
deleted file mode 100644
index a7d5399..0000000
--- a/client/tests/kvm/unattended/Fedora-9.ks
+++ /dev/null
@@ -1,38 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-keyboard us
-key --skip
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-reboot
-poweroff
-
-%packages
-@base
-@development-libs
-@development-tools
-ntpdate
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/OpenSUSE-11.xml b/client/tests/kvm/unattended/OpenSUSE-11.xml
deleted file mode 100644
index 0f11ac9..0000000
--- a/client/tests/kvm/unattended/OpenSUSE-11.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE profile>
-<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
- <bootloader>
- <device_map config:type="list">
- <device_map_entry>
- <firmware>hd0</firmware>
- <linux>/dev/vda</linux>
- </device_map_entry>
- </device_map>
- <global>
- <activate>true</activate>
- <boot_boot>false</boot_boot>
- <boot_extended>false</boot_extended>
- <boot_mbr>false</boot_mbr>
- <boot_root>true</boot_root>
- <debug>false</debug>
- <generic_mbr>false</generic_mbr>
- <gfxmenu>/boot/message</gfxmenu>
- <hiddenmenu>false</hiddenmenu>
- <lines_cache_id>2</lines_cache_id>
- <timeout config:type="integer">8</timeout>
- </global>
- <initrd_modules config:type="list">
- <initrd_module>
- <module>processor</module>
- </initrd_module>
- <initrd_module>
- <module>thermal</module>
- </initrd_module>
- <initrd_module>
- <module>ata_piix</module>
- </initrd_module>
- <initrd_module>
- <module>virtio_pci</module>
- </initrd_module>
- <initrd_module>
- <module>fan</module>
- </initrd_module>
- <initrd_module>
- <module>jbd</module>
- </initrd_module>
- <initrd_module>
- <module>ext3</module>
- </initrd_module>
- <initrd_module>
- <module>virtio_blk</module>
- </initrd_module>
- <initrd_module>
- <module>edd</module>
- </initrd_module>
- </initrd_modules>
- <append>console=tty0 console=ttyS0,115200</append>
- <loader_type>grub</loader_type>
- <sections config:type="list"/>
- </bootloader>
- <firewall>
- <FW_DEV_DMZ></FW_DEV_DMZ>
- <FW_DEV_EXT></FW_DEV_EXT>
- <FW_DEV_INT></FW_DEV_INT>
- <enable_firewall config:type="boolean">false</enable_firewall>
- <start_firewall config:type="boolean">false</start_firewall>
- </firewall>
- <general>
- <ask-list config:type="list"/>
- <mode>
- <confirm config:type="boolean">false</confirm>
- <halt config:type="boolean">true</halt>
- </mode>
- <mouse>
- <id>none</id>
- </mouse>
- <signature-handling>
- <accept_file_without_checksum config:type="boolean">true</accept_file_without_checksum>
- <accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
- <accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
- <accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
- <accept_verification_failed config:type="boolean">false</accept_verification_failed>
- <import_gpg_key config:type="boolean">true</import_gpg_key>
- </signature-handling>
- </general>
- <groups config:type="list">
- <group>
- <gid>33</gid>
- <group_password>x</group_password>
- <groupname>video</groupname>
- <userlist>linux</userlist>
- </group>
- <group>
- <gid>16</gid>
- <group_password>x</group_password>
- <groupname>dialout</groupname>
- <userlist>linux</userlist>
- </group>
- </groups>
- <keyboard>
- <keyboard_values>
- <numlock>bios</numlock>
- <tty>tty1 tty2 tty3 tty4 tty5 tty6</tty>
- </keyboard_values>
- <keymap>english-us</keymap>
- </keyboard>
- <networking>
- <dhcp_options>
- <dhclient_additional_options></dhclient_additional_options>
- <dhclient_client_id></dhclient_client_id>
- <dhclient_hostname_option>AUTO</dhclient_hostname_option>
- </dhcp_options>
- <dns>
- <dhcp_hostname config:type="boolean">true</dhcp_hostname>
- <dhcp_resolv config:type="boolean">true</dhcp_resolv>
- </dns>
- <interfaces config:type="list">
- <interface>
- <bootproto>dhcp</bootproto>
- <device>eth0</device>
- <startmode>auto</startmode>
- <usercontrol>no</usercontrol>
- </interface>
- </interfaces>
- <managed config:type="boolean">false</managed>
- <routing>
- <ip_forward config:type="boolean">false</ip_forward>
- </routing>
- </networking>
- <partitioning config:type="list">
- <drive>
- <device>/dev/vda</device>
- <partitions config:type="list"/>
- <type config:type="symbol">CT_DISK</type>
- <use>all</use>
- </drive>
- </partitioning>
- <report>
- <errors>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">0</timeout>
- </errors>
- <messages>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">0</timeout>
- </messages>
- <warnings>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">0</timeout>
- </warnings>
- <yesno_messages>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">0</timeout>
- </yesno_messages>
- </report>
- <scripts>
- <init-scripts config:type="list">
- <script>
- <debug config:type="boolean">true</debug>
- <filename>config</filename>
- <source><![CDATA[dhclient eth0
-chkconfig sshd on
-sed -i -e 's/\(PasswordAuthentication\s\)no/\1yes/g' /etc/ssh/sshd_config
-service sshd restart
-]]></source>
- </script>
- </init-scripts>
- <pre-scripts config:type="list">
- <script>
- <debug config:type="boolean">true</debug>
- <feedback config:type="boolean">false</feedback>
- <filename>disksetup</filename>
- <interpreter>shell</interpreter>
- <source><![CDATA[ if fdisk -l | grep sda -c >0;then sed -e 's/\(.*\/dev\/\)vda\(.*\)/\1sda\2/g' /tmp/profile/autoinst.xml>/tmp/profile/modified.xml; fi
-]]></source>
- </script>
- </pre-scripts>
- </scripts>
- <software>
- <packages config:type="list">
- <package>autoyast2-installation</package>
- <package>dhcp-client</package>
- <package>dhcp-tools</package>
- <package>autoyast2-installation</package>
- <package>autoyast2-installation</package>
- <package>autoyast2-installation</package>
- </packages>
- <patterns config:type="list">
- <pattern>apparmor</pattern>
- <pattern>apparmor_opt</pattern>
- <pattern>base</pattern>
- <pattern>console</pattern>
- <pattern>devel_basis</pattern>
- <pattern>enhanced_base</pattern>
- <pattern>enhanced_base_opt</pattern>
- <pattern>sw_management</pattern>
- <pattern>yast2_basis</pattern>
- <pattern>yast2_install_wf</pattern>
- </patterns>
- </software>
- <user_defaults>
- <group>100</group>
- <groups>video,dialout</groups>
- <home>/home</home>
- <inactive>-1</inactive>
- <shell>/bin/bash</shell>
- <skel>/etc/skel</skel>
- </user_defaults>
- <users config:type="list">
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>linux</fullname>
- <gid>100</gid>
- <home>/home/linux</home>
- <password_settings>
- <inact>-1</inact>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/bash</shell>
- <uid>1000</uid>
- <user_password>$2a$05$bgtKW4IJKSS04W4GdU4ckeZL9yVHZdTmZz6F.gAxw9xItSfmt.zci</user_password>
- <username>linux</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>root</fullname>
- <gid>0</gid>
- <home>/root</home>
- <password_settings>
- <inact>-1</inact>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/bash</shell>
- <uid>0</uid>
- <user_password>$2a$05$yit2ieOcDslJrkEqLo8D3ej1ZNWNX79iAaT885W.aDTZ581ZwBD8S</user_password>
- <username>root</username>
- </user>
- </users>
-</profile>
diff --git a/client/tests/kvm/unattended/RHEL-3-series.ks b/client/tests/kvm/unattended/RHEL-3-series.ks
deleted file mode 100644
index a42fbdf..0000000
--- a/client/tests/kvm/unattended/RHEL-3-series.ks
+++ /dev/null
@@ -1,36 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-langsupport --default=en_US.UTF-8 en_US.UTF-9
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-timezone America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-clearpart --all --initlabel
-autopart
-reboot
-mouse generic3ps/2
-skipx
-
-%packages --resolvedeps
-@ base
-@ development-libs
-@ development-tools
-ntp
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('/bin/ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up')
-os.system('/bin/route add default gw 10.0.2.2')
-os.system('chkconfig sshd on')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/RHEL-4-series.ks b/client/tests/kvm/unattended/RHEL-4-series.ks
deleted file mode 100644
index 83ae918..0000000
--- a/client/tests/kvm/unattended/RHEL-4-series.ks
+++ /dev/null
@@ -1,37 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-langsupport --default=en_US.UTF-8 en_US.UTF-9
-keyboard us
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-poweroff
-
-%packages
-@ base
-@ development-libs
-@ development-tools
-ntp
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/RHEL-5-series.ks b/client/tests/kvm/unattended/RHEL-5-series.ks
deleted file mode 100644
index 7ffd19f..0000000
--- a/client/tests/kvm/unattended/RHEL-5-series.ks
+++ /dev/null
@@ -1,39 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-keyboard us
-key --skip
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-poweroff
-
-%packages
-@base
-@development-libs
-@development-tools
-kexec-tools
-watchdog
-ntp
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/RHEL-6-series.ks b/client/tests/kvm/unattended/RHEL-6-series.ks
deleted file mode 100644
index 166c499..0000000
--- a/client/tests/kvm/unattended/RHEL-6-series.ks
+++ /dev/null
@@ -1,42 +0,0 @@
-install
-KVM_TEST_MEDIUM
-text
-reboot
-lang en_US.UTF-8
-keyboard us
-key --skip
-network --bootproto dhcp
-rootpw 123456
-firewall --enabled --ssh
-selinux --enforcing
-timezone --utc America/New_York
-firstboot --disable
-bootloader --location=mbr --append="console=tty0 console=ttyS0,115200"
-zerombr
-clearpart --all --initlabel
-autopart
-poweroff
-
-%packages
-@base
-@core
-@development
-@additional-devel
-@debugging-tools
-@network-tools
-NetworkManager
-ntpdate
-watchdog
-
-%post --interpreter /usr/bin/python
-import socket, os
-os.system('dhclient')
-os.system('chkconfig sshd on')
-os.system('iptables -F')
-os.system('echo 0 > /selinux/enforce')
-server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-server.bind(('', 12323))
-server.listen(1)
-(client, addr) = server.accept()
-client.send("done")
-client.close()
diff --git a/client/tests/kvm/unattended/SLES-11.xml b/client/tests/kvm/unattended/SLES-11.xml
deleted file mode 100644
index 16c25d0..0000000
--- a/client/tests/kvm/unattended/SLES-11.xml
+++ /dev/null
@@ -1,891 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE profile>
-<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
- <add-on/>
- <bootloader>
- <global>
- <activate>true</activate>
- <boot_boot>false</boot_boot>
- <boot_extended>false</boot_extended>
- <boot_mbr>false</boot_mbr>
- <boot_root>true</boot_root>
- <debug>false</debug>
- <default>SUSE Linux Enterprise Server 11 - 2.6.27.19-5</default>
- <generic_mbr>true</generic_mbr>
- <hiddenmenu>false</hiddenmenu>
- <lines_cache_id>2</lines_cache_id>
- <timeout config:type="integer">8</timeout>
- <trusted_grub>false</trusted_grub>
- </global>
- <initrd_modules config:type="list">
- <initrd_module>
- <module>processor</module>
- </initrd_module>
- <initrd_module>
- <module>thermal</module>
- </initrd_module>
- <initrd_module>
- <module>ata_piix</module>
- </initrd_module>
- <initrd_module>
- <module>ata_generic</module>
- </initrd_module>
- <initrd_module>
- <module>piix</module>
- </initrd_module>
- <initrd_module>
- <module>ide_pci_generic</module>
- </initrd_module>
- <initrd_module>
- <module>fan</module>
- </initrd_module>
- <initrd_module>
- <module>jbd</module>
- </initrd_module>
- <initrd_module>
- <module>ext3</module>
- </initrd_module>
- <initrd_module>
- <module>edd</module>
- </initrd_module>
- </initrd_modules>
- <append>console=tty0 console=ttyS0,115200</append>
- <loader_type>grub</loader_type>
- <sections config:type="list"/>
- </bootloader>
- <ca_mgm>
- <CAName>YaST_Default_CA</CAName>
- <ca_commonName>YaST Default CA (linux-h1i4)</ca_commonName>
- <country>US</country>
- <password>ENTER PASSWORD HERE</password>
- <server_commonName>linux-h1i4.site</server_commonName>
- <server_email>postmaster@site</server_email>
- <takeLocalServerName config:type="boolean">false</takeLocalServerName>
- </ca_mgm>
- <deploy_image>
- <image_installation config:type="boolean">false</image_installation>
- </deploy_image>
- <firewall>
- <FW_ALLOW_FW_BROADCAST_DMZ>no</FW_ALLOW_FW_BROADCAST_DMZ>
- <FW_ALLOW_FW_BROADCAST_EXT>no</FW_ALLOW_FW_BROADCAST_EXT>
- <FW_ALLOW_FW_BROADCAST_INT>no</FW_ALLOW_FW_BROADCAST_INT>
- <FW_CONFIGURATIONS_EXT>sshd</FW_CONFIGURATIONS_EXT>
- <FW_DEV_DMZ></FW_DEV_DMZ>
- <FW_DEV_EXT>any</FW_DEV_EXT>
- <FW_DEV_INT></FW_DEV_INT>
- <FW_IGNORE_FW_BROADCAST_DMZ>no</FW_IGNORE_FW_BROADCAST_DMZ>
- <FW_IGNORE_FW_BROADCAST_EXT>yes</FW_IGNORE_FW_BROADCAST_EXT>
- <FW_IGNORE_FW_BROADCAST_INT>no</FW_IGNORE_FW_BROADCAST_INT>
- <FW_IPSEC_TRUST>no</FW_IPSEC_TRUST>
- <FW_LOAD_MODULES>nf_conntrack_netbios_ns</FW_LOAD_MODULES>
- <FW_LOG_ACCEPT_ALL>no</FW_LOG_ACCEPT_ALL>
- <FW_LOG_ACCEPT_CRIT>yes</FW_LOG_ACCEPT_CRIT>
- <FW_LOG_DROP_ALL>no</FW_LOG_DROP_ALL>
- <FW_LOG_DROP_CRIT>yes</FW_LOG_DROP_CRIT>
- <FW_MASQUERADE>no</FW_MASQUERADE>
- <FW_PROTECT_FROM_INT>no</FW_PROTECT_FROM_INT>
- <FW_ROUTE>no</FW_ROUTE>
- <enable_firewall config:type="boolean">false</enable_firewall>
- <start_firewall config:type="boolean">false</start_firewall>
- </firewall>
- <general>
- <ask-list config:type="list"/>
- <mode>
- <confirm config:type="boolean">false</confirm>
- <halt config:type="boolean">true</halt>
- </mode>
- <mouse>
- <id>none</id>
- </mouse>
- <proposals config:type="list"/>
- <signature-handling>
- <accept_file_without_checksum config:type="boolean">true</accept_file_without_checksum>
- <accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
- <accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
- <accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
- <accept_verification_failed config:type="boolean">false</accept_verification_failed>
- <import_gpg_key config:type="boolean">true</import_gpg_key>
- </signature-handling>
- </general>
- <groups config:type="list">
- <group>
- <gid>1000</gid>
- <group_password>$1$9ibtMhyS$uY16P2nxSWgejk4Ffz/LB0</group_password>
- <groupname>users</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>19</gid>
- <group_password>x</group_password>
- <groupname>floppy</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>1</gid>
- <group_password>x</group_password>
- <groupname>bin</groupname>
- <userlist>daemon</userlist>
- </group>
- <group>
- <gid>41</gid>
- <group_password>x</group_password>
- <groupname>xok</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>65533</gid>
- <group_password>x</group_password>
- <groupname>nobody</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>43</gid>
- <group_password>x</group_password>
- <groupname>modem</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>5</gid>
- <group_password>x</group_password>
- <groupname>tty</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>7</gid>
- <group_password>x</group_password>
- <groupname>lp</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>104</gid>
- <group_password>!</group_password>
- <groupname>uuidd</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>51</gid>
- <group_password>!</group_password>
- <groupname>postfix</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>111</gid>
- <group_password>!</group_password>
- <groupname>gdm</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>65534</gid>
- <group_password>x</group_password>
- <groupname>nogroup</groupname>
- <userlist>nobody</userlist>
- </group>
- <group>
- <gid>101</gid>
- <group_password>!</group_password>
- <groupname>messagebus</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>59</gid>
- <group_password>!</group_password>
- <groupname>maildrop</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>33</gid>
- <group_password>x</group_password>
- <groupname>video</groupname>
- <userlist>linux</userlist>
- </group>
- <group>
- <gid>3</gid>
- <group_password>x</group_password>
- <groupname>sys</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>15</gid>
- <group_password>x</group_password>
- <groupname>shadow</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>20</gid>
- <group_password>x</group_password>
- <groupname>cdrom</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>21</gid>
- <group_password>x</group_password>
- <groupname>console</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>42</gid>
- <group_password>x</group_password>
- <groupname>trusted</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>102</gid>
- <group_password>!</group_password>
- <groupname>haldaemon</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>16</gid>
- <group_password>x</group_password>
- <groupname>dialout</groupname>
- <userlist>linux</userlist>
- </group>
- <group>
- <gid>106</gid>
- <group_password>!</group_password>
- <groupname>polkituser</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>10</gid>
- <group_password>x</group_password>
- <groupname>wheel</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>107</gid>
- <group_password>!</group_password>
- <groupname>pulse</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>8</gid>
- <group_password>x</group_password>
- <groupname>www</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>40</gid>
- <group_password>x</group_password>
- <groupname>games</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>6</gid>
- <group_password>x</group_password>
- <groupname>disk</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>17</gid>
- <group_password>x</group_password>
- <groupname>audio</groupname>
- <userlist>pulse</userlist>
- </group>
- <group>
- <gid>110</gid>
- <group_password>!</group_password>
- <groupname>suse-ncc</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>49</gid>
- <group_password>x</group_password>
- <groupname>ftp</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>25</gid>
- <group_password>!</group_password>
- <groupname>at</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>9</gid>
- <group_password>x</group_password>
- <groupname>kmem</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>32</gid>
- <group_password>x</group_password>
- <groupname>public</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>12</gid>
- <group_password>x</group_password>
- <groupname>mail</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>0</gid>
- <group_password>x</group_password>
- <groupname>root</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>2</gid>
- <group_password>x</group_password>
- <groupname>daemon</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>103</gid>
- <group_password>!</group_password>
- <groupname>sfcb</groupname>
- <userlist>root</userlist>
- </group>
- <group>
- <gid>105</gid>
- <group_password>!</group_password>
- <groupname>ntp</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>14</gid>
- <group_password>x</group_password>
- <groupname>uucp</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>109</gid>
- <group_password>!</group_password>
- <groupname>pulse-access</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>71</gid>
- <group_password>!</group_password>
- <groupname>ntadmin</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>62</gid>
- <group_password>x</group_password>
- <groupname>man</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>108</gid>
- <group_password>!</group_password>
- <groupname>pulse-rt</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>22</gid>
- <group_password>x</group_password>
- <groupname>utmp</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>13</gid>
- <group_password>x</group_password>
- <groupname>news</groupname>
- <userlist></userlist>
- </group>
- <group>
- <gid>65</gid>
- <group_password>!</group_password>
- <groupname>sshd</groupname>
- <userlist></userlist>
- </group>
- </groups>
- <host>
- <hosts config:type="list">
- <hosts_entry>
- <host_address>127.0.0.1</host_address>
- <names config:type="list">
- <name>localhost</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>::1</host_address>
- <names config:type="list">
- <name>localhost ipv6-localhost ipv6-loopback</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>fe00::0</host_address>
- <names config:type="list">
- <name>ipv6-localnet</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>ff00::0</host_address>
- <names config:type="list">
- <name>ipv6-mcastprefix</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>ff02::1</host_address>
- <names config:type="list">
- <name>ipv6-allnodes</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>ff02::2</host_address>
- <names config:type="list">
- <name>ipv6-allrouters</name>
- </names>
- </hosts_entry>
- <hosts_entry>
- <host_address>ff02::3</host_address>
- <names config:type="list">
- <name>ipv6-allhosts</name>
- </names>
- </hosts_entry>
- </hosts>
- </host>
- <iscsi-client>
- <version>1.0</version>
- </iscsi-client>
- <keyboard>
- <keymap>english-us</keymap>
- </keyboard>
- <language>
- <language>en_US</language>
- <languages>en_US</languages>
- </language>
- <ldap>
- <base_config_dn></base_config_dn>
- <bind_dn></bind_dn>
- <create_ldap config:type="boolean">false</create_ldap>
- <file_server config:type="boolean">false</file_server>
- <ldap_domain>dc=example,dc=com</ldap_domain>
- <ldap_server>127.0.0.1</ldap_server>
- <ldap_tls config:type="boolean">true</ldap_tls>
- <ldap_v2 config:type="boolean">false</ldap_v2>
- <login_enabled config:type="boolean">true</login_enabled>
- <member_attribute>member</member_attribute>
- <nss_base_group></nss_base_group>
- <nss_base_passwd></nss_base_passwd>
- <nss_base_shadow></nss_base_shadow>
- <pam_password>exop</pam_password>
- <start_autofs config:type="boolean">false</start_autofs>
- <start_ldap config:type="boolean">false</start_ldap>
- </ldap>
- <login_settings/>
- <networking>
- <dns>
- <dhcp_hostname config:type="boolean">true</dhcp_hostname>
- <resolv_conf_policy>auto</resolv_conf_policy>
- </dns>
- <interfaces config:type="list">
- <interface>
- <bootproto>dhcp</bootproto>
- <device>eth0</device>
- <startmode>auto</startmode>
- <usercontrol>no</usercontrol>
- </interface>
- </interfaces>
- <managed config:type="boolean">false</managed>
- <routing>
- <ip_forward config:type="boolean">false</ip_forward>
- </routing>
- </networking>
- <nis>
- <netconfig_policy>auto</netconfig_policy>
- <nis_broadcast config:type="boolean">false</nis_broadcast>
- <nis_broken_server config:type="boolean">false</nis_broken_server>
- <nis_local_only config:type="boolean">false</nis_local_only>
- <start_autofs config:type="boolean">false</start_autofs>
- <start_nis config:type="boolean">false</start_nis>
- </nis>
- <partitioning config:type="list">
- <drive>
- <initialize config:type="boolean">true</initialize>
- <partitions config:type="list"/>
- <pesize></pesize>
- <type config:type="symbol">CT_DISK</type>
- <use>all</use>
- </drive>
- </partitioning>
- <proxy>
- <enabled config:type="boolean">false</enabled>
- <ftp_proxy></ftp_proxy>
- <http_proxy></http_proxy>
- <https_proxy></https_proxy>
- <no_proxy>localhost, 127.0.0.1</no_proxy>
- <proxy_password></proxy_password>
- <proxy_user></proxy_user>
- </proxy>
- <report>
- <errors>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">10</timeout>
- </errors>
- <messages>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">10</timeout>
- </messages>
- <warnings>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">10</timeout>
- </warnings>
- <yesno_messages>
- <log config:type="boolean">true</log>
- <show config:type="boolean">true</show>
- <timeout config:type="integer">10</timeout>
- </yesno_messages>
- </report>
- <runlevel>
- <default>3</default>
- </runlevel>
- <scripts>
- <init-scripts config:type="list">
- <script>
- <debug config:type="boolean">true</debug>
- <filename>config</filename>
- <source><![CDATA[dhclient eth0
-chkconfig sshd on
-sed -i -e 's/\(PasswordAuthentication\s\)no/\1yes/g' /etc/ssh/sshd_config
-service sshd restart
-]]></source>
- </script>
- </init-scripts>
- </scripts>
- <software>
- <packages config:type="list">
- <package>dhcp-client</package>
- </packages>
- <patterns config:type="list">
- <pattern>Basis-Devel</pattern>
- <pattern>base</pattern>
- <pattern>laptop</pattern>
- <pattern>Minimal</pattern>
- </patterns>
- </software>
- <timezone>
- <hwclock>UTC</hwclock>
- <timezone>America/New_York</timezone>
- </timezone>
- <user_defaults>
- <group>100</group>
- <groups>video,dialout</groups>
- <home>/home</home>
- <inactive>-1</inactive>
- <shell>/bin/bash</shell>
- <skel>/etc/skel</skel>
- </user_defaults>
- <users config:type="list">
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>linux</fullname>
- <gid>100</gid>
- <home>/home/linux</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/bash</shell>
- <uid>1000</uid>
- <user_password>$2a$05$FAAcDkjOVQxuDKvppCzcROelTVQeDSr9FIKSwP02wrg7SBulFkeXK</user_password>
- <username>linux</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Games account</fullname>
- <gid>100</gid>
- <home>/var/games</home>
- <shell>/bin/bash</shell>
- <uid>12</uid>
- <user_password>*</user_password>
- <username>games</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>bin</fullname>
- <gid>1</gid>
- <home>/bin</home>
- <shell>/bin/bash</shell>
- <uid>1</uid>
- <user_password>*</user_password>
- <username>bin</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>nobody</fullname>
- <gid>65533</gid>
- <home>/var/lib/nobody</home>
- <shell>/bin/bash</shell>
- <uid>65534</uid>
- <user_password>*</user_password>
- <username>nobody</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Printing daemon</fullname>
- <gid>7</gid>
- <home>/var/spool/lpd</home>
- <shell>/bin/bash</shell>
- <uid>4</uid>
- <user_password>*</user_password>
- <username>lp</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>User for uuidd</fullname>
- <gid>104</gid>
- <home>/var/run/uuidd</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>102</uid>
- <user_password>*</user_password>
- <username>uuidd</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Postfix Daemon</fullname>
- <gid>51</gid>
- <home>/var/spool/postfix</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>51</uid>
- <user_password>*</user_password>
- <username>postfix</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Novell Customer Center User</fullname>
- <gid>110</gid>
- <home>/var/lib/YaST2/suse-ncc-fakehome</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/bash</shell>
- <uid>105</uid>
- <user_password>*</user_password>
- <username>suse-ncc</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>FTP account</fullname>
- <gid>49</gid>
- <home>/srv/ftp</home>
- <shell>/bin/bash</shell>
- <uid>40</uid>
- <user_password>*</user_password>
- <username>ftp</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Gnome Display Manager daemon</fullname>
- <gid>111</gid>
- <home>/var/lib/gdm</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>106</uid>
- <user_password>*</user_password>
- <username>gdm</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Batch jobs daemon</fullname>
- <gid>25</gid>
- <home>/var/spool/atjobs</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/bash</shell>
- <uid>25</uid>
- <user_password>*</user_password>
- <username>at</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>root</fullname>
- <gid>0</gid>
- <home>/root</home>
- <shell>/bin/bash</shell>
- <uid>0</uid>
- <user_password>$2a$05$6EDh/ymzfFidFVZ9GxPpR.QLaswYgGBxlmCoy0WUo42stJDGcPcxK</user_password>
- <username>root</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Mailer daemon</fullname>
- <gid>12</gid>
- <home>/var/spool/clientmqueue</home>
- <shell>/bin/false</shell>
- <uid>8</uid>
- <user_password>*</user_password>
- <username>mail</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Daemon</fullname>
- <gid>2</gid>
- <home>/sbin</home>
- <shell>/bin/bash</shell>
- <uid>2</uid>
- <user_password>*</user_password>
- <username>daemon</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>NTP daemon</fullname>
- <gid>105</gid>
- <home>/var/lib/ntp</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>74</uid>
- <user_password>*</user_password>
- <username>ntp</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Unix-to-Unix CoPy system</fullname>
- <gid>14</gid>
- <home>/etc/uucp</home>
- <shell>/bin/bash</shell>
- <uid>10</uid>
- <user_password>*</user_password>
- <username>uucp</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>User for D-Bus</fullname>
- <gid>101</gid>
- <home>/var/run/dbus</home>
- <password_settings>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>100</uid>
- <user_password>*</user_password>
- <username>messagebus</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>User for haldaemon</fullname>
- <gid>102</gid>
- <home>/var/run/hald</home>
- <password_settings>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>101</uid>
- <user_password>*</user_password>
- <username>haldaemon</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>WWW daemon apache</fullname>
- <gid>8</gid>
- <home>/var/lib/wwwrun</home>
- <shell>/bin/false</shell>
- <uid>30</uid>
- <user_password>*</user_password>
- <username>wwwrun</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>Manual pages viewer</fullname>
- <gid>62</gid>
- <home>/var/cache/man</home>
- <shell>/bin/bash</shell>
- <uid>13</uid>
- <user_password>*</user_password>
- <username>man</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>PolicyKit</fullname>
- <gid>106</gid>
- <home>/var/run/PolicyKit</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>103</uid>
- <user_password>*</user_password>
- <username>polkituser</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>News system</fullname>
- <gid>13</gid>
- <home>/etc/news</home>
- <shell>/bin/bash</shell>
- <uid>9</uid>
- <user_password>*</user_password>
- <username>news</username>
- </user>
- <user>
- <fullname>SSH daemon</fullname>
- <gid>65</gid>
- <home>/var/lib/sshd</home>
- <password_settings>
- <flag></flag>
- <inact>-1</inact>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/bin/false</shell>
- <uid>71</uid>
- <username>sshd</username>
- </user>
- <user>
- <encrypted config:type="boolean">true</encrypted>
- <fullname>PulseAudio daemon</fullname>
- <gid>107</gid>
- <home>/var/lib/pulseaudio</home>
- <password_settings>
- <max>99999</max>
- <min>0</min>
- <warn>7</warn>
- </password_settings>
- <shell>/sbin/nologin</shell>
- <uid>104</uid>
- <user_password>*</user_password>
- <username>pulse</username>
- </user>
- </users>
- <x11>
- <color_depth config:type="integer">16</color_depth>
- <display_manager>gdm</display_manager>
- <enable_3d config:type="boolean">false</enable_3d>
- <monitor>
- <display>
- <max_hsync config:type="integer">38</max_hsync>
- <max_vsync config:type="integer">60</max_vsync>
- <min_hsync config:type="integer">31</min_hsync>
- <min_vsync config:type="integer">50</min_vsync>
- </display>
- <monitor_device>800X600@60HZ</monitor_device>
- <monitor_vendor>--> VESA</monitor_vendor>
- </monitor>
- <resolution>800x600 (SVGA)</resolution>
- <window_manager>gnome</window_manager>
- </x11>
-</profile>
diff --git a/client/tests/kvm/unattended/win2000-32.sif b/client/tests/kvm/unattended/win2000-32.sif
deleted file mode 100644
index 6aa1848..0000000
--- a/client/tests/kvm/unattended/win2000-32.sif
+++ /dev/null
@@ -1,76 +0,0 @@
-[Data]
-AutoPartition = 1
-MsDosInitiated = "0"
-UnattendedInstall = "Yes"
-
-[Unattended]
-Repartition = Yes
-UnattendMode = FullUnattended
-OemSkipEula = Yes
-OemPreinstall = No
-TargetPath = \WINDOWS
-UnattendSwitch = Yes
-CrashDumpSetting = 1
-DriverSigningPolicy = ignore
-OemPnPDriversPath = KVM_TEST_NETWORK_DRIVER_PATH
-WaitForReboot = no
-
-[GuiUnattended]
-AdminPassword = "1q2w3eP"
-EncryptedAdminPassword = NO
-TimeZone = 85
-OemSkipWelcome = 1
-AutoLogon = Yes
-AutoLogonCount = 1000
-OEMSkipRegional = 1
-
-[UserData]
-ProductKey = KVM_TEST_CDKEY
-FullName = "Autotest Mindless Drone"
-OrgName = "Autotest"
-ComputerName = *
-
-[Identification]
-JoinWorkgroup = WORKGROUP
-
-[Networking]
-InstallDefaultComponents = Yes
-
-[Proxy]
-Proxy_Enable = 0
-Use_Same_Proxy = 0
-
-[Components]
-dialer = off
-media_clips = off
-media_utopia = off
-msnexplr = off
-netoc = off
-OEAccess = off
-templates = off
-WMAccess = off
-zonegames = off
-
-[TerminalServices]
-AllowConnections = 1
-
-[WindowsFirewall]
-Profiles = WindowsFirewall.TurnOffFirewall
-
-[WindowsFirewall.TurnOffFirewall]
-Mode = 0
-
-[Branding]
-BrandIEUsingUnattended = Yes
-
-[Display]
-Xresolution = 1024
-YResolution = 768
-
-[GuiRunOnce]
-Command0 = "cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"
-Command1 = "cmd /c E:\setuprss.bat"
-Command2 = "cmd /c netsh interface ip set address local dhcp"
-Command3 = "cmd /c sc config tlntsvr start= auto"
-Command4 = "cmd /c net start telnet"
-Command5 = "cmd /c A:\finish.exe"
diff --git a/client/tests/kvm/unattended/win2003-32.sif b/client/tests/kvm/unattended/win2003-32.sif
deleted file mode 100644
index 6e69b5e..0000000
--- a/client/tests/kvm/unattended/win2003-32.sif
+++ /dev/null
@@ -1,66 +0,0 @@
-[Data]
-AutoPartition = 1
-MsDosInitiated = 0
-UnattendedInstall = Yes
-
-[Unattended]
-UnattendMode = FullUnattended
-OemSkipEula = Yes
-OemPreinstall = No
-UnattendSwitch = Yes
-CrashDumpSetting = 1
-DriverSigningPolicy = ignore
-OemPnPDriversPath = KVM_TEST_NETWORK_DRIVER_PATH
-WaitForReboot = no
-Repartition = yes
-
-[GuiUnattended]
-AdminPassword = "1q2w3eP"
-AutoLogon = Yes
-AutoLogonCount = 1000
-OEMSkipRegional = 1
-TimeZone = 85
-OemSkipWelcome = 1
-
-[UserData]
-ProductKey = KVM_TEST_CDKEY
-FullName = "Autotest Mindless Drone"
-OrgName = "Autotest"
-ComputerName = *
-
-[LicenseFilePrintData]
-AutoMode = PerServer
-AutoUsers = 15
-
-[Identification]
-JoinWorkgroup = WORKGROUP
-
-[Networking]
-InstallDefaultComponents = Yes
-
-[Components]
-
-[TerminalServices]
-AllowConnections = 1
-
-[WindowsFirewall]
-Profiles = WindowsFirewall.TurnOffFirewall
-
-[WindowsFirewall.TurnOffFirewall]
-Mode = 0
-
-[SetupParams]
-local = "Local Area Connection"
-
-[Display]
-Xresolution = 1024
-YResolution = 768
-
-[GuiRunOnce]
-Command0 = "cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"
-Command1 = "cmd /c sc config TlntSvr start= auto"
-Command2 = "cmd /c netsh firewall set opmode disable"
-Command3 = "cmd /c net start telnet"
-Command4 = "cmd /c E:\setuprss.bat"
-Command5 = "cmd /c netsh interface ip set address local dhcp"
-Command6 = "cmd /c A:\finish.exe"
diff --git a/client/tests/kvm/unattended/win2003-64.sif b/client/tests/kvm/unattended/win2003-64.sif
deleted file mode 100644
index 6e69b5e..0000000
--- a/client/tests/kvm/unattended/win2003-64.sif
+++ /dev/null
@@ -1,66 +0,0 @@
-[Data]
-AutoPartition = 1
-MsDosInitiated = 0
-UnattendedInstall = Yes
-
-[Unattended]
-UnattendMode = FullUnattended
-OemSkipEula = Yes
-OemPreinstall = No
-UnattendSwitch = Yes
-CrashDumpSetting = 1
-DriverSigningPolicy = ignore
-OemPnPDriversPath = KVM_TEST_NETWORK_DRIVER_PATH
-WaitForReboot = no
-Repartition = yes
-
-[GuiUnattended]
-AdminPassword = "1q2w3eP"
-AutoLogon = Yes
-AutoLogonCount = 1000
-OEMSkipRegional = 1
-TimeZone = 85
-OemSkipWelcome = 1
-
-[UserData]
-ProductKey = KVM_TEST_CDKEY
-FullName = "Autotest Mindless Drone"
-OrgName = "Autotest"
-ComputerName = *
-
-[LicenseFilePrintData]
-AutoMode = PerServer
-AutoUsers = 15
-
-[Identification]
-JoinWorkgroup = WORKGROUP
-
-[Networking]
-InstallDefaultComponents = Yes
-
-[Components]
-
-[TerminalServices]
-AllowConnections = 1
-
-[WindowsFirewall]
-Profiles = WindowsFirewall.TurnOffFirewall
-
-[WindowsFirewall.TurnOffFirewall]
-Mode = 0
-
-[SetupParams]
-local = "Local Area Connection"
-
-[Display]
-Xresolution = 1024
-YResolution = 768
-
-[GuiRunOnce]
-Command0 = "cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"
-Command1 = "cmd /c sc config TlntSvr start= auto"
-Command2 = "cmd /c netsh firewall set opmode disable"
-Command3 = "cmd /c net start telnet"
-Command4 = "cmd /c E:\setuprss.bat"
-Command5 = "cmd /c netsh interface ip set address local dhcp"
-Command6 = "cmd /c A:\finish.exe"
diff --git a/client/tests/kvm/unattended/win2008-32-autounattend.xml b/client/tests/kvm/unattended/win2008-32-autounattend.xml
deleted file mode 100644
index e33a36b..0000000
--- a/client/tests/kvm/unattended/win2008-32-autounattend.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00010409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- <WillShowUI>OnError</WillShowUI>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallFrom>
- <MetaData wcm:action="add">
- <Key>/IMAGE/INDEX</Key>
- <Value>1</Value>
- </MetaData>
- </InstallFrom>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- <FullName>Autotest Mindless Drone</FullName>
- <Organization>Autotest</Organization>
- </UserData>
- <EnableFirewall>false</EnableFirewall>
- <EnableNetwork>true</EnableNetwork>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <Reseal>
- <ForceShutdownNow>false</ForceShutdownNow>
- </Reseal>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Username>Administrator</Username>
- <LogonCount>5</LogonCount>
- <Enabled>true</Enabled>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>9</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- <OOBE>
- <ProtectYourPC>1</ProtectYourPC>
- <NetworkLocation>Work</NetworkLocation>
- </OOBE>
- </component>
- </settings>
- <settings pass="auditSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Username>Administrator</Username>
- <LogonCount>1000</LogonCount>
- <Enabled>true</Enabled>
- </AutoLogon>
- </component>
- </settings>
- <cpi:offlineImage
- cpi:source="wim:d:/os/win2k8/i386/sources/install.wim#Windows Longhorn SERVERSTANDARD"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
diff --git a/client/tests/kvm/unattended/win2008-64-autounattend.xml b/client/tests/kvm/unattended/win2008-64-autounattend.xml
deleted file mode 100644
index 5de61a9..0000000
--- a/client/tests/kvm/unattended/win2008-64-autounattend.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallFrom>
- <MetaData wcm:action="add">
- <Key>/IMAGE/INDEX</Key>
- <Value>1</Value>
- </MetaData>
- </InstallFrom>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- <WillShowUI>OnError</WillShowUI>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- <FullName>Autotest Mindless Drone</FullName>
- <Organization>Autotest</Organization>
- </UserData>
- </component>
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UserLocale>en-us</UserLocale>
- <UILanguageFallback>en-us</UILanguageFallback>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>9</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- </settings>
- <cpi:offlineImage
- cpi:source="wim:d:/os/vista/x64/sources/install.wim#Windows Vista ENTERPRISE"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
diff --git a/client/tests/kvm/unattended/win2008-r2-autounattend.xml b/client/tests/kvm/unattended/win2008-r2-autounattend.xml
deleted file mode 100644
index 5de61a9..0000000
--- a/client/tests/kvm/unattended/win2008-r2-autounattend.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallFrom>
- <MetaData wcm:action="add">
- <Key>/IMAGE/INDEX</Key>
- <Value>1</Value>
- </MetaData>
- </InstallFrom>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- <WillShowUI>OnError</WillShowUI>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- <FullName>Autotest Mindless Drone</FullName>
- <Organization>Autotest</Organization>
- </UserData>
- </component>
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UserLocale>en-us</UserLocale>
- <UILanguageFallback>en-us</UILanguageFallback>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>9</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- </settings>
- <cpi:offlineImage
- cpi:source="wim:d:/os/vista/x64/sources/install.wim#Windows Vista ENTERPRISE"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
diff --git a/client/tests/kvm/unattended/win7-32-autounattend.xml b/client/tests/kvm/unattended/win7-32-autounattend.xml
deleted file mode 100644
index f313f4a..0000000
--- a/client/tests/kvm/unattended/win7-32-autounattend.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- </UserData>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>9</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- </component>
- </settings>
- <cpi:offlineImage cpi:source="wim:c:/install.wim#Windows Longhorn SERVERSTANDARD"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
\ No newline at end of file
diff --git a/client/tests/kvm/unattended/win7-64-autounattend.xml b/client/tests/kvm/unattended/win7-64-autounattend.xml
deleted file mode 100644
index b42aa8f..0000000
--- a/client/tests/kvm/unattended/win7-64-autounattend.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- </UserData>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>9</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- </component>
- </settings>
- <cpi:offlineImage cpi:source="wim:c:/install.wim#Windows Longhorn SERVERSTANDARD"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
\ No newline at end of file
diff --git a/client/tests/kvm/unattended/winnt.bat b/client/tests/kvm/unattended/winnt.bat
deleted file mode 100644
index e3e0645..0000000
--- a/client/tests/kvm/unattended/winnt.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@rem SetupMgrTag
-@echo off
-
-rem
-rem This is a SAMPLE batch script generated by Setup Manager.
-rem If this script is moved from the location where it was generated, it may have to be modified.
-rem
-
-set AnswerFile=.\winnt.sif
-set SetupFiles=D:\i386
-
-D:\i386\winnt32 /s:%SetupFiles% /unattend:%AnswerFile%
diff --git a/client/tests/kvm/unattended/winvista-32-autounattend.xml b/client/tests/kvm/unattended/winvista-32-autounattend.xml
deleted file mode 100644
index 4dfe06c..0000000
--- a/client/tests/kvm/unattended/winvista-32-autounattend.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <Key>KVM_TEST_CDKEY</Key>
- <WillShowUI>OnError</WillShowUI>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- </UserData>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- <AutoLogon>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- </AutoLogon>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- </component>
- </settings>
- <cpi:offlineImage cpi:source="wim:c:/install.wim#Windows Longhorn SERVERSTANDARD"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
diff --git a/client/tests/kvm/unattended/winvista-64-autounattend.xml b/client/tests/kvm/unattended/winvista-64-autounattend.xml
deleted file mode 100644
index 5867bdb..0000000
--- a/client/tests/kvm/unattended/winvista-64-autounattend.xml
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<unattend xmlns="urn:schemas-microsoft-com:unattend">
- <settings pass="windowsPE">
- <component name="Microsoft-Windows-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DiskConfiguration>
- <WillShowUI>OnError</WillShowUI>
- <Disk wcm:action="add">
- <CreatePartitions>
- <CreatePartition wcm:action="add">
- <Order>1</Order>
- <Size>20000</Size>
- <Type>Primary</Type>
- </CreatePartition>
- </CreatePartitions>
- <ModifyPartitions>
- <ModifyPartition wcm:action="add">
- <Active>true</Active>
- <Extend>false</Extend>
- <Format>NTFS</Format>
- <Label>OS_Install</Label>
- <Letter>C</Letter>
- <Order>1</Order>
- <PartitionID>1</PartitionID>
- </ModifyPartition>
- </ModifyPartitions>
- <DiskID>0</DiskID>
- <WillWipeDisk>true</WillWipeDisk>
- </Disk>
- </DiskConfiguration>
- <ImageInstall>
- <OSImage>
- <InstallTo>
- <DiskID>0</DiskID>
- <PartitionID>1</PartitionID>
- </InstallTo>
- <WillShowUI>OnError</WillShowUI>
- </OSImage>
- </ImageInstall>
- <UserData>
- <ProductKey>
- <WillShowUI>OnError</WillShowUI>
- <Key>KVM_TEST_CDKEY</Key>
- </ProductKey>
- <AcceptEula>true</AcceptEula>
- </UserData>
- </component>
- <component name="Microsoft-Windows-International-Core-WinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <SetupUILanguage>
- <UILanguage>en-us</UILanguage>
- </SetupUILanguage>
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UserLocale>en-us</UserLocale>
- <UILanguageFallback>en-us</UILanguageFallback>
- </component>
- <component name="Microsoft-Windows-PnpCustomizationsWinPE"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:keyValue="1" wcm:action="add">
- <Path>KVM_TEST_STORAGE_DRIVER_PATH</Path>
- </PathAndCredentials>
- <PathAndCredentials wcm:keyValue="2" wcm:action="add">
- <Path>KVM_TEST_NETWORK_DRIVER_PATH</Path>
- </PathAndCredentials>
- </DriverPaths>
- </component>
- </settings>
- <settings pass="specialize">
- <component name="Microsoft-Windows-Deployment"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <RunSynchronous>
- <RunSynchronousCommand wcm:action="add">
- <Description>EnableAdmin</Description>
- <Order>1</Order>
- <Path>cmd /c net user Administrator /active:yes</Path>
- </RunSynchronousCommand>
- <RunSynchronousCommand wcm:action="add">
- <Description>UnfilterAdministratorToken</Description>
- <Order>2</Order>
- <Path>cmd /c reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /d 0 /f</Path>
- </RunSynchronousCommand>
- </RunSynchronous>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="x86" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-US</SystemLocale>
- <UILanguage>en-US</UILanguage>
- <UserLocale>en-US</UserLocale>
- </component>
- </settings>
- <settings pass="oobeSystem">
- <component name="Microsoft-Windows-Shell-Setup"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <UserAccounts>
- <AdministratorPassword>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </AdministratorPassword>
- </UserAccounts>
- <AutoLogon>
- <Enabled>true</Enabled>
- <LogonCount>1000</LogonCount>
- <Username>Administrator</Username>
- <Password>
- <Value>1q2w3eP</Value>
- <PlainText>true</PlainText>
- </Password>
- </AutoLogon>
- <OOBE>
- <HideEULAPage>true</HideEULAPage>
- <NetworkLocation>Work</NetworkLocation>
- <ProtectYourPC>1</ProtectYourPC>
- <SkipUserOOBE>true</SkipUserOOBE>
- <SkipMachineOOBE>true</SkipMachineOOBE>
- </OOBE>
- <FirstLogonCommands>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"</CommandLine>
- <Order>1</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c start /w pkgmgr /iu:"TelnetServer"</CommandLine>
- <Order>2</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c sc config TlntSvr start= auto</CommandLine>
- <Order>3</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh firewall set opmode disable</CommandLine>
- <Order>4</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c net start telnet</CommandLine>
- <Order>5</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
- <Order>6</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
- <Order>7</Order>
- </SynchronousCommand>
- <SynchronousCommand wcm:action="add">
- <CommandLine>%WINDIR%\System32\cmd /c A:\finish.exe</CommandLine>
- <Order>8</Order>
- </SynchronousCommand>
- </FirstLogonCommands>
- </component>
- <component name="Microsoft-Windows-International-Core"
- processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35"
- language="neutral" versionScope="nonSxS"
- xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <InputLocale>0409:00000409</InputLocale>
- <SystemLocale>en-us</SystemLocale>
- <UILanguage>en-us</UILanguage>
- <UILanguageFallback>en-us</UILanguageFallback>
- <UserLocale>en-us</UserLocale>
- </component>
- </settings>
- <cpi:offlineImage
- cpi:source="wim:d:/os/vista/x64/sources/install.wim#Windows Vista ENTERPRISE"
- xmlns:cpi="urn:schemas-microsoft-com:cpi" />
-</unattend>
diff --git a/client/tests/kvm/unattended/winxp32.sif b/client/tests/kvm/unattended/winxp32.sif
deleted file mode 100644
index 6aa1848..0000000
--- a/client/tests/kvm/unattended/winxp32.sif
+++ /dev/null
@@ -1,76 +0,0 @@
-[Data]
-AutoPartition = 1
-MsDosInitiated = "0"
-UnattendedInstall = "Yes"
-
-[Unattended]
-Repartition = Yes
-UnattendMode = FullUnattended
-OemSkipEula = Yes
-OemPreinstall = No
-TargetPath = \WINDOWS
-UnattendSwitch = Yes
-CrashDumpSetting = 1
-DriverSigningPolicy = ignore
-OemPnPDriversPath = KVM_TEST_NETWORK_DRIVER_PATH
-WaitForReboot = no
-
-[GuiUnattended]
-AdminPassword = "1q2w3eP"
-EncryptedAdminPassword = NO
-TimeZone = 85
-OemSkipWelcome = 1
-AutoLogon = Yes
-AutoLogonCount = 1000
-OEMSkipRegional = 1
-
-[UserData]
-ProductKey = KVM_TEST_CDKEY
-FullName = "Autotest Mindless Drone"
-OrgName = "Autotest"
-ComputerName = *
-
-[Identification]
-JoinWorkgroup = WORKGROUP
-
-[Networking]
-InstallDefaultComponents = Yes
-
-[Proxy]
-Proxy_Enable = 0
-Use_Same_Proxy = 0
-
-[Components]
-dialer = off
-media_clips = off
-media_utopia = off
-msnexplr = off
-netoc = off
-OEAccess = off
-templates = off
-WMAccess = off
-zonegames = off
-
-[TerminalServices]
-AllowConnections = 1
-
-[WindowsFirewall]
-Profiles = WindowsFirewall.TurnOffFirewall
-
-[WindowsFirewall.TurnOffFirewall]
-Mode = 0
-
-[Branding]
-BrandIEUsingUnattended = Yes
-
-[Display]
-Xresolution = 1024
-YResolution = 768
-
-[GuiRunOnce]
-Command0 = "cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"
-Command1 = "cmd /c E:\setuprss.bat"
-Command2 = "cmd /c netsh interface ip set address local dhcp"
-Command3 = "cmd /c sc config tlntsvr start= auto"
-Command4 = "cmd /c net start telnet"
-Command5 = "cmd /c A:\finish.exe"
diff --git a/client/tests/kvm/unattended/winxp64.sif b/client/tests/kvm/unattended/winxp64.sif
deleted file mode 100644
index 6aa1848..0000000
--- a/client/tests/kvm/unattended/winxp64.sif
+++ /dev/null
@@ -1,76 +0,0 @@
-[Data]
-AutoPartition = 1
-MsDosInitiated = "0"
-UnattendedInstall = "Yes"
-
-[Unattended]
-Repartition = Yes
-UnattendMode = FullUnattended
-OemSkipEula = Yes
-OemPreinstall = No
-TargetPath = \WINDOWS
-UnattendSwitch = Yes
-CrashDumpSetting = 1
-DriverSigningPolicy = ignore
-OemPnPDriversPath = KVM_TEST_NETWORK_DRIVER_PATH
-WaitForReboot = no
-
-[GuiUnattended]
-AdminPassword = "1q2w3eP"
-EncryptedAdminPassword = NO
-TimeZone = 85
-OemSkipWelcome = 1
-AutoLogon = Yes
-AutoLogonCount = 1000
-OEMSkipRegional = 1
-
-[UserData]
-ProductKey = KVM_TEST_CDKEY
-FullName = "Autotest Mindless Drone"
-OrgName = "Autotest"
-ComputerName = *
-
-[Identification]
-JoinWorkgroup = WORKGROUP
-
-[Networking]
-InstallDefaultComponents = Yes
-
-[Proxy]
-Proxy_Enable = 0
-Use_Same_Proxy = 0
-
-[Components]
-dialer = off
-media_clips = off
-media_utopia = off
-msnexplr = off
-netoc = off
-OEAccess = off
-templates = off
-WMAccess = off
-zonegames = off
-
-[TerminalServices]
-AllowConnections = 1
-
-[WindowsFirewall]
-Profiles = WindowsFirewall.TurnOffFirewall
-
-[WindowsFirewall.TurnOffFirewall]
-Mode = 0
-
-[Branding]
-BrandIEUsingUnattended = Yes
-
-[Display]
-Xresolution = 1024
-YResolution = 768
-
-[GuiRunOnce]
-Command0 = "cmd /c KVM_TEST_VIRTIO_NETWORK_INSTALLER"
-Command1 = "cmd /c E:\setuprss.bat"
-Command2 = "cmd /c netsh interface ip set address local dhcp"
-Command3 = "cmd /c sc config tlntsvr start= auto"
-Command4 = "cmd /c net start telnet"
-Command5 = "cmd /c A:\finish.exe"
diff --git a/client/tests/kvm/unittests.cfg.sample b/client/tests/kvm/unittests.cfg.sample
deleted file mode 100644
index dfab508..0000000
--- a/client/tests/kvm/unittests.cfg.sample
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copy this file to unittests.cfg and edit it.
-#
-# Define the objects we'll be using
-vms = vm1
-vm_type = kvm
-
-# Choose the main VM
-main_vm = vm1
-
-# Some preprocessor/postprocessor params
-start_vm = yes
-kill_vm = yes
-kill_vm_gracefully = no
-
-# Monitor
-monitors = humanmonitor1
-main_monitor = humanmonitor1
-monitor_type = human
-
-# Screendump specific stuff
-take_regular_screendumps = no
-
-# Some default VM params
-qemu_binary = qemu
-qemu_img_binary = qemu-img
-mem = 512
-display = vnc
-
-# Default scheduler params
-used_cpus = 1
-used_mem = 512
-
-# NIC parameters
-run_tcpdump = no
-
-# Misc
-run_kvm_stat = yes
-
-# Tests
-variants:
- - build:
- type = build
- vms = ''
- start_vm = no
- # Load modules built/installed by the build test?
- load_modules = no
- # Save the results of this build on test.resultsdir?
- save_results = no
- # Preserve the source code directory between tests?
- preserve_srcdir = yes
- variants:
- - git:
- mode = git
- user_git_repo = git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
- user_branch = next
- user_lbranch = next
- test_git_repo = git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
-
- - unittest:
- type = unittest
- vms = ''
- start_vm = no
- unittest_timeout = 600
- testdev = yes
- extra_params += " -S"
- # In case you want to execute only a subset of the tests defined on the
- # unittests.cfg file on qemu-kvm, uncomment and edit test_list
- #test_list = idt_test hypercall vmexit realmode
-
-only build.git unittest
diff --git a/client/tests/kvm/virtio-win.cfg.sample b/client/tests/kvm/virtio-win.cfg.sample
deleted file mode 100644
index ce1bcf4..0000000
--- a/client/tests/kvm/virtio-win.cfg.sample
+++ /dev/null
@@ -1,235 +0,0 @@
-# Copy this file to virtio-win.cfg and edit it.
-# This file intends to be a central point of configuration for folks wanting
-# to install windows virtio drivers on windows guests
-
-# A bit of context on windows virtio drivers install
-# --------------------------------------------------
-# This method of install so far covers the storage (viostor) and network
-# (NetKVM) drivers. KVM autotest uses a boot floppy with a Windows answer
-# file in order to perform unattended install of windows guests. For winXP
-# and win2003, the unattended files are simple .ini files, while for win2008
-# and later, the unattended files are XML files.
-#
-# In order to install the virtio drivers during guest install, KVM autotest
-# has to inform the windows install programs *where* to find the drivers. So,
-# we work from the following assumptions:
-#
-# * You already have an iso file that contains windows virtio drivers
-# (inf files) for both netkvm and viostor. If you are unsure how to generate
-# that iso, there's an example script under contrib, inside the kvm test
-# directory. If you take a look at the files inside this iso image, a small
-# part of them should look like:
-#
-# ./wxp/x86/viostor.cat
-# ./wxp/x86/viostor.inf
-# ./wxp/x86/viostor.pdb
-# ./wxp/x86/viostor.sys
-#
-# * If you are planning on installing WinXP or Win2003, you should also have
-# a pre-made floppy disk image with the virtio drivers *and* a configuration
-# file that the installer program will read to fetch the right drivers from it.
-# Unfortunately, I don't have much info on how to build that file, you probably
-# would have the image already assembled if you are willing to test those guest
-# OS.
-#
-# So you have to map the paths of your cd containing the drivers on the config
-# variables. More details below.
-
-Windows:
- unattended_install.cdrom, whql.support_vm_install:
- # In order to enable drivers install, turn the below to 'yes'
- install_virtio = no
-
- # In order to enable drivers install, uncomment the assignment lines
- # below.
-
- # This makes the vm to be started with the virtio iso file as an extra
- # cdrom drive
- #cdroms += " virtio"
-
- # This assumes the virtio iso will be at (/tmp/kvm_autotest_root/isos)
- #cdrom_virtio = isos/virtio-win.iso
-
- # This ensures the iso will appear to the guest as F:
- #drive_index_virtio = 3
-
- # This assumes the virtio floppy will be at (/tmp/kvm_autotest_root/)
- # This floppy is needed only if you desire to test virtio drivers
- # install for WinXP and Win2003. If you don't, you can leave the line
- # below uncommented
- #virtio_floppy = virtio-drivers.vfd
-
- WinXP:
- 32:
- unattended_install.cdrom, whql.support_vm_install:
- # This is a label used on the oemsetup.ini file, inside your
- # virtio floppy. You might actually want to check what are
- # the labels on yours
- virtio_oemsetup_id = WXP32
-
- # Look at your cd structure and see where the drivers are
- # actually located
- virtio_network_path = 'F:\xp\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- 64:
- unattended_install.cdrom, whql.support_vm_install:
- # This is a label used on the oemsetup.ini file, inside your
- # virtio floppy. You might actually want to check what are
- # the labels on yours
- virtio_oemsetup_id = WNET64
-
- # Look at your cd structure and see where the drivers are
- # actually located
- virtio_network_path = 'F:\xp\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- Win2003:
- 32:
- unattended_install.cdrom, whql.support_vm_install:
- # This is a label used on the oemsetup.ini file, inside your
- # virtio floppy. You might actually want to check what are
- # the labels on yours
- virtio_oemsetup_id = WNET32
-
- # Look at your cd structure and see where the drivers are
- # actually located
- virtio_network_path = 'F:\xp\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- 64:
- unattended_install.cdrom, whql.support_vm_install:
- # This is a label used on the oemsetup.ini file, inside your
- # virtio floppy. You might actually want to check what are
- # the labels on yours
- virtio_oemsetup_id = WNET64
-
- # Look at your cd structure and see where the drivers are
- # actually located
- virtio_network_path = 'F:\xp\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- WinVista:
- 32:
- sp1:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\x86'
- virtio_network_path = 'F:\vista\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- sp2:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\x86'
- virtio_network_path = 'F:\vista\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- 64:
- sp1:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- sp2:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- Win2008:
- 32:
- sp1:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\x86'
- virtio_network_path = 'F:\vista\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- sp2:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\x86'
- virtio_network_path = 'F:\vista\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- 64:
- sp1:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- sp2:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- r2:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
-
- Win7:
- 32:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\x86'
- virtio_network_path = 'F:\vista\x86'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
-
- 64:
- unattended_install.cdrom, whql.support_vm_install:
- # Look at your cd structure and see where the drivers are
- # actually located (viostor and netkvm)
- virtio_storage_path = 'F:\win7\amd64'
- virtio_network_path = 'F:\vista\amd64'
-
- # Uncomment if you have a nw driver installer on the iso
- #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
diff --git a/client/tools/scan_results.py b/client/tools/scan_results.py
deleted file mode 100755
index be825f6..0000000
--- a/client/tools/scan_results.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/python
-"""
-Program that parses the autotest results and return a nicely printed final test
-result.
-
-@copyright: Red Hat 2008-2009
-"""
-
-def parse_results(text):
- """
- Parse text containing Autotest results.
-
- @return: A list of result 4-tuples.
- """
- result_list = []
- start_time_list = []
- info_list = []
-
- lines = text.splitlines()
- for line in lines:
- line = line.strip()
- parts = line.split("\t")
-
- # Found a START line -- get start time
- if (line.startswith("START") and len(parts) >= 5 and
- parts[3].startswith("timestamp")):
- start_time = float(parts[3].split("=")[1])
- start_time_list.append(start_time)
- info_list.append("")
-
- # Found an END line -- get end time, name and status
- elif (line.startswith("END") and len(parts) >= 5 and
- parts[3].startswith("timestamp")):
- end_time = float(parts[3].split("=")[1])
- start_time = start_time_list.pop()
- info = info_list.pop()
- test_name = parts[2]
- test_status = parts[0].split()[1]
- # Remove "kvm." prefix
- if test_name.startswith("kvm."):
- test_name = test_name[4:]
- result_list.append((test_name, test_status,
- int(end_time - start_time), info))
-
- # Found a FAIL/ERROR/GOOD line -- get failure/success info
- elif (len(parts) >= 6 and parts[3].startswith("timestamp") and
- parts[4].startswith("localtime")):
- info_list[-1] = parts[5]
-
- return result_list
-
-
-def print_result(result, name_width):
- """
- Nicely print a single Autotest result.
-
- @param result: a 4-tuple
- @param name_width: test name maximum width
- """
- if result:
- format = "%%-%ds %%-10s %%-8s %%s" % name_width
- print format % result
-
-
-def main(resfiles):
- result_lists = []
- name_width = 40
-
- for resfile in resfiles:
- try:
- text = open(resfile).read()
- except IOError:
- print "Bad result file: %s" % resfile
- continue
- results = parse_results(text)
- result_lists.append((resfile, results))
- name_width = max([name_width] + [len(r[0]) for r in results])
-
- print_result(("Test", "Status", "Seconds", "Info"), name_width)
- print_result(("----", "------", "-------", "----"), name_width)
-
- for resfile, results in result_lists:
- print " (Result file: %s)" % resfile
- for r in results:
- print_result(r, name_width)
-
-
-if __name__ == "__main__":
- import sys, glob
-
- resfiles = glob.glob("../../results/default/status*")
- if len(sys.argv) > 1:
- if sys.argv[1] == "-h" or sys.argv[1] == "--help":
- print "Usage: %s [result files]" % sys.argv[0]
- sys.exit(0)
- resfiles = sys.argv[1:]
- main(resfiles)
diff --git a/client/virt/__init__.py b/client/virt/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/client/virt/__init__.py
+++ /dev/null
diff --git a/client/virt/aexpect.py b/client/virt/aexpect.py
deleted file mode 100755
index 223305d..0000000
--- a/client/virt/aexpect.py
+++ /dev/null
@@ -1,1351 +0,0 @@
-#!/usr/bin/python
-"""
-A class and functions used for running and controlling child processes.
-
-@copyright: 2008-2009 Red Hat Inc.
-"""
-
-import os, sys, pty, select, termios, fcntl
-
-
-# The following helper functions are shared by the server and the client.
-
-def _lock(filename):
- if not os.path.exists(filename):
- open(filename, "w").close()
- fd = os.open(filename, os.O_RDWR)
- fcntl.lockf(fd, fcntl.LOCK_EX)
- return fd
-
-
-def _unlock(fd):
- fcntl.lockf(fd, fcntl.LOCK_UN)
- os.close(fd)
-
-
-def _locked(filename):
- try:
- fd = os.open(filename, os.O_RDWR)
- except:
- return False
- try:
- fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
- except:
- os.close(fd)
- return True
- fcntl.lockf(fd, fcntl.LOCK_UN)
- os.close(fd)
- return False
-
-
-def _wait(filename):
- fd = _lock(filename)
- _unlock(fd)
-
-
-def _get_filenames(base_dir, id):
- return [os.path.join(base_dir, s + id) for s in
- "shell-pid-", "status-", "output-", "inpipe-",
- "lock-server-running-", "lock-client-starting-"]
-
-
-def _get_reader_filename(base_dir, id, reader):
- return os.path.join(base_dir, "outpipe-%s-%s" % (reader, id))
-
-
-# The following is the server part of the module.
-
-if __name__ == "__main__":
- id = sys.stdin.readline().strip()
- echo = sys.stdin.readline().strip() == "True"
- readers = sys.stdin.readline().strip().split(",")
- command = sys.stdin.readline().strip() + " && echo %s > /dev/null" % id
-
- # Define filenames to be used for communication
- base_dir = "/tmp/kvm_spawn"
- (shell_pid_filename,
- status_filename,
- output_filename,
- inpipe_filename,
- lock_server_running_filename,
- lock_client_starting_filename) = _get_filenames(base_dir, id)
-
- # Populate the reader filenames list
- reader_filenames = [_get_reader_filename(base_dir, id, reader)
- for reader in readers]
-
- # Set $TERM = dumb
- os.putenv("TERM", "dumb")
-
- (shell_pid, shell_fd) = pty.fork()
- if shell_pid == 0:
- # Child process: run the command in a subshell
- os.execv("/bin/sh", ["/bin/sh", "-c", command])
- else:
- # Parent process
- lock_server_running = _lock(lock_server_running_filename)
-
- # Set terminal echo on/off and disable pre- and post-processing
- attr = termios.tcgetattr(shell_fd)
- attr[0] &= ~termios.INLCR
- attr[0] &= ~termios.ICRNL
- attr[0] &= ~termios.IGNCR
- attr[1] &= ~termios.OPOST
- if echo:
- attr[3] |= termios.ECHO
- else:
- attr[3] &= ~termios.ECHO
- termios.tcsetattr(shell_fd, termios.TCSANOW, attr)
-
- # Open output file
- output_file = open(output_filename, "w")
- # Open input pipe
- os.mkfifo(inpipe_filename)
- inpipe_fd = os.open(inpipe_filename, os.O_RDWR)
- # Open output pipes (readers)
- reader_fds = []
- for filename in reader_filenames:
- os.mkfifo(filename)
- reader_fds.append(os.open(filename, os.O_RDWR))
-
- # Write shell PID to file
- file = open(shell_pid_filename, "w")
- file.write(str(shell_pid))
- file.close()
-
- # Print something to stdout so the client can start working
- print "Server %s ready" % id
- sys.stdout.flush()
-
- # Initialize buffers
- buffers = ["" for reader in readers]
-
- # Read from child and write to files/pipes
- while True:
- check_termination = False
- # Make a list of reader pipes whose buffers are not empty
- fds = [fd for (i, fd) in enumerate(reader_fds) if buffers[i]]
- # Wait until there's something to do
- r, w, x = select.select([shell_fd, inpipe_fd], fds, [], 0.5)
- # If a reader pipe is ready for writing --
- for (i, fd) in enumerate(reader_fds):
- if fd in w:
- bytes_written = os.write(fd, buffers[i])
- buffers[i] = buffers[i][bytes_written:]
- # If there's data to read from the child process --
- if shell_fd in r:
- try:
- data = os.read(shell_fd, 16384)
- except OSError:
- data = ""
- if not data:
- check_termination = True
- # Remove carriage returns from the data -- they often cause
- # trouble and are normally not needed
- data = data.replace("\r", "")
- output_file.write(data)
- output_file.flush()
- for i in range(len(readers)):
- buffers[i] += data
- # If os.read() raised an exception or there was nothing to read --
- if check_termination or shell_fd not in r:
- pid, status = os.waitpid(shell_pid, os.WNOHANG)
- if pid:
- status = os.WEXITSTATUS(status)
- break
- # If there's data to read from the client --
- if inpipe_fd in r:
- data = os.read(inpipe_fd, 1024)
- os.write(shell_fd, data)
-
- # Write the exit status to a file
- file = open(status_filename, "w")
- file.write(str(status))
- file.close()
-
- # Wait for the client to finish initializing
- _wait(lock_client_starting_filename)
-
- # Delete FIFOs
- for filename in reader_filenames + [inpipe_filename]:
- try:
- os.unlink(filename)
- except OSError:
- pass
-
- # Close all files and pipes
- output_file.close()
- os.close(inpipe_fd)
- for fd in reader_fds:
- os.close(fd)
-
- _unlock(lock_server_running)
- exit(0)
-
-
-# The following is the client part of the module.
-
-import subprocess, time, signal, re, threading, logging
-import virt_utils
-
-
-class ExpectError(Exception):
- def __init__(self, patterns, output):
- Exception.__init__(self, patterns, output)
- self.patterns = patterns
- self.output = output
-
- def _pattern_str(self):
- if len(self.patterns) == 1:
- return "pattern %r" % self.patterns[0]
- else:
- return "patterns %r" % self.patterns
-
- def __str__(self):
- return ("Unknown error occurred while looking for %s (output: %r)" %
- (self._pattern_str(), self.output))
-
-
-class ExpectTimeoutError(ExpectError):
- def __str__(self):
- return ("Timeout expired while looking for %s (output: %r)" %
- (self._pattern_str(), self.output))
-
-
-class ExpectProcessTerminatedError(ExpectError):
- def __init__(self, patterns, status, output):
- ExpectError.__init__(self, patterns, output)
- self.status = status
-
- def __str__(self):
- return ("Process terminated while looking for %s "
- "(status: %s, output: %r)" % (self._pattern_str(),
- self.status, self.output))
-
-
-class ShellError(Exception):
- def __init__(self, cmd, output):
- Exception.__init__(self, cmd, output)
- self.cmd = cmd
- self.output = output
-
- def __str__(self):
- return ("Could not execute shell command %r (output: %r)" %
- (self.cmd, self.output))
-
-
-class ShellTimeoutError(ShellError):
- def __str__(self):
- return ("Timeout expired while waiting for shell command to "
- "complete: %r (output: %r)" % (self.cmd, self.output))
-
-
-class ShellProcessTerminatedError(ShellError):
- # Raised when the shell process itself (e.g. ssh, netcat, telnet)
- # terminates unexpectedly
- def __init__(self, cmd, status, output):
- ShellError.__init__(self, cmd, output)
- self.status = status
-
- def __str__(self):
- return ("Shell process terminated while waiting for command to "
- "complete: %r (status: %s, output: %r)" %
- (self.cmd, self.status, self.output))
-
-
-class ShellCmdError(ShellError):
- # Raised when a command executed in a shell terminates with a nonzero
- # exit code (status)
- def __init__(self, cmd, status, output):
- ShellError.__init__(self, cmd, output)
- self.status = status
-
- def __str__(self):
- return ("Shell command failed: %r (status: %s, output: %r)" %
- (self.cmd, self.status, self.output))
-
-
-class ShellStatusError(ShellError):
- # Raised when the command's exit status cannot be obtained
- def __str__(self):
- return ("Could not get exit status of command: %r (output: %r)" %
- (self.cmd, self.output))
-
-
-def run_bg(command, termination_func=None, output_func=None, output_prefix="",
- timeout=1.0):
- """
- Run command as a subprocess. Call output_func with each line of output
- from the subprocess (prefixed by output_prefix). Call termination_func
- when the subprocess terminates. Return when timeout expires or when the
- subprocess exits -- whichever occurs first.
-
- @brief: Run a subprocess in the background and collect its output and
- exit status.
-
- @param command: The shell command to execute
- @param termination_func: A function to call when the process terminates
- (should take an integer exit status parameter)
- @param output_func: A function to call with each line of output from
- the subprocess (should take a string parameter)
- @param output_prefix: A string to pre-pend to each line of the output,
- before passing it to stdout_func
- @param timeout: Time duration (in seconds) to wait for the subprocess to
- terminate before returning
-
- @return: A Tail object.
- """
- process = Tail(command=command,
- termination_func=termination_func,
- output_func=output_func,
- output_prefix=output_prefix)
-
- end_time = time.time() + timeout
- while time.time() < end_time and process.is_alive():
- time.sleep(0.1)
-
- return process
-
-
-def run_fg(command, output_func=None, output_prefix="", timeout=1.0):
- """
- Run command as a subprocess. Call output_func with each line of output
- from the subprocess (prefixed by prefix). Return when timeout expires or
- when the subprocess exits -- whichever occurs first. If timeout expires
- and the subprocess is still running, kill it before returning.
-
- @brief: Run a subprocess in the foreground and collect its output and
- exit status.
-
- @param command: The shell command to execute
- @param output_func: A function to call with each line of output from
- the subprocess (should take a string parameter)
- @param output_prefix: A string to pre-pend to each line of the output,
- before passing it to stdout_func
- @param timeout: Time duration (in seconds) to wait for the subprocess to
- terminate before killing it and returning
-
- @return: A 2-tuple containing the exit status of the process and its
- STDOUT/STDERR output. If timeout expires before the process
- terminates, the returned status is None.
- """
- process = run_bg(command, None, output_func, output_prefix, timeout)
- output = process.get_output()
- if process.is_alive():
- status = None
- else:
- status = process.get_status()
- process.close()
- return (status, output)
-
-
-class Spawn:
- """
- This class is used for spawning and controlling a child process.
-
- A new instance of this class can either run a new server (a small Python
- program that reads output from the child process and reports it to the
- client and to a text file) or attach to an already running server.
- When a server is started it runs the child process.
- The server writes output from the child's STDOUT and STDERR to a text file.
- The text file can be accessed at any time using get_output().
- In addition, the server opens as many pipes as requested by the client and
- writes the output to them.
- The pipes are requested and accessed by classes derived from Spawn.
- These pipes are referred to as "readers".
- The server also receives input from the client and sends it to the child
- process.
- An instance of this class can be pickled. Every derived class is
- responsible for restoring its own state by properly defining
- __getinitargs__().
-
- The first named pipe is used by _tail(), a function that runs in the
- background and reports new output from the child as it is produced.
- The second named pipe is used by a set of functions that read and parse
- output as requested by the user in an interactive manner, similar to
- pexpect.
- When unpickled it automatically
- resumes _tail() if needed.
- """
-
- def __init__(self, command=None, id=None, auto_close=False, echo=False,
- linesep="\n"):
- """
- Initialize the class and run command as a child process.
-
- @param command: Command to run, or None if accessing an already running
- server.
- @param id: ID of an already running server, if accessing a running
- server, or None if starting a new one.
- @param auto_close: If True, close() the instance automatically when its
- reference count drops to zero (default False).
- @param echo: Boolean indicating whether echo should be initially
- enabled for the pseudo terminal running the subprocess. This
- parameter has an effect only when starting a new server.
- @param linesep: Line separator to be appended to strings sent to the
- child process by sendline().
- """
- self.id = id or virt_utils.generate_random_string(8)
-
- # Define filenames for communication with server
- base_dir = "/tmp/kvm_spawn"
- try:
- os.makedirs(base_dir)
- except:
- pass
- (self.shell_pid_filename,
- self.status_filename,
- self.output_filename,
- self.inpipe_filename,
- self.lock_server_running_filename,
- self.lock_client_starting_filename) = _get_filenames(base_dir,
- self.id)
-
- # Remember some attributes
- self.auto_close = auto_close
- self.echo = echo
- self.linesep = linesep
-
- # Make sure the 'readers' and 'close_hooks' attributes exist
- if not hasattr(self, "readers"):
- self.readers = []
- if not hasattr(self, "close_hooks"):
- self.close_hooks = []
-
- # Define the reader filenames
- self.reader_filenames = dict(
- (reader, _get_reader_filename(base_dir, self.id, reader))
- for reader in self.readers)
-
- # Let the server know a client intends to open some pipes;
- # if the executed command terminates quickly, the server will wait for
- # the client to release the lock before exiting
- lock_client_starting = _lock(self.lock_client_starting_filename)
-
- # Start the server (which runs the command)
- if command:
- sub = subprocess.Popen("%s %s" % (sys.executable, __file__),
- shell=True,
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- # Send parameters to the server
- sub.stdin.write("%s\n" % self.id)
- sub.stdin.write("%s\n" % echo)
- sub.stdin.write("%s\n" % ",".join(self.readers))
- sub.stdin.write("%s\n" % command)
- # Wait for the server to complete its initialization
- while not "Server %s ready" % self.id in sub.stdout.readline():
- pass
-
- # Open the reading pipes
- self.reader_fds = {}
- try:
- assert(_locked(self.lock_server_running_filename))
- for reader, filename in self.reader_filenames.items():
- self.reader_fds[reader] = os.open(filename, os.O_RDONLY)
- except:
- pass
-
- # Allow the server to continue
- _unlock(lock_client_starting)
-
-
- # The following two functions are defined to make sure the state is set
- # exclusively by the constructor call as specified in __getinitargs__().
-
- def __getstate__(self):
- pass
-
-
- def __setstate__(self, state):
- pass
-
-
- def __getinitargs__(self):
- # Save some information when pickling -- will be passed to the
- # constructor upon unpickling
- return (None, self.id, self.auto_close, self.echo, self.linesep)
-
-
- def __del__(self):
- if self.auto_close:
- self.close()
-
-
- def _add_reader(self, reader):
- """
- Add a reader whose file descriptor can be obtained with _get_fd().
- Should be called before __init__(). Intended for use by derived
- classes.
-
- @param reader: The name of the reader.
- """
- if not hasattr(self, "readers"):
- self.readers = []
- self.readers.append(reader)
-
-
- def _add_close_hook(self, hook):
- """
- Add a close hook function to be called when close() is called.
- The function will be called after the process terminates but before
- final cleanup. Intended for use by derived classes.
-
- @param hook: The hook function.
- """
- if not hasattr(self, "close_hooks"):
- self.close_hooks = []
- self.close_hooks.append(hook)
-
-
- def _get_fd(self, reader):
- """
- Return an open file descriptor corresponding to the specified reader
- pipe. If no such reader exists, or the pipe could not be opened,
- return None. Intended for use by derived classes.
-
- @param reader: The name of the reader.
- """
- return self.reader_fds.get(reader)
-
-
- def get_id(self):
- """
- Return the instance's id attribute, which may be used to access the
- process in the future.
- """
- return self.id
-
-
- def get_pid(self):
- """
- Return the PID of the process.
-
- Note: this may be the PID of the shell process running the user given
- command.
- """
- try:
- file = open(self.shell_pid_filename, "r")
- pid = int(file.read())
- file.close()
- return pid
- except:
- return None
-
-
- def get_status(self):
- """
- Wait for the process to exit and return its exit status, or None
- if the exit status is not available.
- """
- _wait(self.lock_server_running_filename)
- try:
- file = open(self.status_filename, "r")
- status = int(file.read())
- file.close()
- return status
- except:
- return None
-
-
- def get_output(self):
- """
- Return the STDOUT and STDERR output of the process so far.
- """
- try:
- file = open(self.output_filename, "r")
- output = file.read()
- file.close()
- return output
- except:
- return ""
-
-
- def is_alive(self):
- """
- Return True if the process is running.
- """
- return _locked(self.lock_server_running_filename)
-
-
- def close(self, sig=signal.SIGKILL):
- """
- Kill the child process if it's alive and remove temporary files.
-
- @param sig: The signal to send the process when attempting to kill it.
- """
- # Kill it if it's alive
- if self.is_alive():
- virt_utils.kill_process_tree(self.get_pid(), sig)
- # Wait for the server to exit
- _wait(self.lock_server_running_filename)
- # Call all cleanup routines
- for hook in self.close_hooks:
- hook(self)
- # Close reader file descriptors
- for fd in self.reader_fds.values():
- try:
- os.close(fd)
- except:
- pass
- self.reader_fds = {}
- # Remove all used files
- for filename in (_get_filenames("/tmp/kvm_spawn", self.id) +
- self.reader_filenames.values()):
- try:
- os.unlink(filename)
- except OSError:
- pass
-
-
- def set_linesep(self, linesep):
- """
- Sets the line separator string (usually "\\n").
-
- @param linesep: Line separator string.
- """
- self.linesep = linesep
-
-
- def send(self, str=""):
- """
- Send a string to the child process.
-
- @param str: String to send to the child process.
- """
- try:
- fd = os.open(self.inpipe_filename, os.O_RDWR)
- os.write(fd, str)
- os.close(fd)
- except:
- pass
-
-
- def sendline(self, str=""):
- """
- Send a string followed by a line separator to the child process.
-
- @param str: String to send to the child process.
- """
- self.send(str + self.linesep)
-
-
-_thread_kill_requested = False
-
-def kill_tail_threads():
- """
- Kill all Tail threads.
-
- After calling this function no new threads should be started.
- """
- global _thread_kill_requested
- _thread_kill_requested = True
- for t in threading.enumerate():
- if hasattr(t, "name") and t.name.startswith("tail_thread"):
- t.join(10)
- _thread_kill_requested = False
-
-
-class Tail(Spawn):
- """
- This class runs a child process in the background and sends its output in
- real time, line-by-line, to a callback function.
-
- See Spawn's docstring.
-
- This class uses a single pipe reader to read data in real time from the
- child process and report it to a given callback function.
- When the child process exits, its exit status is reported to an additional
- callback function.
-
- When this class is unpickled, it automatically resumes reporting output.
- """
-
- def __init__(self, command=None, id=None, auto_close=False, echo=False,
- linesep="\n", termination_func=None, termination_params=(),
- output_func=None, output_params=(), output_prefix=""):
- """
- Initialize the class and run command as a child process.
-
- @param command: Command to run, or None if accessing an already running
- server.
- @param id: ID of an already running server, if accessing a running
- server, or None if starting a new one.
- @param auto_close: If True, close() the instance automatically when its
- reference count drops to zero (default False).
- @param echo: Boolean indicating whether echo should be initially
- enabled for the pseudo terminal running the subprocess. This
- parameter has an effect only when starting a new server.
- @param linesep: Line separator to be appended to strings sent to the
- child process by sendline().
- @param termination_func: Function to call when the process exits. The
- function must accept a single exit status parameter.
- @param termination_params: Parameters to send to termination_func
- before the exit status.
- @param output_func: Function to call whenever a line of output is
- available from the STDOUT or STDERR streams of the process.
- The function must accept a single string parameter. The string
- does not include the final newline.
- @param output_params: Parameters to send to output_func before the
- output line.
- @param output_prefix: String to prepend to lines sent to output_func.
- """
- # Add a reader and a close hook
- self._add_reader("tail")
- self._add_close_hook(Tail._join_thread)
-
- # Init the superclass
- Spawn.__init__(self, command, id, auto_close, echo, linesep)
-
- # Remember some attributes
- self.termination_func = termination_func
- self.termination_params = termination_params
- self.output_func = output_func
- self.output_params = output_params
- self.output_prefix = output_prefix
-
- # Start the thread in the background
- self.tail_thread = None
- if termination_func or output_func:
- self._start_thread()
-
-
- def __getinitargs__(self):
- return Spawn.__getinitargs__(self) + (self.termination_func,
- self.termination_params,
- self.output_func,
- self.output_params,
- self.output_prefix)
-
-
- def set_termination_func(self, termination_func):
- """
- Set the termination_func attribute. See __init__() for details.
-
- @param termination_func: Function to call when the process terminates.
- Must take a single parameter -- the exit status.
- """
- self.termination_func = termination_func
- if termination_func and not self.tail_thread:
- self._start_thread()
-
-
- def set_termination_params(self, termination_params):
- """
- Set the termination_params attribute. See __init__() for details.
-
- @param termination_params: Parameters to send to termination_func
- before the exit status.
- """
- self.termination_params = termination_params
-
-
- def set_output_func(self, output_func):
- """
- Set the output_func attribute. See __init__() for details.
-
- @param output_func: Function to call for each line of STDOUT/STDERR
- output from the process. Must take a single string parameter.
- """
- self.output_func = output_func
- if output_func and not self.tail_thread:
- self._start_thread()
-
-
- def set_output_params(self, output_params):
- """
- Set the output_params attribute. See __init__() for details.
-
- @param output_params: Parameters to send to output_func before the
- output line.
- """
- self.output_params = output_params
-
-
- def set_output_prefix(self, output_prefix):
- """
- Set the output_prefix attribute. See __init__() for details.
-
- @param output_prefix: String to pre-pend to each line sent to
- output_func (see set_output_callback()).
- """
- self.output_prefix = output_prefix
-
-
- def _tail(self):
- def print_line(text):
- # Pre-pend prefix and remove trailing whitespace
- text = self.output_prefix + text.rstrip()
- # Pass text to output_func
- try:
- params = self.output_params + (text,)
- self.output_func(*params)
- except TypeError:
- pass
-
- try:
- fd = self._get_fd("tail")
- buffer = ""
- while True:
- global _thread_kill_requested
- if _thread_kill_requested:
- return
- try:
- # See if there's any data to read from the pipe
- r, w, x = select.select([fd], [], [], 0.05)
- except:
- break
- if fd in r:
- # Some data is available; read it
- new_data = os.read(fd, 1024)
- if not new_data:
- break
- buffer += new_data
- # Send the output to output_func line by line
- # (except for the last line)
- if self.output_func:
- lines = buffer.split("\n")
- for line in lines[:-1]:
- print_line(line)
- # Leave only the last line
- last_newline_index = buffer.rfind("\n")
- buffer = buffer[last_newline_index+1:]
- else:
- # No output is available right now; flush the buffer
- if buffer:
- print_line(buffer)
- buffer = ""
- # The process terminated; print any remaining output
- if buffer:
- print_line(buffer)
- # Get the exit status, print it and send it to termination_func
- status = self.get_status()
- if status is None:
- return
- print_line("(Process terminated with status %s)" % status)
- try:
- params = self.termination_params + (status,)
- self.termination_func(*params)
- except TypeError:
- pass
- finally:
- self.tail_thread = None
-
-
- def _start_thread(self):
- self.tail_thread = threading.Thread(target=self._tail,
- name="tail_thread_%s" % self.id)
- self.tail_thread.start()
-
-
- def _join_thread(self):
- # Wait for the tail thread to exit
- # (it's done this way because self.tail_thread may become None at any
- # time)
- t = self.tail_thread
- if t:
- t.join()
-
-
-class Expect(Tail):
- """
- This class runs a child process in the background and provides expect-like
- services.
-
- It also provides all of Tail's functionality.
- """
-
- def __init__(self, command=None, id=None, auto_close=True, echo=False,
- linesep="\n", termination_func=None, termination_params=(),
- output_func=None, output_params=(), output_prefix=""):
- """
- Initialize the class and run command as a child process.
-
- @param command: Command to run, or None if accessing an already running
- server.
- @param id: ID of an already running server, if accessing a running
- server, or None if starting a new one.
- @param auto_close: If True, close() the instance automatically when its
- reference count drops to zero (default False).
- @param echo: Boolean indicating whether echo should be initially
- enabled for the pseudo terminal running the subprocess. This
- parameter has an effect only when starting a new server.
- @param linesep: Line separator to be appended to strings sent to the
- child process by sendline().
- @param termination_func: Function to call when the process exits. The
- function must accept a single exit status parameter.
- @param termination_params: Parameters to send to termination_func
- before the exit status.
- @param output_func: Function to call whenever a line of output is
- available from the STDOUT or STDERR streams of the process.
- The function must accept a single string parameter. The string
- does not include the final newline.
- @param output_params: Parameters to send to output_func before the
- output line.
- @param output_prefix: String to prepend to lines sent to output_func.
- """
- # Add a reader
- self._add_reader("expect")
-
- # Init the superclass
- Tail.__init__(self, command, id, auto_close, echo, linesep,
- termination_func, termination_params,
- output_func, output_params, output_prefix)
-
-
- def __getinitargs__(self):
- return Tail.__getinitargs__(self)
-
-
- def read_nonblocking(self, timeout=None):
- """
- Read from child until there is nothing to read for timeout seconds.
-
- @param timeout: Time (seconds) to wait before we give up reading from
- the child process, or None to use the default value.
- """
- if timeout is None:
- timeout = 0.1
- fd = self._get_fd("expect")
- data = ""
- while True:
- try:
- r, w, x = select.select([fd], [], [], timeout)
- except:
- return data
- if fd in r:
- new_data = os.read(fd, 1024)
- if not new_data:
- return data
- data += new_data
- else:
- return data
-
-
- def match_patterns(self, str, patterns):
- """
- Match str against a list of patterns.
-
- Return the index of the first pattern that matches a substring of str.
- None and empty strings in patterns are ignored.
- If no match is found, return None.
-
- @param patterns: List of strings (regular expression patterns).
- """
- for i in range(len(patterns)):
- if not patterns[i]:
- continue
- if re.search(patterns[i], str):
- return i
-
-
- def read_until_output_matches(self, patterns, filter=lambda x: x,
- timeout=60, internal_timeout=None,
- print_func=None):
- """
- Read using read_nonblocking until a match is found using match_patterns,
- or until timeout expires. Before attempting to search for a match, the
- data is filtered using the filter function provided.
-
- @brief: Read from child using read_nonblocking until a pattern
- matches.
- @param patterns: List of strings (regular expression patterns)
- @param filter: Function to apply to the data read from the child before
- attempting to match it against the patterns (should take and
- return a string)
- @param timeout: The duration (in seconds) to wait until a match is
- found
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
- @return: Tuple containing the match index and the data read so far
- @raise ExpectTimeoutError: Raised if timeout expires
- @raise ExpectProcessTerminatedError: Raised if the child process
- terminates while waiting for output
- @raise ExpectError: Raised if an unknown error occurs
- """
- fd = self._get_fd("expect")
- o = ""
- end_time = time.time() + timeout
- while True:
- try:
- r, w, x = select.select([fd], [], [],
- max(0, end_time - time.time()))
- except (select.error, TypeError):
- break
- if not r:
- raise ExpectTimeoutError(patterns, o)
- # Read data from child
- data = self.read_nonblocking(internal_timeout)
- if not data:
- break
- # Print it if necessary
- if print_func:
- for line in data.splitlines():
- print_func(line)
- # Look for patterns
- o += data
- match = self.match_patterns(filter(o), patterns)
- if match is not None:
- return match, o
-
- # Check if the child has terminated
- if virt_utils.wait_for(lambda: not self.is_alive(), 5, 0, 0.1):
- raise ExpectProcessTerminatedError(patterns, self.get_status(), o)
- else:
- # This shouldn't happen
- raise ExpectError(patterns, o)
-
-
- def read_until_last_word_matches(self, patterns, timeout=60,
- internal_timeout=None, print_func=None):
- """
- Read using read_nonblocking until the last word of the output matches
- one of the patterns (using match_patterns), or until timeout expires.
-
- @param patterns: A list of strings (regular expression patterns)
- @param timeout: The duration (in seconds) to wait until a match is
- found
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
- @return: A tuple containing the match index and the data read so far
- @raise ExpectTimeoutError: Raised if timeout expires
- @raise ExpectProcessTerminatedError: Raised if the child process
- terminates while waiting for output
- @raise ExpectError: Raised if an unknown error occurs
- """
- def get_last_word(str):
- if str:
- return str.split()[-1]
- else:
- return ""
-
- return self.read_until_output_matches(patterns, get_last_word,
- timeout, internal_timeout,
- print_func)
-
-
- def read_until_last_line_matches(self, patterns, timeout=60,
- internal_timeout=None, print_func=None):
- """
- Read using read_nonblocking until the last non-empty line of the output
- matches one of the patterns (using match_patterns), or until timeout
- expires. Return a tuple containing the match index (or None if no match
- was found) and the data read so far.
-
- @brief: Read using read_nonblocking until the last non-empty line
- matches a pattern.
-
- @param patterns: A list of strings (regular expression patterns)
- @param timeout: The duration (in seconds) to wait until a match is
- found
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
- @return: A tuple containing the match index and the data read so far
- @raise ExpectTimeoutError: Raised if timeout expires
- @raise ExpectProcessTerminatedError: Raised if the child process
- terminates while waiting for output
- @raise ExpectError: Raised if an unknown error occurs
- """
- def get_last_nonempty_line(str):
- nonempty_lines = [l for l in str.splitlines() if l.strip()]
- if nonempty_lines:
- return nonempty_lines[-1]
- else:
- return ""
-
- return self.read_until_output_matches(patterns, get_last_nonempty_line,
- timeout, internal_timeout,
- print_func)
-
-
-class ShellSession(Expect):
- """
- This class runs a child process in the background. It it suited for
- processes that provide an interactive shell, such as SSH and Telnet.
-
- It provides all services of Expect and Tail. In addition, it
- provides command running services, and a utility function to test the
- process for responsiveness.
- """
-
- def __init__(self, command=None, id=None, auto_close=True, echo=False,
- linesep="\n", termination_func=None, termination_params=(),
- output_func=None, output_params=(), output_prefix="",
- prompt=r"[\#\$]\s*$", status_test_command="echo $?"):
- """
- Initialize the class and run command as a child process.
-
- @param command: Command to run, or None if accessing an already running
- server.
- @param id: ID of an already running server, if accessing a running
- server, or None if starting a new one.
- @param auto_close: If True, close() the instance automatically when its
- reference count drops to zero (default True).
- @param echo: Boolean indicating whether echo should be initially
- enabled for the pseudo terminal running the subprocess. This
- parameter has an effect only when starting a new server.
- @param linesep: Line separator to be appended to strings sent to the
- child process by sendline().
- @param termination_func: Function to call when the process exits. The
- function must accept a single exit status parameter.
- @param termination_params: Parameters to send to termination_func
- before the exit status.
- @param output_func: Function to call whenever a line of output is
- available from the STDOUT or STDERR streams of the process.
- The function must accept a single string parameter. The string
- does not include the final newline.
- @param output_params: Parameters to send to output_func before the
- output line.
- @param output_prefix: String to prepend to lines sent to output_func.
- @param prompt: Regular expression describing the shell's prompt line.
- @param status_test_command: Command to be used for getting the last
- exit status of commands run inside the shell (used by
- cmd_status_output() and friends).
- """
- # Init the superclass
- Expect.__init__(self, command, id, auto_close, echo, linesep,
- termination_func, termination_params,
- output_func, output_params, output_prefix)
-
- # Remember some attributes
- self.prompt = prompt
- self.status_test_command = status_test_command
-
-
- def __getinitargs__(self):
- return Expect.__getinitargs__(self) + (self.prompt,
- self.status_test_command)
-
-
- def set_prompt(self, prompt):
- """
- Set the prompt attribute for later use by read_up_to_prompt.
-
- @param: String that describes the prompt contents.
- """
- self.prompt = prompt
-
-
- def set_status_test_command(self, status_test_command):
- """
- Set the command to be sent in order to get the last exit status.
-
- @param status_test_command: Command that will be sent to get the last
- exit status.
- """
- self.status_test_command = status_test_command
-
-
- def is_responsive(self, timeout=5.0):
- """
- Return True if the process responds to STDIN/terminal input.
-
- Send a newline to the child process (e.g. SSH or Telnet) and read some
- output using read_nonblocking().
- If all is OK, some output should be available (e.g. the shell prompt).
- In that case return True. Otherwise return False.
-
- @param timeout: Time duration to wait before the process is considered
- unresponsive.
- """
- # Read all output that's waiting to be read, to make sure the output
- # we read next is in response to the newline sent
- self.read_nonblocking(timeout=0)
- # Send a newline
- self.sendline()
- # Wait up to timeout seconds for some output from the child
- end_time = time.time() + timeout
- while time.time() < end_time:
- time.sleep(0.5)
- if self.read_nonblocking(timeout=0).strip():
- return True
- # No output -- report unresponsive
- return False
-
-
- def read_up_to_prompt(self, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Read using read_nonblocking until the last non-empty line of the output
- matches the prompt regular expression set by set_prompt, or until
- timeout expires.
-
- @brief: Read using read_nonblocking until the last non-empty line
- matches the prompt.
-
- @param timeout: The duration (in seconds) to wait until a match is
- found
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being
- read (should take a string parameter)
-
- @return: The data read so far
- @raise ExpectTimeoutError: Raised if timeout expires
- @raise ExpectProcessTerminatedError: Raised if the shell process
- terminates while waiting for output
- @raise ExpectError: Raised if an unknown error occurs
- """
- m, o = self.read_until_last_line_matches([self.prompt], timeout,
- internal_timeout, print_func)
- return o
-
-
- def cmd_output(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Send a command and return its output.
-
- @param cmd: Command to send (must not contain newline characters)
- @param timeout: The duration (in seconds) to wait for the prompt to
- return
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
-
- @return: The output of cmd
- @raise ShellTimeoutError: Raised if timeout expires
- @raise ShellProcessTerminatedError: Raised if the shell process
- terminates while waiting for output
- @raise ShellError: Raised if an unknown error occurs
- """
- def remove_command_echo(str, cmd):
- if str and str.splitlines()[0] == cmd:
- str = "".join(str.splitlines(True)[1:])
- return str
-
- def remove_last_nonempty_line(str):
- return "".join(str.rstrip().splitlines(True)[:-1])
-
- logging.debug("Sending command: %s" % cmd)
- self.read_nonblocking(timeout=0)
- self.sendline(cmd)
- try:
- o = self.read_up_to_prompt(timeout, internal_timeout, print_func)
- except ExpectError, e:
- o = remove_command_echo(e.output, cmd)
- if isinstance(e, ExpectTimeoutError):
- raise ShellTimeoutError(cmd, o)
- elif isinstance(e, ExpectProcessTerminatedError):
- raise ShellProcessTerminatedError(cmd, e.status, o)
- else:
- raise ShellError(cmd, o)
-
- # Remove the echoed command and the final shell prompt
- return remove_last_nonempty_line(remove_command_echo(o, cmd))
-
-
- def cmd_status_output(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Send a command and return its exit status and output.
-
- @param cmd: Command to send (must not contain newline characters)
- @param timeout: The duration (in seconds) to wait for the prompt to
- return
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
-
- @return: A tuple (status, output) where status is the exit status and
- output is the output of cmd
- @raise ShellTimeoutError: Raised if timeout expires
- @raise ShellProcessTerminatedError: Raised if the shell process
- terminates while waiting for output
- @raise ShellStatusError: Raised if the exit status cannot be obtained
- @raise ShellError: Raised if an unknown error occurs
- """
- o = self.cmd_output(cmd, timeout, internal_timeout, print_func)
- try:
- # Send the 'echo $?' (or equivalent) command to get the exit status
- s = self.cmd_output(self.status_test_command, 10, internal_timeout)
- except ShellError:
- raise ShellStatusError(cmd, o)
-
- # Get the first line consisting of digits only
- digit_lines = [l for l in s.splitlines() if l.strip().isdigit()]
- if digit_lines:
- return int(digit_lines[0].strip()), o
- else:
- raise ShellStatusError(cmd, o)
-
-
- def cmd_status(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Send a command and return its exit status.
-
- @param cmd: Command to send (must not contain newline characters)
- @param timeout: The duration (in seconds) to wait for the prompt to
- return
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
-
- @return: The exit status of cmd
- @raise ShellTimeoutError: Raised if timeout expires
- @raise ShellProcessTerminatedError: Raised if the shell process
- terminates while waiting for output
- @raise ShellStatusError: Raised if the exit status cannot be obtained
- @raise ShellError: Raised if an unknown error occurs
- """
- s, o = self.cmd_status_output(cmd, timeout, internal_timeout,
- print_func)
- return s
-
-
- def cmd(self, cmd, timeout=60, internal_timeout=None, print_func=None):
- """
- Send a command and return its output. If the command's exit status is
- nonzero, raise an exception.
-
- @param cmd: Command to send (must not contain newline characters)
- @param timeout: The duration (in seconds) to wait for the prompt to
- return
- @param internal_timeout: The timeout to pass to read_nonblocking
- @param print_func: A function to be used to print the data being read
- (should take a string parameter)
-
- @return: The output of cmd
- @raise ShellTimeoutError: Raised if timeout expires
- @raise ShellProcessTerminatedError: Raised if the shell process
- terminates while waiting for output
- @raise ShellError: Raised if the exit status cannot be obtained or if
- an unknown error occurs
- @raise ShellStatusError: Raised if the exit status cannot be obtained
- @raise ShellError: Raised if an unknown error occurs
- @raise ShellCmdError: Raised if the exit status is nonzero
- """
- s, o = self.cmd_status_output(cmd, timeout, internal_timeout,
- print_func)
- if s != 0:
- raise ShellCmdError(cmd, s, o)
- return o
-
-
- def get_command_output(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Alias for cmd_output() for backward compatibility.
- """
- return self.cmd_output(cmd, timeout, internal_timeout, print_func)
-
-
- def get_command_status_output(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Alias for cmd_status_output() for backward compatibility.
- """
- return self.cmd_status_output(cmd, timeout, internal_timeout,
- print_func)
-
-
- def get_command_status(self, cmd, timeout=60, internal_timeout=None,
- print_func=None):
- """
- Alias for cmd_status() for backward compatibility.
- """
- return self.cmd_status(cmd, timeout, internal_timeout, print_func)
diff --git a/client/virt/base_installer.py b/client/virt/base_installer.py
deleted file mode 100644
index 84231b2..0000000
--- a/client/virt/base_installer.py
+++ /dev/null
@@ -1,623 +0,0 @@
-'''
-This module implements classes that perform the installation of the
-virtualization software on a host system.
-
-These classes can be, and usually are, inherited by subclasses that implement
-custom logic for each virtualization hypervisor/software.
-'''
-
-import os, logging
-from autotest_lib.client.bin import utils, os_dep
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-class VirtInstallException(Exception):
- '''
- Base virtualization software components installation exception
- '''
- pass
-
-
-class VirtInstallFailed(VirtInstallException):
- '''
- Installation of virtualization software components failed
- '''
- pass
-
-
-class VirtInstallNotInstalled(VirtInstallException):
- '''
- Virtualization software components are not installed
- '''
- pass
-
-
-class BaseInstaller(object):
- '''
- Base virtualization software installer
-
- This class holds all the skeleton features for installers and should be
- inherited from when creating a new installer.
- '''
- def __init__(self, mode, name, test=None, params=None):
- '''
- Instantiates a new base installer
-
- @param mode: installer mode, such as git_repo, local_src, etc
- @param name: installer short name, foo for git_repo_foo
- @param test: test
- @param params: params
- '''
- self.mode = mode
- self.name = name
- self.params = params
- self.param_key_prefix = '%s_%s' % (self.mode,
- self.name)
-
- if test and params:
- self.set_install_params(test, params)
-
-
- def _set_test_dirs(self, test):
- '''
- Save common test directories paths (srcdir, bindir) as class attributes
-
- Test variables values are saved here again because it's not possible to
- pickle the test instance inside BaseInstaller due to limitations
- in the pickle protocol. And, in case this pickle thing needs more
- explanation, take a loot at the Env class inside virt_utils.
-
- Besides that, we also ensure that srcdir exists, by creating it if
- necessary.
-
- For reference:
- * bindir = tests/<test>
- * srcdir = tests/<test>/src
-
- So, for KVM tests, it'd evaluate to:
- * bindir = tests/kvm/
- * srcdir = tests/kvm/src
- '''
- self.test_bindir = test.bindir
- self.test_srcdir = test.srcdir
-
- #
- # test_bindir is guaranteed to exist, but test_srcdir is not
- #
- if not os.path.isdir(test.srcdir):
- os.makedirs(test.srcdir)
-
-
- def _set_param_load_module(self):
- '''
- Checks whether kernel modules should be loaded
-
- Default behavior is to load modules unless set to 'no'
-
- Configuration file parameter: load_modules
- Class attribute set: should_load_modules
- '''
- load_modules = self.params.get('load_modules', 'no')
- if not load_modules or load_modules == 'yes':
- self.should_load_modules = True
- elif load_modules == 'no':
- self.should_load_modules = False
-
-
- def _set_param_module_list(self):
- '''
- Sets the list of kernel modules to be loaded during installation
-
- Configuration file parameter: module_list
- Class attribute set: module_list
- '''
- self.module_list = self.params.get('module_list', '').split()
-
-
- def _set_param_save_results(self):
- '''
- Checks whether to save the result of the build on test.resultsdir
-
- Configuration file parameter: save_results
- Class attribute set: save_results
- '''
- self.save_results = True
- save_results = self.params.get('save_results', 'no')
- if save_results == 'no':
- self.save_results = False
-
-
- def set_install_params(self, test=None, params=None):
- '''
- Called by test to setup parameters from the configuration file
- '''
- if test is not None:
- self._set_test_dirs(test)
-
- if params is not None:
- self.params = params
- self._set_param_load_module()
- self._set_param_module_list()
- self._set_param_save_results()
-
-
- def _install_phase_cleanup(self):
- '''
- Optional install phase for removing previous version of the software
-
- If a particular virtualization software installation mechanism
- needs to download files (it most probably does), override this
- method with custom functionality.
-
- This replaces methods such as KojiInstaller._get_packages()
- '''
- pass
-
-
- def _install_phase_cleanup_verify(self):
- '''
- Optional install phase for removing previous version of the software
-
- If a particular virtualization software installation mechanism
- needs to download files (it most probably does), override this
- method with custom functionality.
-
- This replaces methods such as KojiInstaller._get_packages()
- '''
- pass
-
-
- def _install_phase_download(self):
- '''
- Optional install phase for downloading software
-
- If a particular virtualization software installation mechanism
- needs to download files (it most probably does), override this
- method with custom functionality.
-
- This replaces methods such as KojiInstaller._get_packages()
- '''
- pass
-
-
- def _install_phase_download_verify(self):
- '''
- Optional install phase for checking downloaded software
-
- If you want to make sure the downloaded software is in good shape,
- override this method.
-
- Ideas for using this method:
- * check MD5SUM/SHA1SUM for tarball downloads
- * check RPM files, probaly by signature (rpm -k)
- * git status and check if there's no locally modified files
- '''
- pass
-
-
- def _install_phase_prepare(self):
- '''
- Optional install phase for preparing software
-
- If a particular virtualization software installation mechanism
- needs to do something to the obtained software, such as extracting
- a tarball or applying patches, this should be done here.
- '''
- pass
-
-
- def _install_phase_prepare_verify(self):
- '''
- Optional install phase for checking software preparation
-
- Ideas for using this method:
- * git status and check if there are locally patched files
- '''
- pass
-
-
- def _install_phase_build(self):
- '''
- Optional install phase for building software
-
- If a particular virtualization software installation mechanism
- needs to compile source code, it should be done here.
- '''
- pass
-
-
- def _install_phase_build_verify(self):
- '''
- Optional install phase for checking software build
-
- Ideas for using this method:
- * running 'make test' or something similar to it
- '''
- pass
-
-
- def _install_phase_install(self):
- '''
- Optional install phase for actually installing software
-
- Ideas for using this method:
- * running 'make install' or something similar to it
- * running 'yum localinstall *.rpm'
- '''
- pass
-
-
- def _install_phase_install_verify(self):
- '''
- Optional install phase for checking the installed software
-
- This should verify the installed software is in a desirable state.
- Ideas for using this include:
- * checking if installed files exists (like os.path.exists())
- * checking packages are indeed installed (rpm -q <pkg>.rpm)
- '''
- pass
-
-
- def _install_phase_init(self):
- '''
- Optional install phase for initializing the installed software
-
- This should initialize the installed software. Ideas for using this:
- * loading kernel modules
- * running services: 'service <daemon> start'
- * linking software (whether built or downloaded) to a common path
- '''
- pass
-
-
- def _install_phase_init_verify(self):
- '''
- Optional install phase for checking that software is initialized
-
- This should verify that the installed software is running. Ideas for
- using this include:
- * checking service (daemon) status: 'service <daemon> status'
- * checking service (functionality) status: 'virsh capabilities'
- '''
- pass
-
-
- def load_modules(self, module_list=None):
- '''
- Load Linux Kernel modules the virtualization software may depend on
-
- If module_directory is not set, the list of modules will simply be
- loaded by the system stock modprobe tool, meaning that modules will be
- looked for in the system default module paths.
-
- @type module_list: list
- @param module_list: list of kernel modules names to load
- '''
- if module_list is None:
- module_list = self.module_list
-
- logging.info("Loading modules from default locations through "
- "modprobe")
- for module in module_list:
- utils.system("modprobe %s" % module)
-
-
- def unload_modules(self, module_list=None):
- '''
- Unloads kernel modules
-
- By default, if no module list is explicitly provided, the list on
- params (coming from the configuration file) will be used.
- '''
- if module_list is None:
- module_list = self.module_list
- module_list = reversed(module_list)
- logging.info("Unloading kernel modules: %s" % ",".join(module_list))
- for module in module_list:
- utils.unload_module(module)
-
-
- def reload_modules(self):
- """
- Reload the kernel modules (unload, then load)
- """
- self.unload_modules()
- self.load_modules()
-
-
- def reload_modules_if_needed(self):
- if self.should_load_modules:
- self.reload_modules()
-
-
- def install(self):
- '''
- Performs the installation of the virtualization software
-
- This is the main entry point of this class, and should either
- be reimplemented completely, or simply implement one or many of the
- install phases.
- '''
- self._install_phase_cleanup()
- self._install_phase_cleanup_verify()
-
- self._install_phase_download()
- self._install_phase_download_verify()
-
- self._install_phase_prepare()
- self._install_phase_prepare_verify()
-
- self._install_phase_build()
- self._install_phase_build_verify()
-
- self._install_phase_install()
- self._install_phase_install_verify()
-
- self._install_phase_init()
- self._install_phase_init_verify()
-
- self.reload_modules_if_needed()
- if self.save_results:
- virt_utils.archive_as_tarball(self.srcdir, self.results_dir)
-
-
- def uninstall(self):
- '''
- Performs the uninstallations of the virtualization software
-
- Note: This replaces old kvm_installer._clean_previous_install()
- '''
- raise NotImplementedError
-
-
-class NoopInstaller(BaseInstaller):
- '''
- Dummy installer that does nothing, useful when software is pre-installed
- '''
- def install(self):
- logging.info("Assuming virtualization software to be already "
- "installed. Doing nothing")
-
-
-class YumInstaller(BaseInstaller):
- '''
- Installs virtualization software using YUM
-
- Notice: this class implements a change of behaviour if compared to
- kvm_installer.YumInstaller.set_install_params(). There's no longer
- a default package list, as each virtualization technology will have
- a completely different default. This should now be kept at the
- configuration file only.
-
- For now this class implements support for installing from the configured
- yum repos only. If the use case of installing from local RPM packages
- arises, we'll implement that.
- '''
- def set_install_params(self, test, params):
- super(YumInstaller, self).set_install_params(test, params)
- os_dep.command("rpm")
- os_dep.command("yum")
- self.yum_pkgs = eval(params.get("%s_pkgs" % self.param_key_prefix,
- "[]"))
-
-
- def _install_phase_cleanup(self):
- packages_to_remove = " ".join(self.yum_pkgs)
- utils.system("yum remove -y %s" % packages_to_remove)
-
-
- def _install_phase_install(self):
- if self.yum_pkgs:
- os.chdir(self.test_srcdir)
- utils.system("yum --nogpgcheck -y install %s" %
- " ".join(self.yum_pkgs))
-
-
-class KojiInstaller(BaseInstaller):
- '''
- Handles virtualization software installation via koji/brew
-
- It uses YUM to install and remove packages.
-
- Change notice: this is not a subclass of YumInstaller anymore. The
- parameters this class uses are different (koji_tag, koji_pgks) and
- the install process runs YUM.
- '''
- def set_install_params(self, test, params):
- super(KojiInstaller, self).set_install_params(test, params)
- os_dep.command("rpm")
- os_dep.command("yum")
-
- self.tag = params.get("%s_tag" % self.param_key_prefix, None)
- self.koji_cmd = params.get("%s_cmd" % self.param_key_prefix, None)
- if self.tag is not None:
- virt_utils.set_default_koji_tag(self.tag)
- self.koji_pkgs = eval(params.get("%s_pkgs" % self.param_key_prefix,
- "[]"))
-
-
- def _get_rpm_names(self):
- all_rpm_names = []
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- rpm_names = koji_client.get_pkg_rpm_names(pkg)
- all_rpm_names += rpm_names
- return all_rpm_names
-
-
- def _get_rpm_file_names(self):
- all_rpm_file_names = []
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- rpm_file_names = koji_client.get_pkg_rpm_file_names(pkg)
- all_rpm_file_names += rpm_file_names
- return all_rpm_file_names
-
-
- def _install_phase_cleanup(self):
- removable_packages = " ".join(self._get_rpm_names())
- utils.system("yum -y remove %s" % removable_packages)
-
-
- def _install_phase_download(self):
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- if pkg.is_valid():
- koji_client.get_pkgs(pkg, dst_dir=self.test_srcdir)
- else:
- logging.error('Package specification (%s) is invalid: %s' %
- (pkg, pkg.describe_invalid()))
-
-
- def _install_phase_install(self):
- os.chdir(self.test_srcdir)
- rpm_file_names = " ".join(self._get_rpm_file_names())
- utils.system("yum --nogpgcheck -y localinstall %s" % rpm_file_names)
-
-
-class BaseLocalSourceInstaller(BaseInstaller):
- def set_install_params(self, test, params):
- super(BaseLocalSourceInstaller, self).set_install_params(test, params)
- self._set_install_prefix()
- self._set_source_destination()
-
- #
- # There are really no choices for patch helpers
- #
- self.patch_helper = virt_utils.PatchParamHelper(
- self.params,
- self.param_key_prefix,
- self.source_destination)
-
- #
- # These helpers should be set by child classes
- #
- self.content_helper = None
- self.build_helper = None
-
-
- def _set_install_prefix(self):
- '''
- Prefix for installation of application built from source
-
- When installing virtualization software from *source*, this is where
- the resulting binaries will be installed. Usually this is the value
- passed to the configure script, ie: ./configure --prefix=<value>
- '''
- prefix = os.path.join(self.test_bindir, 'install_root')
- self.install_prefix = os.path.abspath(prefix)
-
-
- def _set_source_destination(self):
- '''
- Sets the source code destination directory path
- '''
- self.source_destination = os.path.join(self.test_srcdir,
- self.name)
-
-
- def _set_build_helper(self):
- '''
- Sets the build helper, default is 'gnu_autotools'
- '''
- build_helper_name = self.params.get('%s_build_helper' %
- self.param_key_prefix,
- 'gnu_autotools')
- if build_helper_name == 'gnu_autotools':
- self.build_helper = virt_utils.GnuSourceBuildParamHelper(
- self.params, self.param_key_prefix,
- self.source_destination, self.install_prefix)
-
-
- def _install_phase_download(self):
- if self.content_helper is not None:
- self.content_helper.execute()
-
-
- def _install_phase_build(self):
- if self.build_helper is not None:
- self.build_helper.execute()
-
-
- def _install_phase_install(self):
- if self.build_helper is not None:
- self.build_helper.install()
-
-
-class LocalSourceDirInstaller(BaseLocalSourceInstaller):
- '''
- Handles software installation by building/installing from a source dir
- '''
- def set_install_params(self, test, params):
- super(LocalSourceDirInstaller, self).set_install_params(test, params)
-
- self.content_helper = virt_utils.LocalSourceDirParamHelper(
- params,
- self.name,
- self.source_destination)
-
- self._set_build_helper()
-
-
-class LocalSourceTarInstaller(BaseLocalSourceInstaller):
- '''
- Handles software installation by building/installing from a tarball
- '''
- def set_install_params(self, test, params):
- super(LocalSourceTarInstaller, self).set_install_params(test, params)
-
- self.content_helper = virt_utils.LocalTarParamHelper(
- params,
- self.name,
- self.source_destination)
-
- self._set_build_helper()
-
-
-class RemoteSourceTarInstaller(BaseLocalSourceInstaller):
- '''
- Handles software installation by building/installing from a remote tarball
- '''
- def set_install_params(self, test, params):
- super(RemoteSourceTarInstaller, self).set_install_params(test, params)
-
- self.content_helper = virt_utils.RemoteTarParamHelper(
- params,
- self.name,
- self.source_destination)
-
- self._set_build_helper()
-
-
-class GitRepoInstaller(BaseLocalSourceInstaller):
- def set_install_params(self, test, params):
- super(GitRepoInstaller, self).set_install_params(test, params)
-
- self.content_helper = virt_utils.GitRepoParamHelper(
- params,
- self.name,
- self.source_destination)
-
- self._set_build_helper()
-
-
-class FailedInstaller:
- """
- Class used to be returned instead of the installer if a installation fails
-
- Useful to make sure no installer object is used if virt installation fails
- """
- def __init__(self, msg="Virtualization software install failed"):
- self._msg = msg
-
-
- def load_modules(self):
- """
- Will refuse to load the kerkel modules as install failed
- """
- raise VirtInstallFailed("Kernel modules not available. reason: %s" %
- self._msg)
diff --git a/client/virt/common.py b/client/virt/common.py
deleted file mode 100644
index 7fc8f6a..0000000
--- a/client/virt/common.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import os, sys
-dirname = os.path.dirname(sys.modules[__name__].__file__)
-client_dir = os.path.abspath(os.path.join(dirname, ".."))
-sys.path.insert(0, client_dir)
-import setup_modules
-sys.path.pop(0)
-setup_modules.setup(base_path=client_dir,
- root_module_name="autotest_lib.client")
-
diff --git a/client/virt/installer.py b/client/virt/installer.py
deleted file mode 100644
index 9b2b99e..0000000
--- a/client/virt/installer.py
+++ /dev/null
@@ -1,172 +0,0 @@
-'''
-Installer classes are responsible for building and installing virtualization
-specific software components. This is the main entry point for tests that
-wish to install virtualization software components.
-
-The most common use case is to simply call make_installer() inside your tests.
-'''
-
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import base_installer
-
-__all__ = ['InstallerRegistry', 'INSTALLER_REGISTRY', 'make_installer',
- 'run_installers']
-
-class InstallerRegistry(dict):
- '''
- Holds information on known installer classes
-
- This class is used to create a single instance, named INSTALLER_REGISTRY,
- that will hold all information on known installer types.
-
- For registering a new installer class, use the register() method. If the
- virt type is not set explicitly, it will be set to 'base'. Example:
-
- >>> INSTALLER_REGISTRY.register('yum', base_installer.YumInstaller)
-
- If you want to register a virt specific installer class, set the virt
- (third) param:
-
- >>> INSTALLER_REGISTRY.register('yum', kvm_installer.YumInstaller, 'kvm')
-
- For getting a installer class, use the get_installer() method. This method
- has a fallback option 'get_default_virt' that will return a generic virt
- installer if set to true.
- '''
-
- DEFAULT_VIRT_NAME = 'base'
-
- def __init__(self, **kwargs):
- dict.__init__(self, **kwargs)
- self[self.DEFAULT_VIRT_NAME] = {}
-
-
- def register(self, mode, klass, virt=None):
- '''
- Register a class as responsible for installing virt software components
-
- If virt is not set, it will assume a default of 'base'.
- '''
- if virt is None:
- virt = self.DEFAULT_VIRT_NAME
- elif not self.has_key(virt):
- self[virt] = {}
-
- self[virt][mode] = klass
-
-
- def get_installer(self, mode, virt=None, get_default_virt=False):
- '''
- Gets a installer class that should be able to install the virt software
-
- Always try to use classes that are specific to the virtualization
- technology that is being tested. If you have confidence that the
- installation is rather trivial and does not require custom steps, you
- may be able to get away with a base class (by setting get_default_virt
- to True).
- '''
- if virt is None:
- virt = self.DEFAULT_VIRT_NAME
- if not self.has_key(virt):
- # return a base installer so the test could and give it a try?
- if get_default_virt:
- return self[self.DEFAULT_VIRT_NAME].get(mode)
- else:
- return self[virt].get(mode)
-
-
- def get_modes(self, virt=None):
- '''
- Returns a list of all registered installer modes
- '''
- if virt is None:
- virt = self.DEFAULT_VIRT_NAME
-
- if not self.has_key(virt):
- return []
-
- return self[virt].keys()
-
-
-#
-# InstallerRegistry unique instance
-#
-INSTALLER_REGISTRY = InstallerRegistry()
-
-
-#
-# Register base installers
-#
-INSTALLER_REGISTRY.register('yum',
- base_installer.YumInstaller)
-INSTALLER_REGISTRY.register('koji',
- base_installer.KojiInstaller)
-INSTALLER_REGISTRY.register('git_repo',
- base_installer.GitRepoInstaller)
-INSTALLER_REGISTRY.register('local_src',
- base_installer.LocalSourceDirInstaller)
-INSTALLER_REGISTRY.register('local_tar',
- base_installer.LocalSourceTarInstaller)
-INSTALLER_REGISTRY.register('remote_tar',
- base_installer.RemoteSourceTarInstaller)
-
-
-def installer_name_split(fullname, virt=None):
- '''
- Split a full installer name into mode and short name
-
- Examples:
- git_repo_foo -> (git_repo, foo)
- local_src_foo -> (local_src, foo)
- '''
- for mode in INSTALLER_REGISTRY.get_modes(virt):
- if fullname.startswith('%s_' % mode):
- null, _name = fullname.split(mode)
- name = _name[1:]
- return (mode, name)
-
- return (None, None)
-
-
-def make_installer(fullname, params, test=None):
- '''
- Installer factory: returns a new installer for the chosen mode and vm type
-
- This is the main entry point for acquiring an installer. Tests, such as
- the build test, should use this function.
-
- Param priority evaluation order is 'install_mode', then 'mode'. For virt
- type, 'vm_type' is consulted.
-
- @param fullname: the full name of instance, eg: git_repo_foo
- @param params: dictionary with parameters generated from cartersian config
- @param test: the test instance
- '''
- virt = params.get("vm_type", None)
-
- mode, name = installer_name_split(fullname, virt)
- if mode is None or name is None:
-
- error_msg = ('Invalid installer mode or name for "%s". Probably an '
- 'installer has not been registered' % fullname)
- if virt is not None:
- error_msg += ' specifically for virt type "%s"' % virt
-
- raise error.TestError(error_msg)
-
- klass = INSTALLER_REGISTRY.get_installer(mode, virt)
- if klass is None:
- raise error.TestError('Installer mode %s is not registered' % mode)
- else:
- return klass(mode, name, test, params)
-
-
-def run_installers(params, test=None):
- '''
- Runs the installation routines for all installers, one at a time
-
- This is usually the main entry point for tests
- '''
- for name in params.get("installers", "").split():
- installer = make_installer(name, params, test)
- installer.install()
diff --git a/client/virt/installer_unittest.py b/client/virt/installer_unittest.py
deleted file mode 100755
index 64b1b89..0000000
--- a/client/virt/installer_unittest.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-import common
-from autotest_lib.client.virt import installer
-from autotest_lib.client.common_lib import cartesian_config
-
-class installer_test(unittest.TestCase):
-
- def setUp(self):
- self.registry = installer.InstallerRegistry()
-
-
- def test_register_get_installer(self):
- install_mode = 'custom_install_mode'
- virt_type = 'custom_virt_type'
-
- class CustomVirtInstaller:
- pass
-
- self.registry.register(install_mode, CustomVirtInstaller, virt_type)
- klass = self.registry.get_installer(install_mode, virt_type)
- self.assertIs(klass, CustomVirtInstaller)
-
-
- def test_register_get_installer_default(self):
- install_mode = 'base_install_mode'
-
- class BaseVirtInstaller:
- pass
-
- self.registry.register(install_mode, BaseVirtInstaller)
- klass = self.registry.get_installer(install_mode,
- get_default_virt=True)
- self.assertIs(klass, BaseVirtInstaller)
-
- klass = self.registry.get_installer(install_mode,
- virt=None,
- get_default_virt=True)
- self.assertIs(klass, BaseVirtInstaller)
-
-
- def test_make_installer(self):
- config = """install_mode = test_install_mode
-vm_type = test"""
-
- class Installer:
- def __init__(self, mode, name, test, params):
- pass
-
- installer.INSTALLER_REGISTRY.register('test_install_mode',
- Installer,
- 'test')
-
- config_parser = cartesian_config.Parser()
- config_parser.parse_string(config)
- params = config_parser.get_dicts().next()
-
- instance = installer.make_installer("test_install_mode_test", params)
- self.assertIsInstance(instance, Installer)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/client/virt/kvm_installer.py b/client/virt/kvm_installer.py
deleted file mode 100644
index 98bde12..0000000
--- a/client/virt/kvm_installer.py
+++ /dev/null
@@ -1,615 +0,0 @@
-import os, logging, datetime, glob, shutil
-from autotest_lib.client.bin import utils, os_dep
-from autotest_lib.client.common_lib import error
-import virt_utils, virt_installer
-
-
-def kill_qemu_processes():
- """
- Kills all qemu processes, also kills all processes holding /dev/kvm down.
- """
- logging.debug("Killing any qemu processes that might be left behind")
- utils.system("pkill qemu", ignore_status=True)
- # Let's double check to see if some other process is holding /dev/kvm
- if os.path.isfile("/dev/kvm"):
- utils.system("fuser -k /dev/kvm", ignore_status=True)
-
-
-def create_symlinks(test_bindir, prefix=None, bin_list=None, unittest=None):
- """
- Create symbolic links for the appropriate qemu and qemu-img commands on
- the kvm test bindir.
-
- @param test_bindir: KVM test bindir
- @param prefix: KVM prefix path
- @param bin_list: List of qemu binaries to link
- @param unittest: Path to configuration file unittests.cfg
- """
- qemu_path = os.path.join(test_bindir, "qemu")
- qemu_img_path = os.path.join(test_bindir, "qemu-img")
- qemu_unittest_path = os.path.join(test_bindir, "unittests")
- if os.path.lexists(qemu_path):
- os.unlink(qemu_path)
- if os.path.lexists(qemu_img_path):
- os.unlink(qemu_img_path)
- if unittest and os.path.lexists(qemu_unittest_path):
- os.unlink(qemu_unittest_path)
-
- logging.debug("Linking qemu binaries")
-
- if bin_list:
- for bin in bin_list:
- if os.path.basename(bin) == 'qemu-kvm':
- os.symlink(bin, qemu_path)
- elif os.path.basename(bin) == 'qemu-img':
- os.symlink(bin, qemu_img_path)
-
- elif prefix:
- kvm_qemu = os.path.join(prefix, "bin", "qemu-system-x86_64")
- if not os.path.isfile(kvm_qemu):
- raise error.TestError('Invalid qemu path')
- kvm_qemu_img = os.path.join(prefix, "bin", "qemu-img")
- if not os.path.isfile(kvm_qemu_img):
- raise error.TestError('Invalid qemu-img path')
- os.symlink(kvm_qemu, qemu_path)
- os.symlink(kvm_qemu_img, qemu_img_path)
-
- if unittest:
- logging.debug("Linking unittest dir")
- os.symlink(unittest, qemu_unittest_path)
-
-
-def install_roms(rom_dir, prefix):
- logging.debug("Path to roms specified. Copying roms to install prefix")
- rom_dst_dir = os.path.join(prefix, 'share', 'qemu')
- for rom_src in glob.glob('%s/*.bin' % rom_dir):
- rom_dst = os.path.join(rom_dst_dir, os.path.basename(rom_src))
- logging.debug("Copying rom file %s to %s", rom_src, rom_dst)
- shutil.copy(rom_src, rom_dst)
-
-
-class KvmInstallException(Exception):
- pass
-
-
-class FailedKvmInstall(KvmInstallException):
- pass
-
-
-class KvmNotInstalled(KvmInstallException):
- pass
-
-
-class BaseInstaller(object):
- def __init__(self, mode=None):
- self.install_mode = mode
- self._full_module_list = None
-
- def set_install_params(self, test, params):
- self.params = params
-
- load_modules = params.get('load_modules', 'no')
- if not load_modules or load_modules == 'yes':
- self.should_load_modules = True
- elif load_modules == 'no':
- self.should_load_modules = False
- default_extra_modules = str(None)
- self.extra_modules = eval(params.get("extra_modules",
- default_extra_modules))
-
- self.cpu_vendor = virt_utils.get_cpu_vendor()
-
- self.srcdir = test.srcdir
- if not os.path.isdir(self.srcdir):
- os.makedirs(self.srcdir)
-
- self.test_bindir = test.bindir
- self.results_dir = test.resultsdir
-
- # KVM build prefix, for the modes that do need it
- prefix = os.path.join(test.bindir, 'build')
- self.prefix = os.path.abspath(prefix)
-
- # Current host kernel directory
- default_host_kernel_source = '/lib/modules/%s/build' % os.uname()[2]
- self.host_kernel_srcdir = params.get('host_kernel_source',
- default_host_kernel_source)
-
- # Extra parameters that can be passed to the configure script
- self.extra_configure_options = params.get('extra_configure_options',
- None)
-
- # Do we want to save the result of the build on test.resultsdir?
- self.save_results = True
- save_results = params.get('save_results', 'no')
- if save_results == 'no':
- self.save_results = False
-
- self._full_module_list = list(self._module_list())
-
-
- def install_unittests(self):
- userspace_srcdir = os.path.join(self.srcdir, "kvm_userspace")
- test_repo = self.params.get("test_git_repo")
- test_branch = self.params.get("test_branch", "master")
- test_commit = self.params.get("test_commit", None)
- test_lbranch = self.params.get("test_lbranch", "master")
-
- if test_repo:
- test_srcdir = os.path.join(self.srcdir, "kvm-unit-tests")
- virt_utils.get_git_branch(test_repo, test_branch, test_srcdir,
- test_commit, test_lbranch)
- unittest_cfg = os.path.join(test_srcdir, 'x86',
- 'unittests.cfg')
- self.test_srcdir = test_srcdir
- else:
- unittest_cfg = os.path.join(userspace_srcdir, 'kvm', 'test', 'x86',
- 'unittests.cfg')
- self.unittest_cfg = None
- if os.path.isfile(unittest_cfg):
- self.unittest_cfg = unittest_cfg
- else:
- if test_repo:
- logging.error("No unittest config file %s found, skipping "
- "unittest build", self.unittest_cfg)
-
- self.unittest_prefix = None
- if self.unittest_cfg:
- logging.info("Building and installing unittests")
- os.chdir(os.path.dirname(os.path.dirname(self.unittest_cfg)))
- utils.system('./configure --prefix=%s' % self.prefix)
- utils.system('make')
- utils.system('make install')
- self.unittest_prefix = os.path.join(self.prefix, 'share', 'qemu',
- 'tests')
-
-
- def full_module_list(self):
- """Return the module list used by the installer
-
- Used by the module_probe test, to avoid using utils.unload_module().
- """
- if self._full_module_list is None:
- raise KvmNotInstalled("KVM modules not installed yet (installer: %s)" % (type(self)))
- return self._full_module_list
-
-
- def _module_list(self):
- """Generate the list of modules that need to be loaded
- """
- yield 'kvm'
- yield 'kvm-%s' % (self.cpu_vendor)
- if self.extra_modules:
- for module in self.extra_modules:
- yield module
-
-
- def _load_modules(self, mod_list):
- """
- Load the KVM modules
-
- May be overridden by subclasses.
- """
- logging.info("Loading KVM modules")
- for module in mod_list:
- utils.system("modprobe %s" % module)
-
-
- def load_modules(self, mod_list=None):
- if mod_list is None:
- mod_list = self.full_module_list()
- self._load_modules(mod_list)
-
-
- def _unload_modules(self, mod_list=None):
- """
- Just unload the KVM modules, without trying to kill Qemu
- """
- if mod_list is None:
- mod_list = self.full_module_list()
- logging.info("Unloading previously loaded KVM modules")
- for module in reversed(mod_list):
- utils.unload_module(module)
-
-
- def unload_modules(self, mod_list=None):
- """
- Kill Qemu and unload the KVM modules
- """
- kill_qemu_processes()
- self._unload_modules(mod_list)
-
-
- def reload_modules(self):
- """
- Reload the KVM modules after killing Qemu and unloading the current modules
- """
- self.unload_modules()
- self.load_modules()
-
-
- def reload_modules_if_needed(self):
- if self.should_load_modules:
- self.reload_modules()
-
-
-class YumInstaller(BaseInstaller):
- """
- Class that uses yum to install and remove packages.
- """
- def set_install_params(self, test, params):
- super(YumInstaller, self).set_install_params(test, params)
- # Checking if all required dependencies are available
- os_dep.command("rpm")
- os_dep.command("yum")
-
- default_pkg_list = str(['qemu-kvm', 'qemu-kvm-tools'])
- default_qemu_bin_paths = str(['/usr/bin/qemu-kvm', '/usr/bin/qemu-img'])
- default_pkg_path_list = str(None)
- self.pkg_list = eval(params.get("pkg_list", default_pkg_list))
- self.pkg_path_list = eval(params.get("pkg_path_list",
- default_pkg_path_list))
- self.qemu_bin_paths = eval(params.get("qemu_bin_paths",
- default_qemu_bin_paths))
-
-
- def _clean_previous_installs(self):
- kill_qemu_processes()
- removable_packages = ""
- for pkg in self.pkg_list:
- removable_packages += " %s" % pkg
-
- utils.system("yum remove -y %s" % removable_packages)
-
-
- def _get_packages(self):
- for pkg in self.pkg_path_list:
- utils.get_file(pkg, os.path.join(self.srcdir,
- os.path.basename(pkg)))
-
-
- def _install_packages(self):
- """
- Install all downloaded packages.
- """
- os.chdir(self.srcdir)
- utils.system("yum install --nogpgcheck -y *.rpm")
-
-
- def install(self):
- self.install_unittests()
- self._clean_previous_installs()
- self._get_packages()
- self._install_packages()
- create_symlinks(test_bindir=self.test_bindir,
- bin_list=self.qemu_bin_paths,
- unittest=self.unittest_prefix)
- self.reload_modules_if_needed()
- if self.save_results:
- virt_utils.archive_as_tarball(self.srcdir, self.results_dir)
-
-
-class KojiInstaller(YumInstaller):
- """
- Class that handles installing KVM from the fedora build service, koji.
-
- It uses yum to install and remove packages. Packages are specified
- according to the syntax defined in the PkgSpec class.
- """
- def set_install_params(self, test, params):
- """
- Gets parameters and initializes the package downloader.
-
- @param test: kvm test object
- @param params: Dictionary with test arguments
- """
- super(KojiInstaller, self).set_install_params(test, params)
- self.tag = params.get("koji_tag", None)
- self.koji_cmd = params.get("koji_cmd", None)
- if self.tag is not None:
- virt_utils.set_default_koji_tag(self.tag)
- self.koji_pkgs = eval(params.get("koji_pkgs", "[]"))
-
-
- def _get_packages(self):
- """
- Downloads the specific arch RPMs for the specific build name.
- """
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- if pkg.is_valid():
- koji_client.get_pkgs(pkg, dst_dir=self.srcdir)
- else:
- logging.error('Package specification (%s) is invalid: %s', pkg,
- pkg.describe_invalid())
-
-
- def _clean_previous_installs(self):
- kill_qemu_processes()
- removable_packages = " ".join(self._get_rpm_names())
- utils.system("yum -y remove %s" % removable_packages)
-
-
- def install(self):
- self._clean_previous_installs()
- self._get_packages()
- self._install_packages()
- self.install_unittests()
- create_symlinks(test_bindir=self.test_bindir,
- bin_list=self.qemu_bin_paths,
- unittest=self.unittest_prefix)
- self.reload_modules_if_needed()
- if self.save_results:
- virt_utils.archive_as_tarball(self.srcdir, self.results_dir)
-
-
- def _get_rpm_names(self):
- all_rpm_names = []
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- rpm_names = koji_client.get_pkg_rpm_names(pkg)
- all_rpm_names += rpm_names
- return all_rpm_names
-
-
- def _get_rpm_file_names(self):
- all_rpm_file_names = []
- koji_client = virt_utils.KojiClient(cmd=self.koji_cmd)
- for pkg_text in self.koji_pkgs:
- pkg = virt_utils.KojiPkgSpec(pkg_text)
- rpm_file_names = koji_client.get_pkg_rpm_file_names(pkg)
- all_rpm_file_names += rpm_file_names
- return all_rpm_file_names
-
-
- def _install_packages(self):
- """
- Install all downloaded packages.
- """
- os.chdir(self.srcdir)
- rpm_file_names = " ".join(self._get_rpm_file_names())
- utils.system("yum --nogpgcheck -y localinstall %s" % rpm_file_names)
-
-
-class SourceDirInstaller(BaseInstaller):
- """
- Class that handles building/installing KVM directly from a tarball or
- a single source code dir.
- """
- def set_install_params(self, test, params):
- """
- Initializes class attributes, and retrieves KVM code.
-
- @param test: kvm test object
- @param params: Dictionary with test arguments
- """
- super(SourceDirInstaller, self).set_install_params(test, params)
-
- self.mod_install_dir = os.path.join(self.prefix, 'modules')
-
- srcdir = params.get("srcdir", None)
- self.path_to_roms = params.get("path_to_rom_images", None)
-
- if self.install_mode == 'localsrc':
- if srcdir is None:
- raise error.TestError("Install from source directory specified"
- "but no source directory provided on the"
- "control file.")
- else:
- shutil.copytree(srcdir, self.srcdir)
-
- elif self.install_mode == 'localtar':
- tarball = params.get("tarball")
- if not tarball:
- raise error.TestError("KVM Tarball install specified but no"
- " tarball provided on control file.")
- logging.info("Installing KVM from a local tarball")
- logging.info("Using tarball %s")
- tarball = utils.unmap_url("/", params.get("tarball"), "/tmp")
- utils.extract_tarball_to_dir(tarball, self.srcdir)
-
- if self.install_mode in ['localtar', 'srcdir']:
- self.repo_type = virt_utils.check_kvm_source_dir(self.srcdir)
- p = os.path.join(self.srcdir, 'configure')
- self.configure_options = virt_installer.check_configure_options(p)
-
-
- def _build(self):
- make_jobs = utils.count_cpus()
- os.chdir(self.srcdir)
- # For testing purposes, it's better to build qemu binaries with
- # debugging symbols, so we can extract more meaningful stack traces.
- cfg = "./configure --prefix=%s" % self.prefix
- if "--disable-strip" in self.configure_options:
- cfg += " --disable-strip"
- steps = [cfg, "make clean", "make -j %s" % make_jobs]
- logging.info("Building KVM")
- for step in steps:
- utils.system(step)
-
-
- def _install(self):
- os.chdir(self.srcdir)
- logging.info("Installing KVM userspace")
- if self.repo_type == 1:
- utils.system("make -C qemu install")
- elif self.repo_type == 2:
- utils.system("make install")
- if self.path_to_roms:
- install_roms(self.path_to_roms, self.prefix)
- self.install_unittests()
- create_symlinks(test_bindir=self.test_bindir,
- prefix=self.prefix,
- unittest=self.unittest_prefix)
-
-
- def install(self):
- self._build()
- self._install()
- self.reload_modules_if_needed()
- if self.save_results:
- virt_utils.archive_as_tarball(self.srcdir, self.results_dir)
-
-class GitRepo(object):
- def __init__(self, installer, prefix,
- srcdir, build_steps=[], repo_param=None):
- params = installer.params
- self.installer = installer
- self.repo = params.get(repo_param or (prefix + '_repo'))
- self.branch = params.get(prefix + '_branch', 'master')
- self.lbranch = params.get(prefix + '_lbranch', 'master')
- self.commit = params.get(prefix + '_commit', None)
- # The config system yields strings, which have to be evalued
- self.patches = eval(params.get(prefix + '_patches', "[]"))
- self.build_steps = build_steps
- self.srcdir = os.path.join(self.installer.srcdir, srcdir)
-
-
- def fetch_and_patch(self):
- if not self.repo:
- return
- virt_utils.get_git_branch(self.repo, self.branch, self.srcdir,
- self.commit, self.lbranch)
- os.chdir(self.srcdir)
- for patch in self.patches:
- utils.get_file(patch, os.path.join(self.srcdir,
- os.path.basename(patch)))
- utils.system('patch -p1 < %s' % os.path.basename(patch))
-
-
- def build(self):
- os.chdir(self.srcdir)
- for step in self.build_steps:
- logging.info(step)
- utils.run(step)
-
-
-class GitInstaller(SourceDirInstaller):
- def _pull_code(self):
- """
- Retrieves code from git repositories.
- """
- params = self.params
- make_jobs = utils.count_cpus()
- cfg = 'PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" ./configure' % (
- self.prefix, self.prefix)
-
- self.spice_protocol = GitRepo(installer=self, prefix='spice_protocol',
- srcdir='spice-protocol',
- build_steps= ['./autogen.sh',
- './configure --prefix=%s' % self.prefix,
- 'make clean',
- 'make -j %s' % (make_jobs),
- 'make install'])
-
- self.spice = GitRepo(installer=self, prefix='spice', srcdir='spice',
- build_steps= ['PKG_CONFIG_PATH="%s/lib/pkgconfig:%s/share/pkgconfig" CXXFLAGS=-Wl,--add-needed ./autogen.sh --prefix=%s' % (self.prefix, self.prefix, self.prefix),
- 'make clean',
- 'make -j %s' % (make_jobs),
- 'make install'])
-
- self.userspace = GitRepo(installer=self, prefix='user',
- repo_param='user_git_repo', srcdir='kvm_userspace')
-
- p = os.path.join(self.userspace.srcdir, 'configure')
- self.configure_options = virt_installer.check_configure_options(p)
-
- cfg = cfg + ' --prefix=%s' % self.prefix
- if "--disable-strip" in self.configure_options:
- cfg += ' --disable-strip'
- if self.extra_configure_options:
- cfg += ' %s' % self.extra_configure_options
-
- self.userspace.build_steps=[cfg, 'make clean', 'make -j %s' % make_jobs]
-
- if not self.userspace.repo:
- message = "KVM user git repository path not specified"
- logging.error(message)
- raise error.TestError(message)
-
- for repo in [self.userspace, self.spice_protocol, self.spice]:
- if not repo.repo:
- continue
- repo.fetch_and_patch()
-
- def _build(self):
- if self.spice_protocol.repo:
- logging.info('Building Spice-protocol')
- self.spice_protocol.build()
-
- if self.spice.repo:
- logging.info('Building Spice')
- self.spice.build()
-
- logging.info('Building KVM userspace code')
- self.userspace.build()
-
-
- def _install(self):
- os.chdir(self.userspace.srcdir)
- utils.system('make install')
-
- if self.path_to_roms:
- install_roms(self.path_to_roms, self.prefix)
- self.install_unittests()
- create_symlinks(test_bindir=self.test_bindir, prefix=self.prefix,
- bin_list=None,
- unittest=self.unittest_prefix)
-
-
- def install(self):
- self._pull_code()
- self._build()
- self._install()
- self.reload_modules_if_needed()
- if self.save_results:
- virt_utils.archive_as_tarball(self.srcdir, self.results_dir)
-
-
-class PreInstalledKvm(BaseInstaller):
- def install(self):
- logging.info("Expecting KVM to be already installed. Doing nothing")
-
-
-class FailedInstaller:
- """
- Class used to be returned instead of the installer if a installation fails
-
- Useful to make sure no installer object is used if KVM installation fails.
- """
- def __init__(self, msg="KVM install failed"):
- self._msg = msg
-
-
- def load_modules(self):
- """Will refuse to load the KVM modules as install failed"""
- raise FailedKvmInstall("KVM modules not available. reason: %s" % (self._msg))
-
-
-installer_classes = {
- 'localsrc': SourceDirInstaller,
- 'localtar': SourceDirInstaller,
- 'git': GitInstaller,
- 'yum': YumInstaller,
- 'koji': KojiInstaller,
- 'preinstalled': PreInstalledKvm,
-}
-
-
-def _installer_class(install_mode):
- c = installer_classes.get(install_mode)
- if c is None:
- raise error.TestError('Invalid or unsupported'
- ' install mode: %s' % install_mode)
- return c
-
-
-def make_installer(params):
- # priority:
- # - 'install_mode' param
- # - 'mode' param
- mode = params.get("install_mode", params.get("mode"))
- klass = _installer_class(mode)
- return klass(mode)
diff --git a/client/virt/kvm_monitor.py b/client/virt/kvm_monitor.py
deleted file mode 100644
index 9b003b1..0000000
--- a/client/virt/kvm_monitor.py
+++ /dev/null
@@ -1,797 +0,0 @@
-"""
-Interfaces to the QEMU monitor.
-
-@copyright: 2008-2010 Red Hat Inc.
-"""
-
-import socket, time, threading, logging, select
-import virt_utils
-try:
- import json
-except ImportError:
- logging.warning("Could not import json module. "
- "QMP monitor functionality disabled.")
-
-
-class MonitorError(Exception):
- pass
-
-
-class MonitorConnectError(MonitorError):
- pass
-
-
-class MonitorSocketError(MonitorError):
- def __init__(self, msg, e):
- Exception.__init__(self, msg, e)
- self.msg = msg
- self.e = e
-
- def __str__(self):
- return "%s (%s)" % (self.msg, self.e)
-
-
-class MonitorLockError(MonitorError):
- pass
-
-
-class MonitorProtocolError(MonitorError):
- pass
-
-
-class MonitorNotSupportedError(MonitorError):
- pass
-
-
-class QMPCmdError(MonitorError):
- def __init__(self, cmd, qmp_args, data):
- MonitorError.__init__(self, cmd, qmp_args, data)
- self.cmd = cmd
- self.qmp_args = qmp_args
- self.data = data
-
- def __str__(self):
- return ("QMP command %r failed (arguments: %r, "
- "error message: %r)" % (self.cmd, self.qmp_args, self.data))
-
-
-class Monitor:
- """
- Common code for monitor classes.
- """
-
- def __init__(self, name, filename):
- """
- Initialize the instance.
-
- @param name: Monitor identifier (a string)
- @param filename: Monitor socket filename
- @raise MonitorConnectError: Raised if the connection fails
- """
- self.name = name
- self.filename = filename
- self._lock = threading.RLock()
- self._socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-
- try:
- self._socket.connect(filename)
- except socket.error:
- raise MonitorConnectError("Could not connect to monitor socket")
-
-
- def __del__(self):
- # Automatically close the connection when the instance is garbage
- # collected
- self._close_sock()
-
-
- # The following two functions are defined to make sure the state is set
- # exclusively by the constructor call as specified in __getinitargs__().
-
- def __getstate__(self):
- pass
-
-
- def __setstate__(self, state):
- pass
-
-
- def __getinitargs__(self):
- # Save some information when pickling -- will be passed to the
- # constructor upon unpickling
- return self.name, self.filename, True
-
-
- def _close_sock(self):
- try:
- self._socket.shutdown(socket.SHUT_RDWR)
- except socket.error:
- pass
- self._socket.close()
-
- def _acquire_lock(self, timeout=20):
- end_time = time.time() + timeout
- while time.time() < end_time:
- if self._lock.acquire(False):
- return True
- time.sleep(0.05)
- return False
-
-
- def _data_available(self, timeout=0):
- timeout = max(0, timeout)
- try:
- return bool(select.select([self._socket], [], [], timeout)[0])
- except socket.error, e:
- raise MonitorSocketError("Verifying data on monitor socket", e)
-
-
- def _recvall(self):
- s = ""
- while self._data_available():
- try:
- data = self._socket.recv(1024)
- except socket.error, e:
- raise MonitorSocketError("Could not receive data from monitor",
- e)
- if not data:
- break
- s += data
- return s
-
-
- def is_responsive(self):
- """
- Return True iff the monitor is responsive.
- """
- try:
- self.verify_responsive()
- return True
- except MonitorError:
- return False
-
-
-class HumanMonitor(Monitor):
- """
- Wraps "human monitor" commands.
- """
-
- def __init__(self, name, filename, suppress_exceptions=False):
- """
- Connect to the monitor socket and find the (qemu) prompt.
-
- @param name: Monitor identifier (a string)
- @param filename: Monitor socket filename
- @raise MonitorConnectError: Raised if the connection fails and
- suppress_exceptions is False
- @raise MonitorProtocolError: Raised if the initial (qemu) prompt isn't
- found and suppress_exceptions is False
- @note: Other exceptions may be raised. See cmd()'s
- docstring.
- """
- try:
- Monitor.__init__(self, name, filename)
-
- self.protocol = "human"
-
- # Find the initial (qemu) prompt
- s, o = self._read_up_to_qemu_prompt(20)
- if not s:
- raise MonitorProtocolError("Could not find (qemu) prompt "
- "after connecting to monitor. "
- "Output so far: %r" % o)
-
- # Save the output of 'help' for future use
- self._help_str = self.cmd("help", debug=False)
-
- except MonitorError, e:
- self._close_sock()
- if suppress_exceptions:
- logging.warning(e)
- else:
- raise
-
-
- # Private methods
-
- def _read_up_to_qemu_prompt(self, timeout=20):
- s = ""
- end_time = time.time() + timeout
- while self._data_available(end_time - time.time()):
- data = self._recvall()
- if not data:
- break
- s += data
- try:
- if s.splitlines()[-1].split()[-1] == "(qemu)":
- return True, "\n".join(s.splitlines()[:-1])
- except IndexError:
- continue
- return False, "\n".join(s.splitlines())
-
-
- def _send(self, cmd):
- """
- Send a command without waiting for output.
-
- @param cmd: Command to send
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- """
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to send "
- "monitor command '%s'" % cmd)
-
- try:
- try:
- self._socket.sendall(cmd + "\n")
- except socket.error, e:
- raise MonitorSocketError("Could not send monitor command %r" %
- cmd, e)
-
- finally:
- self._lock.release()
-
-
- # Public methods
-
- def cmd(self, command, timeout=20, debug=True):
- """
- Send command to the monitor.
-
- @param command: Command to send to the monitor
- @param timeout: Time duration to wait for the (qemu) prompt to return
- @param debug: Whether to print the commands being sent and responses
- @return: Output received from the monitor
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- @raise MonitorProtocolError: Raised if the (qemu) prompt cannot be
- found after sending the command
- """
- if debug:
- logging.debug("(monitor %s) Sending command '%s'",
- self.name, command)
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to send "
- "monitor command '%s'" % command)
-
- try:
- # Read any data that might be available
- self._recvall()
- # Send command
- self._send(command)
- # Read output
- s, o = self._read_up_to_qemu_prompt(timeout)
- # Remove command echo from output
- o = "\n".join(o.splitlines()[1:])
- # Report success/failure
- if s:
- if debug and o:
- logging.debug("(monitor %s) "
- "Response to '%s'", self.name,
- command)
- for l in o.splitlines():
- logging.debug("(monitor %s) %s", self.name, l)
- return o
- else:
- msg = ("Could not find (qemu) prompt after command '%s'. "
- "Output so far: %r" % (command, o))
- raise MonitorProtocolError(msg)
-
- finally:
- self._lock.release()
-
-
- def verify_responsive(self):
- """
- Make sure the monitor is responsive by sending a command.
- """
- self.cmd("info status", debug=False)
-
-
- def verify_status(self, status):
- """
- Verify VM status
-
- @param status: Optional VM status, 'running' or 'paused'
- @return: return True if VM status is same as we expected
- """
- o = self.cmd("info status", debug=False)
- if status=='paused' or status=='running':
- return (status in o)
-
-
- # Command wrappers
- # Notes:
- # - All of the following commands raise exceptions in a similar manner to
- # cmd().
- # - A command wrapper should use self._help_str if it requires information
- # about the monitor's capabilities.
-
- def quit(self):
- """
- Send "quit" without waiting for output.
- """
- self._send("quit")
-
-
- def info(self, what):
- """
- Request info about something and return the output.
- """
- return self.cmd("info %s" % what)
-
-
- def query(self, what):
- """
- Alias for info.
- """
- return self.info(what)
-
-
- def screendump(self, filename, debug=True):
- """
- Request a screendump.
-
- @param filename: Location for the screendump
- @return: The command's output
- """
- return self.cmd(command="screendump %s" % filename, debug=debug)
-
-
- def migrate(self, uri, full_copy=False, incremental_copy=False, wait=False):
- """
- Migrate.
-
- @param uri: destination URI
- @param full_copy: If true, migrate with full disk copy
- @param incremental_copy: If true, migrate with incremental disk copy
- @param wait: If true, wait for completion
- @return: The command's output
- """
- cmd = "migrate"
- if not wait:
- cmd += " -d"
- if full_copy:
- cmd += " -b"
- if incremental_copy:
- cmd += " -i"
- cmd += " %s" % uri
- return self.cmd(cmd)
-
-
- def migrate_set_speed(self, value):
- """
- Set maximum speed (in bytes/sec) for migrations.
-
- @param value: Speed in bytes/sec
- @return: The command's output
- """
- return self.cmd("migrate_set_speed %s" % value)
-
-
- def sendkey(self, keystr, hold_time=1):
- """
- Send key combination to VM.
-
- @param keystr: Key combination string
- @param hold_time: Hold time in ms (should normally stay 1 ms)
- @return: The command's output
- """
- return self.cmd("sendkey %s %s" % (keystr, hold_time))
-
-
- def mouse_move(self, dx, dy):
- """
- Move mouse.
-
- @param dx: X amount
- @param dy: Y amount
- @return: The command's output
- """
- return self.cmd("mouse_move %d %d" % (dx, dy))
-
-
- def mouse_button(self, state):
- """
- Set mouse button state.
-
- @param state: Button state (1=L, 2=M, 4=R)
- @return: The command's output
- """
- return self.cmd("mouse_button %d" % state)
-
-
-class QMPMonitor(Monitor):
- """
- Wraps QMP monitor commands.
- """
-
- def __init__(self, name, filename, suppress_exceptions=False):
- """
- Connect to the monitor socket, read the greeting message and issue the
- qmp_capabilities command. Also make sure the json module is available.
-
- @param name: Monitor identifier (a string)
- @param filename: Monitor socket filename
- @raise MonitorConnectError: Raised if the connection fails and
- suppress_exceptions is False
- @raise MonitorProtocolError: Raised if the no QMP greeting message is
- received and suppress_exceptions is False
- @raise MonitorNotSupportedError: Raised if json isn't available and
- suppress_exceptions is False
- @note: Other exceptions may be raised if the qmp_capabilities command
- fails. See cmd()'s docstring.
- """
- try:
- Monitor.__init__(self, name, filename)
-
- self.protocol = "qmp"
- self._greeting = None
- self._events = []
-
- # Make sure json is available
- try:
- json
- except NameError:
- raise MonitorNotSupportedError("QMP requires the json module "
- "(Python 2.6 and up)")
-
- # Read greeting message
- end_time = time.time() + 20
- while time.time() < end_time:
- for obj in self._read_objects():
- if "QMP" in obj:
- self._greeting = obj
- break
- if self._greeting:
- break
- time.sleep(0.1)
- else:
- raise MonitorProtocolError("No QMP greeting message received")
-
- # Issue qmp_capabilities
- self.cmd("qmp_capabilities")
-
- except MonitorError, e:
- self._close_sock()
- if suppress_exceptions:
- logging.warning(e)
- else:
- raise
-
-
- # Private methods
-
- def _build_cmd(self, cmd, args=None, id=None):
- obj = {"execute": cmd}
- if args is not None:
- obj["arguments"] = args
- if id is not None:
- obj["id"] = id
- return obj
-
-
- def _read_objects(self, timeout=5):
- """
- Read lines from the monitor and try to decode them.
- Stop when all available lines have been successfully decoded, or when
- timeout expires. If any decoded objects are asynchronous events, store
- them in self._events. Return all decoded objects.
-
- @param timeout: Time to wait for all lines to decode successfully
- @return: A list of objects
- """
- if not self._data_available():
- return []
- s = ""
- end_time = time.time() + timeout
- while self._data_available(end_time - time.time()):
- s += self._recvall()
- # Make sure all lines are decodable
- for line in s.splitlines():
- if line:
- try:
- json.loads(line)
- except:
- # Found an incomplete or broken line -- keep reading
- break
- else:
- # All lines are OK -- stop reading
- break
- # Decode all decodable lines
- objs = []
- for line in s.splitlines():
- try:
- objs += [json.loads(line)]
- except:
- pass
- # Keep track of asynchronous events
- self._events += [obj for obj in objs if "event" in obj]
- return objs
-
-
- def _send(self, data):
- """
- Send raw data without waiting for response.
-
- @param data: Data to send
- @raise MonitorSocketError: Raised if a socket error occurs
- """
- try:
- self._socket.sendall(data)
- except socket.error, e:
- raise MonitorSocketError("Could not send data: %r" % data, e)
-
-
- def _get_response(self, id=None, timeout=20):
- """
- Read a response from the QMP monitor.
-
- @param id: If not None, look for a response with this id
- @param timeout: Time duration to wait for response
- @return: The response dict, or None if none was found
- """
- end_time = time.time() + timeout
- while self._data_available(end_time - time.time()):
- for obj in self._read_objects():
- if isinstance(obj, dict):
- if id is not None and obj.get("id") != id:
- continue
- if "return" in obj or "error" in obj:
- return obj
-
-
- # Public methods
-
- def cmd(self, cmd, args=None, timeout=20, debug=True):
- """
- Send a QMP monitor command and return the response.
-
- Note: an id is automatically assigned to the command and the response
- is checked for the presence of the same id.
-
- @param cmd: Command to send
- @param args: A dict containing command arguments, or None
- @param timeout: Time duration to wait for response
- @return: The response received
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- @raise MonitorProtocolError: Raised if no response is received
- @raise QMPCmdError: Raised if the response is an error message
- (the exception's args are (cmd, args, data) where data is the
- error data)
- """
- if debug:
- logging.debug("(monitor %s) Sending command '%s'",
- self.name, cmd)
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to send "
- "QMP command '%s'" % cmd)
-
- try:
- # Read any data that might be available
- self._read_objects()
- # Send command
- id = virt_utils.generate_random_string(8)
- self._send(json.dumps(self._build_cmd(cmd, args, id)) + "\n")
- # Read response
- r = self._get_response(id, timeout)
- if r is None:
- raise MonitorProtocolError("Received no response to QMP "
- "command '%s', or received a "
- "response with an incorrect id"
- % cmd)
- if "return" in r:
- if debug and r["return"]:
- logging.debug("(monitor %s) "
- "Response to '%s'", self.name, cmd)
- o = str(r["return"])
- for l in o.splitlines():
- logging.debug("(monitor %s) %s", self.name, l)
- return r["return"]
- if "error" in r:
- raise QMPCmdError(cmd, args, r["error"])
-
- finally:
- self._lock.release()
-
-
- def cmd_raw(self, data, timeout=20):
- """
- Send a raw string to the QMP monitor and return the response.
- Unlike cmd(), return the raw response dict without performing any
- checks on it.
-
- @param data: The data to send
- @param timeout: Time duration to wait for response
- @return: The response received
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- @raise MonitorProtocolError: Raised if no response is received
- """
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to send "
- "data: %r" % data)
-
- try:
- self._read_objects()
- self._send(data)
- r = self._get_response(None, timeout)
- if r is None:
- raise MonitorProtocolError("Received no response to data: %r" %
- data)
- return r
-
- finally:
- self._lock.release()
-
-
- def cmd_obj(self, obj, timeout=20):
- """
- Transform a Python object to JSON, send the resulting string to the QMP
- monitor, and return the response.
- Unlike cmd(), return the raw response dict without performing any
- checks on it.
-
- @param obj: The object to send
- @param timeout: Time duration to wait for response
- @return: The response received
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- @raise MonitorProtocolError: Raised if no response is received
- """
- return self.cmd_raw(json.dumps(obj) + "\n")
-
-
- def cmd_qmp(self, cmd, args=None, id=None, timeout=20):
- """
- Build a QMP command from the passed arguments, send it to the monitor
- and return the response.
- Unlike cmd(), return the raw response dict without performing any
- checks on it.
-
- @param cmd: Command to send
- @param args: A dict containing command arguments, or None
- @param id: An id for the command, or None
- @param timeout: Time duration to wait for response
- @return: The response received
- @raise MonitorLockError: Raised if the lock cannot be acquired
- @raise MonitorSocketError: Raised if a socket error occurs
- @raise MonitorProtocolError: Raised if no response is received
- """
- return self.cmd_obj(self._build_cmd(cmd, args, id), timeout)
-
-
- def verify_responsive(self):
- """
- Make sure the monitor is responsive by sending a command.
- """
- self.cmd(cmd="query-status", debug=False)
-
-
- def verify_status(self, status):
- """
- Verify VM status
-
- @param status: Optional VM status, 'running' or 'paused'
- @return: return True if VM status is same as we expected
- """
- o = str(self.cmd(cmd="query-status", debug=False))
- if (status=='paused' and "u'running': False" in o):
- return True
- if (status=='running' and "u'running': True" in o):
- return True
-
-
- def get_events(self):
- """
- Return a list of the asynchronous events received since the last
- clear_events() call.
-
- @return: A list of events (the objects returned have an "event" key)
- @raise MonitorLockError: Raised if the lock cannot be acquired
- """
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to read "
- "QMP events")
- try:
- self._read_objects()
- return self._events[:]
- finally:
- self._lock.release()
-
-
- def get_event(self, name):
- """
- Look for an event with the given name in the list of events.
-
- @param name: The name of the event to look for (e.g. 'RESET')
- @return: An event object or None if none is found
- """
- for e in self.get_events():
- if e.get("event") == name:
- return e
-
-
- def clear_events(self):
- """
- Clear the list of asynchronous events.
-
- @raise MonitorLockError: Raised if the lock cannot be acquired
- """
- if not self._acquire_lock(20):
- raise MonitorLockError("Could not acquire exclusive lock to clear "
- "QMP event list")
- self._events = []
- self._lock.release()
-
-
- def get_greeting(self):
- """
- Return QMP greeting message.
- """
- return self._greeting
-
-
- # Command wrappers
- # Note: all of the following functions raise exceptions in a similar manner
- # to cmd().
-
- def quit(self):
- """
- Send "quit" and return the response.
- """
- return self.cmd("quit")
-
-
- def info(self, what):
- """
- Request info about something and return the response.
- """
- return self.cmd("query-%s" % what)
-
-
- def query(self, what):
- """
- Alias for info.
- """
- return self.info(what)
-
-
- def screendump(self, filename, debug=True):
- """
- Request a screendump.
-
- @param filename: Location for the screendump
- @return: The response to the command
- """
- args = {"filename": filename}
- return self.cmd(cmd="screendump", args=args, debug=debug)
-
-
- def migrate(self, uri, full_copy=False, incremental_copy=False, wait=False):
- """
- Migrate.
-
- @param uri: destination URI
- @param full_copy: If true, migrate with full disk copy
- @param incremental_copy: If true, migrate with incremental disk copy
- @param wait: If true, wait for completion
- @return: The response to the command
- """
- args = {"uri": uri,
- "blk": full_copy,
- "inc": incremental_copy}
- return self.cmd("migrate", args)
-
-
- def migrate_set_speed(self, value):
- """
- Set maximum speed (in bytes/sec) for migrations.
-
- @param value: Speed in bytes/sec
- @return: The response to the command
- """
- args = {"value": value}
- return self.cmd("migrate_set_speed", args)
diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
deleted file mode 100644
index 423ec3b..0000000
--- a/client/virt/kvm_vm.py
+++ /dev/null
@@ -1,1381 +0,0 @@
-"""
-Utility classes and functions to handle Virtual Machine creation using qemu.
-
-@copyright: 2008-2009 Red Hat Inc.
-"""
-
-import time, os, logging, fcntl, re, commands, glob
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-import virt_utils, virt_vm, virt_test_setup, kvm_monitor, aexpect
-
-
-class VM(virt_vm.BaseVM):
- """
- This class handles all basic VM operations.
- """
-
- MIGRATION_PROTOS = ['tcp', 'unix', 'exec']
-
- def __init__(self, name, params, root_dir, address_cache, state=None):
- """
- Initialize the object and set a few attributes.
-
- @param name: The name of the object
- @param params: A dict containing VM params
- (see method make_qemu_command for a full description)
- @param root_dir: Base directory for relative filenames
- @param address_cache: A dict that maps MAC addresses to IP addresses
- @param state: If provided, use this as self.__dict__
- """
- virt_vm.BaseVM.__init__(self, name, params)
-
- if state:
- self.__dict__ = state
- else:
- self.process = None
- self.serial_console = None
- self.redirs = {}
- self.vnc_port = 5900
- self.monitors = []
- self.pci_assignable = None
- self.netdev_id = []
- self.device_id = []
- self.tapfds = []
- self.uuid = None
-
-
- self.spice_port = 8000
- self.name = name
- self.params = params
- self.root_dir = root_dir
- self.address_cache = address_cache
-
-
- def verify_alive(self):
- """
- Make sure the VM is alive and that the main monitor is responsive.
-
- @raise VMDeadError: If the VM is dead
- @raise: Various monitor exceptions if the monitor is unresponsive
- """
- try:
- virt_vm.BaseVM.verify_alive(self)
- if self.monitors:
- self.monitor.verify_responsive()
- except virt_vm.VMDeadError:
- raise virt_vm.VMDeadError(self.process.get_status(),
- self.process.get_output())
-
-
- def is_alive(self):
- """
- Return True if the VM is alive and its monitor is responsive.
- """
- return not self.is_dead() and (not self.monitors or
- self.monitor.is_responsive())
-
-
- def is_dead(self):
- """
- Return True if the qemu process is dead.
- """
- return not self.process or not self.process.is_alive()
-
-
- def verify_status(self, status):
- """
- Check VM status
-
- @param status: Optional VM status, 'running' or 'paused'
- @raise VMStatusError: If the VM status is not same as parameter
- """
- if not self.monitor.verify_status(status):
- raise virt_vm.VMStatusError("VM status is unexpected")
-
-
- def clone(self, name=None, params=None, root_dir=None, address_cache=None,
- copy_state=False):
- """
- Return a clone of the VM object with optionally modified parameters.
- The clone is initially not alive and needs to be started using create().
- Any parameters not passed to this function are copied from the source
- VM.
-
- @param name: Optional new VM name
- @param params: Optional new VM creation parameters
- @param root_dir: Optional new base directory for relative filenames
- @param address_cache: A dict that maps MAC addresses to IP addresses
- @param copy_state: If True, copy the original VM's state to the clone.
- Mainly useful for make_qemu_command().
- """
- if name is None:
- name = self.name
- if params is None:
- params = self.params.copy()
- if root_dir is None:
- root_dir = self.root_dir
- if address_cache is None:
- address_cache = self.address_cache
- if copy_state:
- state = self.__dict__.copy()
- else:
- state = None
- return VM(name, params, root_dir, address_cache, state)
-
-
- def __make_qemu_command(self, name=None, params=None, root_dir=None):
- """
- Generate a qemu command line. All parameters are optional. If a
- parameter is not supplied, the corresponding value stored in the
- class attributes is used.
-
- @param name: The name of the object
- @param params: A dict containing VM params
- @param root_dir: Base directory for relative filenames
-
- @note: The params dict should contain:
- mem -- memory size in MBs
- cdrom -- ISO filename to use with the qemu -cdrom parameter
- extra_params -- a string to append to the qemu command
- shell_port -- port of the remote shell daemon on the guest
- (SSH, Telnet or the home-made Remote Shell Server)
- shell_client -- client program to use for connecting to the
- remote shell daemon on the guest (ssh, telnet or nc)
- x11_display -- if specified, the DISPLAY environment variable
- will be be set to this value for the qemu process (useful for
- SDL rendering)
- images -- a list of image object names, separated by spaces
- nics -- a list of NIC object names, separated by spaces
-
- For each image in images:
- drive_format -- string to pass as 'if' parameter for this
- image (e.g. ide, scsi)
- image_snapshot -- if yes, pass 'snapshot=on' to qemu for
- this image
- image_boot -- if yes, pass 'boot=on' to qemu for this image
- In addition, all parameters required by get_image_filename.
-
- For each NIC in nics:
- nic_model -- string to pass as 'model' parameter for this
- NIC (e.g. e1000)
- """
- # Helper function for command line option wrappers
- def has_option(help, option):
- return bool(re.search(r"^-%s(\s|$)" % option, help, re.MULTILINE))
-
- # Wrappers for all supported qemu command line parameters.
- # This is meant to allow support for multiple qemu versions.
- # Each of these functions receives the output of 'qemu -help' as a
- # parameter, and should add the requested command line option
- # accordingly.
-
- def add_name(help, name):
- return " -name '%s'" % name
-
- def add_human_monitor(help, filename):
- return " -monitor unix:'%s',server,nowait" % filename
-
- def add_qmp_monitor(help, filename):
- return " -qmp unix:'%s',server,nowait" % filename
-
- def add_serial(help, filename):
- return " -serial unix:'%s',server,nowait" % filename
-
- def add_mem(help, mem):
- return " -m %s" % mem
-
- def add_smp(help, smp):
- return " -smp %s" % smp
-
- def add_cdrom(help, filename, index=None, format=None):
- if has_option(help, "drive"):
- name = None;
- dev = "";
- if format == "ahci":
- name = "ahci%s" % index
- dev += " -device ide-drive,bus=ahci.%s,drive=%s" % (index, name)
- format = "none"
- index = None
- if format == "usb2":
- name = "usb2.%s" % index
- dev += " -device usb-storage,bus=ehci.0,drive=%s" % name
- dev += ",port=%d" % (int(index) + 1)
- format = "none"
- index = None
- cmd = " -drive file='%s',media=cdrom" % filename
- if index is not None:
- cmd += ",index=%s" % index
- if format:
- cmd += ",if=%s" % format
- if name:
- cmd += ",id=%s" % name
- return cmd + dev
- else:
- return " -cdrom '%s'" % filename
-
- def add_drive(help, filename, index=None, format=None, cache=None,
- werror=None, serial=None, snapshot=False, boot=False):
- name = None;
- dev = "";
- if format == "ahci":
- name = "ahci%s" % index
- dev += " -device ide-drive,bus=ahci.%s,drive=%s" % (index, name)
- format = "none"
- index = None
- if format == "usb2":
- name = "usb2.%s" % index
- dev += " -device usb-storage,bus=ehci.0,drive=%s" % name
- dev += ",port=%d" % (int(index) + 1)
- format = "none"
- index = None
- cmd = " -drive file='%s'" % filename
- if index is not None:
- cmd += ",index=%s" % index
- if format:
- cmd += ",if=%s" % format
- if cache:
- cmd += ",cache=%s" % cache
- if werror:
- cmd += ",werror=%s" % werror
- if serial:
- cmd += ",serial='%s'" % serial
- if snapshot:
- cmd += ",snapshot=on"
- if boot:
- cmd += ",boot=on"
- if name:
- cmd += ",id=%s" % name
- return cmd + dev
-
- def add_nic(help, vlan, model=None, mac=None, device_id=None, netdev_id=None,
- nic_extra_params=None):
- if has_option(help, "netdev"):
- netdev_vlan_str = ",netdev=%s" % netdev_id
- else:
- netdev_vlan_str = ",vlan=%d" % vlan
- if has_option(help, "device"):
- if not model:
- model = "rtl8139"
- elif model == "virtio":
- model = "virtio-net-pci"
- cmd = " -device %s" % model + netdev_vlan_str
- if mac:
- cmd += ",mac='%s'" % mac
- if nic_extra_params:
- cmd += ",%s" % nic_extra_params
- else:
- cmd = " -net nic" + netdev_vlan_str
- if model:
- cmd += ",model=%s" % model
- if mac:
- cmd += ",macaddr='%s'" % mac
- if device_id:
- cmd += ",id='%s'" % device_id
- return cmd
-
- def add_net(help, vlan, mode, ifname=None, tftp=None, bootfile=None,
- hostfwd=[], netdev_id=None, netdev_extra_params=None,
- tapfd=None):
- if has_option(help, "netdev"):
- cmd = " -netdev %s,id=%s" % (mode, netdev_id)
- if netdev_extra_params:
- cmd += ",%s" % netdev_extra_params
- else:
- cmd = " -net %s,vlan=%d" % (mode, vlan)
- if mode == "tap" and tapfd:
- cmd += ",fd=%d" % tapfd
- elif mode == "user":
- if tftp and "[,tftp=" in help:
- cmd += ",tftp='%s'" % tftp
- if bootfile and "[,bootfile=" in help:
- cmd += ",bootfile='%s'" % bootfile
- if "[,hostfwd=" in help:
- for host_port, guest_port in hostfwd:
- cmd += ",hostfwd=tcp::%s-:%s" % (host_port, guest_port)
- return cmd
-
- def add_floppy(help, filename):
- return " -fda '%s'" % filename
-
- def add_tftp(help, filename):
- # If the new syntax is supported, don't add -tftp
- if "[,tftp=" in help:
- return ""
- else:
- return " -tftp '%s'" % filename
-
- def add_bootp(help, filename):
- # If the new syntax is supported, don't add -bootp
- if "[,bootfile=" in help:
- return ""
- else:
- return " -bootp '%s'" % filename
-
- def add_tcp_redir(help, host_port, guest_port):
- # If the new syntax is supported, don't add -redir
- if "[,hostfwd=" in help:
- return ""
- else:
- return " -redir tcp:%s::%s" % (host_port, guest_port)
-
- def add_vnc(help, vnc_port):
- return " -vnc :%d" % (vnc_port - 5900)
-
- def add_sdl(help):
- if has_option(help, "sdl"):
- return " -sdl"
- else:
- return ""
-
- def add_nographic(help):
- return " -nographic"
-
- def add_uuid(help, uuid):
- return " -uuid '%s'" % uuid
-
- def add_pcidevice(help, host):
- return " -pcidevice host='%s'" % host
-
- def add_spice(help, port, param):
- if has_option(help,"spice"):
- return " -spice port=%s,%s" % (port, param)
- else:
- return ""
-
- def add_qxl_vga(help, qxl, vga, qxl_dev_nr=None):
- str = ""
- if has_option(help, "qxl"):
- if qxl and qxl_dev_nr is not None:
- str += " -qxl %s" % qxl_dev_nr
- if has_option(help, "vga") and vga and vga != "qxl":
- str += " -vga %s" % vga
- elif has_option(help, "vga"):
- if qxl:
- str += " -vga qxl"
- elif vga:
- str += " -vga %s" % vga
- return str
-
- def add_kernel(help, filename):
- return " -kernel '%s'" % filename
-
- def add_initrd(help, filename):
- return " -initrd '%s'" % filename
-
- def add_kernel_cmdline(help, cmdline):
- return " -append '%s'" % cmdline
-
- def add_testdev(help, filename):
- return (" -chardev file,id=testlog,path=%s"
- " -device testdev,chardev=testlog" % filename)
-
- def add_no_hpet(help):
- if has_option(help, "no-hpet"):
- return " -no-hpet"
- else:
- return ""
-
- # End of command line option wrappers
-
- if name is None:
- name = self.name
- if params is None:
- params = self.params
- if root_dir is None:
- root_dir = self.root_dir
-
- have_ahci = False
- have_usb2 = False
-
- # Clone this VM using the new params
- vm = self.clone(name, params, root_dir, copy_state=True)
-
- qemu_binary = virt_utils.get_path(root_dir, params.get("qemu_binary",
- "qemu"))
- help = commands.getoutput("%s -help" % qemu_binary)
-
- # Start constructing the qemu command
- qemu_cmd = ""
- # Set the X11 display parameter if requested
- if params.get("x11_display"):
- qemu_cmd += "DISPLAY=%s " % params.get("x11_display")
- # Update LD_LIBRARY_PATH for built libraries (libspice-server)
- library_path = os.path.join(self.root_dir, 'build', 'lib')
- if os.path.isdir(library_path):
- library_path = os.path.abspath(library_path)
- qemu_cmd += "LD_LIBRARY_PATH=%s " % library_path
- # Add the qemu binary
- qemu_cmd += qemu_binary
- # Add the VM's name
- qemu_cmd += add_name(help, name)
- # no automagic devices please
- if has_option(help,"nodefaults"):
- qemu_cmd += " -nodefaults"
- qemu_cmd += " -vga std"
- # Add monitors
- for monitor_name in params.objects("monitors"):
- monitor_params = params.object_params(monitor_name)
- monitor_filename = vm.get_monitor_filename(monitor_name)
- if monitor_params.get("monitor_type") == "qmp":
- qemu_cmd += add_qmp_monitor(help, monitor_filename)
- else:
- qemu_cmd += add_human_monitor(help, monitor_filename)
-
- # Add serial console redirection
- qemu_cmd += add_serial(help, vm.get_serial_console_filename())
-
- for image_name in params.objects("images"):
- image_params = params.object_params(image_name)
- if image_params.get("boot_drive") == "no":
- continue
- if image_params.get("drive_format") == "ahci" and not have_ahci:
- qemu_cmd += " -device ahci,id=ahci"
- have_ahci = True
- if image_params.get("drive_format") == "usb2" and not have_usb2:
- qemu_cmd += " -device usb-ehci,id=ehci"
- have_usb2 = True
- qemu_cmd += add_drive(help,
- virt_vm.get_image_filename(image_params, root_dir),
- image_params.get("drive_index"),
- image_params.get("drive_format"),
- image_params.get("drive_cache"),
- image_params.get("drive_werror"),
- image_params.get("drive_serial"),
- image_params.get("image_snapshot") == "yes",
- image_params.get("image_boot") == "yes")
-
- redirs = []
- for redir_name in params.objects("redirs"):
- redir_params = params.object_params(redir_name)
- guest_port = int(redir_params.get("guest_port"))
- host_port = vm.redirs.get(guest_port)
- redirs += [(host_port, guest_port)]
-
- vlan = 0
- for nic_name in params.objects("nics"):
- nic_params = params.object_params(nic_name)
- try:
- netdev_id = vm.netdev_id[vlan]
- device_id = vm.device_id[vlan]
- except IndexError:
- netdev_id = None
- device_id = None
- # Handle the '-net nic' part
- try:
- mac = vm.get_mac_address(vlan)
- except virt_vm.VMAddressError:
- mac = None
- qemu_cmd += add_nic(help, vlan, nic_params.get("nic_model"), mac,
- device_id, netdev_id, nic_params.get("nic_extra_params"))
- # Handle the '-net tap' or '-net user' or '-netdev' part
- tftp = nic_params.get("tftp")
- if tftp:
- tftp = virt_utils.get_path(root_dir, tftp)
- if nic_params.get("nic_mode") == "tap":
- try:
- tapfd = vm.tapfds[vlan]
- except:
- tapfd = None
- else:
- tapfd = None
- qemu_cmd += add_net(help, vlan,
- nic_params.get("nic_mode", "user"),
- vm.get_ifname(vlan), tftp,
- nic_params.get("bootp"), redirs, netdev_id,
- nic_params.get("netdev_extra_params"),
- tapfd)
- # Proceed to next NIC
- vlan += 1
-
- mem = params.get("mem")
- if mem:
- qemu_cmd += add_mem(help, mem)
-
- smp = params.get("smp")
- if smp:
- qemu_cmd += add_smp(help, smp)
-
- for cdrom in params.objects("cdroms"):
- cdrom_params = params.object_params(cdrom)
- iso = cdrom_params.get("cdrom")
- if cdrom_params.get("cd_format") == "ahci" and not have_ahci:
- qemu_cmd += " -device ahci,id=ahci"
- have_ahci = True
- if cdrom_params.get("cd_format") == "usb2" and not have_usb2:
- qemu_cmd += " -device usb-ehci,id=ehci"
- have_usb2 = True
- if iso:
- qemu_cmd += add_cdrom(help, virt_utils.get_path(root_dir, iso),
- cdrom_params.get("drive_index"),
- cdrom_params.get("cd_format"))
-
- # We may want to add {floppy_otps} parameter for -fda
- # {fat:floppy:}/path/. However vvfat is not usually recommended.
- floppy = params.get("floppy")
- if floppy:
- floppy = virt_utils.get_path(root_dir, floppy)
- qemu_cmd += add_floppy(help, floppy)
-
- tftp = params.get("tftp")
- if tftp:
- tftp = virt_utils.get_path(root_dir, tftp)
- qemu_cmd += add_tftp(help, tftp)
-
- bootp = params.get("bootp")
- if bootp:
- qemu_cmd += add_bootp(help, bootp)
-
- kernel = params.get("kernel")
- if kernel:
- kernel = virt_utils.get_path(root_dir, kernel)
- qemu_cmd += add_kernel(help, kernel)
-
- kernel_cmdline = params.get("kernel_cmdline")
- if kernel_cmdline:
- qemu_cmd += add_kernel_cmdline(help, kernel_cmdline)
-
- initrd = params.get("initrd")
- if initrd:
- initrd = virt_utils.get_path(root_dir, initrd)
- qemu_cmd += add_initrd(help, initrd)
-
- for host_port, guest_port in redirs:
- qemu_cmd += add_tcp_redir(help, host_port, guest_port)
-
- if params.get("display") == "vnc":
- qemu_cmd += add_vnc(help, vm.vnc_port)
- elif params.get("display") == "sdl":
- qemu_cmd += add_sdl(help)
- elif params.get("display") == "nographic":
- qemu_cmd += add_nographic(help)
- elif params.get("display") == "spice":
- qemu_cmd += add_spice(help, self.spice_port, params.get("spice"))
-
- qxl = ""
- vga = ""
- if params.get("qxl"):
- qxl = params.get("qxl")
- if params.get("vga"):
- vga = params.get("vga")
- if qxl or vga:
- if params.get("display") == "spice":
- qxl_dev_nr = params.get("qxl_dev_nr", None)
- qemu_cmd += add_qxl_vga(help, qxl, vga, qxl_dev_nr)
-
- if params.get("uuid") == "random":
- qemu_cmd += add_uuid(help, vm.uuid)
- elif params.get("uuid"):
- qemu_cmd += add_uuid(help, params.get("uuid"))
-
- if params.get("testdev") == "yes":
- qemu_cmd += add_testdev(help, vm.get_testlog_filename())
-
- if params.get("disable_hpet") == "yes":
- qemu_cmd += add_no_hpet(help)
-
- # If the PCI assignment step went OK, add each one of the PCI assigned
- # devices to the qemu command line.
- if vm.pci_assignable:
- for pci_id in vm.pa_pci_ids:
- qemu_cmd += add_pcidevice(help, pci_id)
-
- extra_params = params.get("extra_params")
- if extra_params:
- qemu_cmd += " %s" % extra_params
-
- return qemu_cmd
-
-
- @error.context_aware
- def create(self, name=None, params=None, root_dir=None, timeout=5.0,
- migration_mode=None, mac_source=None):
- """
- Start the VM by running a qemu command.
- All parameters are optional. If name, params or root_dir are not
- supplied, the respective values stored as class attributes are used.
-
- @param name: The name of the object
- @param params: A dict containing VM params
- @param root_dir: Base directory for relative filenames
- @param migration_mode: If supplied, start VM for incoming migration
- using this protocol (either 'tcp', 'unix' or 'exec')
- @param migration_exec_cmd: Command to embed in '-incoming "exec: ..."'
- (e.g. 'gzip -c -d filename') if migration_mode is 'exec'
- @param mac_source: A VM object from which to copy MAC addresses. If not
- specified, new addresses will be generated.
-
- @raise VMCreateError: If qemu terminates unexpectedly
- @raise VMKVMInitError: If KVM initialization fails
- @raise VMHugePageError: If hugepage initialization fails
- @raise VMImageMissingError: If a CD image is missing
- @raise VMHashMismatchError: If a CD image hash has doesn't match the
- expected hash
- @raise VMBadPATypeError: If an unsupported PCI assignment type is
- requested
- @raise VMPAError: If no PCI assignable devices could be assigned
- @raise TAPCreationError: If fail to create tap fd
- @raise BRAddIfError: If fail to add a tap to a bridge
- @raise TAPBringUpError: If fail to bring up a tap
- """
- error.context("creating '%s'" % self.name)
- self.destroy(free_mac_addresses=False)
-
- if name is not None:
- self.name = name
- if params is not None:
- self.params = params
- if root_dir is not None:
- self.root_dir = root_dir
- name = self.name
- params = self.params
- root_dir = self.root_dir
-
- # Verify the md5sum of the ISO images
- for cdrom in params.objects("cdroms"):
- cdrom_params = params.object_params(cdrom)
- iso = cdrom_params.get("cdrom")
- if iso:
- iso = virt_utils.get_path(root_dir, iso)
- if not os.path.exists(iso):
- raise virt_vm.VMImageMissingError(iso)
- compare = False
- if cdrom_params.get("md5sum_1m"):
- logging.debug("Comparing expected MD5 sum with MD5 sum of "
- "first MB of ISO file...")
- actual_hash = utils.hash_file(iso, 1048576, method="md5")
- expected_hash = cdrom_params.get("md5sum_1m")
- compare = True
- elif cdrom_params.get("md5sum"):
- logging.debug("Comparing expected MD5 sum with MD5 sum of "
- "ISO file...")
- actual_hash = utils.hash_file(iso, method="md5")
- expected_hash = cdrom_params.get("md5sum")
- compare = True
- elif cdrom_params.get("sha1sum"):
- logging.debug("Comparing expected SHA1 sum with SHA1 sum "
- "of ISO file...")
- actual_hash = utils.hash_file(iso, method="sha1")
- expected_hash = cdrom_params.get("sha1sum")
- compare = True
- if compare:
- if actual_hash == expected_hash:
- logging.debug("Hashes match")
- else:
- raise virt_vm.VMHashMismatchError(actual_hash,
- expected_hash)
-
- # Make sure the following code is not executed by more than one thread
- # at the same time
- lockfile = open("/tmp/kvm-autotest-vm-create.lock", "w+")
- fcntl.lockf(lockfile, fcntl.LOCK_EX)
-
- try:
- # Handle port redirections
- redir_names = params.objects("redirs")
- host_ports = virt_utils.find_free_ports(5000, 6000, len(redir_names))
- self.redirs = {}
- for i in range(len(redir_names)):
- redir_params = params.object_params(redir_names[i])
- guest_port = int(redir_params.get("guest_port"))
- self.redirs[guest_port] = host_ports[i]
-
- # Generate netdev IDs for all NICs and create TAP fd
- self.netdev_id = []
- self.tapfds = []
- vlan = 0
- for nic in params.objects("nics"):
- self.netdev_id.append(virt_utils.generate_random_id())
- self.device_id.append(virt_utils.generate_random_id())
- nic_params = params.object_params(nic)
- if nic_params.get("nic_mode") == "tap":
- ifname = self.get_ifname(vlan)
- brname = nic_params.get("bridge")
- tapfd = virt_utils.open_tap("/dev/net/tun", ifname)
- virt_utils.add_to_bridge(ifname, brname)
- virt_utils.bring_up_ifname(ifname)
- self.tapfds.append(tapfd)
- vlan += 1
-
- # Find available VNC port, if needed
- if params.get("display") == "vnc":
- self.vnc_port = virt_utils.find_free_port(5900, 6100)
-
- # Find available spice port, if needed
- if params.get("spice"):
- self.spice_port = virt_utils.find_free_port(8000, 8100)
-
- # Find random UUID if specified 'uuid = random' in config file
- if params.get("uuid") == "random":
- f = open("/proc/sys/kernel/random/uuid")
- self.uuid = f.read().strip()
- f.close()
-
- # Generate or copy MAC addresses for all NICs
- num_nics = len(params.objects("nics"))
- for vlan in range(num_nics):
- nic_name = params.objects("nics")[vlan]
- nic_params = params.object_params(nic_name)
- mac = (nic_params.get("nic_mac") or
- mac_source and mac_source.get_mac_address(vlan))
- if mac:
- virt_utils.set_mac_address(self.instance, vlan, mac)
- else:
- virt_utils.generate_mac_address(self.instance, vlan)
-
- # Assign a PCI assignable device
- self.pci_assignable = None
- pa_type = params.get("pci_assignable")
- if pa_type and pa_type != "no":
- pa_devices_requested = params.get("devices_requested")
-
- # Virtual Functions (VF) assignable devices
- if pa_type == "vf":
- self.pci_assignable = virt_utils.PciAssignable(
- type=pa_type,
- driver=params.get("driver"),
- driver_option=params.get("driver_option"),
- devices_requested=pa_devices_requested)
- # Physical NIC (PF) assignable devices
- elif pa_type == "pf":
- self.pci_assignable = virt_utils.PciAssignable(
- type=pa_type,
- names=params.get("device_names"),
- devices_requested=pa_devices_requested)
- # Working with both VF and PF
- elif pa_type == "mixed":
- self.pci_assignable = virt_utils.PciAssignable(
- type=pa_type,
- driver=params.get("driver"),
- driver_option=params.get("driver_option"),
- names=params.get("device_names"),
- devices_requested=pa_devices_requested)
- else:
- raise virt_vm.VMBadPATypeError(pa_type)
-
- self.pa_pci_ids = self.pci_assignable.request_devs()
-
- if self.pa_pci_ids:
- logging.debug("Successfuly assigned devices: %s",
- self.pa_pci_ids)
- else:
- raise virt_vm.VMPAError(pa_type)
-
- # Make qemu command
- qemu_command = self.__make_qemu_command()
-
- # Add migration parameters if required
- if migration_mode == "tcp":
- self.migration_port = virt_utils.find_free_port(5200, 6000)
- qemu_command += " -incoming tcp:0:%d" % self.migration_port
- elif migration_mode == "unix":
- self.migration_file = "/tmp/migration-unix-%s" % self.instance
- qemu_command += " -incoming unix:%s" % self.migration_file
- elif migration_mode == "exec":
- self.migration_port = virt_utils.find_free_port(5200, 6000)
- qemu_command += (' -incoming "exec:nc -l %s"' %
- self.migration_port)
-
- logging.info("Running qemu command:\n%s", qemu_command)
- self.process = aexpect.run_bg(qemu_command, None,
- logging.info, "(qemu) ")
- for tapfd in self.tapfds:
- try:
- os.close(tapfd)
- # File descriptor is already closed
- except OSError:
- pass
-
- # Make sure the process was started successfully
- if not self.process.is_alive():
- e = virt_vm.VMCreateError(qemu_command,
- self.process.get_status(),
- self.process.get_output())
- self.destroy()
- raise e
-
- # Establish monitor connections
- self.monitors = []
- for monitor_name in params.objects("monitors"):
- monitor_params = params.object_params(monitor_name)
- # Wait for monitor connection to succeed
- end_time = time.time() + timeout
- while time.time() < end_time:
- try:
- if monitor_params.get("monitor_type") == "qmp":
- # Add a QMP monitor
- monitor = kvm_monitor.QMPMonitor(
- monitor_name,
- self.get_monitor_filename(monitor_name))
- else:
- # Add a "human" monitor
- monitor = kvm_monitor.HumanMonitor(
- monitor_name,
- self.get_monitor_filename(monitor_name))
- monitor.verify_responsive()
- break
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- time.sleep(1)
- else:
- self.destroy()
- raise e
- # Add this monitor to the list
- self.monitors += [monitor]
-
- # Get the output so far, to see if we have any problems with
- # KVM modules or with hugepage setup.
- output = self.process.get_output()
-
- if re.search("Could not initialize KVM", output, re.IGNORECASE):
- e = virt_vm.VMKVMInitError(qemu_command, self.process.get_output())
- self.destroy()
- raise e
-
- if "alloc_mem_area" in output:
- e = virt_vm.VMHugePageError(qemu_command, self.process.get_output())
- self.destroy()
- raise e
-
- logging.debug("VM appears to be alive with PID %s", self.get_pid())
-
- # Establish a session with the serial console -- requires a version
- # of netcat that supports -U
- self.serial_console = aexpect.ShellSession(
- "nc -U %s" % self.get_serial_console_filename(),
- auto_close=False,
- output_func=virt_utils.log_line,
- output_params=("serial-%s.log" % name,))
-
- finally:
- fcntl.lockf(lockfile, fcntl.LOCK_UN)
- lockfile.close()
-
-
- def destroy(self, gracefully=True, free_mac_addresses=True):
- """
- Destroy the VM.
-
- If gracefully is True, first attempt to shutdown the VM with a shell
- command. Then, attempt to destroy the VM via the monitor with a 'quit'
- command. If that fails, send SIGKILL to the qemu process.
-
- @param gracefully: If True, an attempt will be made to end the VM
- using a shell command before trying to end the qemu process
- with a 'quit' or a kill signal.
- @param free_mac_addresses: If True, the MAC addresses used by the VM
- will be freed.
- """
- try:
- # Is it already dead?
- if self.is_dead():
- return
-
- logging.debug("Destroying VM with PID %s", self.get_pid())
-
- if gracefully and self.params.get("shutdown_command"):
- # Try to destroy with shell command
- logging.debug("Trying to shutdown VM with shell command")
- try:
- session = self.login()
- except (virt_utils.LoginError, virt_vm.VMError), e:
- logging.debug(e)
- else:
- try:
- # Send the shutdown command
- session.sendline(self.params.get("shutdown_command"))
- logging.debug("Shutdown command sent; waiting for VM "
- "to go down")
- if virt_utils.wait_for(self.is_dead, 60, 1, 1):
- logging.debug("VM is down")
- return
- finally:
- session.close()
-
- if self.monitor:
- # Try to destroy with a monitor command
- logging.debug("Trying to kill VM with monitor command")
- try:
- self.monitor.quit()
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- else:
- # Wait for the VM to be really dead
- if virt_utils.wait_for(self.is_dead, 5, 0.5, 0.5):
- logging.debug("VM is down")
- return
-
- # If the VM isn't dead yet...
- logging.debug("Cannot quit normally, sending a kill to close the "
- "deal")
- virt_utils.kill_process_tree(self.process.get_pid(), 9)
- # Wait for the VM to be really dead
- if virt_utils.wait_for(self.is_dead, 5, 0.5, 0.5):
- logging.debug("VM is down")
- return
-
- logging.error("Process %s is a zombie!", self.process.get_pid())
-
- finally:
- self.monitors = []
- if self.pci_assignable:
- self.pci_assignable.release_devs()
- if self.process:
- self.process.close()
- if self.serial_console:
- self.serial_console.close()
- for f in ([self.get_testlog_filename(),
- self.get_serial_console_filename()] +
- self.get_monitor_filenames()):
- try:
- os.unlink(f)
- except OSError:
- pass
- if hasattr(self, "migration_file"):
- try:
- os.unlink(self.migration_file)
- except OSError:
- pass
- if free_mac_addresses:
- num_nics = len(self.params.objects("nics"))
- for vlan in range(num_nics):
- self.free_mac_address(vlan)
-
-
- @property
- def monitor(self):
- """
- Return the main monitor object, selected by the parameter main_monitor.
- If main_monitor isn't defined, return the first monitor.
- If no monitors exist, or if main_monitor refers to a nonexistent
- monitor, return None.
- """
- for m in self.monitors:
- if m.name == self.params.get("main_monitor"):
- return m
- if self.monitors and not self.params.get("main_monitor"):
- return self.monitors[0]
-
-
- def get_monitor_filename(self, monitor_name):
- """
- Return the filename corresponding to a given monitor name.
- """
- return "/tmp/monitor-%s-%s" % (monitor_name, self.instance)
-
-
- def get_monitor_filenames(self):
- """
- Return a list of all monitor filenames (as specified in the VM's
- params).
- """
- return [self.get_monitor_filename(m) for m in
- self.params.objects("monitors")]
-
-
- def get_address(self, index=0):
- """
- Return the address of a NIC of the guest, in host space.
-
- If port redirection is used, return 'localhost' (the NIC has no IP
- address of its own). Otherwise return the NIC's IP address.
-
- @param index: Index of the NIC whose address is requested.
- @raise VMMACAddressMissingError: If no MAC address is defined for the
- requested NIC
- @raise VMIPAddressMissingError: If no IP address is found for the the
- NIC's MAC address
- @raise VMAddressVerificationError: If the MAC-IP address mapping cannot
- be verified (using arping)
- """
- nics = self.params.objects("nics")
- nic_name = nics[index]
- nic_params = self.params.object_params(nic_name)
- if nic_params.get("nic_mode") == "tap":
- mac = self.get_mac_address(index).lower()
- # Get the IP address from the cache
- ip = self.address_cache.get(mac)
- if not ip:
- raise virt_vm.VMIPAddressMissingError(mac)
- # Make sure the IP address is assigned to this guest
- macs = [self.get_mac_address(i) for i in range(len(nics))]
- if not virt_utils.verify_ip_address_ownership(ip, macs):
- raise virt_vm.VMAddressVerificationError(mac, ip)
- return ip
- else:
- return "localhost"
-
-
- def get_port(self, port, nic_index=0):
- """
- Return the port in host space corresponding to port in guest space.
-
- @param port: Port number in host space.
- @param nic_index: Index of the NIC.
- @return: If port redirection is used, return the host port redirected
- to guest port port. Otherwise return port.
- @raise VMPortNotRedirectedError: If an unredirected port is requested
- in user mode
- """
- nic_name = self.params.objects("nics")[nic_index]
- nic_params = self.params.object_params(nic_name)
- if nic_params.get("nic_mode") == "tap":
- return port
- else:
- try:
- return self.redirs[port]
- except KeyError:
- raise virt_vm.VMPortNotRedirectedError(port)
-
-
- def get_peer(self, netid):
- """
- Return the peer of netdev or network deivce.
-
- @param netid: id of netdev or device
- @return: id of the peer device otherwise None
- """
- network_info = self.monitor.info("network")
- try:
- return re.findall("%s:.*peer=(.*)" % netid, network_info)[0]
- except IndexError:
- return None
-
-
- def get_ifname(self, nic_index=0):
- """
- Return the ifname of a tap device associated with a NIC.
-
- @param nic_index: Index of the NIC
- """
- nics = self.params.objects("nics")
- nic_name = nics[nic_index]
- nic_params = self.params.object_params(nic_name)
- if nic_params.get("nic_ifname"):
- return nic_params.get("nic_ifname")
- else:
- return "t%d-%s" % (nic_index, self.instance[-11:])
-
-
- def get_mac_address(self, nic_index=0):
- """
- Return the MAC address of a NIC.
-
- @param nic_index: Index of the NIC
- @raise VMMACAddressMissingError: If no MAC address is defined for the
- requested NIC
- """
- nic_name = self.params.objects("nics")[nic_index]
- nic_params = self.params.object_params(nic_name)
- mac = (nic_params.get("nic_mac") or
- virt_utils.get_mac_address(self.instance, nic_index))
- if not mac:
- raise virt_vm.VMMACAddressMissingError(nic_index)
- return mac
-
-
- def free_mac_address(self, nic_index=0):
- """
- Free a NIC's MAC address.
-
- @param nic_index: Index of the NIC
- """
- virt_utils.free_mac_address(self.instance, nic_index)
-
-
- def get_pid(self):
- """
- Return the VM's PID. If the VM is dead return None.
-
- @note: This works under the assumption that self.process.get_pid()
- returns the PID of the parent shell process.
- """
- try:
- children = commands.getoutput("ps --ppid=%d -o pid=" %
- self.process.get_pid()).split()
- return int(children[0])
- except (TypeError, IndexError, ValueError):
- return None
-
-
- def get_shell_pid(self):
- """
- Return the PID of the parent shell process.
-
- @note: This works under the assumption that self.process.get_pid()
- returns the PID of the parent shell process.
- """
- return self.process.get_pid()
-
-
- def get_shared_meminfo(self):
- """
- Returns the VM's shared memory information.
-
- @return: Shared memory used by VM (MB)
- """
- if self.is_dead():
- logging.error("Could not get shared memory info from dead VM.")
- return None
-
- filename = "/proc/%d/statm" % self.get_pid()
- shm = int(open(filename).read().split()[2])
- # statm stores informations in pages, translate it to MB
- return shm * 4.0 / 1024
-
-
- @error.context_aware
- def migrate(self, timeout=3600, protocol="tcp", cancel_delay=None,
- offline=False, stable_check=False, clean=True,
- save_path="/tmp", dest_host="localhost", remote_port=None):
- """
- Migrate the VM.
-
- If the migration is local, the VM object's state is switched with that
- of the destination VM. Otherwise, the state is switched with that of
- a dead VM (returned by self.clone()).
-
- @param timeout: Time to wait for migration to complete.
- @param protocol: Migration protocol (as defined in MIGRATION_PROTOS)
- @param cancel_delay: If provided, specifies a time duration after which
- migration will be canceled. Used for testing migrate_cancel.
- @param offline: If True, pause the source VM before migration.
- @param stable_check: If True, compare the VM's state after migration to
- its state before migration and raise an exception if they
- differ.
- @param clean: If True, delete the saved state files (relevant only if
- stable_check is also True).
- @save_path: The path for state files.
- @param dest_host: Destination host (defaults to 'localhost').
- @param remote_port: Port to use for remote migration.
- """
- if protocol not in self.MIGRATION_PROTOS:
- raise virt_vm.VMMigrateProtoUnsupportedError
-
- error.base_context("migrating '%s'" % self.name)
-
- def mig_finished():
- o = self.monitor.info("migrate")
- if isinstance(o, str):
- return "status: active" not in o
- else:
- return o.get("status") != "active"
-
- def mig_succeeded():
- o = self.monitor.info("migrate")
- if isinstance(o, str):
- return "status: completed" in o
- else:
- return o.get("status") == "completed"
-
- def mig_failed():
- o = self.monitor.info("migrate")
- if isinstance(o, str):
- return "status: failed" in o
- else:
- return o.get("status") == "failed"
-
- def mig_cancelled():
- o = self.monitor.info("migrate")
- if isinstance(o, str):
- return ("Migration status: cancelled" in o or
- "Migration status: canceled" in o)
- else:
- return (o.get("status") == "cancelled" or
- o.get("status") == "canceled")
-
- def wait_for_migration():
- if not virt_utils.wait_for(mig_finished, timeout, 2, 2,
- "Waiting for migration to complete"):
- raise virt_vm.VMMigrateTimeoutError("Timeout expired while waiting "
- "for migration to finish")
-
- local = dest_host == "localhost"
-
- clone = self.clone()
- if local:
- error.context("creating destination VM")
- if stable_check:
- # Pause the dest vm after creation
- extra_params = clone.params.get("extra_params", "") + " -S"
- clone.params["extra_params"] = extra_params
- clone.create(migration_mode=protocol, mac_source=self)
- error.context()
-
- try:
- if protocol == "tcp":
- if local:
- uri = "tcp:localhost:%d" % clone.migration_port
- else:
- uri = "tcp:%s:%d" % (dest_host, remote_port)
- elif protocol == "unix":
- uri = "unix:%s" % clone.migration_file
- elif protocol == "exec":
- uri = '"exec:nc localhost %s"' % clone.migration_port
-
- if offline:
- self.monitor.cmd("stop")
-
- logging.info("Migrating to %s", uri)
- self.monitor.migrate(uri)
-
- if cancel_delay:
- time.sleep(cancel_delay)
- self.monitor.cmd("migrate_cancel")
- if not virt_utils.wait_for(mig_cancelled, 60, 2, 2,
- "Waiting for migration "
- "cancellation"):
- raise virt_vm.VMMigrateCancelError("Cannot cancel migration")
- return
-
- wait_for_migration()
-
- # Report migration status
- if mig_succeeded():
- logging.info("Migration completed successfully")
- elif mig_failed():
- raise virt_vm.VMMigrateFailedError("Migration failed")
- else:
- raise virt_vm.VMMigrateFailedError("Migration ended with "
- "unknown status")
-
- # Switch self <-> clone
- temp = self.clone(copy_state=True)
- self.__dict__ = clone.__dict__
- clone = temp
-
- # From now on, clone is the source VM that will soon be destroyed
- # and self is the destination VM that will remain alive. If this
- # is remote migration, self is a dead VM object.
-
- error.context("after migration")
- if local:
- time.sleep(1)
- self.verify_alive()
-
- if local and stable_check:
- try:
- save1 = os.path.join(save_path, "src-" + clone.instance)
- save2 = os.path.join(save_path, "dst-" + self.instance)
- clone.save_to_file(save1)
- self.save_to_file(save2)
- # Fail if we see deltas
- md5_save1 = utils.hash_file(save1)
- md5_save2 = utils.hash_file(save2)
- if md5_save1 != md5_save2:
- raise virt_vm.VMMigrateStateMismatchError(md5_save1,
- md5_save2)
- finally:
- if clean:
- if os.path.isfile(save1):
- os.remove(save1)
- if os.path.isfile(save2):
- os.remove(save2)
-
- finally:
- # If we're doing remote migration and it's completed successfully,
- # self points to a dead VM object
- if self.is_alive():
- self.monitor.cmd("cont")
- clone.destroy(gracefully=False)
-
-
- @error.context_aware
- def reboot(self, session=None, method="shell", nic_index=0, timeout=240):
- """
- Reboot the VM and wait for it to come back up by trying to log in until
- timeout expires.
-
- @param session: A shell session object or None.
- @param method: Reboot method. Can be "shell" (send a shell reboot
- command) or "system_reset" (send a system_reset monitor command).
- @param nic_index: Index of NIC to access in the VM, when logging in
- after rebooting.
- @param timeout: Time to wait for login to succeed (after rebooting).
- @return: A new shell session object.
- """
- error.base_context("rebooting '%s'" % self.name, logging.info)
- error.context("before reboot")
- session = session or self.login()
- error.context()
-
- if method == "shell":
- session.sendline(self.params.get("reboot_command"))
- elif method == "system_reset":
- # Clear the event list of all QMP monitors
- qmp_monitors = [m for m in self.monitors if m.protocol == "qmp"]
- for m in qmp_monitors:
- m.clear_events()
- # Send a system_reset monitor command
- self.monitor.cmd("system_reset")
- # Look for RESET QMP events
- time.sleep(1)
- for m in qmp_monitors:
- if m.get_event("RESET"):
- logging.info("RESET QMP event received")
- else:
- raise virt_vm.VMRebootError("RESET QMP event not received "
- "after system_reset "
- "(monitor '%s')" % m.name)
- else:
- raise virt_vm.VMRebootError("Unknown reboot method: %s" % method)
-
- error.context("waiting for guest to go down", logging.info)
- if not virt_utils.wait_for(lambda:
- not session.is_responsive(timeout=30),
- 120, 0, 1):
- raise virt_vm.VMRebootError("Guest refuses to go down")
- session.close()
-
- error.context("logging in after reboot", logging.info)
- return self.wait_for_login(nic_index, timeout=timeout)
-
-
- def send_key(self, keystr):
- """
- Send a key event to the VM.
-
- @param: keystr: A key event string (e.g. "ctrl-alt-delete")
- """
- # For compatibility with versions of QEMU that do not recognize all
- # key names: replace keyname with the hex value from the dict, which
- # QEMU will definitely accept
- dict = {"comma": "0x33",
- "dot": "0x34",
- "slash": "0x35"}
- for key, value in dict.items():
- keystr = keystr.replace(key, value)
- self.monitor.sendkey(keystr)
- time.sleep(0.2)
-
-
- # should this really be expected from VMs of all hypervisor types?
- def screendump(self, filename):
- try:
- if self.monitor:
- self.monitor.screendump(filename=filename)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
-
-
- def save_to_file(self, path):
- """
- Save the state of virtual machine to a file through migrate to
- exec
- """
- # Make sure we only get one iteration
- self.monitor.cmd("migrate_set_speed 1000g")
- self.monitor.cmd("migrate_set_downtime 100000000")
- self.monitor.migrate('"exec:cat>%s"' % path)
- # Restore the speed and downtime of migration
- self.monitor.cmd("migrate_set_speed %d" % (32<<20))
- self.monitor.cmd("migrate_set_downtime 0.03")
-
-
- def needs_restart(self, name, params, basedir):
- """
- Verifies whether the current qemu commandline matches the requested
- one, based on the test parameters.
- """
- return (self.__make_qemu_command() !=
- self.__make_qemu_command(name, params, basedir))
diff --git a/client/virt/ppm_utils.py b/client/virt/ppm_utils.py
deleted file mode 100644
index 90ff46d..0000000
--- a/client/virt/ppm_utils.py
+++ /dev/null
@@ -1,237 +0,0 @@
-"""
-Utility functions to deal with ppm (qemu screendump format) files.
-
-@copyright: Red Hat 2008-2009
-"""
-
-import os, struct, time, re
-from autotest_lib.client.bin import utils
-
-# Some directory/filename utils, for consistency
-
-def find_id_for_screendump(md5sum, dir):
- """
- Search dir for a PPM file whose name ends with md5sum.
-
- @param md5sum: md5 sum string
- @param dir: Directory that holds the PPM files.
- @return: The file's basename without any preceding path, e.g.
- '20080101_120000_d41d8cd98f00b204e9800998ecf8427e.ppm'.
- """
- try:
- files = os.listdir(dir)
- except OSError:
- files = []
- for file in files:
- exp = re.compile(r"(.*_)?" + md5sum + r"\.ppm", re.IGNORECASE)
- if exp.match(file):
- return file
-
-
-def generate_id_for_screendump(md5sum, dir):
- """
- Generate a unique filename using the given MD5 sum.
-
- @return: Only the file basename, without any preceding path. The
- filename consists of the current date and time, the MD5 sum and a .ppm
- extension, e.g. '20080101_120000_d41d8cd98f00b204e9800998ecf8427e.ppm'.
- """
- filename = time.strftime("%Y%m%d_%H%M%S") + "_" + md5sum + ".ppm"
- return filename
-
-
-def get_data_dir(steps_filename):
- """
- Return the data dir of the given steps filename.
- """
- filename = os.path.basename(steps_filename)
- return os.path.join(os.path.dirname(steps_filename), "..", "steps_data",
- filename + "_data")
-
-
-# Functions for working with PPM files
-
-def image_read_from_ppm_file(filename):
- """
- Read a PPM image.
-
- @return: A 3 element tuple containing the width, height and data of the
- image.
- """
- fin = open(filename,"rb")
- l1 = fin.readline()
- l2 = fin.readline()
- l3 = fin.readline()
- data = fin.read()
- fin.close()
-
- (w, h) = map(int, l2.split())
- return (w, h, data)
-
-
-def image_write_to_ppm_file(filename, width, height, data):
- """
- Write a PPM image with the given width, height and data.
-
- @param filename: PPM file path
- @param width: PPM file width (pixels)
- @param height: PPM file height (pixels)
- """
- fout = open(filename,"wb")
- fout.write("P6\n")
- fout.write("%d %d\n" % (width, height))
- fout.write("255\n")
- fout.write(data)
- fout.close()
-
-
-def image_crop(width, height, data, x1, y1, dx, dy):
- """
- Crop an image.
-
- @param width: Original image width
- @param height: Original image height
- @param data: Image data
- @param x1: Desired x coordinate of the cropped region
- @param y1: Desired y coordinate of the cropped region
- @param dx: Desired width of the cropped region
- @param dy: Desired height of the cropped region
- @return: A 3-tuple containing the width, height and data of the
- cropped image.
- """
- if x1 > width - 1: x1 = width - 1
- if y1 > height - 1: y1 = height - 1
- if dx > width - x1: dx = width - x1
- if dy > height - y1: dy = height - y1
- newdata = ""
- index = (x1 + y1*width) * 3
- for i in range(dy):
- newdata += data[index:(index+dx*3)]
- index += width*3
- return (dx, dy, newdata)
-
-
-def image_md5sum(width, height, data):
- """
- Return the md5sum of an image.
-
- @param width: PPM file width
- @param height: PPM file height
- @data: PPM file data
- """
- header = "P6\n%d %d\n255\n" % (width, height)
- hash = utils.hash('md5', header)
- hash.update(data)
- return hash.hexdigest()
-
-
-def get_region_md5sum(width, height, data, x1, y1, dx, dy,
- cropped_image_filename=None):
- """
- Return the md5sum of a cropped region.
-
- @param width: Original image width
- @param height: Original image height
- @param data: Image data
- @param x1: Desired x coord of the cropped region
- @param y1: Desired y coord of the cropped region
- @param dx: Desired width of the cropped region
- @param dy: Desired height of the cropped region
- @param cropped_image_filename: if not None, write the resulting cropped
- image to a file with this name
- """
- (cw, ch, cdata) = image_crop(width, height, data, x1, y1, dx, dy)
- # Write cropped image for debugging
- if cropped_image_filename:
- image_write_to_ppm_file(cropped_image_filename, cw, ch, cdata)
- return image_md5sum(cw, ch, cdata)
-
-
-def image_verify_ppm_file(filename):
- """
- Verify the validity of a PPM file.
-
- @param filename: Path of the file being verified.
- @return: True if filename is a valid PPM image file. This function
- reads only the first few bytes of the file so it should be rather fast.
- """
- try:
- size = os.path.getsize(filename)
- fin = open(filename, "rb")
- assert(fin.readline().strip() == "P6")
- (width, height) = map(int, fin.readline().split())
- assert(width > 0 and height > 0)
- assert(fin.readline().strip() == "255")
- size_read = fin.tell()
- fin.close()
- assert(size - size_read == width*height*3)
- return True
- except:
- return False
-
-
-def image_comparison(width, height, data1, data2):
- """
- Generate a green-red comparison image from two given images.
-
- @param width: Width of both images
- @param height: Height of both images
- @param data1: Data of first image
- @param data2: Data of second image
- @return: A 3-element tuple containing the width, height and data of the
- generated comparison image.
-
- @note: Input images must be the same size.
- """
- newdata = ""
- i = 0
- while i < width*height*3:
- # Compute monochromatic value of current pixel in data1
- pixel1_str = data1[i:i+3]
- temp = struct.unpack("BBB", pixel1_str)
- value1 = int((temp[0] + temp[1] + temp[2]) / 3)
- # Compute monochromatic value of current pixel in data2
- pixel2_str = data2[i:i+3]
- temp = struct.unpack("BBB", pixel2_str)
- value2 = int((temp[0] + temp[1] + temp[2]) / 3)
- # Compute average of the two values
- value = int((value1 + value2) / 2)
- # Scale value to the upper half of the range [0, 255]
- value = 128 + value / 2
- # Compare pixels
- if pixel1_str == pixel2_str:
- # Equal -- give the pixel a greenish hue
- newpixel = [0, value, 0]
- else:
- # Not equal -- give the pixel a reddish hue
- newpixel = [value, 0, 0]
- newdata += struct.pack("BBB", newpixel[0], newpixel[1], newpixel[2])
- i += 3
- return (width, height, newdata)
-
-
-def image_fuzzy_compare(width, height, data1, data2):
- """
- Return the degree of equality of two given images.
-
- @param width: Width of both images
- @param height: Height of both images
- @param data1: Data of first image
- @param data2: Data of second image
- @return: Ratio equal_pixel_count / total_pixel_count.
-
- @note: Input images must be the same size.
- """
- equal = 0.0
- different = 0.0
- i = 0
- while i < width*height*3:
- pixel1_str = data1[i:i+3]
- pixel2_str = data2[i:i+3]
- # Compare pixels
- if pixel1_str == pixel2_str:
- equal += 1.0
- else:
- different += 1.0
- i += 3
- return equal / (equal + different)
diff --git a/client/virt/rss_client.py b/client/virt/rss_client.py
deleted file mode 100755
index 4d00d17..0000000
--- a/client/virt/rss_client.py
+++ /dev/null
@@ -1,519 +0,0 @@
-#!/usr/bin/python
-"""
-Client for file transfer services offered by RSS (Remote Shell Server).
-
-@author: Michael Goldish ([email protected])
-@copyright: 2008-2010 Red Hat Inc.
-"""
-
-import socket, struct, time, sys, os, glob
-
-# Globals
-CHUNKSIZE = 65536
-
-# Protocol message constants
-RSS_MAGIC = 0x525353
-RSS_OK = 1
-RSS_ERROR = 2
-RSS_UPLOAD = 3
-RSS_DOWNLOAD = 4
-RSS_SET_PATH = 5
-RSS_CREATE_FILE = 6
-RSS_CREATE_DIR = 7
-RSS_LEAVE_DIR = 8
-RSS_DONE = 9
-
-# See rss.cpp for protocol details.
-
-
-class FileTransferError(Exception):
- def __init__(self, msg, e=None, filename=None):
- Exception.__init__(self, msg, e, filename)
- self.msg = msg
- self.e = e
- self.filename = filename
-
- def __str__(self):
- s = self.msg
- if self.e and self.filename:
- s += " (error: %s, filename: %s)" % (self.e, self.filename)
- elif self.e:
- s += " (%s)" % self.e
- elif self.filename:
- s += " (filename: %s)" % self.filename
- return s
-
-
-class FileTransferConnectError(FileTransferError):
- pass
-
-
-class FileTransferTimeoutError(FileTransferError):
- pass
-
-
-class FileTransferProtocolError(FileTransferError):
- pass
-
-
-class FileTransferSocketError(FileTransferError):
- pass
-
-
-class FileTransferServerError(FileTransferError):
- def __init__(self, errmsg):
- FileTransferError.__init__(self, None, errmsg)
-
- def __str__(self):
- s = "Server said: %r" % self.e
- if self.filename:
- s += " (filename: %s)" % self.filename
- return s
-
-
-class FileTransferNotFoundError(FileTransferError):
- pass
-
-
-class FileTransferClient(object):
- """
- Connect to a RSS (remote shell server) and transfer files.
- """
-
- def __init__(self, address, port, log_func=None, timeout=20):
- """
- Connect to a server.
-
- @param address: The server's address
- @param port: The server's port
- @param log_func: If provided, transfer stats will be passed to this
- function during the transfer
- @param timeout: Time duration to wait for connection to succeed
- @raise FileTransferConnectError: Raised if the connection fails
- """
- self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self._socket.settimeout(timeout)
- try:
- self._socket.connect((address, port))
- except socket.error, e:
- raise FileTransferConnectError("Cannot connect to server at "
- "%s:%s" % (address, port), e)
- try:
- if self._receive_msg(timeout) != RSS_MAGIC:
- raise FileTransferConnectError("Received wrong magic number")
- except FileTransferTimeoutError:
- raise FileTransferConnectError("Timeout expired while waiting to "
- "receive magic number")
- self._send(struct.pack("=i", CHUNKSIZE))
- self._log_func = log_func
- self._last_time = time.time()
- self._last_transferred = 0
- self.transferred = 0
-
-
- def __del__(self):
- self.close()
-
-
- def close(self):
- """
- Close the connection.
- """
- self._socket.close()
-
-
- def _send(self, str, timeout=60):
- try:
- if timeout <= 0:
- raise socket.timeout
- self._socket.settimeout(timeout)
- self._socket.sendall(str)
- except socket.timeout:
- raise FileTransferTimeoutError("Timeout expired while sending "
- "data to server")
- except socket.error, e:
- raise FileTransferSocketError("Could not send data to server", e)
-
-
- def _receive(self, size, timeout=60):
- strs = []
- end_time = time.time() + timeout
- try:
- while size > 0:
- timeout = end_time - time.time()
- if timeout <= 0:
- raise socket.timeout
- self._socket.settimeout(timeout)
- data = self._socket.recv(size)
- if not data:
- raise FileTransferProtocolError("Connection closed "
- "unexpectedly while "
- "receiving data from "
- "server")
- strs.append(data)
- size -= len(data)
- except socket.timeout:
- raise FileTransferTimeoutError("Timeout expired while receiving "
- "data from server")
- except socket.error, e:
- raise FileTransferSocketError("Error receiving data from server",
- e)
- return "".join(strs)
-
-
- def _report_stats(self, str):
- if self._log_func:
- dt = time.time() - self._last_time
- if dt >= 1:
- transferred = self.transferred / 1048576.
- speed = (self.transferred - self._last_transferred) / dt
- speed /= 1048576.
- self._log_func("%s %.3f MB (%.3f MB/sec)" %
- (str, transferred, speed))
- self._last_time = time.time()
- self._last_transferred = self.transferred
-
-
- def _send_packet(self, str, timeout=60):
- self._send(struct.pack("=I", len(str)))
- self._send(str, timeout)
- self.transferred += len(str) + 4
- self._report_stats("Sent")
-
-
- def _receive_packet(self, timeout=60):
- size = struct.unpack("=I", self._receive(4))[0]
- str = self._receive(size, timeout)
- self.transferred += len(str) + 4
- self._report_stats("Received")
- return str
-
-
- def _send_file_chunks(self, filename, timeout=60):
- if self._log_func:
- self._log_func("Sending file %s" % filename)
- f = open(filename, "rb")
- try:
- try:
- end_time = time.time() + timeout
- while True:
- data = f.read(CHUNKSIZE)
- self._send_packet(data, end_time - time.time())
- if len(data) < CHUNKSIZE:
- break
- except FileTransferError, e:
- e.filename = filename
- raise
- finally:
- f.close()
-
-
- def _receive_file_chunks(self, filename, timeout=60):
- if self._log_func:
- self._log_func("Receiving file %s" % filename)
- f = open(filename, "wb")
- try:
- try:
- end_time = time.time() + timeout
- while True:
- data = self._receive_packet(end_time - time.time())
- f.write(data)
- if len(data) < CHUNKSIZE:
- break
- except FileTransferError, e:
- e.filename = filename
- raise
- finally:
- f.close()
-
-
- def _send_msg(self, msg, timeout=60):
- self._send(struct.pack("=I", msg))
-
-
- def _receive_msg(self, timeout=60):
- s = self._receive(4, timeout)
- return struct.unpack("=I", s)[0]
-
-
- def _handle_transfer_error(self):
- # Save original exception
- e = sys.exc_info()
- try:
- # See if we can get an error message
- msg = self._receive_msg()
- except FileTransferError:
- # No error message -- re-raise original exception
- raise e[0], e[1], e[2]
- if msg == RSS_ERROR:
- errmsg = self._receive_packet()
- raise FileTransferServerError(errmsg)
- raise e[0], e[1], e[2]
-
-
-class FileUploadClient(FileTransferClient):
- """
- Connect to a RSS (remote shell server) and upload files or directory trees.
- """
-
- def __init__(self, address, port, log_func=None, timeout=20):
- """
- Connect to a server.
-
- @param address: The server's address
- @param port: The server's port
- @param log_func: If provided, transfer stats will be passed to this
- function during the transfer
- @param timeout: Time duration to wait for connection to succeed
- @raise FileTransferConnectError: Raised if the connection fails
- @raise FileTransferProtocolError: Raised if an incorrect magic number
- is received
- @raise FileTransferSocketError: Raised if the RSS_UPLOAD message cannot
- be sent to the server
- """
- super(FileUploadClient, self).__init__(address, port, log_func, timeout)
- self._send_msg(RSS_UPLOAD)
-
-
- def _upload_file(self, path, end_time):
- if os.path.isfile(path):
- self._send_msg(RSS_CREATE_FILE)
- self._send_packet(os.path.basename(path))
- self._send_file_chunks(path, end_time - time.time())
- elif os.path.isdir(path):
- self._send_msg(RSS_CREATE_DIR)
- self._send_packet(os.path.basename(path))
- for filename in os.listdir(path):
- self._upload_file(os.path.join(path, filename), end_time)
- self._send_msg(RSS_LEAVE_DIR)
-
-
- def upload(self, src_pattern, dst_path, timeout=600):
- """
- Send files or directory trees to the server.
- The semantics of src_pattern and dst_path are similar to those of scp.
- For example, the following are OK:
- src_pattern='/tmp/foo.txt', dst_path='C:\\'
- (uploads a single file)
- src_pattern='/usr/', dst_path='C:\\Windows\\'
- (uploads a directory tree recursively)
- src_pattern='/usr/*', dst_path='C:\\Windows\\'
- (uploads all files and directory trees under /usr/)
- The following is not OK:
- src_pattern='/tmp/foo.txt', dst_path='C:\\Windows\\*'
- (wildcards are only allowed in src_pattern)
-
- @param src_pattern: A path or wildcard pattern specifying the files or
- directories to send to the server
- @param dst_path: A path in the server's filesystem where the files will
- be saved
- @param timeout: Time duration in seconds to wait for the transfer to
- complete
- @raise FileTransferTimeoutError: Raised if timeout expires
- @raise FileTransferServerError: Raised if something goes wrong and the
- server sends an informative error message to the client
- @note: Other exceptions can be raised.
- """
- end_time = time.time() + timeout
- try:
- try:
- self._send_msg(RSS_SET_PATH)
- self._send_packet(dst_path)
- matches = glob.glob(src_pattern)
- for filename in matches:
- self._upload_file(os.path.abspath(filename), end_time)
- self._send_msg(RSS_DONE)
- except FileTransferTimeoutError:
- raise
- except FileTransferError:
- self._handle_transfer_error()
- else:
- # If nothing was transferred, raise an exception
- if not matches:
- raise FileTransferNotFoundError("Pattern %s does not "
- "match any files or "
- "directories" %
- src_pattern)
- # Look for RSS_OK or RSS_ERROR
- msg = self._receive_msg(end_time - time.time())
- if msg == RSS_OK:
- return
- elif msg == RSS_ERROR:
- errmsg = self._receive_packet()
- raise FileTransferServerError(errmsg)
- else:
- # Neither RSS_OK nor RSS_ERROR found
- raise FileTransferProtocolError("Received unexpected msg")
- except:
- # In any case, if the transfer failed, close the connection
- self.close()
- raise
-
-
-class FileDownloadClient(FileTransferClient):
- """
- Connect to a RSS (remote shell server) and download files or directory trees.
- """
-
- def __init__(self, address, port, log_func=None, timeout=20):
- """
- Connect to a server.
-
- @param address: The server's address
- @param port: The server's port
- @param log_func: If provided, transfer stats will be passed to this
- function during the transfer
- @param timeout: Time duration to wait for connection to succeed
- @raise FileTransferConnectError: Raised if the connection fails
- @raise FileTransferProtocolError: Raised if an incorrect magic number
- is received
- @raise FileTransferSendError: Raised if the RSS_UPLOAD message cannot
- be sent to the server
- """
- super(FileDownloadClient, self).__init__(address, port, log_func, timeout)
- self._send_msg(RSS_DOWNLOAD)
-
-
- def download(self, src_pattern, dst_path, timeout=600):
- """
- Receive files or directory trees from the server.
- The semantics of src_pattern and dst_path are similar to those of scp.
- For example, the following are OK:
- src_pattern='C:\\foo.txt', dst_path='/tmp'
- (downloads a single file)
- src_pattern='C:\\Windows', dst_path='/tmp'
- (downloads a directory tree recursively)
- src_pattern='C:\\Windows\\*', dst_path='/tmp'
- (downloads all files and directory trees under C:\\Windows)
- The following is not OK:
- src_pattern='C:\\Windows', dst_path='/tmp/*'
- (wildcards are only allowed in src_pattern)
-
- @param src_pattern: A path or wildcard pattern specifying the files or
- directories, in the server's filesystem, that will be sent to
- the client
- @param dst_path: A path in the local filesystem where the files will
- be saved
- @param timeout: Time duration in seconds to wait for the transfer to
- complete
- @raise FileTransferTimeoutError: Raised if timeout expires
- @raise FileTransferServerError: Raised if something goes wrong and the
- server sends an informative error message to the client
- @note: Other exceptions can be raised.
- """
- dst_path = os.path.abspath(dst_path)
- end_time = time.time() + timeout
- file_count = 0
- dir_count = 0
- try:
- try:
- self._send_msg(RSS_SET_PATH)
- self._send_packet(src_pattern)
- except FileTransferError:
- self._handle_transfer_error()
- while True:
- msg = self._receive_msg()
- if msg == RSS_CREATE_FILE:
- # Receive filename and file contents
- filename = self._receive_packet()
- if os.path.isdir(dst_path):
- dst_path = os.path.join(dst_path, filename)
- self._receive_file_chunks(dst_path, end_time - time.time())
- dst_path = os.path.dirname(dst_path)
- file_count += 1
- elif msg == RSS_CREATE_DIR:
- # Receive dirname and create the directory
- dirname = self._receive_packet()
- if os.path.isdir(dst_path):
- dst_path = os.path.join(dst_path, dirname)
- if not os.path.isdir(dst_path):
- os.mkdir(dst_path)
- dir_count += 1
- elif msg == RSS_LEAVE_DIR:
- # Return to parent dir
- dst_path = os.path.dirname(dst_path)
- elif msg == RSS_DONE:
- # Transfer complete
- if not file_count and not dir_count:
- raise FileTransferNotFoundError("Pattern %s does not "
- "match any files or "
- "directories that "
- "could be downloaded" %
- src_pattern)
- break
- elif msg == RSS_ERROR:
- # Receive error message and abort
- errmsg = self._receive_packet()
- raise FileTransferServerError(errmsg)
- else:
- # Unexpected msg
- raise FileTransferProtocolError("Received unexpected msg")
- except:
- # In any case, if the transfer failed, close the connection
- self.close()
- raise
-
-
-def upload(address, port, src_pattern, dst_path, log_func=None, timeout=60,
- connect_timeout=20):
- """
- Connect to server and upload files.
-
- @see: FileUploadClient
- """
- client = FileUploadClient(address, port, log_func, connect_timeout)
- client.upload(src_pattern, dst_path, timeout)
- client.close()
-
-
-def download(address, port, src_pattern, dst_path, log_func=None, timeout=60,
- connect_timeout=20):
- """
- Connect to server and upload files.
-
- @see: FileDownloadClient
- """
- client = FileDownloadClient(address, port, log_func, connect_timeout)
- client.download(src_pattern, dst_path, timeout)
- client.close()
-
-
-def main():
- import optparse
-
- usage = "usage: %prog [options] address port src_pattern dst_path"
- parser = optparse.OptionParser(usage=usage)
- parser.add_option("-d", "--download",
- action="store_true", dest="download",
- help="download files from server")
- parser.add_option("-u", "--upload",
- action="store_true", dest="upload",
- help="upload files to server")
- parser.add_option("-v", "--verbose",
- action="store_true", dest="verbose",
- help="be verbose")
- parser.add_option("-t", "--timeout",
- type="int", dest="timeout", default=3600,
- help="transfer timeout")
- options, args = parser.parse_args()
- if options.download == options.upload:
- parser.error("you must specify either -d or -u")
- if len(args) != 4:
- parser.error("incorrect number of arguments")
- address, port, src_pattern, dst_path = args
- port = int(port)
-
- logger = None
- if options.verbose:
- def p(s):
- print s
- logger = p
-
- if options.download:
- download(address, port, src_pattern, dst_path, logger, options.timeout)
- elif options.upload:
- upload(address, port, src_pattern, dst_path, logger, options.timeout)
-
-
-if __name__ == "__main__":
- main()
diff --git a/client/virt/tests/__init__.py b/client/virt/tests/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/client/virt/tests/__init__.py
+++ /dev/null
diff --git a/client/virt/tests/autotest.py b/client/virt/tests/autotest.py
deleted file mode 100644
index cdea31a..0000000
--- a/client/virt/tests/autotest.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import os
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_autotest(test, params, env):
- """
- Run an autotest test inside a guest.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- # Collect test parameters
- timeout = int(params.get("test_timeout", 300))
- control_path = os.path.join(test.bindir, "autotest_control",
- params.get("test_control_file"))
- outputdir = test.outputdir
-
- virt_test_utils.run_autotest(vm, session, control_path, timeout, outputdir,
- params)
diff --git a/client/virt/tests/boot.py b/client/virt/tests/boot.py
deleted file mode 100644
index 4fabcd5..0000000
--- a/client/virt/tests/boot.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import time
-
-
-def run_boot(test, params, env):
- """
- KVM reboot test:
- 1) Log into a guest
- 2) Send a reboot command or a system_reset monitor command (optional)
- 3) Wait until the guest is up again
- 4) Log into the guest to verify it's up again
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = float(params.get("login_timeout", 240))
- session = vm.wait_for_login(timeout=timeout)
-
- if params.get("reboot_method"):
- if params["reboot_method"] == "system_reset":
- time.sleep(int(params.get("sleep_before_reset", 10)))
- session = vm.reboot(session, params["reboot_method"], 0, timeout)
-
- session.close()
diff --git a/client/virt/tests/clock_getres.py b/client/virt/tests/clock_getres.py
deleted file mode 100644
index 9f57c6e..0000000
--- a/client/virt/tests/clock_getres.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import logging, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-
-
-def run_clock_getres(test, params, env):
- """
- Verify if guests using kvm-clock as the time source have a sane clock
- resolution.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- source_name = "test_clock_getres/test_clock_getres.c"
- source_name = os.path.join(test.bindir, "deps", source_name)
- dest_name = "/tmp/test_clock_getres.c"
- bin_name = "/tmp/test_clock_getres"
-
- if not os.path.isfile(source_name):
- raise error.TestError("Could not find %s" % source_name)
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- vm.copy_files_to(source_name, dest_name)
- session.cmd("gcc -lrt -o %s %s" % (bin_name, dest_name))
- session.cmd(bin_name)
- logging.info("PASS: Guest reported appropriate clock resolution")
- logging.info("Guest's dmesg:\n%s", session.cmd_output("dmesg").strip())
diff --git a/client/virt/tests/ethtool.py b/client/virt/tests/ethtool.py
deleted file mode 100644
index 1152f00..0000000
--- a/client/virt/tests/ethtool.py
+++ /dev/null
@@ -1,235 +0,0 @@
-import logging, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_test_utils, virt_utils, aexpect
-
-
-def run_ethtool(test, params, env):
- """
- Test offload functions of ethernet device by ethtool
-
- 1) Log into a guest.
- 2) Initialize the callback of sub functions.
- 3) Enable/disable sub function of NIC.
- 4) Execute callback function.
- 5) Check the return value.
- 6) Restore original configuration.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
-
- @todo: Not all guests have ethtool installed, so
- find a way to get it installed using yum/apt-get/
- whatever
- """
- def ethtool_get(f_type):
- feature_pattern = {
- 'tx': 'tx.*checksumming',
- 'rx': 'rx.*checksumming',
- 'sg': 'scatter.*gather',
- 'tso': 'tcp.*segmentation.*offload',
- 'gso': 'generic.*segmentation.*offload',
- 'gro': 'generic.*receive.*offload',
- 'lro': 'large.*receive.*offload',
- }
- o = session.cmd("ethtool -k %s" % ethname)
- try:
- return re.findall("%s: (.*)" % feature_pattern.get(f_type), o)[0]
- except IndexError:
- logging.debug("Could not get %s status", f_type)
-
-
- def ethtool_set(f_type, status):
- """
- Set ethernet device offload status
-
- @param f_type: Offload type name
- @param status: New status will be changed to
- """
- logging.info("Try to set %s %s", f_type, status)
- if status not in ["off", "on"]:
- return False
- cmd = "ethtool -K %s %s %s" % (ethname, f_type, status)
- if ethtool_get(f_type) != status:
- try:
- session.cmd(cmd)
- return True
- except:
- return False
- if ethtool_get(f_type) != status:
- logging.error("Fail to set %s %s", f_type, status)
- return False
- return True
-
-
- def ethtool_save_params():
- logging.info("Save ethtool configuration")
- for i in supported_features:
- feature_status[i] = ethtool_get(i)
-
-
- def ethtool_restore_params():
- logging.info("Restore ethtool configuration")
- for i in supported_features:
- ethtool_set(i, feature_status[i])
-
-
- def compare_md5sum(name):
- logging.info("Compare md5sum of the files on guest and host")
- host_result = utils.hash_file(name, method="md5")
- try:
- o = session.cmd_output("md5sum %s" % name)
- guest_result = re.findall("\w+", o)[0]
- except IndexError:
- logging.error("Could not get file md5sum in guest")
- return False
- logging.debug("md5sum: guest(%s), host(%s)", guest_result, host_result)
- return guest_result == host_result
-
-
- def transfer_file(src="guest"):
- """
- Transfer file by scp, use tcpdump to capture packets, then check the
- return string.
-
- @param src: Source host of transfer file
- @return: Tuple (status, error msg/tcpdump result)
- """
- session2.cmd_output("rm -rf %s" % filename)
- dd_cmd = ("dd if=/dev/urandom of=%s bs=1M count=%s" %
- (filename, params.get("filesize")))
- failure = (False, "Failed to create file using dd, cmd: %s" % dd_cmd)
- logging.info("Creating file in source host, cmd: %s", dd_cmd)
- tcpdump_cmd = "tcpdump -lep -s 0 tcp -vv port ssh"
- if src == "guest":
- tcpdump_cmd += " and src %s" % guest_ip
- copy_files_from = vm.copy_files_from
- try:
- session.cmd_output(dd_cmd, timeout=360)
- except aexpect.ShellCmdError, e:
- return failure
- else:
- tcpdump_cmd += " and dst %s" % guest_ip
- copy_files_from = vm.copy_files_to
- try:
- utils.system(dd_cmd)
- except error.CmdError, e:
- return failure
-
- # only capture the new tcp port after offload setup
- original_tcp_ports = re.findall("tcp.*:(\d+).*%s" % guest_ip,
- utils.system_output("/bin/netstat -nap"))
- for i in original_tcp_ports:
- tcpdump_cmd += " and not port %s" % i
- logging.debug("Listen using command: %s", tcpdump_cmd)
- session2.sendline(tcpdump_cmd)
- if not virt_utils.wait_for(
- lambda:session.cmd_status("pgrep tcpdump") == 0, 30):
- return (False, "Tcpdump process wasn't launched")
-
- logging.info("Start to transfer file")
- try:
- copy_files_from(filename, filename)
- except virt_utils.SCPError, e:
- return (False, "File transfer failed (%s)" % e)
- logging.info("Transfer file completed")
- session.cmd("killall tcpdump")
- try:
- tcpdump_string = session2.read_up_to_prompt(timeout=60)
- except aexpect.ExpectError:
- return (False, "Fail to read tcpdump's output")
-
- if not compare_md5sum(filename):
- return (False, "Files' md5sum mismatched")
- return (True, tcpdump_string)
-
-
- def tx_callback(status="on"):
- s, o = transfer_file(src="guest")
- if not s:
- logging.error(o)
- return False
- return True
-
-
- def rx_callback(status="on"):
- s, o = transfer_file(src="host")
- if not s:
- logging.error(o)
- return False
- return True
-
-
- def so_callback(status="on"):
- s, o = transfer_file(src="guest")
- if not s:
- logging.error(o)
- return False
- logging.info("Check if contained large frame")
- # MTU: default IPv4 MTU is 1500 Bytes, ethernet header is 14 Bytes
- return (status == "on") ^ (len([i for i in re.findall(
- "length (\d*):", o) if int(i) > mtu]) == 0)
-
-
- def ro_callback(status="on"):
- s, o = transfer_file(src="host")
- if not s:
- logging.error(o)
- return False
- return True
-
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
- # Let's just error the test if we identify that there's no ethtool installed
- session.cmd("ethtool -h")
- session2 = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
- mtu = 1514
- feature_status = {}
- filename = "/tmp/ethtool.dd"
- guest_ip = vm.get_address()
- ethname = virt_test_utils.get_linux_ifname(session, vm.get_mac_address(0))
- supported_features = params.get("supported_features")
- if supported_features:
- supported_features = supported_features.split()
- else:
- supported_features = []
- test_matrix = {
- # type:(callback, (dependence), (exclude)
- "tx": (tx_callback, (), ()),
- "rx": (rx_callback, (), ()),
- "sg": (tx_callback, ("tx",), ()),
- "tso": (so_callback, ("tx", "sg",), ("gso",)),
- "gso": (so_callback, (), ("tso",)),
- "gro": (ro_callback, ("rx",), ("lro",)),
- "lro": (rx_callback, (), ("gro",)),
- }
- ethtool_save_params()
- success = True
- try:
- for f_type in supported_features:
- callback = test_matrix[f_type][0]
- for i in test_matrix[f_type][2]:
- if not ethtool_set(i, "off"):
- logging.error("Fail to disable %s", i)
- success = False
- for i in [f for f in test_matrix[f_type][1]] + [f_type]:
- if not ethtool_set(i, "on"):
- logging.error("Fail to enable %s", i)
- success = False
- if not callback():
- raise error.TestFail("Test failed, %s: on", f_type)
-
- if not ethtool_set(f_type, "off"):
- logging.error("Fail to disable %s", f_type)
- success = False
- if not callback(status="off"):
- raise error.TestFail("Test failed, %s: off", f_type)
- if not success:
- raise error.TestError("Enable/disable offload function fail")
- finally:
- ethtool_restore_params()
- session.close()
- session2.close()
diff --git a/client/virt/tests/file_transfer.py b/client/virt/tests/file_transfer.py
deleted file mode 100644
index 2d0ffad..0000000
--- a/client/virt/tests/file_transfer.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import logging, time, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils
-
-
-def run_file_transfer(test, params, env):
- """
- Test ethrnet device function by ethtool
-
- 1) Boot up a VM.
- 2) Create a large file by dd on host.
- 3) Copy this file from host to guest.
- 4) Copy this file from guest to host.
- 5) Check if file transfers ended good.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
-
- session = vm.wait_for_login(timeout=login_timeout)
-
- dir_name = test.tmpdir
- transfer_timeout = int(params.get("transfer_timeout"))
- transfer_type = params.get("transfer_type")
- tmp_dir = params.get("tmp_dir", "/tmp/")
- clean_cmd = params.get("clean_cmd", "rm -f")
- filesize = int(params.get("filesize", 4000))
- count = int(filesize / 10)
- if count == 0:
- count = 1
-
- host_path = os.path.join(dir_name, "tmp-%s" %
- virt_utils.generate_random_string(8))
- host_path2 = host_path + ".2"
- cmd = "dd if=/dev/zero of=%s bs=10M count=%d" % (host_path, count)
- guest_path = (tmp_dir + "file_transfer-%s" %
- virt_utils.generate_random_string(8))
-
- try:
- logging.info("Creating %dMB file on host", filesize)
- utils.run(cmd)
-
- if transfer_type == "remote":
- logging.info("Transfering file host -> guest, timeout: %ss",
- transfer_timeout)
- t_begin = time.time()
- vm.copy_files_to(host_path, guest_path, timeout=transfer_timeout)
- t_end = time.time()
- throughput = filesize / (t_end - t_begin)
- logging.info("File transfer host -> guest succeed, "
- "estimated throughput: %.2fMB/s", throughput)
-
- logging.info("Transfering file guest -> host, timeout: %ss",
- transfer_timeout)
- t_begin = time.time()
- vm.copy_files_from(guest_path, host_path2, timeout=transfer_timeout)
- t_end = time.time()
- throughput = filesize / (t_end - t_begin)
- logging.info("File transfer guest -> host succeed, "
- "estimated throughput: %.2fMB/s", throughput)
- else:
- raise error.TestError("Unknown test file transfer mode %s" %
- transfer_type)
-
- if (utils.hash_file(host_path, method="md5") !=
- utils.hash_file(host_path2, method="md5")):
- raise error.TestFail("File changed after transfer host -> guest "
- "and guest -> host")
-
- finally:
- logging.info('Cleaning temp file on guest')
- session.cmd("%s %s" % (clean_cmd, guest_path))
- logging.info('Cleaning temp files on host')
- try:
- os.remove(host_path)
- os.remove(host_path2)
- except OSError:
- pass
- session.close()
diff --git a/client/virt/tests/fillup_disk.py b/client/virt/tests/fillup_disk.py
deleted file mode 100644
index 97cd7b8..0000000
--- a/client/virt/tests/fillup_disk.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-
-def run_fillup_disk(test, params, env):
- """
- Fillup guest disk (root mount point) using dd if=/dev/zero,
- and then clean up (rm the big file). The main purpose of this case is to
- expand the qcow2 file to its max size.
-
- Suggest to test rebooting vm after this test.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- fillup_timeout = int(params.get("fillup_timeout"))
- fillup_size = int(params.get("fillup_size"))
- fill_dir = params.get("guest_testdir","/tmp")
- filled = False
- number = 0
-
- try:
- logging.info("Start filling the disk in %s" % fill_dir)
- cmd = params.get("fillup_cmd")
- while not filled:
- # As we want to test the backing file, so bypass the cache
- tmp_cmd = cmd % (fill_dir, number, fillup_size)
- logging.debug(tmp_cmd)
- s, o = session.cmd_status_output(tmp_cmd, timeout=fillup_timeout)
- if "No space left on device" in o:
- logging.debug("Successfully filled up the disk")
- filled = True;
- elif s != 0:
- raise error.TestFail("Command dd failed to execute: %s" % o)
- number += 1
- finally:
- logging.info("Cleaning the temporary files...")
- while number >= 0:
- cmd = "rm -f /%s/fillup.%d" % (fill_dir, number)
- logging.debug(cmd)
- s, o = session.cmd_status_output(cmd)
- if s != 0:
- logging.error(o)
- raise error.TestFail("Failed to remove file %s: %s;"
- "guest may be unresponsive or "
- "command timeout" % (number, o))
- number -= 1
- session.close()
diff --git a/client/virt/tests/guest_s4.py b/client/virt/tests/guest_s4.py
deleted file mode 100644
index 5b5708d..0000000
--- a/client/virt/tests/guest_s4.py
+++ /dev/null
@@ -1,76 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-
[email protected]_aware
-def run_guest_s4(test, params, env):
- """
- Suspend guest to disk, supports both Linux & Windows OSes.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- error.base_context("before S4")
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- error.context("checking whether guest OS supports S4", logging.info)
- session.cmd(params.get("check_s4_support_cmd"))
- error.context()
-
- logging.info("Waiting until all guest OS services are fully started...")
- time.sleep(float(params.get("services_up_timeout", 30)))
-
- # Start up a program (tcpdump for linux & ping for Windows), as a flag.
- # If the program died after suspend, then fails this testcase.
- test_s4_cmd = params.get("test_s4_cmd")
- session.sendline(test_s4_cmd)
- time.sleep(5)
-
- # Get the second session to start S4
- session2 = vm.wait_for_login(timeout=timeout)
-
- # Make sure the background program is running as expected
- error.context("making sure background program is running")
- check_s4_cmd = params.get("check_s4_cmd")
- session2.cmd(check_s4_cmd)
- logging.info("Launched background command in guest: %s", test_s4_cmd)
- error.context()
- error.base_context()
-
- # Suspend to disk
- logging.info("Starting suspend to disk now...")
- session2.sendline(params.get("set_s4_cmd"))
-
- # Make sure the VM goes down
- error.base_context("after S4")
- suspend_timeout = 240 + int(params.get("smp")) * 60
- if not virt_utils.wait_for(vm.is_dead, suspend_timeout, 2, 2):
- raise error.TestFail("VM refuses to go down. Suspend failed.")
- logging.info("VM suspended successfully. Sleeping for a while before "
- "resuming it.")
- time.sleep(10)
-
- # Start vm, and check whether the program is still running
- logging.info("Resuming suspended VM...")
- vm.create()
-
- # Log into the resumed VM
- relogin_timeout = int(params.get("relogin_timeout", 240))
- logging.info("Logging into resumed VM, timeout %s", relogin_timeout)
- session2 = vm.wait_for_login(timeout=relogin_timeout)
-
- # Check whether the test command is still alive
- error.context("making sure background program is still running",
- logging.info)
- session2.cmd(check_s4_cmd)
- error.context()
-
- logging.info("VM resumed successfuly after suspend to disk")
- session2.cmd_output(params.get("kill_test_s4_cmd"))
- session.close()
- session2.close()
diff --git a/client/virt/tests/guest_test.py b/client/virt/tests/guest_test.py
deleted file mode 100644
index 3bc7da7..0000000
--- a/client/virt/tests/guest_test.py
+++ /dev/null
@@ -1,80 +0,0 @@
-import os, logging
-from autotest_lib.client.virt import virt_utils
-
-
-def run_guest_test(test, params, env):
- """
- A wrapper for running customized tests in guests.
-
- 1) Log into a guest.
- 2) Run script.
- 3) Wait for script execution to complete.
- 4) Pass/fail according to exit status of script.
-
- @param test: KVM test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- login_timeout = int(params.get("login_timeout", 360))
- reboot = params.get("reboot", "no")
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- if params.get("serial_login") == "yes":
- session = vm.wait_for_serial_login(timeout=login_timeout)
- else:
- session = vm.wait_for_login(timeout=login_timeout)
-
- if reboot == "yes":
- logging.debug("Rebooting guest before test ...")
- session = vm.reboot(session, timeout=login_timeout)
-
- try:
- logging.info("Starting script...")
-
- # Collect test parameters
- interpreter = params.get("interpreter")
- script = params.get("guest_script")
- dst_rsc_path = params.get("dst_rsc_path", "script.au3")
- script_params = params.get("script_params", "")
- test_timeout = float(params.get("test_timeout", 600))
-
- logging.debug("Starting preparing resouce files...")
- # Download the script resource from a remote server, or
- # prepare the script using rss?
- if params.get("download") == "yes":
- download_cmd = params.get("download_cmd")
- rsc_server = params.get("rsc_server")
- rsc_dir = os.path.basename(rsc_server)
- dst_rsc_dir = params.get("dst_rsc_dir")
-
- # Change dir to dst_rsc_dir, and remove the guest script dir there
- rm_cmd = "cd %s && (rmdir /s /q %s || del /s /q %s)" % \
- (dst_rsc_dir, rsc_dir, rsc_dir)
- session.cmd(rm_cmd, timeout=test_timeout)
- logging.debug("Clean directory succeeded.")
-
- # then download the resource.
- rsc_cmd = "cd %s && %s %s" % (dst_rsc_dir, download_cmd, rsc_server)
- session.cmd(rsc_cmd, timeout=test_timeout)
- logging.info("Download resource finished.")
- else:
- session.cmd_output("del %s" % dst_rsc_path, internal_timeout=0)
- script_path = virt_utils.get_path(test.bindir, script)
- vm.copy_files_to(script_path, dst_rsc_path, timeout=60)
-
- cmd = "%s %s %s" % (interpreter, dst_rsc_path, script_params)
-
- try:
- logging.info("------------ Script output ------------")
- session.cmd(cmd, print_func=logging.info, timeout=test_timeout)
- finally:
- logging.info("------------ End of script output ------------")
-
- if reboot == "yes":
- logging.debug("Rebooting guest after test ...")
- session = vm.reboot(session, timeout=login_timeout)
-
- logging.debug("guest test PASSED.")
- finally:
- session.close()
diff --git a/client/virt/tests/image_copy.py b/client/virt/tests/image_copy.py
deleted file mode 100644
index cc921ab..0000000
--- a/client/virt/tests/image_copy.py
+++ /dev/null
@@ -1,45 +0,0 @@
-import os, logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils
-
-
-def run_image_copy(test, params, env):
- """
- Copy guest images from nfs server.
- 1) Mount the NFS share directory
- 2) Check the existence of source image
- 3) If it exists, copy the image from NFS
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- mount_dest_dir = params.get('dst_dir', '/mnt/images')
- if not os.path.exists(mount_dest_dir):
- try:
- os.makedirs(mount_dest_dir)
- except OSError, err:
- logging.warning('mkdir %s error:\n%s', mount_dest_dir, err)
-
- if not os.path.exists(mount_dest_dir):
- raise error.TestError('Failed to create NFS share dir %s' %
- mount_dest_dir)
-
- src = params.get('images_good')
- image = '%s.%s' % (os.path.split(params['image_name'])[1],
- params['image_format'])
- src_path = os.path.join(mount_dest_dir, image)
- dst_path = '%s.%s' % (params['image_name'], params['image_format'])
- cmd = 'cp %s %s' % (src_path, dst_path)
-
- if not virt_utils.mount(src, mount_dest_dir, 'nfs', 'ro'):
- raise error.TestError('Could not mount NFS share %s to %s' %
- (src, mount_dest_dir))
-
- # Check the existence of source image
- if not os.path.exists(src_path):
- raise error.TestError('Could not find %s in NFS share' % src_path)
-
- logging.debug('Copying image %s...', image)
- utils.system(cmd)
diff --git a/client/virt/tests/iofuzz.py b/client/virt/tests/iofuzz.py
deleted file mode 100644
index e64466e..0000000
--- a/client/virt/tests/iofuzz.py
+++ /dev/null
@@ -1,136 +0,0 @@
-import logging, re, random
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import aexpect
-
-
-def run_iofuzz(test, params, env):
- """
- KVM iofuzz test:
- 1) Log into a guest
- 2) Enumerate all IO port ranges through /proc/ioports
- 3) On each port of the range:
- * Read it
- * Write 0 to it
- * Write a random value to a random port on a random order
-
- If the guest SSH session hangs, the test detects the hang and the guest
- is then rebooted. The test fails if we detect the qemu process to terminate
- while executing the process.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- def outb(session, port, data):
- """
- Write data to a given port.
-
- @param session: SSH session stablished to a VM
- @param port: Port where we'll write the data
- @param data: Integer value that will be written on the port. This
- value will be converted to octal before its written.
- """
- logging.debug("outb(0x%x, 0x%x)", port, data)
- outb_cmd = ("echo -e '\\%s' | dd of=/dev/port seek=%d bs=1 count=1" %
- (oct(data), port))
- try:
- session.cmd(outb_cmd)
- except aexpect.ShellError, e:
- logging.debug(e)
-
-
- def inb(session, port):
- """
- Read from a given port.
-
- @param session: SSH session stablished to a VM
- @param port: Port where we'll read data
- """
- logging.debug("inb(0x%x)", port)
- inb_cmd = "dd if=/dev/port seek=%d of=/dev/null bs=1 count=1" % port
- try:
- session.cmd(inb_cmd)
- except aexpect.ShellError, e:
- logging.debug(e)
-
-
- def fuzz(session, inst_list):
- """
- Executes a series of read/write/randwrite instructions.
-
- If the guest SSH session hangs, an attempt to relogin will be made.
- If it fails, the guest will be reset. If during the process the VM
- process abnormally ends, the test fails.
-
- @param inst_list: List of instructions that will be executed.
- @raise error.TestFail: If the VM process dies in the middle of the
- fuzzing procedure.
- """
- for (op, operand) in inst_list:
- if op == "read":
- inb(session, operand[0])
- elif op == "write":
- outb(session, operand[0], operand[1])
- else:
- raise error.TestError("Unknown command %s" % op)
-
- if not session.is_responsive():
- logging.debug("Session is not responsive")
- if vm.process.is_alive():
- logging.debug("VM is alive, try to re-login")
- try:
- session = vm.wait_for_login(timeout=10)
- except:
- logging.debug("Could not re-login, reboot the guest")
- session = vm.reboot(method="system_reset")
- else:
- raise error.TestFail("VM has quit abnormally during "
- "%s: %s" % (op, operand))
-
-
- login_timeout = float(params.get("login_timeout", 240))
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=login_timeout)
-
- try:
- ports = {}
- r = random.SystemRandom()
-
- logging.info("Enumerate guest devices through /proc/ioports")
- ioports = session.cmd_output("cat /proc/ioports")
- logging.debug(ioports)
- devices = re.findall("(\w+)-(\w+)\ : (.*)", ioports)
-
- skip_devices = params.get("skip_devices","")
- fuzz_count = int(params.get("fuzz_count", 10))
-
- for (beg, end, name) in devices:
- ports[(int(beg, base=16), int(end, base=16))] = name.strip()
-
- for (beg, end) in ports.keys():
- name = ports[(beg, end)]
- if name in skip_devices:
- logging.info("Skipping device %s", name)
- continue
-
- logging.info("Fuzzing %s, port range 0x%x-0x%x", name, beg, end)
- inst = []
-
- # Read all ports of the range
- for port in range(beg, end + 1):
- inst.append(("read", [port]))
-
- # Write 0 to all ports of the range
- for port in range(beg, end + 1):
- inst.append(("write", [port, 0]))
-
- # Write random values to random ports of the range
- for seq in range(fuzz_count * (end - beg + 1)):
- inst.append(("write",
- [r.randint(beg, end), r.randint(0,255)]))
-
- fuzz(session, inst)
-
- finally:
- session.close()
diff --git a/client/virt/tests/ioquit.py b/client/virt/tests/ioquit.py
deleted file mode 100644
index 34b4fb5..0000000
--- a/client/virt/tests/ioquit.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import logging, time, random
-
-
-def run_ioquit(test, params, env):
- """
- Emulate the poweroff under IO workload(dd so far) using kill -9.
-
- @param test: Kvm test object
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
- session2 = vm.wait_for_login(timeout=login_timeout)
- try:
- bg_cmd = params.get("background_cmd")
- logging.info("Add IO workload for guest OS.")
- session.cmd_output(bg_cmd, timeout=60)
- check_cmd = params.get("check_cmd")
- session2.cmd(check_cmd, timeout=60)
-
- logging.info("Sleep for a while")
- time.sleep(random.randrange(30, 100))
- session2.cmd(check_cmd, timeout=60)
- logging.info("Kill the virtual machine")
- vm.process.close()
- finally:
- session.close()
- session2.close()
diff --git a/client/virt/tests/iozone_windows.py b/client/virt/tests/iozone_windows.py
deleted file mode 100644
index b4779c6..0000000
--- a/client/virt/tests/iozone_windows.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import logging, os
-from autotest_lib.client.bin import utils
-from autotest_lib.client.tests.iozone import postprocessing
-
-
-def run_iozone_windows(test, params, env):
- """
- Run IOzone for windows on a windows guest:
- 1) Log into a guest
- 2) Execute the IOzone test contained in the winutils.iso
- 3) Get results
- 4) Postprocess it with the IOzone postprocessing module
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- results_path = os.path.join(test.resultsdir,
- 'raw_output_%s' % test.iteration)
- analysisdir = os.path.join(test.resultsdir, 'analysis_%s' % test.iteration)
-
- # Run IOzone and record its results
- c = params.get("iozone_cmd")
- t = int(params.get("iozone_timeout"))
- logging.info("Running IOzone command on guest, timeout %ss", t)
- results = session.cmd_output(cmd=c, timeout=t)
- utils.open_write_close(results_path, results)
-
- # Postprocess the results using the IOzone postprocessing module
- logging.info("Iteration succeed, postprocessing")
- a = postprocessing.IOzoneAnalyzer(list_files=[results_path],
- output_dir=analysisdir)
- a.analyze()
- p = postprocessing.IOzonePlotter(results_file=results_path,
- output_dir=analysisdir)
- p.plot_all()
diff --git a/client/virt/tests/jumbo.py b/client/virt/tests/jumbo.py
deleted file mode 100644
index 5108227..0000000
--- a/client/virt/tests/jumbo.py
+++ /dev/null
@@ -1,127 +0,0 @@
-import logging, commands, random
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_utils, virt_test_utils
-
-
-def run_jumbo(test, params, env):
- """
- Test the RX jumbo frame function of vnics:
-
- 1) Boot the VM.
- 2) Change the MTU of guest nics and host taps depending on the NIC model.
- 3) Add the static ARP entry for guest NIC.
- 4) Wait for the MTU ok.
- 5) Verify the path MTU using ping.
- 6) Ping the guest with large frames.
- 7) Increment size ping.
- 8) Flood ping the guest with large frames.
- 9) Verify the path MTU.
- 10) Recover the MTU.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
- mtu = params.get("mtu", "1500")
- flood_time = params.get("flood_time", "300")
- max_icmp_pkt_size = int(mtu) - 28
-
- ifname = vm.get_ifname(0)
- ip = vm.get_address(0)
- if ip is None:
- raise error.TestError("Could not get the IP address")
-
- try:
- # Environment preparation
- ethname = virt_test_utils.get_linux_ifname(session, vm.get_mac_address(0))
-
- logging.info("Changing the MTU of guest ...")
- guest_mtu_cmd = "ifconfig %s mtu %s" % (ethname , mtu)
- session.cmd(guest_mtu_cmd)
-
- logging.info("Chaning the MTU of host tap ...")
- host_mtu_cmd = "ifconfig %s mtu %s" % (ifname, mtu)
- utils.run(host_mtu_cmd)
-
- logging.info("Add a temporary static ARP entry ...")
- arp_add_cmd = "arp -s %s %s -i %s" % (ip, vm.get_mac_address(0), ifname)
- utils.run(arp_add_cmd)
-
- def is_mtu_ok():
- s, o = virt_test_utils.ping(ip, 1, interface=ifname,
- packetsize=max_icmp_pkt_size,
- hint="do", timeout=2)
- return s == 0
-
- def verify_mtu():
- logging.info("Verify the path MTU")
- s, o = virt_test_utils.ping(ip, 10, interface=ifname,
- packetsize=max_icmp_pkt_size,
- hint="do", timeout=15)
- if s != 0 :
- logging.error(o)
- raise error.TestFail("Path MTU is not as expected")
- if virt_test_utils.get_loss_ratio(o) != 0:
- logging.error(o)
- raise error.TestFail("Packet loss ratio during MTU "
- "verification is not zero")
-
- def flood_ping():
- logging.info("Flood with large frames")
- virt_test_utils.ping(ip, interface=ifname,
- packetsize=max_icmp_pkt_size,
- flood=True, timeout=float(flood_time))
-
- def large_frame_ping(count=100):
- logging.info("Large frame ping")
- s, o = virt_test_utils.ping(ip, count, interface=ifname,
- packetsize=max_icmp_pkt_size,
- timeout=float(count) * 2)
- ratio = virt_test_utils.get_loss_ratio(o)
- if ratio != 0:
- raise error.TestFail("Loss ratio of large frame ping is %s" %
- ratio)
-
- def size_increase_ping(step=random.randrange(90, 110)):
- logging.info("Size increase ping")
- for size in range(0, max_icmp_pkt_size + 1, step):
- logging.info("Ping %s with size %s", ip, size)
- s, o = virt_test_utils.ping(ip, 1, interface=ifname,
- packetsize=size,
- hint="do", timeout=1)
- if s != 0:
- s, o = virt_test_utils.ping(ip, 10, interface=ifname,
- packetsize=size,
- adaptive=True, hint="do",
- timeout=20)
-
- if virt_test_utils.get_loss_ratio(o) > int(params.get(
- "fail_ratio", 50)):
- raise error.TestFail("Ping loss ratio is greater "
- "than 50% for size %s" % size)
-
- logging.info("Waiting for the MTU to be OK")
- wait_mtu_ok = 10
- if not virt_utils.wait_for(is_mtu_ok, wait_mtu_ok, 0, 1):
- logging.debug(commands.getoutput("ifconfig -a"))
- raise error.TestError("MTU is not as expected even after %s "
- "seconds" % wait_mtu_ok)
-
- # Functional Test
- verify_mtu()
- large_frame_ping()
- size_increase_ping()
-
- # Stress test
- flood_ping()
- verify_mtu()
-
- finally:
- # Environment clean
- session.close()
- logging.info("Removing the temporary ARP entry")
- utils.run("arp -d %s -i %s" % (ip, ifname))
diff --git a/client/virt/tests/kdump.py b/client/virt/tests/kdump.py
deleted file mode 100644
index 90c004b..0000000
--- a/client/virt/tests/kdump.py
+++ /dev/null
@@ -1,75 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-
-def run_kdump(test, params, env):
- """
- KVM reboot test:
- 1) Log into a guest
- 2) Check and enable the kdump
- 3) For each vcpu, trigger a crash and check the vmcore
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = float(params.get("login_timeout", 240))
- crash_timeout = float(params.get("crash_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- def_kernel_param_cmd = ("grubby --update-kernel=`grubby --default-kernel`"
- " --args=crashkernel=128M")
- kernel_param_cmd = params.get("kernel_param_cmd", def_kernel_param_cmd)
- def_kdump_enable_cmd = "chkconfig kdump on && service kdump start"
- kdump_enable_cmd = params.get("kdump_enable_cmd", def_kdump_enable_cmd)
- def_crash_kernel_prob_cmd = "grep -q 1 /sys/kernel/kexec_crash_loaded"
- crash_kernel_prob_cmd = params.get("crash_kernel_prob_cmd",
- def_crash_kernel_prob_cmd)
-
- def crash_test(vcpu):
- """
- Trigger a crash dump through sysrq-trigger
-
- @param vcpu: vcpu which is used to trigger a crash
- """
- session = vm.wait_for_login(timeout=timeout)
- session.cmd_output("rm -rf /var/crash/*")
-
- logging.info("Triggering crash on vcpu %d ...", vcpu)
- crash_cmd = "taskset -c %d echo c > /proc/sysrq-trigger" % vcpu
- session.sendline(crash_cmd)
-
- if not virt_utils.wait_for(lambda: not session.is_responsive(), 240, 0,
- 1):
- raise error.TestFail("Could not trigger crash on vcpu %d" % vcpu)
-
- logging.info("Waiting for kernel crash dump to complete")
- session = vm.wait_for_login(timeout=crash_timeout)
-
- logging.info("Probing vmcore file...")
- session.cmd("ls -R /var/crash | grep vmcore")
- logging.info("Found vmcore.")
-
- session.cmd_output("rm -rf /var/crash/*")
-
- try:
- logging.info("Checking the existence of crash kernel...")
- try:
- session.cmd(crash_kernel_prob_cmd)
- except:
- logging.info("Crash kernel is not loaded. Trying to load it")
- session.cmd(kernel_param_cmd)
- session = vm.reboot(session, timeout=timeout)
-
- logging.info("Enabling kdump service...")
- # the initrd may be rebuilt here so we need to wait a little more
- session.cmd(kdump_enable_cmd, timeout=120)
-
- nvcpu = int(params.get("smp", 1))
- for i in range (nvcpu):
- crash_test(i)
-
- finally:
- session.close()
diff --git a/client/virt/tests/linux_s3.py b/client/virt/tests/linux_s3.py
deleted file mode 100644
index 5a04fca..0000000
--- a/client/virt/tests/linux_s3.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-
-
-def run_linux_s3(test, params, env):
- """
- Suspend a guest Linux OS to memory.
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- logging.info("Checking that VM supports S3")
- session.cmd("grep -q mem /sys/power/state")
-
- logging.info("Waiting for a while for X to start")
- time.sleep(10)
-
- src_tty = session.cmd_output("fgconsole").strip()
- logging.info("Current virtual terminal is %s", src_tty)
- if src_tty not in map(str, range(1, 10)):
- raise error.TestFail("Got a strange current vt (%s)" % src_tty)
-
- dst_tty = "1"
- if src_tty == "1":
- dst_tty = "2"
-
- logging.info("Putting VM into S3")
- command = "chvt %s && echo mem > /sys/power/state && chvt %s" % (dst_tty,
- src_tty)
- suspend_timeout = 120 + int(params.get("smp")) * 60
- session.cmd(command, timeout=suspend_timeout)
-
- logging.info("VM resumed after S3")
-
- session.close()
diff --git a/client/virt/tests/lvm.py b/client/virt/tests/lvm.py
deleted file mode 100644
index d171747..0000000
--- a/client/virt/tests/lvm.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import logging, os
-from autotest_lib.client.common_lib import error
-
-
[email protected]_aware
-def mount_lv(lv_path, session):
- error.context("mounting ext3 filesystem made on logical volume %s" %
- os.path.basename(lv_path))
- session.cmd("mkdir -p /mnt/kvm_test_lvm")
- session.cmd("mount %s /mnt/kvm_test_lvm" % lv_path)
-
-
[email protected]_aware
-def umount_lv(lv_path, session):
- error.context("umounting ext3 filesystem made on logical volume %s" %
- os.path.basename(lv_path))
- session.cmd("umount %s" % lv_path)
- session.cmd("rm -rf /mnt/kvm_test_lvm")
-
-
[email protected]_aware
-def run_lvm(test, params, env):
- """
- KVM reboot test:
- 1) Log into a guest
- 2) Create a volume group and add both disks as pv to the Group
- 3) Create a logical volume on the VG
- 5) `fsck' to check the partition that LV locates
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- vg_name = "vg_kvm_test"
- lv_name = "lv_kvm_test"
- lv_path = "/dev/%s/%s" % (vg_name, lv_name)
- disks = params.get("disks", "/dev/hdb /dev/hdc")
- clean = params.get("clean", "yes")
- timeout = params.get("lvm_timeout", "600")
-
- try:
- error.context("adding physical volumes %s" % disks)
- session.cmd("pvcreate %s" % disks)
-
- error.context("creating a volume group out of %s" % disks)
- session.cmd("vgcreate %s %s" % (vg_name, disks))
-
- error.context("activating volume group %s" % vg_name)
- session.cmd("vgchange -ay %s" % vg_name)
-
- error.context("creating logical volume on volume group %s" % vg_name)
- session.cmd("lvcreate -L2000 -n %s %s" % (lv_name, vg_name))
-
- error.context("creating ext3 filesystem on logical volume %s" % lv_name)
- session.cmd("yes | mkfs.ext3 %s" % lv_path, timeout=int(timeout))
-
- mount_lv(lv_path, session)
-
- umount_lv(lv_path, session)
-
- error.context("checking ext3 filesystem made on logical volume %s" %
- lv_name)
- session.cmd("fsck %s" % lv_path, timeout=int(timeout))
-
- if clean == "no":
- mount_lv(lv_path, session)
-
- finally:
- if clean == "yes":
- umount_lv(lv_path, session)
-
- error.context("removing logical volume %s" % lv_name)
- session.cmd("lvremove %s" % lv_name)
-
- error.context("disabling volume group %s" % vg_name)
- session.cmd("vgchange -a n %s" % vg_name)
-
- error.context("removing volume group %s" % vg_name)
- session.cmd("vgremove -f %s" % vg_name)
diff --git a/client/virt/tests/mac_change.py b/client/virt/tests/mac_change.py
deleted file mode 100644
index 19bf3dc..0000000
--- a/client/virt/tests/mac_change.py
+++ /dev/null
@@ -1,60 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_test_utils
-
-
-def run_mac_change(test, params, env):
- """
- Change MAC address of guest.
-
- 1) Get a new mac from pool, and the old mac addr of guest.
- 2) Set new mac in guest and regain new IP.
- 3) Re-log into guest with new MAC.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session_serial = vm.wait_for_serial_login(timeout=timeout)
- # This session will be used to assess whether the IP change worked
- session = vm.wait_for_login(timeout=timeout)
- old_mac = vm.get_mac_address(0)
- while True:
- vm.free_mac_address(0)
- new_mac = virt_utils.generate_mac_address(vm.instance, 0)
- if old_mac != new_mac:
- break
- logging.info("The initial MAC address is %s", old_mac)
- interface = virt_test_utils.get_linux_ifname(session_serial, old_mac)
- # Start change MAC address
- logging.info("Changing MAC address to %s", new_mac)
- change_cmd = ("ifconfig %s down && ifconfig %s hw ether %s && "
- "ifconfig %s up" % (interface, interface, new_mac, interface))
- session_serial.cmd(change_cmd)
-
- # Verify whether MAC address was changed to the new one
- logging.info("Verifying the new mac address")
- session_serial.cmd("ifconfig | grep -i %s" % new_mac)
-
- # Restart `dhclient' to regain IP for new mac address
- logging.info("Restart the network to gain new IP")
- dhclient_cmd = "dhclient -r && dhclient %s" % interface
- session_serial.sendline(dhclient_cmd)
-
- # Re-log into the guest after changing mac address
- if virt_utils.wait_for(session.is_responsive, 120, 20, 3):
- # Just warning when failed to see the session become dead,
- # because there is a little chance the ip does not change.
- logging.warning("The session is still responsive, settings may fail.")
- session.close()
-
- # Re-log into guest and check if session is responsive
- logging.info("Re-log into the guest")
- session = vm.wait_for_login(timeout=timeout)
- if not session.is_responsive():
- raise error.TestFail("The new session is not responsive.")
-
- session.close()
diff --git a/client/virt/tests/multicast.py b/client/virt/tests/multicast.py
deleted file mode 100644
index c36573b..0000000
--- a/client/virt/tests/multicast.py
+++ /dev/null
@@ -1,90 +0,0 @@
-import logging, os, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import virt_test_utils, aexpect
-
-
-def run_multicast(test, params, env):
- """
- Test multicast function of nic (rtl8139/e1000/virtio)
-
- 1) Create a VM.
- 2) Join guest into multicast groups.
- 3) Ping multicast addresses on host.
- 4) Flood ping test with different size of packets.
- 5) Final ping test and check if lose packet.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
-
- def run_guest(cmd):
- try:
- session.cmd(cmd)
- except aexpect.ShellError, e:
- logging.warning(e)
-
- def run_host_guest(cmd):
- run_guest(cmd)
- utils.system(cmd, ignore_status=True)
-
- # flush the firewall rules
- cmd_flush = "iptables -F"
- cmd_selinux = ("if [ -e /selinux/enforce ]; then setenforce 0; "
- "else echo 'no /selinux/enforce file present'; fi")
- run_host_guest(cmd_flush)
- run_host_guest(cmd_selinux)
- # make sure guest replies to broadcasts
- cmd_broadcast = "echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts"
- cmd_broadcast_2 = "echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all"
- run_guest(cmd_broadcast)
- run_guest(cmd_broadcast_2)
-
- # base multicast address
- mcast = params.get("mcast", "225.0.0.1")
- # count of multicast addresses, less than 20
- mgroup_count = int(params.get("mgroup_count", 5))
- flood_minutes = float(params.get("flood_minutes", 10))
- ifname = vm.get_ifname()
- prefix = re.findall("\d+.\d+.\d+", mcast)[0]
- suffix = int(re.findall("\d+", mcast)[-1])
- # copy python script to guest for joining guest to multicast groups
- mcast_path = os.path.join(test.bindir, "scripts/multicast_guest.py")
- vm.copy_files_to(mcast_path, "/tmp")
- output = session.cmd_output("python /tmp/multicast_guest.py %d %s %d" %
- (mgroup_count, prefix, suffix))
-
- # if success to join multicast, the process will be paused, and return PID.
- try:
- pid = re.findall("join_mcast_pid:(\d+)", output)[0]
- except IndexError:
- raise error.TestFail("Can't join multicast groups,output:%s" % output)
-
- try:
- for i in range(mgroup_count):
- new_suffix = suffix + i
- mcast = "%s.%d" % (prefix, new_suffix)
-
- logging.info("Initial ping test, mcast: %s", mcast)
- s, o = virt_test_utils.ping(mcast, 10, interface=ifname, timeout=20)
- if s != 0:
- raise error.TestFail(" Ping return non-zero value %s" % o)
-
- logging.info("Flood ping test, mcast: %s", mcast)
- virt_test_utils.ping(mcast, None, interface=ifname, flood=True,
- output_func=None, timeout=flood_minutes*60)
-
- logging.info("Final ping test, mcast: %s", mcast)
- s, o = virt_test_utils.ping(mcast, 10, interface=ifname, timeout=20)
- if s != 0:
- raise error.TestFail("Ping failed, status: %s, output: %s" %
- (s, o))
-
- finally:
- logging.debug(session.cmd_output("ipmaddr show"))
- session.cmd_output("kill -s SIGCONT %s" % pid)
- session.close()
diff --git a/client/virt/tests/netperf.py b/client/virt/tests/netperf.py
deleted file mode 100644
index 458364a..0000000
--- a/client/virt/tests/netperf.py
+++ /dev/null
@@ -1,106 +0,0 @@
-import logging, os, signal
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import aexpect, virt_utils
-
-def run_netperf(test, params, env):
- """
- Network stress test with netperf.
-
- 1) Boot up a VM with multiple nics.
- 2) Launch netserver on guest.
- 3) Execute multiple netperf clients on host in parallel
- with different protocols.
- 4) Output the test result.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
- session.close()
- session_serial = vm.wait_for_serial_login(timeout=login_timeout)
-
- netperf_dir = os.path.join(os.environ['AUTODIR'], "tests/netperf2")
- setup_cmd = params.get("setup_cmd")
-
- firewall_flush = "iptables -F"
- session_serial.cmd_output(firewall_flush)
- try:
- utils.run("iptables -F")
- except:
- pass
-
- for i in params.get("netperf_files").split():
- vm.copy_files_to(os.path.join(netperf_dir, i), "/tmp")
-
- try:
- session_serial.cmd(firewall_flush)
- except aexpect.ShellError:
- logging.warning("Could not flush firewall rules on guest")
-
- session_serial.cmd(setup_cmd % "/tmp", timeout=200)
- session_serial.cmd(params.get("netserver_cmd") % "/tmp")
-
- if "tcpdump" in env and env["tcpdump"].is_alive():
- # Stop the background tcpdump process
- try:
- logging.debug("Stopping the background tcpdump")
- env["tcpdump"].close()
- except:
- pass
-
- def netperf(i=0):
- guest_ip = vm.get_address(i)
- logging.info("Netperf_%s: netserver %s" % (i, guest_ip))
- result_file = os.path.join(test.resultsdir, "output_%s_%s"
- % (test.iteration, i ))
- list_fail = []
- result = open(result_file, "w")
- result.write("Netperf test results\n")
-
- for p in params.get("protocols").split():
- packet_size = params.get("packet_size", "1500")
- for size in packet_size.split():
- cmd = params.get("netperf_cmd") % (netperf_dir, p,
- guest_ip, size)
- logging.info("Netperf_%s: protocol %s" % (i, p))
- try:
- netperf_output = utils.system_output(cmd,
- retain_output=True)
- result.write("%s\n" % netperf_output)
- except:
- logging.error("Test of protocol %s failed", p)
- list_fail.append(p)
-
- result.close()
- if list_fail:
- raise error.TestFail("Some netperf tests failed: %s" %
- ", ".join(list_fail))
-
- try:
- logging.info("Setup and run netperf clients on host")
- utils.run(setup_cmd % netperf_dir)
-
- bg = []
- nic_num = len(params.get("nics").split())
- for i in range(nic_num):
- bg.append(virt_utils.Thread(netperf, (i,)))
- bg[i].start()
-
- completed = False
- while not completed:
- completed = True
- for b in bg:
- if b.isAlive():
- completed = False
- finally:
- try:
- for b in bg:
- if b:
- b.join()
- finally:
- session_serial.cmd_output("killall netserver")
diff --git a/client/virt/tests/netstress_kill_guest.py b/client/virt/tests/netstress_kill_guest.py
deleted file mode 100644
index e7e0116..0000000
--- a/client/virt/tests/netstress_kill_guest.py
+++ /dev/null
@@ -1,148 +0,0 @@
-import logging, os, signal, re, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt import aexpect, virt_utils
-
-
-def run_netstress_kill_guest(test, params, env):
- """
- Try stop network interface in VM when other VM try to communicate.
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- def get_corespond_ip(ip):
- """
- Get local ip address which is used for contact ip.
-
- @param ip: Remote ip
- @return: Local corespond IP.
- """
- result = utils.run("ip route get %s" % (ip)).stdout
- ip = re.search("src (.+)", result)
- if ip is not None:
- ip = ip.groups()[0]
- return ip
-
-
- def get_ethernet_driver(session):
- """
- Get driver of network cards.
-
- @param session: session to machine
- """
- modules = []
- out = session.cmd("ls -l --color=never "
- "/sys/class/net/*/device/driver/module")
- for module in out.split("\n"):
- modules.append(module.split("/")[-1])
- modules.remove("")
- return set(modules)
-
-
- def kill_and_check(vm):
- vm_pid = vm.get_pid()
- vm.destroy(gracefully=False)
- time.sleep(2)
- try:
- os.kill(vm_pid, 0)
- logging.error("VM is not dead")
- raise error.TestFail("VM is not dead after sending signal 0 to it")
- except OSError:
- logging.info("VM is dead")
-
-
- def netload_kill_problem(session_serial):
- netperf_dir = os.path.join(os.environ['AUTODIR'], "tests/netperf2")
- setup_cmd = params.get("setup_cmd")
- clean_cmd = params.get("clean_cmd")
- firewall_flush = "iptables -F"
-
- try:
- utils.run(firewall_flush)
- except:
- logging.warning("Could not flush firewall rules on guest")
-
- try:
- session_serial.cmd(firewall_flush)
- except aexpect.ShellError:
- logging.warning("Could not flush firewall rules on guest")
-
- for i in params.get("netperf_files").split():
- vm.copy_files_to(os.path.join(netperf_dir, i), "/tmp")
-
- guest_ip = vm.get_address(0)
- server_ip = get_corespond_ip(guest_ip)
-
- logging.info("Setup and run netperf on host and guest")
- session_serial.cmd(setup_cmd % "/tmp", timeout=200)
- utils.run(setup_cmd % netperf_dir)
-
- try:
- session_serial.cmd(clean_cmd)
- except:
- pass
- session_serial.cmd(params.get("netserver_cmd") % "/tmp")
-
- utils.run(clean_cmd, ignore_status=True)
- utils.run(params.get("netserver_cmd") % netperf_dir)
-
- server_netperf_cmd = params.get("netperf_cmd") % (netperf_dir, "TCP_STREAM",
- guest_ip, params.get("packet_size", "1500"))
- quest_netperf_cmd = params.get("netperf_cmd") % ("/tmp", "TCP_STREAM",
- server_ip, params.get("packet_size", "1500"))
-
- tcpdump = env.get("tcpdump")
- pid = None
- if tcpdump:
- # Stop the background tcpdump process
- try:
- pid = int(utils.system_output("pidof tcpdump"))
- logging.debug("Stopping the background tcpdump")
- os.kill(pid, signal.SIGSTOP)
- except:
- pass
-
- try:
- logging.info("Start heavy network load host <=> guest.")
- session_serial.sendline(quest_netperf_cmd)
- utils.BgJob(server_netperf_cmd)
-
- #Wait for create big network usage.
- time.sleep(10)
- kill_and_check(vm)
-
- finally:
- utils.run(clean_cmd, ignore_status=True)
- if tcpdump and pid:
- logging.debug("Resuming the background tcpdump")
- logging.info("pid is %s" % pid)
- os.kill(pid, signal.SIGCONT)
-
-
- def netdriver_kill_problem(session_serial):
- modules = get_ethernet_driver(session_serial)
- logging.debug(modules)
- for _ in range(50):
- for module in modules:
- session_serial.cmd("rmmod %s" % (module))
- time.sleep(0.2)
- for module in modules:
- session_serial.cmd("modprobe %s" % (module))
- time.sleep(0.2)
- kill_and_check(vm)
-
-
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=login_timeout)
- session.close()
- session_serial = vm.wait_for_serial_login(timeout=login_timeout)
-
- mode = params.get("mode")
- if mode == "driver":
- netdriver_kill_problem(session_serial)
- elif mode == "load":
- netload_kill_problem(session_serial)
diff --git a/client/virt/tests/nic_promisc.py b/client/virt/tests/nic_promisc.py
deleted file mode 100644
index de4c4d6..0000000
--- a/client/virt/tests/nic_promisc.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import logging, threading
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt.tests import file_transfer
-from autotest_lib.client.virt import virt_test_utils, virt_utils
-
-
-def run_nic_promisc(test, params, env):
- """
- Test nic driver in promisc mode:
-
- 1) Boot up a VM.
- 2) Repeatedly enable/disable promiscuous mode in guest.
- 3) Transfer file from host to guest, and from guest to host in the same time
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session_serial = vm.wait_for_serial_login(timeout=timeout)
-
- ethname = virt_test_utils.get_linux_ifname(session_serial,
- vm.get_mac_address(0))
-
- try:
- transfer_thread = virt_utils.Thread(file_transfer.run_file_transfer,
- (test, params, env))
- transfer_thread.start()
- while transfer_thread.isAlive():
- session_serial.cmd("ip link set %s promisc on" % ethname)
- session_serial.cmd("ip link set %s promisc off" % ethname)
- except:
- transfer_thread.join(suppress_exception=True)
- raise
- else:
- transfer_thread.join()
diff --git a/client/virt/tests/nicdriver_unload.py b/client/virt/tests/nicdriver_unload.py
deleted file mode 100644
index be0a83f..0000000
--- a/client/virt/tests/nicdriver_unload.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import logging, threading, os, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.virt.tests import file_transfer
-from autotest_lib.client.virt import virt_test_utils, virt_utils
-
-
-def run_nicdriver_unload(test, params, env):
- """
- Test nic driver.
-
- 1) Boot a VM.
- 2) Get the NIC driver name.
- 3) Repeatedly unload/load NIC driver.
- 4) Multi-session TCP transfer on test interface.
- 5) Check whether the test interface should still work.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- timeout = int(params.get("login_timeout", 360))
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session_serial = vm.wait_for_serial_login(timeout=timeout)
-
- ethname = virt_test_utils.get_linux_ifname(session_serial,
- vm.get_mac_address(0))
-
- # get ethernet driver from '/sys' directory.
- # ethtool can do the same thing and doesn't care about os type.
- # if we make sure all guests have ethtool, we can make a change here.
- sys_path = params.get("sys_path") % (ethname)
-
- # readlink in RHEL4.8 doesn't have '-e' param, should use '-f' in RHEL4.8.
- readlink_cmd = params.get("readlink_command", "readlink -e")
- driver = os.path.basename(session_serial.cmd("%s %s" % (readlink_cmd,
- sys_path)).strip())
-
- logging.info("driver is %s", driver)
-
- try:
- threads = []
- for t in range(int(params.get("sessions_num", "10"))):
- thread = virt_utils.Thread(file_transfer.run_file_transfer,
- (test, params, env))
- thread.start()
- threads.append(thread)
-
- time.sleep(10)
- while threads[0].isAlive():
- session_serial.cmd("sleep 10")
- session_serial.cmd("ifconfig %s down" % ethname)
- session_serial.cmd("modprobe -r %s" % driver)
- session_serial.cmd("modprobe %s" % driver)
- session_serial.cmd("ifconfig %s up" % ethname)
- except:
- for thread in threads:
- thread.join(suppress_exception=True)
- raise
- else:
- for thread in threads:
- thread.join()
diff --git a/client/virt/tests/ping.py b/client/virt/tests/ping.py
deleted file mode 100644
index 08791fb..0000000
--- a/client/virt/tests/ping.py
+++ /dev/null
@@ -1,73 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_test_utils
-
-
-def run_ping(test, params, env):
- """
- Ping the guest with different size of packets.
-
- Packet Loss Test:
- 1) Ping the guest with different size/interval of packets.
-
- Stress Test:
- 1) Flood ping the guest.
- 2) Check if the network is still usable.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
-
- counts = params.get("ping_counts", 100)
- flood_minutes = float(params.get("flood_minutes", 10))
- nics = params.get("nics").split()
- strict_check = params.get("strict_check", "no") == "yes"
-
- packet_size = [0, 1, 4, 48, 512, 1440, 1500, 1505, 4054, 4055, 4096, 4192,
- 8878, 9000, 32767, 65507]
-
- try:
- for i, nic in enumerate(nics):
- ip = vm.get_address(i)
- if not ip:
- logging.error("Could not get the ip of nic index %d: %s",
- i, nic)
- continue
-
- for size in packet_size:
- logging.info("Ping with packet size %s", size)
- status, output = virt_test_utils.ping(ip, 10,
- packetsize=size,
- timeout=20)
- if strict_check:
- ratio = virt_test_utils.get_loss_ratio(output)
- if ratio != 0:
- raise error.TestFail("Loss ratio is %s for packet size"
- " %s" % (ratio, size))
- else:
- if status != 0:
- raise error.TestFail("Ping failed, status: %s,"
- " output: %s" % (status, output))
-
- logging.info("Flood ping test")
- virt_test_utils.ping(ip, None, flood=True, output_func=None,
- timeout=flood_minutes * 60)
-
- logging.info("Final ping test")
- status, output = virt_test_utils.ping(ip, counts,
- timeout=float(counts) * 1.5)
- if strict_check:
- ratio = virt_test_utils.get_loss_ratio(output)
- if ratio != 0:
- raise error.TestFail("Ping failed, status: %s,"
- " output: %s" % (status, output))
- else:
- if status != 0:
- raise error.TestFail("Ping returns non-zero value %s" %
- output)
- finally:
- session.close()
diff --git a/client/virt/tests/pxe.py b/client/virt/tests/pxe.py
deleted file mode 100644
index 325e353..0000000
--- a/client/virt/tests/pxe.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import aexpect
-
-def run_pxe(test, params, env):
- """
- PXE test:
-
- 1) Snoop the tftp packet in the tap device.
- 2) Wait for some seconds.
- 3) Check whether we could capture TFTP packets.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("pxe_timeout", 60))
-
- logging.info("Try to boot from PXE")
- output = aexpect.run_fg("tcpdump -nli %s" % vm.get_ifname(),
- logging.debug, "(pxe capture) ", timeout)[1]
-
- logging.info("Analyzing the tcpdump result...")
- if not "tftp" in output:
- raise error.TestFail("Couldn't find any TFTP packets after %s seconds" %
- timeout)
- logging.info("Found TFTP packet")
diff --git a/client/virt/tests/shutdown.py b/client/virt/tests/shutdown.py
deleted file mode 100644
index 4fbb9b8..0000000
--- a/client/virt/tests/shutdown.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import logging, time
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-
[email protected]_aware
-def run_shutdown(test, params, env):
- """
- KVM shutdown test:
- 1) Log into a guest
- 2) Send a shutdown command to the guest, or issue a system_powerdown
- monitor command (depending on the value of shutdown_method)
- 3) Wait until the guest is down
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- try:
- error.base_context("shutting down the VM")
- if params.get("shutdown_method") == "shell":
- # Send a shutdown command to the guest's shell
- session.sendline(vm.get_params().get("shutdown_command"))
- error.context("waiting VM to go down (shutdown shell cmd)")
- elif params.get("shutdown_method") == "system_powerdown":
- # Sleep for a while -- give the guest a chance to finish booting
- time.sleep(float(params.get("sleep_before_powerdown", 10)))
- # Send a system_powerdown monitor command
- vm.monitor.cmd("system_powerdown")
- error.context("waiting VM to go down "
- "(system_powerdown monitor cmd)")
-
- if not virt_utils.wait_for(vm.is_dead, 240, 0, 1):
- raise error.TestFail("Guest refuses to go down")
-
- finally:
- session.close()
diff --git a/client/virt/tests/softlockup.py b/client/virt/tests/softlockup.py
deleted file mode 100644
index 0864d52..0000000
--- a/client/virt/tests/softlockup.py
+++ /dev/null
@@ -1,147 +0,0 @@
-import logging, os, socket, time
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-
-def run_softlockup(test, params, env):
- """
- soft lockup/drift test with stress.
-
- 1) Boot up a VM.
- 2) Build stress on host and guest.
- 3) run heartbeat with the given options on server and host.
- 3) Run for a relatively long time length. ex: 12, 18 or 24 hours.
- 4) Output the test result and observe drift.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- stress_setup_cmd = params.get("stress_setup_cmd")
- stress_cmd = params.get("stress_cmd")
- server_setup_cmd = params.get("server_setup_cmd")
- drift_cmd = params.get("drift_cmd")
- kill_stress_cmd = params.get("kill_stress_cmd")
- kill_monitor_cmd = params.get("kill_monitor_cmd")
-
- threshold = int(params.get("stress_threshold"))
- monitor_log_file_server = params.get("monitor_log_file_server")
- monitor_log_file_client = params.get("monitor_log_file_client")
- test_length = int(3600 * float(params.get("test_length")))
- monitor_port = int(params.get("monitor_port"))
-
- vm = env.get_vm(params["main_vm"])
- login_timeout = int(params.get("login_timeout", 360))
- stress_dir = os.path.join(os.environ['AUTODIR'], "tests/stress")
- monitor_dir = os.path.join(test.bindir, 'deps')
-
-
- def _kill_guest_programs(session, kill_stress_cmd, kill_monitor_cmd):
- logging.info("Kill stress and monitor on guest")
- try:
- session.cmd(kill_stress_cmd)
- except:
- pass
- try:
- session.cmd(kill_monitor_cmd)
- except:
- pass
-
-
- def _kill_host_programs(kill_stress_cmd, kill_monitor_cmd):
- logging.info("Kill stress and monitor on host")
- utils.run(kill_stress_cmd, ignore_status=True)
- utils.run(kill_monitor_cmd, ignore_status=True)
-
-
- def host():
- logging.info("Setup monitor server on host")
- # Kill previous instances of the host load programs, if any
- _kill_host_programs(kill_stress_cmd, kill_monitor_cmd)
- # Cleanup previous log instances
- if os.path.isfile(monitor_log_file_server):
- os.remove(monitor_log_file_server)
- # Opening firewall ports on host
- utils.run("iptables -F", ignore_status=True)
-
- # Run heartbeat on host
- utils.run(server_setup_cmd % (monitor_dir, threshold,
- monitor_log_file_server, monitor_port))
-
- logging.info("Build stress on host")
- # Uncompress and build stress on host
- utils.run(stress_setup_cmd % stress_dir)
-
- logging.info("Run stress on host")
- # stress_threads = 2 * n_cpus
- threads_host = 2 * utils.count_cpus()
- # Run stress test on host
- utils.run(stress_cmd % (stress_dir, threads_host))
-
-
- def guest():
- try:
- host_ip = socket.gethostbyname(socket.gethostname())
- except socket.error:
- try:
- # Hackish, but works well on stand alone (laptop) setups
- # with access to the internet. If this fails, well, then
- # not much else can be done...
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.connect(("redhat.com", 80))
- host_ip = s.getsockname()[0]
- except socket.error, (value, e):
- raise error.TestError("Could not determine host IP: %d %s" %
- (value, e))
-
- # Now, starting the guest
- vm.verify_alive()
- session = vm.wait_for_login(timeout=login_timeout)
-
- # Kill previous instances of the load programs, if any
- _kill_guest_programs(session, kill_stress_cmd, kill_monitor_cmd)
- # Clean up previous log instances
- session.cmd("rm -f %s" % monitor_log_file_client)
-
- # Opening firewall ports on guest
- try:
- session.cmd("iptables -F")
- except:
- pass
-
- # Get required files and copy them from host to guest
- monitor_path = os.path.join(test.bindir, 'deps', 'heartbeat_slu.py')
- stress_path = os.path.join(os.environ['AUTODIR'], "tests", "stress",
- "stress-1.0.4.tar.gz")
- vm.copy_files_to(monitor_path, "/tmp")
- vm.copy_files_to(stress_path, "/tmp")
-
- logging.info("Setup monitor client on guest")
- # Start heartbeat on guest
- session.cmd(params.get("client_setup_cmd") %
- ("/tmp", host_ip, monitor_log_file_client, monitor_port))
-
- logging.info("Build stress on guest")
- # Uncompress and build stress on guest
- session.cmd(stress_setup_cmd % "/tmp", timeout=200)
-
- logging.info("Run stress on guest")
- # stress_threads = 2 * n_vcpus
- threads_guest = 2 * int(params.get("smp", 1))
- # Run stress test on guest
- session.cmd(stress_cmd % ("/tmp", threads_guest))
-
- # Wait and report
- logging.debug("Wait for %d s", test_length)
- time.sleep(test_length)
-
- # Kill instances of the load programs on both guest and host
- _kill_guest_programs(session, kill_stress_cmd, kill_monitor_cmd)
- _kill_host_programs(kill_stress_cmd, kill_monitor_cmd)
-
- # Collect drift
- drift = utils.system_output(drift_cmd % monitor_log_file_server)
- logging.info("Drift noticed: %s", drift)
-
-
- host()
- guest()
diff --git a/client/virt/tests/stress_boot.py b/client/virt/tests/stress_boot.py
deleted file mode 100644
index e3ac14d..0000000
--- a/client/virt/tests/stress_boot.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import logging
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_env_process
-
-
[email protected]_aware
-def run_stress_boot(test, 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 respond to shell commands
- 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.
- """
- error.base_context("waiting for the first guest to be up", logging.info)
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- login_timeout = float(params.get("login_timeout", 240))
- session = vm.wait_for_login(timeout=login_timeout)
-
- num = 2
- sessions = [session]
-
- # Boot the VMs
- try:
- while num <= int(params.get("max_vms")):
- # Clone vm according to the first one
- error.base_context("booting guest #%d" % num, logging.info)
- vm_name = "vm%d" % num
- vm_params = vm.params.copy()
- curr_vm = vm.clone(vm_name, vm_params)
- env.register_vm(vm_name, curr_vm)
- virt_env_process.preprocess_vm(test, vm_params, env, vm_name)
- params["vms"] += " " + vm_name
-
- sessions.append(curr_vm.wait_for_login(timeout=login_timeout))
- logging.info("Guest #%d booted up successfully", num)
-
- # Check whether all previous shell sessions are responsive
- for i, se in enumerate(sessions):
- error.context("checking responsiveness of guest #%d" % (i + 1),
- logging.debug)
- se.cmd(params.get("alive_test_cmd"))
- num += 1
- finally:
- for se in sessions:
- se.close()
- logging.info("Total number booted: %d" % (num -1))
diff --git a/client/virt/tests/vlan.py b/client/virt/tests/vlan.py
deleted file mode 100644
index 9fc1f64..0000000
--- a/client/virt/tests/vlan.py
+++ /dev/null
@@ -1,175 +0,0 @@
-import logging, time, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_test_utils, aexpect
-
-
-def run_vlan(test, params, env):
- """
- Test 802.1Q vlan of NIC, config it by vconfig command.
-
- 1) Create two VMs.
- 2) Setup guests in 10 different vlans by vconfig and using hard-coded
- ip address.
- 3) Test by ping between same and different vlans of two VMs.
- 4) Test by TCP data transfer, floop ping between same vlan of two VMs.
- 5) Test maximal plumb/unplumb vlans.
- 6) Recover the vlan config.
-
- @param test: KVM test object.
- @param params: Dictionary with the test parameters.
- @param env: Dictionary with test environment.
- """
- vm = []
- session = []
- ifname = []
- vm_ip = []
- digest_origin = []
- vlan_ip = ['', '']
- ip_unit = ['1', '2']
- subnet = params.get("subnet")
- vlan_num = int(params.get("vlan_num"))
- maximal = int(params.get("maximal"))
- file_size = params.get("file_size")
-
- vm.append(env.get_vm(params["main_vm"]))
- vm.append(env.get_vm("vm2"))
- for vm_ in vm:
- vm_.verify_alive()
-
- def add_vlan(session, v_id, iface="eth0"):
- session.cmd("vconfig add %s %s" % (iface, v_id))
-
- def set_ip_vlan(session, v_id, ip, iface="eth0"):
- iface = "%s.%s" % (iface, v_id)
- session.cmd("ifconfig %s %s" % (iface, ip))
-
- def set_arp_ignore(session, iface="eth0"):
- ignore_cmd = "echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore"
- session.cmd(ignore_cmd)
-
- def rem_vlan(session, v_id, iface="eth0"):
- rem_vlan_cmd = "if [[ -e /proc/net/vlan/%s ]];then vconfig rem %s;fi"
- iface = "%s.%s" % (iface, v_id)
- return session.cmd_status(rem_vlan_cmd % (iface, iface))
-
- def nc_transfer(src, dst):
- nc_port = virt_utils.find_free_port(1025, 5334, vm_ip[dst])
- listen_cmd = params.get("listen_cmd")
- send_cmd = params.get("send_cmd")
-
- #listen in dst
- listen_cmd = listen_cmd % (nc_port, "receive")
- session[dst].sendline(listen_cmd)
- time.sleep(2)
- #send file from src to dst
- send_cmd = send_cmd % (vlan_ip[dst], str(nc_port), "file")
- session[src].cmd(send_cmd, timeout=60)
- try:
- session[dst].read_up_to_prompt(timeout=60)
- except aexpect.ExpectError:
- raise error.TestFail ("Fail to receive file"
- " from vm%s to vm%s" % (src+1, dst+1))
- #check MD5 message digest of receive file in dst
- output = session[dst].cmd_output("md5sum receive").strip()
- digest_receive = re.findall(r'(\w+)', output)[0]
- if digest_receive == digest_origin[src]:
- logging.info("file succeed received in vm %s", vlan_ip[dst])
- else:
- logging.info("digest_origin is %s", digest_origin[src])
- logging.info("digest_receive is %s", digest_receive)
- raise error.TestFail("File transfered differ from origin")
- session[dst].cmd_output("rm -f receive")
-
- for i in range(2):
- session.append(vm[i].wait_for_login(
- timeout=int(params.get("login_timeout", 360))))
- if not session[i] :
- raise error.TestError("Could not log into guest(vm%d)" % i)
- logging.info("Logged in")
-
- ifname.append(virt_test_utils.get_linux_ifname(session[i],
- vm[i].get_mac_address()))
- #get guest ip
- vm_ip.append(vm[i].get_address())
-
- #produce sized file in vm
- dd_cmd = "dd if=/dev/urandom of=file bs=1024k count=%s"
- session[i].cmd(dd_cmd % file_size)
- #record MD5 message digest of file
- output = session[i].cmd("md5sum file", timeout=60)
- digest_origin.append(re.findall(r'(\w+)', output)[0])
-
- #stop firewall in vm
- session[i].cmd_output("/etc/init.d/iptables stop")
-
- #load 8021q module for vconfig
- session[i].cmd("modprobe 8021q")
-
- try:
- for i in range(2):
- for vlan_i in range(1, vlan_num+1):
- add_vlan(session[i], vlan_i, ifname[i])
- set_ip_vlan(session[i], vlan_i, "%s.%s.%s" %
- (subnet, vlan_i, ip_unit[i]), ifname[i])
- set_arp_ignore(session[i], ifname[i])
-
- for vlan in range(1, vlan_num+1):
- logging.info("Test for vlan %s", vlan)
-
- logging.info("Ping between vlans")
- interface = ifname[0] + '.' + str(vlan)
- for vlan2 in range(1, vlan_num+1):
- for i in range(2):
- interface = ifname[i] + '.' + str(vlan)
- dest = subnet +'.'+ str(vlan2)+ '.' + ip_unit[(i+1)%2]
- s, o = virt_test_utils.ping(dest, count=2,
- interface=interface,
- session=session[i], timeout=30)
- if ((vlan == vlan2) ^ (s == 0)):
- raise error.TestFail ("%s ping %s unexpected" %
- (interface, dest))
-
- vlan_ip[0] = subnet + '.' + str(vlan) + '.' + ip_unit[0]
- vlan_ip[1] = subnet + '.' + str(vlan) + '.' + ip_unit[1]
-
- logging.info("Flood ping")
- def flood_ping(src, dst):
- # we must use a dedicated session becuase the aexpect
- # does not have the other method to interrupt the process in
- # the guest rather than close the session.
- session_flood = vm[src].wait_for_login(timeout=60)
- virt_test_utils.ping(vlan_ip[dst], flood=True,
- interface=ifname[src],
- session=session_flood, timeout=10)
- session_flood.close()
-
- flood_ping(0, 1)
- flood_ping(1, 0)
-
- logging.info("Transfering data through nc")
- nc_transfer(0, 1)
- nc_transfer(1, 0)
-
- finally:
- for vlan in range(1, vlan_num+1):
- rem_vlan(session[0], vlan, ifname[0])
- rem_vlan(session[1], vlan, ifname[1])
- logging.info("rem vlan: %s", vlan)
-
- # Plumb/unplumb maximal number of vlan interfaces
- i = 1
- s = 0
- try:
- logging.info("Testing the plumb of vlan interface")
- for i in range (1, maximal+1):
- add_vlan(session[0], i, ifname[0])
- finally:
- for j in range (1, i+1):
- s = s or rem_vlan(session[0], j, ifname[0])
- if s == 0:
- logging.info("maximal interface plumb test done")
- else:
- logging.error("maximal interface plumb test failed")
-
- session[0].close()
- session[1].close()
diff --git a/client/virt/tests/watchdog.py b/client/virt/tests/watchdog.py
deleted file mode 100644
index 446f250..0000000
--- a/client/virt/tests/watchdog.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import logging, time, shutil
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils
-
-
-def run_watchdog(test, params, env):
- """
- Configure watchdog, crash the guest and check if watchdog_action occurs.
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
- relogin_timeout = int(params.get("relogin_timeout", 240))
- watchdog_enable_cmd = "chkconfig watchdog on && service watchdog start"
-
- def watchdog_action_reset():
- """
- Trigger a crash dump through sysrq-trigger
- Ensure watchdog_action(reset) occur.
- """
- session = vm.wait_for_login(timeout=timeout)
-
- logging.info("Triggering crash on vm")
- crash_cmd = "echo c > /proc/sysrq-trigger"
- session.sendline(crash_cmd)
-
- if not virt_utils.wait_for(lambda: not session.is_responsive(),
- 240, 0, 1):
- raise error.TestFail("Could not trigger crash")
-
- logging.info("Waiting for kernel watchdog_action to take place")
- session = vm.wait_for_login(timeout=relogin_timeout)
-
- logging.info("Enabling watchdog service...")
- session.cmd(watchdog_enable_cmd, timeout=320)
- watchdog_action_reset()
-
- # Close stablished session
- session.close()
diff --git a/client/virt/tests/whql_client_install.py b/client/virt/tests/whql_client_install.py
deleted file mode 100644
index 2d72a5e..0000000
--- a/client/virt/tests/whql_client_install.py
+++ /dev/null
@@ -1,136 +0,0 @@
-import logging, time, os
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, virt_test_utils, rss_client
-
-
-def run_whql_client_install(test, params, env):
- """
- WHQL DTM client installation:
- 1) Log into the guest (the client machine) and into a DTM server machine
- 2) Stop the DTM client service (wttsvc) on the client machine
- 3) Delete the client machine from the server's data store
- 4) Rename the client machine (give it a randomly generated name)
- 5) Move the client machine into the server's workgroup
- 6) Reboot the client machine
- 7) Install the DTM client software
- 8) Setup auto logon for the user created by the installation
- (normally DTMLLUAdminUser)
- 9) Reboot again
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360)))
-
- # Collect test params
- server_address = params.get("server_address")
- server_shell_port = int(params.get("server_shell_port"))
- server_file_transfer_port = int(params.get("server_file_transfer_port"))
- server_studio_path = params.get("server_studio_path", "%programfiles%\\ "
- "Microsoft Driver Test Manager\\Studio")
- server_username = params.get("server_username")
- server_password = params.get("server_password")
- client_username = params.get("client_username")
- client_password = params.get("client_password")
- dsso_delete_machine_binary = params.get("dsso_delete_machine_binary",
- "deps/whql_delete_machine_15.exe")
- dsso_delete_machine_binary = virt_utils.get_path(test.bindir,
- dsso_delete_machine_binary)
- install_timeout = float(params.get("install_timeout", 600))
- install_cmd = params.get("install_cmd")
- wtt_services = params.get("wtt_services")
-
- # Stop WTT service(s) on client
- for svc in wtt_services.split():
- virt_test_utils.stop_windows_service(session, svc)
-
- # Copy dsso_delete_machine_binary to server
- rss_client.upload(server_address, server_file_transfer_port,
- dsso_delete_machine_binary, server_studio_path,
- timeout=60)
-
- # Open a shell session with server
- server_session = virt_utils.remote_login("nc", server_address,
- server_shell_port, "", "",
- session.prompt, session.linesep)
- server_session.set_status_test_command(session.status_test_command)
-
- # Get server and client information
- cmd = "echo %computername%"
- server_name = server_session.cmd_output(cmd).strip()
- client_name = session.cmd_output(cmd).strip()
- cmd = "wmic computersystem get domain"
- server_workgroup = server_session.cmd_output(cmd).strip()
- server_workgroup = server_workgroup.splitlines()[-1]
- regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
- cmd = "reg query %s /v Domain" % regkey
- o = server_session.cmd_output(cmd).strip().splitlines()[-1]
- try:
- server_dns_suffix = o.split(None, 2)[2]
- except IndexError:
- server_dns_suffix = ""
-
- # Delete the client machine from the server's data store (if it's there)
- server_session.cmd("cd %s" % server_studio_path)
- cmd = "%s %s %s" % (os.path.basename(dsso_delete_machine_binary),
- server_name, client_name)
- server_session.cmd(cmd, print_func=logging.info)
- server_session.close()
-
- # Rename the client machine
- client_name = "autotest_%s" % virt_utils.generate_random_string(4)
- logging.info("Renaming client machine to '%s'", client_name)
- cmd = ('wmic computersystem where name="%%computername%%" rename name="%s"'
- % client_name)
- session.cmd(cmd, timeout=600)
-
- # Join the server's workgroup
- logging.info("Joining workgroup '%s'", server_workgroup)
- cmd = ('wmic computersystem where name="%%computername%%" call '
- 'joindomainorworkgroup name="%s"' % server_workgroup)
- session.cmd(cmd, timeout=600)
-
- # Set the client machine's DNS suffix
- logging.info("Setting DNS suffix to '%s'", server_dns_suffix)
- cmd = 'reg add %s /v Domain /d "%s" /f' % (regkey, server_dns_suffix)
- session.cmd(cmd, timeout=300)
-
- # Reboot
- session = vm.reboot(session)
-
- # Access shared resources on the server machine
- logging.info("Attempting to access remote share on server")
- cmd = r"net use \\%s /user:%s %s" % (server_name, server_username,
- server_password)
- end_time = time.time() + 120
- while time.time() < end_time:
- try:
- session.cmd(cmd)
- break
- except:
- pass
- time.sleep(5)
- else:
- raise error.TestError("Could not access server share from client "
- "machine")
-
- # Install
- logging.info("Installing DTM client (timeout=%ds)", install_timeout)
- install_cmd = r"cmd /c \\%s\%s" % (server_name, install_cmd.lstrip("\\"))
- session.cmd(install_cmd, timeout=install_timeout)
-
- # Setup auto logon
- logging.info("Setting up auto logon for user '%s'", client_username)
- cmd = ('reg add '
- '"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\winlogon" '
- '/v "%s" /d "%s" /t REG_SZ /f')
- session.cmd(cmd % ("AutoAdminLogon", "1"))
- session.cmd(cmd % ("DefaultUserName", client_username))
- session.cmd(cmd % ("DefaultPassword", client_password))
-
- # Reboot one more time
- session = vm.reboot(session)
- session.close()
diff --git a/client/virt/tests/whql_submission.py b/client/virt/tests/whql_submission.py
deleted file mode 100644
index bbeb836..0000000
--- a/client/virt/tests/whql_submission.py
+++ /dev/null
@@ -1,275 +0,0 @@
-import logging, os, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import virt_utils, rss_client, aexpect
-
-
-def run_whql_submission(test, params, env):
- """
- WHQL submission test:
- 1) Log into the client machines and into a DTM server machine
- 2) Copy the automation program binary (dsso_test_binary) to the server machine
- 3) Run the automation program
- 4) Pass the program all relevant parameters (e.g. device_data)
- 5) Wait for the program to terminate
- 6) Parse and report job results
- (logs and HTML reports are placed in test.debugdir)
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- # Log into all client VMs
- login_timeout = int(params.get("login_timeout", 360))
- vms = []
- sessions = []
- for vm_name in params.objects("vms"):
- vms.append(env.get_vm(vm_name))
- vms[-1].verify_alive()
- sessions.append(vms[-1].wait_for_login(timeout=login_timeout))
-
- # Make sure all NICs of all client VMs are up
- for vm in vms:
- nics = vm.params.objects("nics")
- for nic_index in range(len(nics)):
- s = vm.wait_for_login(nic_index, 600)
- s.close()
-
- # Collect parameters
- server_address = params.get("server_address")
- server_shell_port = int(params.get("server_shell_port"))
- server_file_transfer_port = int(params.get("server_file_transfer_port"))
- server_studio_path = params.get("server_studio_path", "%programfiles%\\ "
- "Microsoft Driver Test Manager\\Studio")
- dsso_test_binary = params.get("dsso_test_binary",
- "deps/whql_submission_15.exe")
- dsso_test_binary = virt_utils.get_path(test.bindir, dsso_test_binary)
- dsso_delete_machine_binary = params.get("dsso_delete_machine_binary",
- "deps/whql_delete_machine_15.exe")
- dsso_delete_machine_binary = virt_utils.get_path(test.bindir,
- dsso_delete_machine_binary)
- test_timeout = float(params.get("test_timeout", 600))
-
- # Copy dsso binaries to the server
- for filename in dsso_test_binary, dsso_delete_machine_binary:
- rss_client.upload(server_address, server_file_transfer_port,
- filename, server_studio_path, timeout=60)
-
- # Open a shell session with the server
- server_session = virt_utils.remote_login("nc", server_address,
- server_shell_port, "", "",
- sessions[0].prompt,
- sessions[0].linesep)
- server_session.set_status_test_command(sessions[0].status_test_command)
-
- # Get the computer names of the server and clients
- cmd = "echo %computername%"
- server_name = server_session.cmd_output(cmd).strip()
- client_names = [session.cmd_output(cmd).strip() for session in sessions]
-
- # Delete all client machines from the server's data store
- server_session.cmd("cd %s" % server_studio_path)
- for client_name in client_names:
- cmd = "%s %s %s" % (os.path.basename(dsso_delete_machine_binary),
- server_name, client_name)
- server_session.cmd(cmd, print_func=logging.debug)
-
- # Reboot the client machines
- sessions = virt_utils.parallel((vm.reboot, (session,))
- for vm, session in zip(vms, sessions))
-
- # Check the NICs again
- for vm in vms:
- nics = vm.params.objects("nics")
- for nic_index in range(len(nics)):
- s = vm.wait_for_login(nic_index, 600)
- s.close()
-
- # Run whql_pre_command and close the sessions
- if params.get("whql_pre_command"):
- for session in sessions:
- session.cmd(params.get("whql_pre_command"),
- int(params.get("whql_pre_command_timeout", 600)))
- session.close()
-
- # Run the automation program on the server
- pool_name = "%s_pool" % client_names[0]
- submission_name = "%s_%s" % (client_names[0],
- params.get("submission_name"))
- cmd = "%s %s %s %s %s %s" % (os.path.basename(dsso_test_binary),
- server_name, pool_name, submission_name,
- test_timeout, " ".join(client_names))
- server_session.sendline(cmd)
-
- # Helper function: wait for a given prompt and raise an exception if an
- # error occurs
- def find_prompt(prompt):
- m, o = server_session.read_until_last_line_matches(
- [prompt, server_session.prompt], print_func=logging.info,
- timeout=600)
- if m != 0:
- errors = re.findall("^Error:.*$", o, re.I | re.M)
- if errors:
- raise error.TestError(errors[0])
- else:
- raise error.TestError("Error running automation program: "
- "could not find '%s' prompt" % prompt)
-
- # Tell the automation program which device to test
- find_prompt("Device to test:")
- server_session.sendline(params.get("test_device"))
-
- # Tell the automation program which jobs to run
- find_prompt("Jobs to run:")
- server_session.sendline(params.get("job_filter", ".*"))
-
- # Set submission DeviceData
- find_prompt("DeviceData name:")
- for dd in params.objects("device_data"):
- dd_params = params.object_params(dd)
- if dd_params.get("dd_name") and dd_params.get("dd_data"):
- server_session.sendline(dd_params.get("dd_name"))
- server_session.sendline(dd_params.get("dd_data"))
- server_session.sendline()
-
- # Set submission descriptors
- find_prompt("Descriptor path:")
- for desc in params.objects("descriptors"):
- desc_params = params.object_params(desc)
- if desc_params.get("desc_path"):
- server_session.sendline(desc_params.get("desc_path"))
- server_session.sendline()
-
- # Set machine dimensions for each client machine
- for vm_name in params.objects("vms"):
- vm_params = params.object_params(vm_name)
- find_prompt(r"Dimension name\b.*:")
- for dp in vm_params.objects("dimensions"):
- dp_params = vm_params.object_params(dp)
- if dp_params.get("dim_name") and dp_params.get("dim_value"):
- server_session.sendline(dp_params.get("dim_name"))
- server_session.sendline(dp_params.get("dim_value"))
- server_session.sendline()
-
- # Set extra parameters for tests that require them (e.g. NDISTest)
- for vm_name in params.objects("vms"):
- vm_params = params.object_params(vm_name)
- find_prompt(r"Parameter name\b.*:")
- for dp in vm_params.objects("device_params"):
- dp_params = vm_params.object_params(dp)
- if dp_params.get("dp_name") and dp_params.get("dp_regex"):
- server_session.sendline(dp_params.get("dp_name"))
- server_session.sendline(dp_params.get("dp_regex"))
- # Make sure the prompt appears again (if the device isn't found
- # the automation program will terminate)
- find_prompt(r"Parameter name\b.*:")
- server_session.sendline()
-
- # Wait for the automation program to terminate
- try:
- o = server_session.read_up_to_prompt(print_func=logging.info,
- timeout=test_timeout + 300)
- # (test_timeout + 300 is used here because the automation program is
- # supposed to terminate cleanly on its own when test_timeout expires)
- done = True
- except aexpect.ExpectError, e:
- o = e.output
- done = False
- server_session.close()
-
- # Look for test results in the automation program's output
- result_summaries = re.findall(r"---- \[.*?\] ----", o, re.DOTALL)
- if not result_summaries:
- raise error.TestError("The automation program did not return any "
- "results")
- results = result_summaries[-1].strip("-")
- results = eval("".join(results.splitlines()))
-
- # Download logs and HTML reports from the server
- for i, r in enumerate(results):
- if "report" in r:
- try:
- rss_client.download(server_address,
- server_file_transfer_port,
- r["report"], test.debugdir)
- except rss_client.FileTransferNotFoundError:
- pass
- if "logs" in r:
- try:
- rss_client.download(server_address,
- server_file_transfer_port,
- r["logs"], test.debugdir)
- except rss_client.FileTransferNotFoundError:
- pass
- else:
- try:
- # Create symlinks to test log dirs to make it easier
- # to access them (their original names are not human
- # readable)
- link_name = "logs_%s" % r["report"].split("\\")[-1]
- link_name = link_name.replace(" ", "_")
- link_name = link_name.replace("/", "_")
- os.symlink(r["logs"].split("\\")[-1],
- os.path.join(test.debugdir, link_name))
- except (KeyError, OSError):
- pass
-
- # Print result summary (both to the regular logs and to a file named
- # 'summary' in test.debugdir)
- def print_summary_line(f, line):
- logging.info(line)
- f.write(line + "\n")
- if results:
- # Make sure all results have the required keys
- for r in results:
- r["id"] = str(r.get("id"))
- r["job"] = str(r.get("job"))
- r["status"] = str(r.get("status"))
- r["pass"] = int(r.get("pass", 0))
- r["fail"] = int(r.get("fail", 0))
- r["notrun"] = int(r.get("notrun", 0))
- r["notapplicable"] = int(r.get("notapplicable", 0))
- # Sort the results by failures and total test count in descending order
- results = [(r["fail"],
- r["pass"] + r["fail"] + r["notrun"] + r["notapplicable"],
- r) for r in results]
- results.sort(reverse=True)
- results = [r[-1] for r in results]
- # Print results
- logging.info("")
- logging.info("Result summary:")
- name_length = max(len(r["job"]) for r in results)
- fmt = "%%-6s %%-%ds %%-15s %%-8s %%-8s %%-8s %%-15s" % name_length
- f = open(os.path.join(test.debugdir, "summary"), "w")
- print_summary_line(f, fmt % ("ID", "Job", "Status", "Pass", "Fail",
- "NotRun", "NotApplicable"))
- print_summary_line(f, fmt % ("--", "---", "------", "----", "----",
- "------", "-------------"))
- for r in results:
- print_summary_line(f, fmt % (r["id"], r["job"], r["status"],
- r["pass"], r["fail"], r["notrun"],
- r["notapplicable"]))
- f.close()
- logging.info("(see logs and HTML reports in %s)", test.debugdir)
-
- # Kill the client VMs and fail if the automation program did not terminate
- # on time
- if not done:
- virt_utils.parallel(vm.destroy for vm in vms)
- raise error.TestFail("The automation program did not terminate "
- "on time")
-
- # Fail if there are failed or incomplete jobs (kill the client VMs if there
- # are incomplete jobs)
- failed_jobs = [r["job"] for r in results
- if r["status"].lower() == "investigate"]
- running_jobs = [r["job"] for r in results
- if r["status"].lower() == "inprogress"]
- errors = []
- if failed_jobs:
- errors += ["Jobs failed: %s." % failed_jobs]
- if running_jobs:
- for vm in vms:
- vm.destroy()
- errors += ["Jobs did not complete on time: %s." % running_jobs]
- if errors:
- raise error.TestFail(" ".join(errors))
diff --git a/client/virt/tests/yum_update.py b/client/virt/tests/yum_update.py
deleted file mode 100644
index 7c9b96c..0000000
--- a/client/virt/tests/yum_update.py
+++ /dev/null
@@ -1,49 +0,0 @@
-import logging, time
-
-
-def internal_yum_update(session, command, prompt, timeout):
- """
- Helper function to perform the yum update test.
-
- @param session: shell session stablished to the host
- @param command: Command to be sent to the shell session
- @param prompt: Machine prompt
- @param timeout: How long to wait until we get an appropriate output from
- the shell session.
- """
- session.sendline(command)
- end_time = time.time() + timeout
- while time.time() < end_time:
- match = session.read_until_last_line_matches(
- ["[Ii]s this [Oo][Kk]", prompt],
- timeout=timeout)[0]
- if match == 0:
- logging.info("Got 'Is this ok'; sending 'y'")
- session.sendline("y")
- elif match == 1:
- logging.info("Got shell prompt")
- return True
- else:
- logging.info("Timeout or process exited")
- return False
-
-
-def run_yum_update(test, params, env):
- """
- Runs yum update and yum update kernel on the remote host (yum enabled
- hosts only).
-
- @param test: kvm test object.
- @param params: Dictionary with test parameters.
- @param env: Dictionary with the test environment.
- """
- vm = env.get_vm(params["main_vm"])
- vm.verify_alive()
- timeout = int(params.get("login_timeout", 360))
- session = vm.wait_for_login(timeout=timeout)
-
- internal_yum_update(session, "yum update", params.get("shell_prompt"), 600)
- internal_yum_update(session, "yum update kernel",
- params.get("shell_prompt"), 600)
-
- session.close()
diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py
deleted file mode 100644
index e9e7f52..0000000
--- a/client/virt/virt_env_process.py
+++ /dev/null
@@ -1,464 +0,0 @@
-import os, time, commands, re, logging, glob, threading, shutil
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-import aexpect, virt_utils, kvm_monitor, ppm_utils, virt_test_setup
-import virt_vm, kvm_vm
-try:
- import PIL.Image
-except ImportError:
- logging.warning('No python imaging library installed. PPM image '
- 'conversion to JPEG disabled. In order to enable it, '
- 'please install python-imaging or the equivalent for your '
- 'distro.')
-
-
-_screendump_thread = None
-_screendump_thread_termination_event = None
-
-
-def preprocess_image(test, params):
- """
- Preprocess a single QEMU image according to the instructions in params.
-
- @param test: Autotest test object.
- @param params: A dict containing image preprocessing parameters.
- @note: Currently this function just creates an image if requested.
- """
- image_filename = virt_vm.get_image_filename(params, test.bindir)
-
- create_image = False
-
- if params.get("force_create_image") == "yes":
- logging.debug("Param 'force_create_image' specified, creating image")
- create_image = True
- elif (params.get("create_image") == "yes" and not
- os.path.exists(image_filename)):
- create_image = True
-
- if create_image and not virt_vm.create_image(params, test.bindir):
- raise error.TestError("Could not create image")
-
-
-def preprocess_vm(test, params, env, name):
- """
- Preprocess a single VM object according to the instructions in params.
- Start the VM if requested and get a screendump.
-
- @param test: An Autotest test object.
- @param params: A dict containing VM preprocessing parameters.
- @param env: The environment (a dict-like object).
- @param name: The name of the VM object.
- """
- logging.debug("Preprocessing VM '%s'", name)
- vm = env.get_vm(name)
- if not vm:
- logging.debug("VM object for '%s' does not exist, creating it", name)
- vm_type = params.get('vm_type')
- if vm_type == 'kvm':
- vm = kvm_vm.VM(name, params, test.bindir, env.get("address_cache"))
- env.register_vm(name, vm)
-
- start_vm = False
-
- if params.get("restart_vm") == "yes":
- logging.debug("Param 'restart_vm' specified, (re)starting VM")
- start_vm = True
- elif params.get("migration_mode"):
- logging.debug("Param 'migration_mode' specified, starting VM in "
- "incoming migration mode")
- start_vm = True
- elif params.get("start_vm") == "yes":
- if not vm.is_alive():
- logging.debug("VM is not alive, starting it")
- start_vm = True
- if vm.needs_restart(name=name, params=params, basedir=test.bindir):
- logging.debug("Current VM specs differ from requested one; "
- "restarting it")
- start_vm = True
-
- if start_vm:
- # Start the VM (or restart it if it's already up)
- vm.create(name, params, test.bindir,
- migration_mode=params.get("migration_mode"))
- else:
- # Don't start the VM, just update its params
- vm.params = params
-
- scrdump_filename = os.path.join(test.debugdir, "pre_%s.ppm" % name)
- try:
- if vm.monitor and params.get("take_regular_screendumps") == "yes":
- vm.monitor.screendump(scrdump_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
-
-
-def postprocess_image(test, params):
- """
- Postprocess a single QEMU image according to the instructions in params.
-
- @param test: An Autotest test object.
- @param params: A dict containing image postprocessing parameters.
- """
- if params.get("check_image") == "yes":
- virt_vm.check_image(params, test.bindir)
- if params.get("remove_image") == "yes":
- virt_vm.remove_image(params, test.bindir)
-
-
-def postprocess_vm(test, params, env, name):
- """
- Postprocess a single VM object according to the instructions in params.
- Kill the VM if requested and get a screendump.
-
- @param test: An Autotest test object.
- @param params: A dict containing VM postprocessing parameters.
- @param env: The environment (a dict-like object).
- @param name: The name of the VM object.
- """
- logging.debug("Postprocessing VM '%s'" % name)
- vm = env.get_vm(name)
- if not vm:
- return
-
- scrdump_filename = os.path.join(test.debugdir, "post_%s.ppm" % name)
- try:
- if vm.monitor and params.get("take_regular_screenshots") == "yes":
- vm.monitor.screendump(scrdump_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
-
- if params.get("kill_vm") == "yes":
- kill_vm_timeout = float(params.get("kill_vm_timeout", 0))
- if kill_vm_timeout:
- logging.debug("Param 'kill_vm' specified, waiting for VM to shut "
- "down before killing it")
- virt_utils.wait_for(vm.is_dead, kill_vm_timeout, 0, 1)
- else:
- logging.debug("Param 'kill_vm' specified, killing VM")
- vm.destroy(gracefully = params.get("kill_vm_gracefully") == "yes")
-
-
-def process_command(test, params, env, command, command_timeout,
- command_noncritical):
- """
- Pre- or post- custom commands to be executed before/after a test is run
-
- @param test: An Autotest test object.
- @param params: A dict containing all VM and image parameters.
- @param env: The environment (a dict-like object).
- @param command: Command to be run.
- @param command_timeout: Timeout for command execution.
- @param command_noncritical: If True test will not fail if command fails.
- """
- # Export environment vars
- for k in params:
- os.putenv("KVM_TEST_%s" % k, str(params[k]))
- # Execute commands
- try:
- utils.system("cd %s; %s" % (test.bindir, command))
- except error.CmdError, e:
- if command_noncritical:
- logging.warning(e)
- else:
- raise
-
-
-def process(test, params, env, image_func, vm_func, vm_first=False):
- """
- Pre- or post-process VMs and images according to the instructions in params.
- Call image_func for each image listed in params and vm_func for each VM.
-
- @param test: An Autotest test object.
- @param params: A dict containing all VM and image parameters.
- @param env: The environment (a dict-like object).
- @param image_func: A function to call for each image.
- @param vm_func: A function to call for each VM.
- """
- # Get list of VMs specified for this test
- for vm_name in params.objects("vms"):
- vm_params = params.object_params(vm_name)
- if not vm_first:
- # Get list of images specified for this VM
- for image_name in vm_params.objects("images"):
- image_params = vm_params.object_params(image_name)
- # Call image_func for each image
- image_func(test, image_params)
- # Call vm_func for each vm
- vm_func(test, vm_params, env, vm_name)
- else:
- vm_func(test, vm_params, env, vm_name)
- for image_name in vm_params.objects("images"):
- image_params = vm_params.object_params(image_name)
- image_func(test, image_params)
-
-
-
[email protected]_aware
-def preprocess(test, params, env):
- """
- Preprocess all VMs and images according to the instructions in params.
- Also, collect some host information, such as the KVM version.
-
- @param test: An Autotest test object.
- @param params: A dict containing all VM and image parameters.
- @param env: The environment (a dict-like object).
- """
- error.context("preprocessing")
-
- # Start tcpdump if it isn't already running
- if "address_cache" not in env:
- env["address_cache"] = {}
- if "tcpdump" in env and not env["tcpdump"].is_alive():
- env["tcpdump"].close()
- del env["tcpdump"]
- if "tcpdump" not in env and params.get("run_tcpdump", "yes") == "yes":
- cmd = "%s -npvi any 'dst port 68'" % virt_utils.find_command("tcpdump")
- logging.debug("Starting tcpdump '%s'", cmd)
- env["tcpdump"] = aexpect.Tail(
- command=cmd,
- output_func=_update_address_cache,
- output_params=(env["address_cache"],))
- if virt_utils.wait_for(lambda: not env["tcpdump"].is_alive(),
- 0.1, 0.1, 1.0):
- logging.warning("Could not start tcpdump")
- logging.warning("Status: %s" % env["tcpdump"].get_status())
- logging.warning("Output:" + virt_utils.format_str_for_message(
- env["tcpdump"].get_output()))
-
- # Destroy and remove VMs that are no longer needed in the environment
- requested_vms = params.objects("vms")
- for key in env.keys():
- vm = env[key]
- if not virt_utils.is_vm(vm):
- continue
- if not vm.name in requested_vms:
- logging.debug("VM '%s' found in environment but not required for "
- "test, destroying it" % vm.name)
- vm.destroy()
- del env[key]
-
- # Get the KVM kernel module version and write it as a keyval
- if os.path.exists("/dev/kvm"):
- try:
- kvm_version = open("/sys/module/kvm/version").read().strip()
- except:
- kvm_version = os.uname()[2]
- else:
- kvm_version = "Unknown"
- logging.debug("KVM module not loaded")
- logging.debug("KVM version: %s" % kvm_version)
- test.write_test_keyval({"kvm_version": kvm_version})
-
- # Get the KVM userspace version and write it as a keyval
- qemu_path = virt_utils.get_path(test.bindir, params.get("qemu_binary",
- "qemu"))
- version_line = commands.getoutput("%s -help | head -n 1" % qemu_path)
- matches = re.findall("[Vv]ersion .*?,", version_line)
- if matches:
- kvm_userspace_version = " ".join(matches[0].split()[1:]).strip(",")
- else:
- kvm_userspace_version = "Unknown"
- logging.debug("KVM userspace version: %s" % kvm_userspace_version)
- test.write_test_keyval({"kvm_userspace_version": kvm_userspace_version})
-
- if params.get("setup_hugepages") == "yes":
- h = virt_test_setup.HugePageConfig(params)
- h.setup()
-
- # Execute any pre_commands
- if params.get("pre_command"):
- process_command(test, params, env, params.get("pre_command"),
- int(params.get("pre_command_timeout", "600")),
- params.get("pre_command_noncritical") == "yes")
-
- # Preprocess all VMs and images
- process(test, params, env, preprocess_image, preprocess_vm)
-
- # Start the screendump thread
- if params.get("take_regular_screendumps") == "yes":
- logging.debug("Starting screendump thread")
- global _screendump_thread, _screendump_thread_termination_event
- _screendump_thread_termination_event = threading.Event()
- _screendump_thread = threading.Thread(target=_take_screendumps,
- args=(test, params, env))
- _screendump_thread.start()
-
-
[email protected]_aware
-def postprocess(test, params, env):
- """
- Postprocess all VMs and images according to the instructions in params.
-
- @param test: An Autotest test object.
- @param params: Dict containing all VM and image parameters.
- @param env: The environment (a dict-like object).
- """
- error.context("postprocessing")
-
- # Postprocess all VMs and images
- process(test, params, env, postprocess_image, postprocess_vm, vm_first=True)
-
- # Terminate the screendump thread
- global _screendump_thread, _screendump_thread_termination_event
- if _screendump_thread:
- logging.debug("Terminating screendump thread")
- _screendump_thread_termination_event.set()
- _screendump_thread.join(10)
- _screendump_thread = None
-
- # Warn about corrupt PPM files
- for f in glob.glob(os.path.join(test.debugdir, "*.ppm")):
- if not ppm_utils.image_verify_ppm_file(f):
- logging.warning("Found corrupt PPM file: %s", f)
-
- # Should we convert PPM files to PNG format?
- if params.get("convert_ppm_files_to_png") == "yes":
- logging.debug("Param 'convert_ppm_files_to_png' specified, converting "
- "PPM files to PNG format")
- try:
- for f in glob.glob(os.path.join(test.debugdir, "*.ppm")):
- if ppm_utils.image_verify_ppm_file(f):
- new_path = f.replace(".ppm", ".png")
- image = PIL.Image.open(f)
- image.save(new_path, format='PNG')
- except NameError:
- pass
-
- # Should we keep the PPM files?
- if params.get("keep_ppm_files") != "yes":
- logging.debug("Param 'keep_ppm_files' not specified, removing all PPM "
- "files from debug dir")
- for f in glob.glob(os.path.join(test.debugdir, '*.ppm')):
- os.unlink(f)
-
- # Should we keep the screendump dirs?
- if params.get("keep_screendumps") != "yes":
- logging.debug("Param 'keep_screendumps' not specified, removing "
- "screendump dirs")
- for d in glob.glob(os.path.join(test.debugdir, "screendumps_*")):
- if os.path.isdir(d) and not os.path.islink(d):
- shutil.rmtree(d, ignore_errors=True)
-
- # Kill all unresponsive VMs
- if params.get("kill_unresponsive_vms") == "yes":
- logging.debug("Param 'kill_unresponsive_vms' specified, killing all "
- "VMs that fail to respond to a remote login request")
- for vm in env.get_all_vms():
- if vm.is_alive():
- try:
- session = vm.login()
- session.close()
- except (virt_utils.LoginError, virt_vm.VMError), e:
- logging.warning(e)
- vm.destroy(gracefully=False)
-
- # Kill all aexpect tail threads
- aexpect.kill_tail_threads()
-
- # Terminate tcpdump if no VMs are alive
- living_vms = [vm for vm in env.get_all_vms() if vm.is_alive()]
- if not living_vms and "tcpdump" in env:
- env["tcpdump"].close()
- del env["tcpdump"]
-
- if params.get("setup_hugepages") == "yes":
- h = virt_test_setup.HugePageConfig(params)
- h.cleanup()
-
- # Execute any post_commands
- if params.get("post_command"):
- process_command(test, params, env, params.get("post_command"),
- int(params.get("post_command_timeout", "600")),
- params.get("post_command_noncritical") == "yes")
-
-
-def postprocess_on_error(test, params, env):
- """
- Perform postprocessing operations required only if the test failed.
-
- @param test: An Autotest test object.
- @param params: A dict containing all VM and image parameters.
- @param env: The environment (a dict-like object).
- """
- params.update(params.object_params("on_error"))
-
-
-def _update_address_cache(address_cache, line):
- if re.search("Your.IP", line, re.IGNORECASE):
- matches = re.findall(r"\d*\.\d*\.\d*\.\d*", line)
- if matches:
- address_cache["last_seen"] = matches[0]
- if re.search("Client.Ethernet.Address", line, re.IGNORECASE):
- matches = re.findall(r"\w*:\w*:\w*:\w*:\w*:\w*", line)
- if matches and address_cache.get("last_seen"):
- mac_address = matches[0].lower()
- if time.time() - address_cache.get("time_%s" % mac_address, 0) > 5:
- logging.debug("(address cache) Adding cache entry: %s ---> %s",
- mac_address, address_cache.get("last_seen"))
- address_cache[mac_address] = address_cache.get("last_seen")
- address_cache["time_%s" % mac_address] = time.time()
- del address_cache["last_seen"]
-
-
-def _take_screendumps(test, params, env):
- global _screendump_thread_termination_event
- temp_dir = test.debugdir
- if params.get("screendump_temp_dir"):
- temp_dir = virt_utils.get_path(test.bindir,
- params.get("screendump_temp_dir"))
- try:
- os.makedirs(temp_dir)
- except OSError:
- pass
- temp_filename = os.path.join(temp_dir, "scrdump-%s.ppm" %
- virt_utils.generate_random_string(6))
- delay = float(params.get("screendump_delay", 5))
- quality = int(params.get("screendump_quality", 30))
-
- cache = {}
-
- while True:
- for vm in env.get_all_vms():
- if not vm.is_alive():
- continue
- try:
- vm.monitor.screendump(filename=temp_filename, debug=False)
- except kvm_monitor.MonitorError, e:
- logging.warning(e)
- continue
- except AttributeError, e:
- continue
- if not os.path.exists(temp_filename):
- logging.warning("VM '%s' failed to produce a screendump", vm.name)
- continue
- if not ppm_utils.image_verify_ppm_file(temp_filename):
- logging.warning("VM '%s' produced an invalid screendump", vm.name)
- os.unlink(temp_filename)
- continue
- screendump_dir = os.path.join(test.debugdir,
- "screendumps_%s" % vm.name)
- try:
- os.makedirs(screendump_dir)
- except OSError:
- pass
- screendump_filename = os.path.join(screendump_dir,
- "%s_%s.jpg" % (vm.name,
- time.strftime("%Y-%m-%d_%H-%M-%S")))
- hash = utils.hash_file(temp_filename)
- if hash in cache:
- try:
- os.link(cache[hash], screendump_filename)
- except OSError:
- pass
- else:
- try:
- image = PIL.Image.open(temp_filename)
- image.save(screendump_filename, format="JPEG", quality=quality)
- cache[hash] = screendump_filename
- except NameError:
- pass
- os.unlink(temp_filename)
- if _screendump_thread_termination_event.isSet():
- _screendump_thread_termination_event = None
- break
- _screendump_thread_termination_event.wait(delay)
diff --git a/client/virt/virt_installer.py b/client/virt/virt_installer.py
deleted file mode 100644
index 49d277e..0000000
--- a/client/virt/virt_installer.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import os, shutil, logging
-from autotest_lib.client.bin import utils
-
-
-def check_configure_options(script_path):
- """
- Return the list of available options (flags) of a GNU autoconf like
- configure build script.
-
- @param script: Path to the configure script
- """
- abspath = os.path.abspath(script_path)
- help_raw = utils.system_output('%s --help' % abspath, ignore_status=True)
- help_output = help_raw.split("\n")
- option_list = []
- for line in help_output:
- cleaned_line = line.lstrip()
- if cleaned_line.startswith("--"):
- option = cleaned_line.split()[0]
- option = option.split("=")[0]
- option_list.append(option)
-
- return option_list
diff --git a/client/virt/virt_scheduler.py b/client/virt/virt_scheduler.py
deleted file mode 100644
index 8353e5f..0000000
--- a/client/virt/virt_scheduler.py
+++ /dev/null
@@ -1,229 +0,0 @@
-import os, select
-import virt_utils, virt_vm, aexpect
-
-
-class scheduler:
- """
- A scheduler that manages several parallel test execution pipelines on a
- single host.
- """
-
- def __init__(self, tests, num_workers, total_cpus, total_mem, bindir):
- """
- Initialize the class.
-
- @param tests: A list of test dictionaries.
- @param num_workers: The number of workers (pipelines).
- @param total_cpus: The total number of CPUs to dedicate to tests.
- @param total_mem: The total amount of memory to dedicate to tests.
- @param bindir: The directory where environment files reside.
- """
- self.tests = tests
- self.num_workers = num_workers
- self.total_cpus = total_cpus
- self.total_mem = total_mem
- self.bindir = bindir
- # Pipes -- s stands for scheduler, w stands for worker
- self.s2w = [os.pipe() for i in range(num_workers)]
- self.w2s = [os.pipe() for i in range(num_workers)]
- self.s2w_r = [os.fdopen(r, "r", 0) for r, w in self.s2w]
- self.s2w_w = [os.fdopen(w, "w", 0) for r, w in self.s2w]
- self.w2s_r = [os.fdopen(r, "r", 0) for r, w in self.w2s]
- self.w2s_w = [os.fdopen(w, "w", 0) for r, w in self.w2s]
- # "Personal" worker dicts contain modifications that are applied
- # specifically to each worker. For example, each worker must use a
- # different environment file and a different MAC address pool.
- self.worker_dicts = [{"env": "env%d" % i} for i in range(num_workers)]
-
-
- def worker(self, index, run_test_func):
- """
- The worker function.
-
- Waits for commands from the scheduler and processes them.
-
- @param index: The index of this worker (in the range 0..num_workers-1).
- @param run_test_func: A function to be called to run a test
- (e.g. job.run_test).
- """
- r = self.s2w_r[index]
- w = self.w2s_w[index]
- self_dict = self.worker_dicts[index]
-
- # Inform the scheduler this worker is ready
- w.write("ready\n")
-
- while True:
- cmd = r.readline().split()
- if not cmd:
- continue
-
- # The scheduler wants this worker to run a test
- if cmd[0] == "run":
- test_index = int(cmd[1])
- test = self.tests[test_index].copy()
- test.update(self_dict)
- test_iterations = int(test.get("iterations", 1))
- status = run_test_func("kvm", params=test,
- tag=test.get("shortname"),
- iterations=test_iterations)
- w.write("done %s %s\n" % (test_index, status))
- w.write("ready\n")
-
- # The scheduler wants this worker to free its used resources
- elif cmd[0] == "cleanup":
- env_filename = os.path.join(self.bindir, self_dict["env"])
- env = virt_utils.Env(env_filename)
- for obj in env.values():
- if isinstance(obj, virt_vm.VM):
- obj.destroy()
- elif isinstance(obj, aexpect.Spawn):
- obj.close()
- env.save()
- w.write("cleanup_done\n")
- w.write("ready\n")
-
- # There's no more work for this worker
- elif cmd[0] == "terminate":
- break
-
-
- def scheduler(self):
- """
- The scheduler function.
-
- Sends commands to workers, telling them to run tests, clean up or
- terminate execution.
- """
- idle_workers = []
- closing_workers = []
- test_status = ["waiting"] * len(self.tests)
- test_worker = [None] * len(self.tests)
- used_cpus = [0] * self.num_workers
- used_mem = [0] * self.num_workers
-
- while True:
- # Wait for a message from a worker
- r, w, x = select.select(self.w2s_r, [], [])
-
- someone_is_ready = False
-
- for pipe in r:
- worker_index = self.w2s_r.index(pipe)
- msg = pipe.readline().split()
- if not msg:
- continue
-
- # A worker is ready -- add it to the idle_workers list
- if msg[0] == "ready":
- idle_workers.append(worker_index)
- someone_is_ready = True
-
- # A worker completed a test
- elif msg[0] == "done":
- test_index = int(msg[1])
- test = self.tests[test_index]
- status = int(eval(msg[2]))
- test_status[test_index] = ("fail", "pass")[status]
- # If the test failed, mark all dependent tests as "failed" too
- if not status:
- for i, other_test in enumerate(self.tests):
- for dep in other_test.get("dep", []):
- if dep in test["name"]:
- test_status[i] = "fail"
-
- # A worker is done shutting down its VMs and other processes
- elif msg[0] == "cleanup_done":
- used_cpus[worker_index] = 0
- used_mem[worker_index] = 0
- closing_workers.remove(worker_index)
-
- if not someone_is_ready:
- continue
-
- for worker in idle_workers[:]:
- # Find a test for this worker
- test_found = False
- for i, test in enumerate(self.tests):
- # We only want "waiting" tests
- if test_status[i] != "waiting":
- continue
- # Make sure the test isn't assigned to another worker
- if test_worker[i] is not None and test_worker[i] != worker:
- continue
- # Make sure the test's dependencies are satisfied
- dependencies_satisfied = True
- for dep in test["dep"]:
- dependencies = [j for j, t in enumerate(self.tests)
- if dep in t["name"]]
- bad_status_deps = [j for j in dependencies
- if test_status[j] != "pass"]
- if bad_status_deps:
- dependencies_satisfied = False
- break
- if not dependencies_satisfied:
- continue
- # Make sure we have enough resources to run the test
- test_used_cpus = int(test.get("used_cpus", 1))
- test_used_mem = int(test.get("used_mem", 128))
- # First make sure the other workers aren't using too many
- # CPUs (not including the workers currently shutting down)
- uc = (sum(used_cpus) - used_cpus[worker] -
- sum(used_cpus[i] for i in closing_workers))
- if uc and uc + test_used_cpus > self.total_cpus:
- continue
- # ... or too much memory
- um = (sum(used_mem) - used_mem[worker] -
- sum(used_mem[i] for i in closing_workers))
- if um and um + test_used_mem > self.total_mem:
- continue
- # If we reached this point it means there are, or will
- # soon be, enough resources to run the test
- test_found = True
- # Now check if the test can be run right now, i.e. if the
- # other workers, including the ones currently shutting
- # down, aren't using too many CPUs
- uc = (sum(used_cpus) - used_cpus[worker])
- if uc and uc + test_used_cpus > self.total_cpus:
- continue
- # ... or too much memory
- um = (sum(used_mem) - used_mem[worker])
- if um and um + test_used_mem > self.total_mem:
- continue
- # Everything is OK -- run the test
- test_status[i] = "running"
- test_worker[i] = worker
- idle_workers.remove(worker)
- # Update used_cpus and used_mem
- used_cpus[worker] = test_used_cpus
- used_mem[worker] = test_used_mem
- # Assign all related tests to this worker
- for j, other_test in enumerate(self.tests):
- for other_dep in other_test["dep"]:
- # All tests that depend on this test
- if other_dep in test["name"]:
- test_worker[j] = worker
- break
- # ... and all tests that share a dependency
- # with this test
- for dep in test["dep"]:
- if dep in other_dep or other_dep in dep:
- test_worker[j] = worker
- break
- # Tell the worker to run the test
- self.s2w_w[worker].write("run %s\n" % i)
- break
-
- # If there won't be any tests for this worker to run soon, tell
- # the worker to free its used resources
- if not test_found and (used_cpus[worker] or used_mem[worker]):
- self.s2w_w[worker].write("cleanup\n")
- idle_workers.remove(worker)
- closing_workers.append(worker)
-
- # If there are no more new tests to run, terminate the workers and
- # the scheduler
- if len(idle_workers) == self.num_workers:
- for worker in idle_workers:
- self.s2w_w[worker].write("terminate\n")
- break
diff --git a/client/virt/virt_step_editor.py b/client/virt/virt_step_editor.py
deleted file mode 100755
index bcdf572..0000000
--- a/client/virt/virt_step_editor.py
+++ /dev/null
@@ -1,1401 +0,0 @@
-#!/usr/bin/python
-"""
-Step file creator/editor.
-
-@copyright: Red Hat Inc 2009
-@author: [email protected] (Michael Goldish)
-@version: "20090401"
-"""
-
-import pygtk, gtk, os, glob, shutil, sys, logging
-import common, ppm_utils
-pygtk.require('2.0')
-
-
-# General utilities
-
-def corner_and_size_clipped(startpoint, endpoint, limits):
- c0 = startpoint[:]
- c1 = endpoint[:]
- if c0[0] < 0:
- c0[0] = 0
- if c0[1] < 0:
- c0[1] = 0
- if c1[0] < 0:
- c1[0] = 0
- if c1[1] < 0:
- c1[1] = 0
- if c0[0] > limits[0] - 1:
- c0[0] = limits[0] - 1
- if c0[1] > limits[1] - 1:
- c0[1] = limits[1] - 1
- if c1[0] > limits[0] - 1:
- c1[0] = limits[0] - 1
- if c1[1] > limits[1] - 1:
- c1[1] = limits[1] - 1
- return ([min(c0[0], c1[0]),
- min(c0[1], c1[1])],
- [abs(c1[0] - c0[0]) + 1,
- abs(c1[1] - c0[1]) + 1])
-
-
-def key_event_to_qemu_string(event):
- keymap = gtk.gdk.keymap_get_default()
- keyvals = keymap.get_entries_for_keycode(event.hardware_keycode)
- keyval = keyvals[0][0]
- keyname = gtk.gdk.keyval_name(keyval)
-
- dict = { "Return": "ret",
- "Tab": "tab",
- "space": "spc",
- "Left": "left",
- "Right": "right",
- "Up": "up",
- "Down": "down",
- "F1": "f1",
- "F2": "f2",
- "F3": "f3",
- "F4": "f4",
- "F5": "f5",
- "F6": "f6",
- "F7": "f7",
- "F8": "f8",
- "F9": "f9",
- "F10": "f10",
- "F11": "f11",
- "F12": "f12",
- "Escape": "esc",
- "minus": "minus",
- "equal": "equal",
- "BackSpace": "backspace",
- "comma": "comma",
- "period": "dot",
- "slash": "slash",
- "Insert": "insert",
- "Delete": "delete",
- "Home": "home",
- "End": "end",
- "Page_Up": "pgup",
- "Page_Down": "pgdn",
- "Menu": "menu",
- "semicolon": "0x27",
- "backslash": "0x2b",
- "apostrophe": "0x28",
- "grave": "0x29",
- "less": "0x2b",
- "bracketleft": "0x1a",
- "bracketright": "0x1b",
- "Super_L": "0xdc",
- "Super_R": "0xdb",
- }
-
- if ord('a') <= keyval <= ord('z') or ord('0') <= keyval <= ord('9'):
- str = keyname
- elif keyname in dict.keys():
- str = dict[keyname]
- else:
- return ""
-
- if event.state & gtk.gdk.CONTROL_MASK:
- str = "ctrl-" + str
- if event.state & gtk.gdk.MOD1_MASK:
- str = "alt-" + str
- if event.state & gtk.gdk.SHIFT_MASK:
- str = "shift-" + str
-
- return str
-
-
-class StepMakerWindow:
-
- # Constructor
-
- def __init__(self):
- # Window
- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
- self.window.set_title("Step Maker Window")
- self.window.connect("delete-event", self.delete_event)
- self.window.connect("destroy", self.destroy)
- self.window.set_default_size(600, 800)
-
- # Main box (inside a frame which is inside a VBox)
- self.menu_vbox = gtk.VBox()
- self.window.add(self.menu_vbox)
- self.menu_vbox.show()
-
- frame = gtk.Frame()
- frame.set_border_width(10)
- frame.set_shadow_type(gtk.SHADOW_NONE)
- self.menu_vbox.pack_end(frame)
- frame.show()
-
- self.main_vbox = gtk.VBox(spacing=10)
- frame.add(self.main_vbox)
- self.main_vbox.show()
-
- # EventBox
- self.scrolledwindow = gtk.ScrolledWindow()
- self.scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC,
- gtk.POLICY_AUTOMATIC)
- self.scrolledwindow.set_shadow_type(gtk.SHADOW_NONE)
- self.main_vbox.pack_start(self.scrolledwindow)
- self.scrolledwindow.show()
-
- table = gtk.Table(1, 1)
- self.scrolledwindow.add_with_viewport(table)
- table.show()
- table.realize()
-
- self.event_box = gtk.EventBox()
- table.attach(self.event_box, 0, 1, 0, 1, gtk.EXPAND, gtk.EXPAND)
- self.event_box.show()
- self.event_box.realize()
-
- # Image
- self.image = gtk.Image()
- self.event_box.add(self.image)
- self.image.show()
-
- # Data VBox
- self.data_vbox = gtk.VBox(spacing=10)
- self.main_vbox.pack_start(self.data_vbox, expand=False)
- self.data_vbox.show()
-
- # User VBox
- self.user_vbox = gtk.VBox(spacing=10)
- self.main_vbox.pack_start(self.user_vbox, expand=False)
- self.user_vbox.show()
-
- # Screendump ID HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- label = gtk.Label("Screendump ID:")
- box.pack_start(label, False)
- label.show()
-
- self.entry_screendump = gtk.Entry()
- self.entry_screendump.set_editable(False)
- box.pack_start(self.entry_screendump)
- self.entry_screendump.show()
-
- label = gtk.Label("Time:")
- box.pack_start(label, False)
- label.show()
-
- self.entry_time = gtk.Entry()
- self.entry_time.set_editable(False)
- self.entry_time.set_width_chars(10)
- box.pack_start(self.entry_time, False)
- self.entry_time.show()
-
- # Comment HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- label = gtk.Label("Comment:")
- box.pack_start(label, False)
- label.show()
-
- self.entry_comment = gtk.Entry()
- box.pack_start(self.entry_comment)
- self.entry_comment.show()
-
- # Sleep HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- self.check_sleep = gtk.CheckButton("Sleep:")
- self.check_sleep.connect("toggled", self.event_check_sleep_toggled)
- box.pack_start(self.check_sleep, False)
- self.check_sleep.show()
-
- self.spin_sleep = gtk.SpinButton(gtk.Adjustment(0, 0, 50000, 1, 10, 0),
- climb_rate=0.0)
- box.pack_start(self.spin_sleep, False)
- self.spin_sleep.show()
-
- # Barrier HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- self.check_barrier = gtk.CheckButton("Barrier:")
- self.check_barrier.connect("toggled", self.event_check_barrier_toggled)
- box.pack_start(self.check_barrier, False)
- self.check_barrier.show()
-
- vbox = gtk.VBox()
- box.pack_start(vbox)
- vbox.show()
-
- self.label_barrier_region = gtk.Label("Region:")
- self.label_barrier_region.set_alignment(0, 0.5)
- vbox.pack_start(self.label_barrier_region)
- self.label_barrier_region.show()
-
- self.label_barrier_md5sum = gtk.Label("MD5:")
- self.label_barrier_md5sum.set_alignment(0, 0.5)
- vbox.pack_start(self.label_barrier_md5sum)
- self.label_barrier_md5sum.show()
-
- self.label_barrier_timeout = gtk.Label("Timeout:")
- box.pack_start(self.label_barrier_timeout, False)
- self.label_barrier_timeout.show()
-
- self.spin_barrier_timeout = gtk.SpinButton(gtk.Adjustment(0, 0, 50000,
- 1, 10, 0),
- climb_rate=0.0)
- box.pack_start(self.spin_barrier_timeout, False)
- self.spin_barrier_timeout.show()
-
- self.check_barrier_optional = gtk.CheckButton("Optional")
- box.pack_start(self.check_barrier_optional, False)
- self.check_barrier_optional.show()
-
- # Keystrokes HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- label = gtk.Label("Keystrokes:")
- box.pack_start(label, False)
- label.show()
-
- frame = gtk.Frame()
- frame.set_shadow_type(gtk.SHADOW_IN)
- box.pack_start(frame)
- frame.show()
-
- self.text_buffer = gtk.TextBuffer()
- self.entry_keys = gtk.TextView(self.text_buffer)
- self.entry_keys.set_wrap_mode(gtk.WRAP_WORD)
- self.entry_keys.connect("key-press-event", self.event_key_press)
- frame.add(self.entry_keys)
- self.entry_keys.show()
-
- self.check_manual = gtk.CheckButton("Manual")
- self.check_manual.connect("toggled", self.event_manual_toggled)
- box.pack_start(self.check_manual, False)
- self.check_manual.show()
-
- button = gtk.Button("Clear")
- button.connect("clicked", self.event_clear_clicked)
- box.pack_start(button, False)
- button.show()
-
- # Mouse click HBox
- box = gtk.HBox(spacing=10)
- self.data_vbox.pack_start(box)
- box.show()
-
- label = gtk.Label("Mouse action:")
- box.pack_start(label, False)
- label.show()
-
- self.button_capture = gtk.Button("Capture")
- box.pack_start(self.button_capture, False)
- self.button_capture.show()
-
- self.check_mousemove = gtk.CheckButton("Move: ...")
- box.pack_start(self.check_mousemove, False)
- self.check_mousemove.show()
-
- self.check_mouseclick = gtk.CheckButton("Click: ...")
- box.pack_start(self.check_mouseclick, False)
- self.check_mouseclick.show()
-
- self.spin_sensitivity = gtk.SpinButton(gtk.Adjustment(1, 1, 100, 1, 10,
- 0),
- climb_rate=0.0)
- box.pack_end(self.spin_sensitivity, False)
- self.spin_sensitivity.show()
-
- label = gtk.Label("Sensitivity:")
- box.pack_end(label, False)
- label.show()
-
- self.spin_latency = gtk.SpinButton(gtk.Adjustment(10, 1, 500, 1, 10, 0),
- climb_rate=0.0)
- box.pack_end(self.spin_latency, False)
- self.spin_latency.show()
-
- label = gtk.Label("Latency:")
- box.pack_end(label, False)
- label.show()
-
- self.handler_event_box_press = None
- self.handler_event_box_release = None
- self.handler_event_box_scroll = None
- self.handler_event_box_motion = None
- self.handler_event_box_expose = None
-
- self.window.realize()
- self.window.show()
-
- self.clear_state()
-
- # Utilities
-
- def message(self, text, title):
- dlg = gtk.MessageDialog(self.window,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_INFO,
- gtk.BUTTONS_CLOSE,
- title)
- dlg.set_title(title)
- dlg.format_secondary_text(text)
- response = dlg.run()
- dlg.destroy()
-
-
- def question_yes_no(self, text, title):
- dlg = gtk.MessageDialog(self.window,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_QUESTION,
- gtk.BUTTONS_YES_NO,
- title)
- dlg.set_title(title)
- dlg.format_secondary_text(text)
- response = dlg.run()
- dlg.destroy()
- if response == gtk.RESPONSE_YES:
- return True
- return False
-
-
- def inputdialog(self, text, title, default_response=""):
- # Define a little helper function
- def inputdialog_entry_activated(entry):
- dlg.response(gtk.RESPONSE_OK)
-
- # Create the dialog
- dlg = gtk.MessageDialog(self.window,
- gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
- gtk.MESSAGE_QUESTION,
- gtk.BUTTONS_OK_CANCEL,
- title)
- dlg.set_title(title)
- dlg.format_secondary_text(text)
-
- # Create an entry widget
- entry = gtk.Entry()
- entry.set_text(default_response)
- entry.connect("activate", inputdialog_entry_activated)
- dlg.vbox.pack_start(entry)
- entry.show()
-
- # Run the dialog
- response = dlg.run()
- dlg.destroy()
- if response == gtk.RESPONSE_OK:
- return entry.get_text()
- return None
-
-
- def filedialog(self, title=None, default_filename=None):
- chooser = gtk.FileChooserDialog(title=title, parent=self.window,
- action=gtk.FILE_CHOOSER_ACTION_OPEN,
- buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
- gtk.RESPONSE_OK))
- chooser.resize(700, 500)
- if default_filename:
- chooser.set_filename(os.path.abspath(default_filename))
- filename = None
- response = chooser.run()
- if response == gtk.RESPONSE_OK:
- filename = chooser.get_filename()
- chooser.destroy()
- return filename
-
-
- def redirect_event_box_input(self, press=None, release=None, scroll=None,
- motion=None, expose=None):
- if self.handler_event_box_press != None: \
- self.event_box.disconnect(self.handler_event_box_press)
- if self.handler_event_box_release != None: \
- self.event_box.disconnect(self.handler_event_box_release)
- if self.handler_event_box_scroll != None: \
- self.event_box.disconnect(self.handler_event_box_scroll)
- if self.handler_event_box_motion != None: \
- self.event_box.disconnect(self.handler_event_box_motion)
- if self.handler_event_box_expose != None: \
- self.event_box.disconnect(self.handler_event_box_expose)
- self.handler_event_box_press = None
- self.handler_event_box_release = None
- self.handler_event_box_scroll = None
- self.handler_event_box_motion = None
- self.handler_event_box_expose = None
- if press != None: self.handler_event_box_press = \
- self.event_box.connect("button-press-event", press)
- if release != None: self.handler_event_box_release = \
- self.event_box.connect("button-release-event", release)
- if scroll != None: self.handler_event_box_scroll = \
- self.event_box.connect("scroll-event", scroll)
- if motion != None: self.handler_event_box_motion = \
- self.event_box.connect("motion-notify-event", motion)
- if expose != None: self.handler_event_box_expose = \
- self.event_box.connect_after("expose-event", expose)
-
-
- def get_keys(self):
- return self.text_buffer.get_text(
- self.text_buffer.get_start_iter(),
- self.text_buffer.get_end_iter())
-
-
- def add_key(self, key):
- text = self.get_keys()
- if len(text) > 0 and text[-1] != ' ':
- text += " "
- text += key
- self.text_buffer.set_text(text)
-
-
- def clear_keys(self):
- self.text_buffer.set_text("")
-
-
- def update_barrier_info(self):
- if self.barrier_selected:
- self.label_barrier_region.set_text("Selected region: Corner: " + \
- str(tuple(self.barrier_corner)) + \
- " Size: " + \
- str(tuple(self.barrier_size)))
- else:
- self.label_barrier_region.set_text("No region selected.")
- self.label_barrier_md5sum.set_text("MD5: " + self.barrier_md5sum)
-
-
- def update_mouse_click_info(self):
- if self.mouse_click_captured:
- self.check_mousemove.set_label("Move: " + \
- str(tuple(self.mouse_click_coords)))
- self.check_mouseclick.set_label("Click: button %d" %
- self.mouse_click_button)
- else:
- self.check_mousemove.set_label("Move: ...")
- self.check_mouseclick.set_label("Click: ...")
-
-
- def clear_state(self, clear_screendump=True):
- # Recording time
- self.entry_time.set_text("unknown")
- if clear_screendump:
- # Screendump
- self.clear_image()
- # Screendump ID
- self.entry_screendump.set_text("")
- # Comment
- self.entry_comment.set_text("")
- # Sleep
- self.check_sleep.set_active(True)
- self.check_sleep.set_active(False)
- self.spin_sleep.set_value(10)
- # Barrier
- self.clear_barrier_state()
- # Keystrokes
- self.check_manual.set_active(False)
- self.clear_keys()
- # Mouse actions
- self.check_mousemove.set_sensitive(False)
- self.check_mouseclick.set_sensitive(False)
- self.check_mousemove.set_active(False)
- self.check_mouseclick.set_active(False)
- self.mouse_click_captured = False
- self.mouse_click_coords = [0, 0]
- self.mouse_click_button = 0
- self.update_mouse_click_info()
-
-
- def clear_barrier_state(self):
- self.check_barrier.set_active(True)
- self.check_barrier.set_active(False)
- self.check_barrier_optional.set_active(False)
- self.spin_barrier_timeout.set_value(10)
- self.barrier_selection_started = False
- self.barrier_selected = False
- self.barrier_corner0 = [0, 0]
- self.barrier_corner1 = [0, 0]
- self.barrier_corner = [0, 0]
- self.barrier_size = [0, 0]
- self.barrier_md5sum = ""
- self.update_barrier_info()
-
-
- def set_image(self, w, h, data):
- (self.image_width, self.image_height, self.image_data) = (w, h, data)
- self.image.set_from_pixbuf(gtk.gdk.pixbuf_new_from_data(
- data, gtk.gdk.COLORSPACE_RGB, False, 8,
- w, h, w*3))
- hscrollbar = self.scrolledwindow.get_hscrollbar()
- hscrollbar.set_range(0, w)
- vscrollbar = self.scrolledwindow.get_vscrollbar()
- vscrollbar.set_range(0, h)
-
-
- def set_image_from_file(self, filename):
- if not ppm_utils.image_verify_ppm_file(filename):
- logging.warning("set_image_from_file: Warning: received invalid"
- "screendump file")
- return self.clear_image()
- (w, h, data) = ppm_utils.image_read_from_ppm_file(filename)
- self.set_image(w, h, data)
-
-
- def clear_image(self):
- self.image.clear()
- self.image_width = 0
- self.image_height = 0
- self.image_data = ""
-
-
- def update_screendump_id(self, data_dir):
- if not self.image_data:
- return
- # Find a proper ID for the screendump
- scrdump_md5sum = ppm_utils.image_md5sum(self.image_width,
- self.image_height,
- self.image_data)
- scrdump_id = ppm_utils.find_id_for_screendump(scrdump_md5sum, data_dir)
- if not scrdump_id:
- # Not found; generate one
- scrdump_id = ppm_utils.generate_id_for_screendump(scrdump_md5sum,
- data_dir)
- self.entry_screendump.set_text(scrdump_id)
-
-
- def get_step_lines(self, data_dir=None):
- if self.check_barrier.get_active() and not self.barrier_selected:
- self.message("No barrier region selected.", "Error")
- return
-
- str = "step"
-
- # Add step recording time
- if self.entry_time.get_text():
- str += " " + self.entry_time.get_text()
-
- str += "\n"
-
- # Add screendump line
- if self.image_data:
- str += "screendump %s\n" % self.entry_screendump.get_text()
-
- # Add comment
- if self.entry_comment.get_text():
- str += "# %s\n" % self.entry_comment.get_text()
-
- # Add sleep line
- if self.check_sleep.get_active():
- str += "sleep %d\n" % self.spin_sleep.get_value()
-
- # Add barrier_2 line
- if self.check_barrier.get_active():
- str += "barrier_2 %d %d %d %d %s %d" % (
- self.barrier_size[0], self.barrier_size[1],
- self.barrier_corner[0], self.barrier_corner[1],
- self.barrier_md5sum, self.spin_barrier_timeout.get_value())
- if self.check_barrier_optional.get_active():
- str += " optional"
- str += "\n"
-
- # Add "Sending keys" comment
- keys_to_send = self.get_keys().split()
- if keys_to_send:
- str += "# Sending keys: %s\n" % self.get_keys()
-
- # Add key and var lines
- for key in keys_to_send:
- if key.startswith("$"):
- varname = key[1:]
- str += "var %s\n" % varname
- else:
- str += "key %s\n" % key
-
- # Add mousemove line
- if self.check_mousemove.get_active():
- str += "mousemove %d %d\n" % (self.mouse_click_coords[0],
- self.mouse_click_coords[1])
-
- # Add mouseclick line
- if self.check_mouseclick.get_active():
- dict = { 1 : 1,
- 2 : 2,
- 3 : 4 }
- str += "mouseclick %d\n" % dict[self.mouse_click_button]
-
- # Write screendump and cropped screendump image files
- if data_dir and self.image_data:
- # Create the data dir if it doesn't exist
- if not os.path.exists(data_dir):
- os.makedirs(data_dir)
- # Get the full screendump filename
- scrdump_filename = os.path.join(data_dir,
- self.entry_screendump.get_text())
- # Write screendump file if it doesn't exist
- if not os.path.exists(scrdump_filename):
- try:
- ppm_utils.image_write_to_ppm_file(scrdump_filename,
- self.image_width,
- self.image_height,
- self.image_data)
- except IOError:
- self.message("Could not write screendump file.", "Error")
-
- #if self.check_barrier.get_active():
- # # Crop image to get the cropped screendump
- # (cw, ch, cdata) = ppm_utils.image_crop(
- # self.image_width, self.image_height, self.image_data,
- # self.barrier_corner[0], self.barrier_corner[1],
- # self.barrier_size[0], self.barrier_size[1])
- # cropped_scrdump_md5sum = ppm_utils.image_md5sum(cw, ch, cdata)
- # cropped_scrdump_filename = \
- # ppm_utils.get_cropped_screendump_filename(scrdump_filename,
- # cropped_scrdump_md5sum)
- # # Write cropped screendump file
- # try:
- # ppm_utils.image_write_to_ppm_file(cropped_scrdump_filename,
- # cw, ch, cdata)
- # except IOError:
- # self.message("Could not write cropped screendump file.",
- # "Error")
-
- return str
-
- def set_state_from_step_lines(self, str, data_dir, warn=True):
- self.clear_state()
-
- for line in str.splitlines():
- words = line.split()
- if not words:
- continue
-
- if line.startswith("#") \
- and not self.entry_comment.get_text() \
- and not line.startswith("# Sending keys:") \
- and not line.startswith("# ----"):
- self.entry_comment.set_text(line.strip("#").strip())
-
- elif words[0] == "step":
- if len(words) >= 2:
- self.entry_time.set_text(words[1])
-
- elif words[0] == "screendump":
- self.entry_screendump.set_text(words[1])
- self.set_image_from_file(os.path.join(data_dir, words[1]))
-
- elif words[0] == "sleep":
- self.spin_sleep.set_value(int(words[1]))
- self.check_sleep.set_active(True)
-
- elif words[0] == "key":
- self.add_key(words[1])
-
- elif words[0] == "var":
- self.add_key("$%s" % words[1])
-
- elif words[0] == "mousemove":
- self.mouse_click_captured = True
- self.mouse_click_coords = [int(words[1]), int(words[2])]
- self.update_mouse_click_info()
-
- elif words[0] == "mouseclick":
- self.mouse_click_captured = True
- self.mouse_click_button = int(words[1])
- self.update_mouse_click_info()
-
- elif words[0] == "barrier_2":
- # Get region corner and size from step lines
- self.barrier_corner = [int(words[3]), int(words[4])]
- self.barrier_size = [int(words[1]), int(words[2])]
- # Get corner0 and corner1 from step lines
- self.barrier_corner0 = self.barrier_corner
- self.barrier_corner1 = [self.barrier_corner[0] +
- self.barrier_size[0] - 1,
- self.barrier_corner[1] +
- self.barrier_size[1] - 1]
- # Get the md5sum
- self.barrier_md5sum = words[5]
- # Pretend the user selected the region with the mouse
- self.barrier_selection_started = True
- self.barrier_selected = True
- # Update label widgets according to region information
- self.update_barrier_info()
- # Check the barrier checkbutton
- self.check_barrier.set_active(True)
- # Set timeout value
- self.spin_barrier_timeout.set_value(int(words[6]))
- # Set 'optional' checkbutton state
- self.check_barrier_optional.set_active(words[-1] == "optional")
- # Update the image widget
- self.event_box.queue_draw()
-
- if warn:
- # See if the computed md5sum matches the one recorded in
- # the file
- computed_md5sum = ppm_utils.get_region_md5sum(
- self.image_width, self.image_height,
- self.image_data, self.barrier_corner[0],
- self.barrier_corner[1], self.barrier_size[0],
- self.barrier_size[1])
- if computed_md5sum != self.barrier_md5sum:
- self.message("Computed MD5 sum (%s) differs from MD5"
- " sum recorded in steps file (%s)" %
- (computed_md5sum, self.barrier_md5sum),
- "Warning")
-
- # Events
-
- def delete_event(self, widget, event):
- pass
-
- def destroy(self, widget):
- gtk.main_quit()
-
- def event_check_barrier_toggled(self, widget):
- if self.check_barrier.get_active():
- self.redirect_event_box_input(
- self.event_button_press,
- self.event_button_release,
- None,
- None,
- self.event_expose)
- self.event_box.queue_draw()
- self.event_box.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.CROSSHAIR))
- self.label_barrier_region.set_sensitive(True)
- self.label_barrier_md5sum.set_sensitive(True)
- self.label_barrier_timeout.set_sensitive(True)
- self.spin_barrier_timeout.set_sensitive(True)
- self.check_barrier_optional.set_sensitive(True)
- else:
- self.redirect_event_box_input()
- self.event_box.queue_draw()
- self.event_box.window.set_cursor(None)
- self.label_barrier_region.set_sensitive(False)
- self.label_barrier_md5sum.set_sensitive(False)
- self.label_barrier_timeout.set_sensitive(False)
- self.spin_barrier_timeout.set_sensitive(False)
- self.check_barrier_optional.set_sensitive(False)
-
- def event_check_sleep_toggled(self, widget):
- if self.check_sleep.get_active():
- self.spin_sleep.set_sensitive(True)
- else:
- self.spin_sleep.set_sensitive(False)
-
- def event_manual_toggled(self, widget):
- self.entry_keys.grab_focus()
-
- def event_clear_clicked(self, widget):
- self.clear_keys()
- self.entry_keys.grab_focus()
-
- def event_expose(self, widget, event):
- if not self.barrier_selection_started:
- return
- (corner, size) = corner_and_size_clipped(self.barrier_corner0,
- self.barrier_corner1,
- self.event_box.size_request())
- gc = self.event_box.window.new_gc(line_style=gtk.gdk.LINE_DOUBLE_DASH,
- line_width=1)
- gc.set_foreground(gc.get_colormap().alloc_color("red"))
- gc.set_background(gc.get_colormap().alloc_color("dark red"))
- gc.set_dashes(0, (4, 4))
- self.event_box.window.draw_rectangle(
- gc, False,
- corner[0], corner[1],
- size[0]-1, size[1]-1)
-
- def event_drag_motion(self, widget, event):
- old_corner1 = self.barrier_corner1
- self.barrier_corner1 = [int(event.x), int(event.y)]
- (corner, size) = corner_and_size_clipped(self.barrier_corner0,
- self.barrier_corner1,
- self.event_box.size_request())
- (old_corner, old_size) = corner_and_size_clipped(self.barrier_corner0,
- old_corner1,
- self.event_box.size_request())
- corner0 = [min(corner[0], old_corner[0]), min(corner[1], old_corner[1])]
- corner1 = [max(corner[0] + size[0], old_corner[0] + old_size[0]),
- max(corner[1] + size[1], old_corner[1] + old_size[1])]
- size = [corner1[0] - corner0[0] + 1,
- corner1[1] - corner0[1] + 1]
- self.event_box.queue_draw_area(corner0[0], corner0[1], size[0], size[1])
-
- def event_button_press(self, widget, event):
- (corner, size) = corner_and_size_clipped(self.barrier_corner0,
- self.barrier_corner1,
- self.event_box.size_request())
- self.event_box.queue_draw_area(corner[0], corner[1], size[0], size[1])
- self.barrier_corner0 = [int(event.x), int(event.y)]
- self.barrier_corner1 = [int(event.x), int(event.y)]
- self.redirect_event_box_input(
- self.event_button_press,
- self.event_button_release,
- None,
- self.event_drag_motion,
- self.event_expose)
- self.barrier_selection_started = True
-
- def event_button_release(self, widget, event):
- self.redirect_event_box_input(
- self.event_button_press,
- self.event_button_release,
- None,
- None,
- self.event_expose)
- (self.barrier_corner, self.barrier_size) = \
- corner_and_size_clipped(self.barrier_corner0, self.barrier_corner1,
- self.event_box.size_request())
- self.barrier_md5sum = ppm_utils.get_region_md5sum(
- self.image_width, self.image_height, self.image_data,
- self.barrier_corner[0], self.barrier_corner[1],
- self.barrier_size[0], self.barrier_size[1])
- self.barrier_selected = True
- self.update_barrier_info()
-
- def event_key_press(self, widget, event):
- if self.check_manual.get_active():
- return False
- str = key_event_to_qemu_string(event)
- self.add_key(str)
- return True
-
-
-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>
- </menubar>
-</ui>'''
-
- # Constructor
-
- def __init__(self, filename=None):
- StepMakerWindow.__init__(self)
-
- self.steps_filename = None
- self.steps = []
-
- # Create a UIManager instance
- uimanager = gtk.UIManager()
-
- # Add the accelerator group to the toplevel window
- accelgroup = uimanager.get_accel_group()
- self.window.add_accel_group(accelgroup)
-
- # Create an ActionGroup
- actiongroup = gtk.ActionGroup('StepEditor')
-
- # Create actions
- actiongroup.add_actions([
- ('Quit', gtk.STOCK_QUIT, '_Quit', None, 'Quit the Program',
- self.quit),
- ('Open', gtk.STOCK_OPEN, '_Open', None, 'Open steps file',
- self.open_steps_file),
- ('CopyStep', gtk.STOCK_COPY, '_Copy current step...', "",
- 'Copy current step to user specified position', self.copy_step),
- ('DeleteStep', gtk.STOCK_DELETE, '_Delete current step', "",
- 'Delete current step', self.event_remove_clicked),
- ('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', "",
- 'Insert new step after current step', self.insert_after),
- ('InsertStepsBefore', gtk.STOCK_ADD, '_Steps before current...',
- "", 'Insert steps (from file) before current step',
- self.insert_steps_before),
- ('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', "",
- 'Move unused PPM files to a backup directory', self.cleanup),
- ('File', None, '_File'),
- ('Edit', None, '_Edit'),
- ('Insert', None, '_Insert'),
- ('Tools', None, '_Tools')
- ])
-
- def create_shortcut(name, callback, keyname):
- # Create an action
- action = gtk.Action(name, None, None, None)
- # Connect a callback to the action
- action.connect("activate", callback)
- actiongroup.add_action_with_accel(action, keyname)
- # Have the action use accelgroup
- action.set_accel_group(accelgroup)
- # Connect the accelerator to the action
- action.connect_accelerator()
-
- create_shortcut("Next", self.event_next_clicked, "Page_Down")
- create_shortcut("Previous", self.event_prev_clicked, "Page_Up")
-
- # Add the actiongroup to the uimanager
- uimanager.insert_action_group(actiongroup, 0)
-
- # Add a UI description
- uimanager.add_ui_from_string(self.ui)
-
- # Create a MenuBar
- menubar = uimanager.get_widget('/MenuBar')
- self.menu_vbox.pack_start(menubar, False)
-
- # Remember the Edit menu bar for future reference
- self.menu_edit = uimanager.get_widget('/MenuBar/Edit')
- self.menu_edit.set_sensitive(False)
-
- # Remember the Insert menu bar for future reference
- self.menu_insert = uimanager.get_widget('/MenuBar/Insert')
- self.menu_insert.set_sensitive(False)
-
- # Remember the Tools menu bar for future reference
- self.menu_tools = uimanager.get_widget('/MenuBar/Tools')
- self.menu_tools.set_sensitive(False)
-
- # Next/Previous HBox
- hbox = gtk.HBox(spacing=10)
- self.user_vbox.pack_start(hbox)
- hbox.show()
-
- self.button_first = gtk.Button(stock=gtk.STOCK_GOTO_FIRST)
- self.button_first.connect("clicked", self.event_first_clicked)
- hbox.pack_start(self.button_first)
- self.button_first.show()
-
- #self.button_prev = gtk.Button("<< Previous")
- self.button_prev = gtk.Button(stock=gtk.STOCK_GO_BACK)
- self.button_prev.connect("clicked", self.event_prev_clicked)
- hbox.pack_start(self.button_prev)
- self.button_prev.show()
-
- self.label_step = gtk.Label("Step:")
- hbox.pack_start(self.label_step, False)
- self.label_step.show()
-
- self.entry_step_num = gtk.Entry()
- self.entry_step_num.connect("activate", self.event_entry_step_activated)
- self.entry_step_num.set_width_chars(3)
- hbox.pack_start(self.entry_step_num, False)
- self.entry_step_num.show()
-
- #self.button_next = gtk.Button("Next >>")
- self.button_next = gtk.Button(stock=gtk.STOCK_GO_FORWARD)
- self.button_next.connect("clicked", self.event_next_clicked)
- hbox.pack_start(self.button_next)
- self.button_next.show()
-
- self.button_last = gtk.Button(stock=gtk.STOCK_GOTO_LAST)
- self.button_last.connect("clicked", self.event_last_clicked)
- hbox.pack_start(self.button_last)
- self.button_last.show()
-
- # Save HBox
- hbox = gtk.HBox(spacing=10)
- self.user_vbox.pack_start(hbox)
- hbox.show()
-
- self.button_save = gtk.Button("_Save current step")
- self.button_save.connect("clicked", self.event_save_clicked)
- hbox.pack_start(self.button_save)
- self.button_save.show()
-
- self.button_remove = gtk.Button("_Delete current step")
- self.button_remove.connect("clicked", self.event_remove_clicked)
- hbox.pack_start(self.button_remove)
- self.button_remove.show()
-
- self.button_replace = gtk.Button("_Replace screendump")
- self.button_replace.connect("clicked", self.event_replace_clicked)
- hbox.pack_start(self.button_replace)
- self.button_replace.show()
-
- # Disable unused widgets
- self.button_capture.set_sensitive(False)
- self.spin_latency.set_sensitive(False)
- self.spin_sensitivity.set_sensitive(False)
-
- # Disable main vbox because no steps file is loaded
- self.main_vbox.set_sensitive(False)
-
- # Set title
- self.window.set_title("Step Editor")
-
- # Events
-
- def delete_event(self, widget, event):
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
-
- def event_first_clicked(self, widget):
- if not self.steps:
- return
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Go to first step
- self.set_step(0)
-
- def event_last_clicked(self, widget):
- if not self.steps:
- return
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Go to last step
- self.set_step(len(self.steps) - 1)
-
- def event_prev_clicked(self, widget):
- if not self.steps:
- return
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Go to previous step
- index = self.current_step_index - 1
- if self.steps:
- index = index % len(self.steps)
- self.set_step(index)
-
- def event_next_clicked(self, widget):
- if not self.steps:
- return
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Go to next step
- index = self.current_step_index + 1
- if self.steps:
- index = index % len(self.steps)
- self.set_step(index)
-
- def event_entry_step_activated(self, widget):
- if not self.steps:
- return
- step_index = self.entry_step_num.get_text()
- if not step_index.isdigit():
- return
- step_index = int(step_index) - 1
- if step_index == self.current_step_index:
- return
- self.verify_save()
- self.set_step(step_index)
-
- def event_save_clicked(self, widget):
- if not self.steps:
- return
- self.save_step()
-
- def event_remove_clicked(self, widget):
- if not self.steps:
- return
- if not self.question_yes_no("This will modify the steps file."
- " Are you sure?", "Remove step?"):
- return
- # Remove step
- del self.steps[self.current_step_index]
- # Write changes to file
- self.write_steps_file(self.steps_filename)
- # Move to previous step
- self.set_step(self.current_step_index)
-
- def event_replace_clicked(self, widget):
- if not self.steps:
- return
- # Let the user choose a screendump file
- current_filename = os.path.join(self.steps_data_dir,
- self.entry_screendump.get_text())
- filename = self.filedialog("Choose PPM image file",
- default_filename=current_filename)
- if not filename:
- return
- if not ppm_utils.image_verify_ppm_file(filename):
- self.message("Not a valid PPM image file.", "Error")
- return
- self.clear_image()
- self.clear_barrier_state()
- self.set_image_from_file(filename)
- self.update_screendump_id(self.steps_data_dir)
-
- # Menu actions
-
- def open_steps_file(self, action):
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Let the user choose a steps file
- current_filename = self.steps_filename
- filename = self.filedialog("Open steps file",
- default_filename=current_filename)
- if not filename:
- return
- self.set_steps_file(filename)
-
- def quit(self, action):
- # Make sure the step is saved (if the user wants it to be)
- self.verify_save()
- # Quit
- gtk.main_quit()
-
- def copy_step(self, action):
- if not self.steps:
- return
- self.verify_save()
- self.set_step(self.current_step_index)
- # Get the desired position
- step_index = self.inputdialog("Copy step to position:",
- "Copy step",
- str(self.current_step_index + 2))
- if not step_index:
- return
- step_index = int(step_index) - 1
- # Get the lines of the current step
- step = self.steps[self.current_step_index]
- # Insert new step at position step_index
- self.steps.insert(step_index, step)
- # Go to new step
- self.set_step(step_index)
- # Write changes to disk
- self.write_steps_file(self.steps_filename)
-
- def insert_before(self, action):
- if not self.steps_filename:
- return
- if not self.question_yes_no("This will modify the steps file."
- " Are you sure?", "Insert new step?"):
- return
- self.verify_save()
- step_index = self.current_step_index
- # Get the lines of a blank step
- self.clear_state()
- step = self.get_step_lines()
- # Insert new step at position step_index
- self.steps.insert(step_index, step)
- # Go to new step
- self.set_step(step_index)
- # Write changes to disk
- self.write_steps_file(self.steps_filename)
-
- def insert_after(self, action):
- if not self.steps_filename:
- return
- if not self.question_yes_no("This will modify the steps file."
- " Are you sure?", "Insert new step?"):
- return
- self.verify_save()
- step_index = self.current_step_index + 1
- # Get the lines of a blank step
- self.clear_state()
- step = self.get_step_lines()
- # Insert new step at position step_index
- self.steps.insert(step_index, step)
- # Go to new step
- self.set_step(step_index)
- # Write changes to disk
- self.write_steps_file(self.steps_filename)
-
- def insert_steps(self, filename, index):
- # Read the steps file
- (steps, header) = self.read_steps_file(filename)
-
- data_dir = ppm_utils.get_data_dir(filename)
- for step in steps:
- self.set_state_from_step_lines(step, data_dir, warn=False)
- step = self.get_step_lines(self.steps_data_dir)
-
- # Insert steps into self.steps
- self.steps[index:index] = steps
- # Write changes to disk
- self.write_steps_file(self.steps_filename)
-
- def insert_steps_before(self, action):
- if not self.steps_filename:
- return
- # Let the user choose a steps file
- current_filename = self.steps_filename
- filename = self.filedialog("Choose steps file",
- default_filename=current_filename)
- if not filename:
- return
- self.verify_save()
-
- step_index = self.current_step_index
- # Insert steps at position step_index
- self.insert_steps(filename, step_index)
- # Go to new steps
- self.set_step(step_index)
-
- def insert_steps_after(self, action):
- if not self.steps_filename:
- return
- # Let the user choose a steps file
- current_filename = self.steps_filename
- filename = self.filedialog("Choose steps file",
- default_filename=current_filename)
- if not filename:
- return
- self.verify_save()
-
- step_index = self.current_step_index + 1
- # Insert new steps at position step_index
- self.insert_steps(filename, step_index)
- # Go to new steps
- self.set_step(step_index)
-
- def cleanup(self, action):
- if not self.steps_filename:
- return
- if not self.question_yes_no("All unused PPM files will be moved to a"
- " backup directory. Are you sure?",
- "Clean up data directory?"):
- return
- # Remember the current step index
- current_step_index = self.current_step_index
- # Get the backup dir
- backup_dir = os.path.join(self.steps_data_dir, "backup")
- # Create it if it doesn't exist
- if not os.path.exists(backup_dir):
- os.makedirs(backup_dir)
- # Move all files to the backup dir
- for filename in glob.glob(os.path.join(self.steps_data_dir,
- "*.[Pp][Pp][Mm]")):
- shutil.move(filename, backup_dir)
- # Get the used files back
- for step in self.steps:
- self.set_state_from_step_lines(step, backup_dir, warn=False)
- self.get_step_lines(self.steps_data_dir)
- # Remove the used files from the backup dir
- used_files = os.listdir(self.steps_data_dir)
- for filename in os.listdir(backup_dir):
- if filename in used_files:
- os.unlink(os.path.join(backup_dir, filename))
- # Restore step index
- self.set_step(current_step_index)
- # Inform the user
- self.message("All unused PPM files may be found at %s." %
- os.path.abspath(backup_dir),
- "Clean up data directory")
-
- # Methods
-
- def read_steps_file(self, filename):
- steps = []
- header = ""
-
- file = open(filename, "r")
- for line in file.readlines():
- words = line.split()
- if not words:
- continue
- if line.startswith("# ----"):
- continue
- if words[0] == "step":
- steps.append("")
- if steps:
- steps[-1] += line
- else:
- header += line
- file.close()
-
- return (steps, header)
-
- def set_steps_file(self, filename):
- try:
- (self.steps, self.header) = self.read_steps_file(filename)
- except (TypeError, IOError):
- self.message("Cannot read file %s." % filename, "Error")
- return
-
- self.steps_filename = filename
- self.steps_data_dir = ppm_utils.get_data_dir(filename)
- # Go to step 0
- self.set_step(0)
-
- def set_step(self, index):
- # Limit index to legal boundaries
- if index < 0:
- index = 0
- if index > len(self.steps) - 1:
- index = len(self.steps) - 1
-
- # Enable the menus
- self.menu_edit.set_sensitive(True)
- self.menu_insert.set_sensitive(True)
- self.menu_tools.set_sensitive(True)
-
- # If no steps exist...
- if self.steps == []:
- self.current_step_index = index
- self.current_step = None
- # Set window title
- self.window.set_title("Step Editor -- %s" %
- os.path.basename(self.steps_filename))
- # Set step entry widget text
- self.entry_step_num.set_text("")
- # Clear the state of all widgets
- self.clear_state()
- # Disable the main vbox
- self.main_vbox.set_sensitive(False)
- return
-
- self.current_step_index = index
- self.current_step = self.steps[index]
- # Set window title
- self.window.set_title("Step Editor -- %s -- step %d" %
- (os.path.basename(self.steps_filename),
- index + 1))
- # Set step entry widget text
- self.entry_step_num.set_text(str(self.current_step_index + 1))
- # Load the state from the step lines
- self.set_state_from_step_lines(self.current_step, self.steps_data_dir)
- # Enable the main vbox
- self.main_vbox.set_sensitive(True)
- # Make sure the step lines in self.current_step are identical to the
- # output of self.get_step_lines
- self.current_step = self.get_step_lines()
-
- def verify_save(self):
- if not self.steps:
- return
- # See if the user changed anything
- if self.get_step_lines() != self.current_step:
- if self.question_yes_no("Step contents have been modified."
- " Save step?", "Save changes?"):
- self.save_step()
-
- def save_step(self):
- lines = self.get_step_lines(self.steps_data_dir)
- if lines != None:
- self.steps[self.current_step_index] = lines
- self.current_step = lines
- self.write_steps_file(self.steps_filename)
-
- def write_steps_file(self, filename):
- file = open(filename, "w")
- file.write(self.header)
- for step in self.steps:
- file.write("# " + "-" * 32 + "\n")
- file.write(step)
- file.close()
-
-
-if __name__ == "__main__":
- se = StepEditor()
- if len(sys.argv) > 1:
- se.set_steps_file(sys.argv[1])
- gtk.main()
diff --git a/client/virt/virt_test_setup.py b/client/virt/virt_test_setup.py
deleted file mode 100644
index 334c3cf..0000000
--- a/client/virt/virt_test_setup.py
+++ /dev/null
@@ -1,291 +0,0 @@
-"""
-Library to perform pre/post test setup for KVM autotest.
-"""
-import os, logging, time, re, random
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-
-
-class THPError(Exception):
- """
- Base exception for Transparent Hugepage setup.
- """
- pass
-
-
-class THPNotSupportedError(THPError):
- """
- Thrown when host does not support tansparent hugepages.
- """
- pass
-
-
-class THPWriteConfigError(THPError):
- """
- Thrown when host does not support tansparent hugepages.
- """
- pass
-
-
-class THPKhugepagedError(THPError):
- """
- Thrown when khugepaged is not behaving as expected.
- """
- pass
-
-
-class TransparentHugePageConfig(object):
- def __init__(self, test, params):
- """
- Find paths for transparent hugepages and kugepaged configuration. Also,
- back up original host configuration so it can be restored during
- cleanup.
- """
- self.params = params
-
- RH_THP_PATH = "/sys/kernel/mm/redhat_transparent_hugepage"
- UPSTREAM_THP_PATH = "/sys/kernel/mm/transparent_hugepage"
- if os.path.isdir(RH_THP_PATH):
- self.thp_path = RH_THP_PATH
- elif os.path.isdir(UPSTREAM_THP_PATH):
- self.thp_path = UPSTREAM_THP_PATH
- else:
- raise THPNotSupportedError("System doesn't support transparent "
- "hugepages")
-
- tmp_list = []
- test_cfg = {}
- test_config = self.params.get("test_config", None)
- if test_config is not None:
- tmp_list = re.split(';', test_config)
- while len(tmp_list) > 0:
- tmp_cfg = tmp_list.pop()
- test_cfg[re.split(":", tmp_cfg)[0]] = re.split(":", tmp_cfg)[1]
- # Save host current config, so we can restore it during cleanup
- # We will only save the writeable part of the config files
- original_config = {}
- # List of files that contain string config values
- self.file_list_str = []
- # List of files that contain integer config values
- self.file_list_num = []
- for f in os.walk(self.thp_path):
- base_dir = f[0]
- if f[2]:
- for name in f[2]:
- f_dir = os.path.join(base_dir, name)
- parameter = file(f_dir, 'r').read()
- try:
- # Verify if the path in question is writable
- f = open(f_dir, 'w')
- f.close()
- if re.findall("\[(.*)\]", parameter):
- original_config[f_dir] = re.findall("\[(.*)\]",
- parameter)[0]
- self.file_list_str.append(f_dir)
- else:
- original_config[f_dir] = int(parameter)
- self.file_list_num.append(f_dir)
- except IOError:
- pass
-
- self.test_config = test_cfg
- self.original_config = original_config
-
-
- def set_env(self):
- """
- Applies test configuration on the host.
- """
- if self.test_config:
- for path in self.test_config.keys():
- file(path, 'w').write(self.test_config[path])
-
-
- def value_listed(self, value):
- """
- Get a parameters list from a string
- """
- value_list = []
- for i in re.split("\[|\]|\n+|\s+", value):
- if i:
- value_list.append(i)
- return value_list
-
-
- def khugepaged_test(self):
- """
- Start, stop and frequency change test for khugepaged.
- """
- def check_status_with_value(action_list, file_name):
- """
- Check the status of khugepaged when set value to specify file.
- """
- for (a, r) in action_list:
- open(file_name, "w").write(a)
- time.sleep(5)
- try:
- utils.run('pgrep khugepaged')
- if r != 0:
- raise THPKhugepagedError("Khugepaged still alive when"
- "transparent huge page is "
- "disabled")
- except error.CmdError:
- if r == 0:
- raise THPKhugepagedError("Khugepaged could not be set to"
- "status %s" % a)
-
-
- for file_path in self.file_list_str:
- action_list = []
- if re.findall("enabled", file_path):
- # Start and stop test for khugepaged
- value_list = self.value_listed(open(file_path,"r").read())
- for i in value_list:
- if re.match("n", i, re.I):
- action_stop = (i, 256)
- for i in value_list:
- if re.match("[^n]", i, re.I):
- action = (i, 0)
- action_list += [action_stop, action, action_stop]
- action_list += [action]
-
- check_status_with_value(action_list, file_path)
- else:
- value_list = self.value_listed(open(file_path,"r").read())
- for i in value_list:
- action = (i, 0)
- action_list.append(action)
- check_status_with_value(action_list, file_path)
-
- for file_path in self.file_list_num:
- action_list = []
- value = int(open(file_path, "r").read())
- if value != 0 and value != 1:
- new_value = random.random()
- action_list.append((str(int(value * new_value)),0))
- action_list.append((str(int(value * ( new_value + 1))),0))
- else:
- action_list.append(("0", 0))
- action_list.append(("1", 0))
-
- check_status_with_value(action_list, file_path)
-
-
- def setup(self):
- """
- Configure host for testing. Also, check that khugepaged is working as
- expected.
- """
- self.set_env()
- self.khugepaged_test()
-
-
- def cleanup(self):
- """:
- Restore the host's original configuration after test
- """
- for path in self.original_config:
- p_file = open(path, 'w')
- p_file.write(str(self.original_config[path]))
- p_file.close()
-
-
-class HugePageConfig(object):
- def __init__(self, params):
- """
- Gets environment variable values and calculates the target number
- of huge memory pages.
-
- @param params: Dict like object containing parameters for the test.
- """
- self.vms = len(params.objects("vms"))
- self.mem = int(params.get("mem"))
- self.max_vms = int(params.get("max_vms", 0))
- self.hugepage_path = '/mnt/kvm_hugepage'
- self.hugepage_size = self.get_hugepage_size()
- self.target_hugepages = self.get_target_hugepages()
- self.kernel_hp_file = '/proc/sys/vm/nr_hugepages'
-
-
- def get_hugepage_size(self):
- """
- Get the current system setting for huge memory page size.
- """
- meminfo = open('/proc/meminfo', 'r').readlines()
- huge_line_list = [h for h in meminfo if h.startswith("Hugepagesize")]
- try:
- return int(huge_line_list[0].split()[1])
- except ValueError, e:
- raise ValueError("Could not get huge page size setting from "
- "/proc/meminfo: %s" % e)
-
-
- def get_target_hugepages(self):
- """
- Calculate the target number of hugepages for testing purposes.
- """
- if self.vms < self.max_vms:
- self.vms = self.max_vms
- # memory of all VMs plus qemu overhead of 64MB per guest
- vmsm = (self.vms * self.mem) + (self.vms * 64)
- return int(vmsm * 1024 / self.hugepage_size)
-
-
- @error.context_aware
- def set_hugepages(self):
- """
- Sets the hugepage limit to the target hugepage value calculated.
- """
- error.context("setting hugepages limit to %s" % self.target_hugepages)
- hugepage_cfg = open(self.kernel_hp_file, "r+")
- hp = hugepage_cfg.readline()
- while int(hp) < self.target_hugepages:
- loop_hp = hp
- hugepage_cfg.write(str(self.target_hugepages))
- hugepage_cfg.flush()
- hugepage_cfg.seek(0)
- hp = int(hugepage_cfg.readline())
- if loop_hp == hp:
- raise ValueError("Cannot set the kernel hugepage setting "
- "to the target value of %d hugepages." %
- self.target_hugepages)
- hugepage_cfg.close()
- logging.debug("Successfuly set %s large memory pages on host ",
- self.target_hugepages)
-
-
- @error.context_aware
- def mount_hugepage_fs(self):
- """
- Verify if there's a hugetlbfs mount set. If there's none, will set up
- a hugetlbfs mount using the class attribute that defines the mount
- point.
- """
- error.context("mounting hugepages path")
- if not os.path.ismount(self.hugepage_path):
- if not os.path.isdir(self.hugepage_path):
- os.makedirs(self.hugepage_path)
- cmd = "mount -t hugetlbfs none %s" % self.hugepage_path
- utils.system(cmd)
-
-
- def setup(self):
- logging.debug("Number of VMs this test will use: %d", self.vms)
- logging.debug("Amount of memory used by each vm: %s", self.mem)
- logging.debug("System setting for large memory page size: %s",
- self.hugepage_size)
- logging.debug("Number of large memory pages needed for this test: %s",
- self.target_hugepages)
- self.set_hugepages()
- self.mount_hugepage_fs()
-
-
- @error.context_aware
- def cleanup(self):
- error.context("trying to dealocate hugepage memory")
- try:
- utils.system("umount %s" % self.hugepage_path)
- except error.CmdError:
- return
- utils.system("echo 0 > %s" % self.kernel_hp_file)
- logging.debug("Hugepage memory successfuly dealocated")
diff --git a/client/virt/virt_test_utils.py b/client/virt/virt_test_utils.py
deleted file mode 100644
index 7c3343b..0000000
--- a/client/virt/virt_test_utils.py
+++ /dev/null
@@ -1,782 +0,0 @@
-"""
-High-level KVM test utility functions.
-
-This module is meant to reduce code size by performing common test procedures.
-Generally, code here should look like test code.
-More specifically:
- - Functions in this module should raise exceptions if things go wrong
- (unlike functions in kvm_utils.py and kvm_vm.py which report failure via
- their returned values).
- - Functions in this module may use logging.info(), in addition to
- logging.debug() and logging.error(), to log messages the user may be
- interested in (unlike kvm_utils.py and kvm_vm.py which use
- logging.debug() for anything that isn't an error).
- - Functions in this module typically use functions and classes from
- lower-level modules (e.g. kvm_utils.py, kvm_vm.py, kvm_subprocess.py).
- - Functions in this module should not be used by lower-level modules.
- - Functions in this module should be used in the right context.
- For example, a function should not be used where it may display
- misleading or inaccurate info or debug messages.
-
-@copyright: 2008-2009 Red Hat Inc.
-"""
-
-import time, os, logging, re, signal
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-from autotest_lib.client.tools import scan_results
-import aexpect, virt_utils, virt_vm
-
-
-def get_living_vm(env, vm_name):
- """
- Get a VM object from the environment and make sure it's alive.
-
- @param env: Dictionary with test environment.
- @param vm_name: Name of the desired VM object.
- @return: A VM object.
- """
- vm = env.get_vm(vm_name)
- if not vm:
- raise error.TestError("VM '%s' not found in environment" % vm_name)
- if not vm.is_alive():
- raise error.TestError("VM '%s' seems to be dead; test requires a "
- "living VM" % vm_name)
- return vm
-
-
-def wait_for_login(vm, nic_index=0, timeout=240, start=0, step=2, serial=None):
- """
- Try logging into a VM repeatedly. Stop on success or when timeout expires.
-
- @param vm: VM object.
- @param nic_index: Index of NIC to access in the VM.
- @param timeout: Time to wait before giving up.
- @param serial: Whether to use a serial connection instead of a remote
- (ssh, rss) one.
- @return: A shell session object.
- """
- end_time = time.time() + timeout
- session = None
- if serial:
- type = 'serial'
- logging.info("Trying to log into guest %s using serial connection,"
- " timeout %ds", vm.name, timeout)
- time.sleep(start)
- while time.time() < end_time:
- try:
- session = vm.serial_login()
- break
- except virt_utils.LoginError, e:
- logging.debug(e)
- time.sleep(step)
- else:
- type = 'remote'
- logging.info("Trying to log into guest %s using remote connection,"
- " timeout %ds", vm.name, timeout)
- time.sleep(start)
- while time.time() < end_time:
- try:
- session = vm.login(nic_index=nic_index)
- break
- except (virt_utils.LoginError, virt_vm.VMError), e:
- logging.debug(e)
- time.sleep(step)
- if not session:
- raise error.TestFail("Could not log into guest %s using %s connection" %
- (vm.name, type))
- logging.info("Logged into guest %s using %s connection", vm.name, type)
- return session
-
-
-def reboot(vm, session, method="shell", sleep_before_reset=10, nic_index=0,
- timeout=240):
- """
- Reboot the VM and wait for it to come back up by trying to log in until
- timeout expires.
-
- @param vm: VM object.
- @param session: A shell session object.
- @param method: Reboot method. Can be "shell" (send a shell reboot
- command) or "system_reset" (send a system_reset monitor command).
- @param nic_index: Index of NIC to access in the VM, when logging in after
- rebooting.
- @param timeout: Time to wait before giving up (after rebooting).
- @return: A new shell session object.
- """
- if method == "shell":
- # Send a reboot command to the guest's shell
- session.sendline(vm.get_params().get("reboot_command"))
- logging.info("Reboot command sent. Waiting for guest to go down")
- elif method == "system_reset":
- # Sleep for a while before sending the command
- time.sleep(sleep_before_reset)
- # Clear the event list of all QMP monitors
- monitors = [m for m in vm.monitors if m.protocol == "qmp"]
- for m in monitors:
- m.clear_events()
- # Send a system_reset monitor command
- vm.monitor.cmd("system_reset")
- logging.info("Monitor command system_reset sent. Waiting for guest to "
- "go down")
- # Look for RESET QMP events
- time.sleep(1)
- for m in monitors:
- if not m.get_event("RESET"):
- raise error.TestFail("RESET QMP event not received after "
- "system_reset (monitor '%s')" % m.name)
- else:
- logging.info("RESET QMP event received")
- else:
- logging.error("Unknown reboot method: %s", method)
-
- # Wait for the session to become unresponsive and close it
- if not virt_utils.wait_for(lambda: not session.is_responsive(timeout=30),
- 120, 0, 1):
- raise error.TestFail("Guest refuses to go down")
- session.close()
-
- # Try logging into the guest until timeout expires
- logging.info("Guest is down. Waiting for it to go up again, timeout %ds",
- timeout)
- session = vm.wait_for_login(nic_index, timeout=timeout)
- logging.info("Guest is up again")
- return session
-
-
-def migrate(vm, env=None, mig_timeout=3600, mig_protocol="tcp",
- mig_cancel=False, offline=False, stable_check=False,
- clean=False, save_path=None, dest_host='localhost', mig_port=None):
- """
- Migrate a VM locally and re-register it in the environment.
-
- @param vm: The VM to migrate.
- @param env: The environment dictionary. If omitted, the migrated VM will
- not be registered.
- @param mig_timeout: timeout value for migration.
- @param mig_protocol: migration protocol
- @param mig_cancel: Test migrate_cancel or not when protocol is tcp.
- @param dest_host: Destination host (defaults to 'localhost').
- @param mig_port: Port that will be used for migration.
- @return: The post-migration VM, in case of same host migration, True in
- case of multi-host migration.
- """
- def mig_finished():
- o = vm.monitor.info("migrate")
- if isinstance(o, str):
- return "status: active" not in o
- else:
- return o.get("status") != "active"
-
- def mig_succeeded():
- o = vm.monitor.info("migrate")
- if isinstance(o, str):
- return "status: completed" in o
- else:
- return o.get("status") == "completed"
-
- def mig_failed():
- o = vm.monitor.info("migrate")
- if isinstance(o, str):
- return "status: failed" in o
- else:
- return o.get("status") == "failed"
-
- def mig_cancelled():
- o = vm.monitor.info("migrate")
- if isinstance(o, str):
- return ("Migration status: cancelled" in o or
- "Migration status: canceled" in o)
- else:
- return (o.get("status") == "cancelled" or
- o.get("status") == "canceled")
-
- def wait_for_migration():
- if not virt_utils.wait_for(mig_finished, mig_timeout, 2, 2,
- "Waiting for migration to finish"):
- raise error.TestFail("Timeout expired while waiting for migration "
- "to finish")
-
- if dest_host == 'localhost':
- dest_vm = vm.clone()
-
- if (dest_host == 'localhost') and stable_check:
- # Pause the dest vm after creation
- dest_vm.params['extra_params'] = (dest_vm.params.get('extra_params','')
- + ' -S')
-
- if dest_host == 'localhost':
- dest_vm.create(migration_mode=mig_protocol, mac_source=vm)
-
- try:
- try:
- if mig_protocol == "tcp":
- if dest_host == 'localhost':
- uri = "tcp:localhost:%d" % dest_vm.migration_port
- else:
- uri = 'tcp:%s:%d' % (dest_host, mig_port)
- elif mig_protocol == "unix":
- uri = "unix:%s" % dest_vm.migration_file
- elif mig_protocol == "exec":
- uri = '"exec:nc localhost %s"' % dest_vm.migration_port
-
- if offline:
- vm.monitor.cmd("stop")
- vm.monitor.migrate(uri)
-
- if mig_cancel:
- time.sleep(2)
- vm.monitor.cmd("migrate_cancel")
- if not virt_utils.wait_for(mig_cancelled, 60, 2, 2,
- "Waiting for migration "
- "cancellation"):
- raise error.TestFail("Failed to cancel migration")
- if offline:
- vm.monitor.cmd("cont")
- if dest_host == 'localhost':
- dest_vm.destroy(gracefully=False)
- return vm
- else:
- wait_for_migration()
- if (dest_host == 'localhost') and stable_check:
- save_path = None or "/tmp"
- save1 = os.path.join(save_path, "src")
- save2 = os.path.join(save_path, "dst")
-
- vm.save_to_file(save1)
- dest_vm.save_to_file(save2)
-
- # Fail if we see deltas
- md5_save1 = utils.hash_file(save1)
- md5_save2 = utils.hash_file(save2)
- if md5_save1 != md5_save2:
- raise error.TestFail("Mismatch of VM state before "
- "and after migration")
-
- if (dest_host == 'localhost') and offline:
- dest_vm.monitor.cmd("cont")
- except:
- if dest_host == 'localhost':
- dest_vm.destroy()
- raise
-
- finally:
- if (dest_host == 'localhost') and stable_check and clean:
- logging.debug("Cleaning the state files")
- if os.path.isfile(save1):
- os.remove(save1)
- if os.path.isfile(save2):
- os.remove(save2)
-
- # Report migration status
- if mig_succeeded():
- logging.info("Migration finished successfully")
- elif mig_failed():
- raise error.TestFail("Migration failed")
- else:
- raise error.TestFail("Migration ended with unknown status")
-
- if dest_host == 'localhost':
- if "paused" in dest_vm.monitor.info("status"):
- logging.debug("Destination VM is paused, resuming it")
- dest_vm.monitor.cmd("cont")
-
- # Kill the source VM
- vm.destroy(gracefully=False)
-
- # Replace the source VM with the new cloned VM
- if (dest_host == 'localhost') and (env is not None):
- env.register_vm(vm.name, dest_vm)
-
- # Return the new cloned VM
- if dest_host == 'localhost':
- return dest_vm
- else:
- return vm
-
-
-def stop_windows_service(session, service, timeout=120):
- """
- Stop a Windows service using sc.
- If the service is already stopped or is not installed, do nothing.
-
- @param service: The name of the service
- @param timeout: Time duration to wait for service to stop
- @raise error.TestError: Raised if the service can't be stopped
- """
- end_time = time.time() + timeout
- while time.time() < end_time:
- o = session.cmd_output("sc stop %s" % service, timeout=60)
- # FAILED 1060 means the service isn't installed.
- # FAILED 1062 means the service hasn't been started.
- if re.search(r"\bFAILED (1060|1062)\b", o, re.I):
- break
- time.sleep(1)
- else:
- raise error.TestError("Could not stop service '%s'" % service)
-
-
-def start_windows_service(session, service, timeout=120):
- """
- Start a Windows service using sc.
- If the service is already running, do nothing.
- If the service isn't installed, fail.
-
- @param service: The name of the service
- @param timeout: Time duration to wait for service to start
- @raise error.TestError: Raised if the service can't be started
- """
- end_time = time.time() + timeout
- while time.time() < end_time:
- o = session.cmd_output("sc start %s" % service, timeout=60)
- # FAILED 1060 means the service isn't installed.
- if re.search(r"\bFAILED 1060\b", o, re.I):
- raise error.TestError("Could not start service '%s' "
- "(service not installed)" % service)
- # FAILED 1056 means the service is already running.
- if re.search(r"\bFAILED 1056\b", o, re.I):
- break
- time.sleep(1)
- else:
- raise error.TestError("Could not start service '%s'" % service)
-
-
-def get_time(session, time_command, time_filter_re, time_format):
- """
- Return the host time and guest time. If the guest time cannot be fetched
- a TestError exception is raised.
-
- Note that the shell session should be ready to receive commands
- (i.e. should "display" a command prompt and should be done with all
- previous commands).
-
- @param session: A shell session.
- @param time_command: Command to issue to get the current guest time.
- @param time_filter_re: Regex filter to apply on the output of
- time_command in order to get the current time.
- @param time_format: Format string to pass to time.strptime() with the
- result of the regex filter.
- @return: A tuple containing the host time and guest time.
- """
- if len(re.findall("ntpdate|w32tm", time_command)) == 0:
- host_time = time.time()
- s = session.cmd_output(time_command)
-
- try:
- s = re.findall(time_filter_re, s)[0]
- except IndexError:
- logging.debug("The time string from guest is:\n%s", s)
- raise error.TestError("The time string from guest is unexpected.")
- except Exception, e:
- logging.debug("(time_filter_re, time_string): (%s, %s)",
- time_filter_re, s)
- raise e
-
- guest_time = time.mktime(time.strptime(s, time_format))
- else:
- o = session.cmd(time_command)
- if re.match('ntpdate', time_command):
- offset = re.findall('offset (.*) sec', o)[0]
- host_main, host_mantissa = re.findall(time_filter_re, o)[0]
- host_time = (time.mktime(time.strptime(host_main, time_format)) +
- float("0.%s" % host_mantissa))
- guest_time = host_time - float(offset)
- else:
- guest_time = re.findall(time_filter_re, o)[0]
- offset = re.findall("o:(.*)s", o)[0]
- if re.match('PM', guest_time):
- hour = re.findall('\d+ (\d+):', guest_time)[0]
- hour = str(int(hour) + 12)
- guest_time = re.sub('\d+\s\d+:', "\d+\s%s:" % hour,
- guest_time)[:-3]
- else:
- guest_time = guest_time[:-3]
- guest_time = time.mktime(time.strptime(guest_time, time_format))
- host_time = guest_time + float(offset)
-
- return (host_time, guest_time)
-
-
-def get_memory_info(lvms):
- """
- Get memory information from host and guests in format:
- Host: memfree = XXXM; Guests memsh = {XXX,XXX,...}
-
- @params lvms: List of VM objects
- @return: String with memory info report
- """
- if not isinstance(lvms, list):
- raise error.TestError("Invalid list passed to get_stat: %s " % lvms)
-
- try:
- meminfo = "Host: memfree = "
- meminfo += str(int(utils.freememtotal()) / 1024) + "M; "
- meminfo += "swapfree = "
- mf = int(utils.read_from_meminfo("SwapFree")) / 1024
- meminfo += str(mf) + "M; "
- except Exception, e:
- raise error.TestFail("Could not fetch host free memory info, "
- "reason: %s" % e)
-
- meminfo += "Guests memsh = {"
- for vm in lvms:
- shm = vm.get_shared_meminfo()
- if shm is None:
- raise error.TestError("Could not get shared meminfo from "
- "VM %s" % vm)
- meminfo += "%dM; " % shm
- meminfo = meminfo[0:-2] + "}"
-
- return meminfo
-
-
-def run_autotest(vm, session, control_path, timeout, outputdir, params):
- """
- Run an autotest control file inside a guest (linux only utility).
-
- @param vm: VM object.
- @param session: A shell session on the VM provided.
- @param control_path: A path to an autotest control file.
- @param timeout: Timeout under which the autotest control file must complete.
- @param outputdir: Path on host where we should copy the guest autotest
- results to.
-
- The following params is used by the migration
- @param params: Test params used in the migration test
- """
- def copy_if_hash_differs(vm, local_path, remote_path):
- """
- Copy a file to a guest if it doesn't exist or if its MD5sum differs.
-
- @param vm: VM object.
- @param local_path: Local path.
- @param remote_path: Remote path.
-
- @return: Whether the hash differs (True) or not (False).
- """
- hash_differs = False
- local_hash = utils.hash_file(local_path)
- basename = os.path.basename(local_path)
- output = session.cmd_output("md5sum %s" % remote_path)
- if "such file" in output:
- remote_hash = "0"
- elif output:
- remote_hash = output.split()[0]
- else:
- logging.warning("MD5 check for remote path %s did not return.",
- remote_path)
- # Let's be a little more lenient here and see if it wasn't a
- # temporary problem
- remote_hash = "0"
- if remote_hash != local_hash:
- hash_differs = True
- logging.debug("Copying %s to guest "
- "(remote hash: %s, local hash:%s)",
- basename, remote_hash, local_hash)
- vm.copy_files_to(local_path, remote_path)
- return hash_differs
-
-
- def extract(vm, remote_path, dest_dir):
- """
- Extract the autotest .tar.bz2 file on the guest, ensuring the final
- destination path will be dest_dir.
-
- @param vm: VM object
- @param remote_path: Remote file path
- @param dest_dir: Destination dir for the contents
- """
- basename = os.path.basename(remote_path)
- logging.debug("Extracting %s on VM %s", basename, vm.name)
- session.cmd("rm -rf %s" % dest_dir)
- dirname = os.path.dirname(remote_path)
- session.cmd("cd %s" % dirname)
- session.cmd("mkdir -p %s" % os.path.dirname(dest_dir))
- e_cmd = "tar xjvf %s -C %s" % (basename, os.path.dirname(dest_dir))
- output = session.cmd(e_cmd, timeout=120)
- autotest_dirname = ""
- for line in output.splitlines():
- autotest_dirname = line.split("/")[0]
- break
- if autotest_dirname != os.path.basename(dest_dir):
- session.cmd("cd %s" % os.path.dirname(dest_dir))
- session.cmd("mv %s %s" %
- (autotest_dirname, os.path.basename(dest_dir)))
-
-
- def get_results(guest_autotest_path):
- """
- Copy autotest results present on the guest back to the host.
- """
- logging.debug("Trying to copy autotest results from guest")
- guest_results_dir = os.path.join(outputdir, "guest_autotest_results")
- if not os.path.exists(guest_results_dir):
- os.mkdir(guest_results_dir)
- vm.copy_files_from("%s/results/default/*" % guest_autotest_path,
- guest_results_dir)
-
-
- def get_results_summary(guest_autotest_path):
- """
- Get the status of the tests that were executed on the host and close
- the session where autotest was being executed.
- """
- session.cmd("cd %s" % guest_autotest_path)
- output = session.cmd_output("cat results/*/status")
- try:
- results = scan_results.parse_results(output)
- # Report test results
- logging.info("Results (test, status, duration, info):")
- for result in results:
- logging.info(str(result))
- session.close()
- return results
- except Exception, e:
- logging.error("Error processing guest autotest results: %s", e)
- return None
-
-
- if not os.path.isfile(control_path):
- raise error.TestError("Invalid path to autotest control file: %s" %
- control_path)
-
- migrate_background = params.get("migrate_background") == "yes"
- if migrate_background:
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
-
- compressed_autotest_path = "/tmp/autotest.tar.bz2"
- destination_autotest_path = "/usr/local/autotest"
-
- # To avoid problems, let's make the test use the current AUTODIR
- # (autotest client path) location
- autotest_path = os.environ['AUTODIR']
- autotest_basename = os.path.basename(autotest_path)
- autotest_parentdir = os.path.dirname(autotest_path)
-
- # tar the contents of bindir/autotest
- cmd = ("cd %s; tar cvjf %s %s/*" %
- (autotest_parentdir, compressed_autotest_path, autotest_basename))
- # Until we have nested virtualization, we don't need the kvm test :)
- cmd += " --exclude=%s/tests/kvm" % autotest_basename
- cmd += " --exclude=%s/results" % autotest_basename
- cmd += " --exclude=%s/tmp" % autotest_basename
- cmd += " --exclude=%s/control*" % autotest_basename
- cmd += " --exclude=*.pyc"
- cmd += " --exclude=*.svn"
- cmd += " --exclude=*.git"
- utils.run(cmd)
-
- # Copy autotest.tar.bz2
- update = copy_if_hash_differs(vm, compressed_autotest_path,
- compressed_autotest_path)
-
- # Extract autotest.tar.bz2
- if update:
- extract(vm, compressed_autotest_path, destination_autotest_path)
-
- vm.copy_files_to(control_path,
- os.path.join(destination_autotest_path, 'control'))
-
- # Run the test
- logging.info("Running autotest control file %s on guest, timeout %ss",
- os.path.basename(control_path), timeout)
- session.cmd("cd %s" % destination_autotest_path)
- try:
- session.cmd("rm -f control.state")
- session.cmd("rm -rf results/*")
- except aexpect.ShellError:
- pass
- try:
- bg = None
- try:
- logging.info("---------------- Test output ----------------")
- if migrate_background:
- mig_timeout = float(params.get("mig_timeout", "3600"))
- mig_protocol = params.get("migration_protocol", "tcp")
-
- bg = virt_utils.Thread(session.cmd_output,
- kwargs={'cmd': "bin/autotest control",
- 'timeout': timeout,
- 'print_func': logging.info})
-
- bg.start()
-
- while bg.is_alive():
- logging.info("Autotest job did not end, start a round of "
- "migration")
- vm.migrate(timeout=mig_timeout, protocol=mig_protocol)
- else:
- session.cmd_output("bin/autotest control", timeout=timeout,
- print_func=logging.info)
- finally:
- logging.info("------------- End of test output ------------")
- if migrate_background and bg:
- bg.join()
- except aexpect.ShellTimeoutError:
- if vm.is_alive():
- get_results(destination_autotest_path)
- get_results_summary(destination_autotest_path)
- raise error.TestError("Timeout elapsed while waiting for job to "
- "complete")
- else:
- raise error.TestError("Autotest job on guest failed "
- "(VM terminated during job)")
- except aexpect.ShellProcessTerminatedError:
- get_results(destination_autotest_path)
- raise error.TestError("Autotest job on guest failed "
- "(Remote session terminated during job)")
-
- results = get_results_summary(destination_autotest_path)
- get_results(destination_autotest_path)
-
- # Make a list of FAIL/ERROR/ABORT results (make sure FAIL results appear
- # before ERROR results, and ERROR results appear before ABORT results)
- bad_results = [r[0] for r in results if r[1] == "FAIL"]
- bad_results += [r[0] for r in results if r[1] == "ERROR"]
- bad_results += [r[0] for r in results if r[1] == "ABORT"]
-
- # Fail the test if necessary
- if not results:
- raise error.TestFail("Autotest control file run did not produce any "
- "recognizable results")
- if bad_results:
- if len(bad_results) == 1:
- e_msg = ("Test %s failed during control file execution" %
- bad_results[0])
- else:
- e_msg = ("Tests %s failed during control file execution" %
- " ".join(bad_results))
- raise error.TestFail(e_msg)
-
-
-def get_loss_ratio(output):
- """
- Get the packet loss ratio from the output of ping
-.
- @param output: Ping output.
- """
- try:
- return int(re.findall('(\d+)% packet loss', output)[0])
- except IndexError:
- logging.debug(output)
- return -1
-
-
-def raw_ping(command, timeout, session, output_func):
- """
- Low-level ping command execution.
-
- @param command: Ping command.
- @param timeout: Timeout of the ping command.
- @param session: Local executon hint or session to execute the ping command.
- """
- if session is None:
- process = aexpect.run_bg(command, output_func=output_func,
- timeout=timeout)
-
- # Send SIGINT signal to notify the timeout of running ping process,
- # Because ping have the ability to catch the SIGINT signal so we can
- # always get the packet loss ratio even if timeout.
- if process.is_alive():
- virt_utils.kill_process_tree(process.get_pid(), signal.SIGINT)
-
- status = process.get_status()
- output = process.get_output()
-
- process.close()
- return status, output
- else:
- output = ""
- try:
- output = session.cmd_output(command, timeout=timeout,
- print_func=output_func)
- except aexpect.ShellTimeoutError:
- # Send ctrl+c (SIGINT) through ssh session
- session.send("\003")
- try:
- output2 = session.read_up_to_prompt(print_func=output_func)
- output += output2
- except aexpect.ExpectTimeoutError, e:
- output += e.output
- # We also need to use this session to query the return value
- session.send("\003")
-
- session.sendline(session.status_test_command)
- try:
- o2 = session.read_up_to_prompt()
- except aexpect.ExpectError:
- status = -1
- else:
- try:
- status = int(re.findall("\d+", o2)[0])
- except:
- status = -1
-
- return status, output
-
-
-def ping(dest=None, count=None, interval=None, interface=None,
- packetsize=None, ttl=None, hint=None, adaptive=False,
- broadcast=False, flood=False, timeout=0,
- output_func=logging.debug, session=None):
- """
- Wrapper of ping.
-
- @param dest: Destination address.
- @param count: Count of icmp packet.
- @param interval: Interval of two icmp echo request.
- @param interface: Specified interface of the source address.
- @param packetsize: Packet size of icmp.
- @param ttl: IP time to live.
- @param hint: Path mtu discovery hint.
- @param adaptive: Adaptive ping flag.
- @param broadcast: Broadcast ping flag.
- @param flood: Flood ping flag.
- @param timeout: Timeout for the ping command.
- @param output_func: Function used to log the result of ping.
- @param session: Local executon hint or session to execute the ping command.
- """
- if dest is not None:
- command = "ping %s " % dest
- else:
- command = "ping localhost "
- if count is not None:
- command += " -c %s" % count
- if interval is not None:
- command += " -i %s" % interval
- if interface is not None:
- command += " -I %s" % interface
- if packetsize is not None:
- command += " -s %s" % packetsize
- if ttl is not None:
- command += " -t %s" % ttl
- if hint is not None:
- command += " -M %s" % hint
- if adaptive:
- command += " -A"
- if broadcast:
- command += " -b"
- if flood:
- command += " -f -q"
- output_func = None
-
- return raw_ping(command, timeout, session, output_func)
-
-
-def get_linux_ifname(session, mac_address):
- """
- Get the interface name through the mac address.
-
- @param session: session to the virtual machine
- @mac_address: the macaddress of nic
- """
-
- output = session.cmd_output("ifconfig -a")
-
- try:
- ethname = re.findall("(\w+)\s+Link.*%s" % mac_address, output,
- re.IGNORECASE)[0]
- return ethname
- except:
- return None
diff --git a/client/virt/virt_utils.py b/client/virt/virt_utils.py
deleted file mode 100644
index d1344e6..0000000
--- a/client/virt/virt_utils.py
+++ /dev/null
@@ -1,3289 +0,0 @@
-"""
-KVM test utility functions.
-
-@copyright: 2008-2009 Red Hat Inc.
-"""
-
-import time, string, random, socket, os, signal, re, logging, commands, cPickle
-import fcntl, shelve, ConfigParser, threading, sys, UserDict, inspect, tarfile
-import struct, shutil
-from autotest_lib.client.bin import utils, os_dep
-from autotest_lib.client.common_lib import error, logging_config
-import rss_client, aexpect
-try:
- import koji
- KOJI_INSTALLED = True
-except ImportError:
- KOJI_INSTALLED = False
-
-# From include/linux/sockios.h
-SIOCSIFHWADDR = 0x8924
-SIOCGIFHWADDR = 0x8927
-SIOCSIFFLAGS = 0x8914
-SIOCGIFINDEX = 0x8933
-SIOCBRADDIF = 0x89a2
-# From linux/include/linux/if_tun.h
-TUNSETIFF = 0x400454ca
-TUNGETIFF = 0x800454d2
-TUNGETFEATURES = 0x800454cf
-IFF_UP = 0x1
-IFF_TAP = 0x0002
-IFF_NO_PI = 0x1000
-IFF_VNET_HDR = 0x4000
-
-def _lock_file(filename):
- f = open(filename, "w")
- fcntl.lockf(f, fcntl.LOCK_EX)
- return f
-
-
-def _unlock_file(f):
- fcntl.lockf(f, fcntl.LOCK_UN)
- f.close()
-
-
-def is_vm(obj):
- """
- Tests whether a given object is a VM object.
-
- @param obj: Python object.
- """
- return obj.__class__.__name__ == "VM"
-
-
-class NetError(Exception):
- pass
-
-
-class TAPModuleError(NetError):
- def __init__(self, devname, action="open", details=None):
- NetError.__init__(self, devname)
- self.devname = devname
- self.details = details
-
- def __str__(self):
- e_msg = "Can't %s %s" % (self.action, self.devname)
- if self.details is not None:
- e_msg += " : %s" % self.details
- return e_msg
-
-
-class TAPNotExistError(NetError):
- def __init__(self, ifname):
- NetError.__init__(self, ifname)
- self.ifname = ifname
-
- def __str__(self):
- return "Interface %s does not exist" % self.ifname
-
-
-class TAPCreationError(NetError):
- def __init__(self, ifname, details=None):
- NetError.__init__(self, ifname, details)
- self.ifname = ifname
- self.details = details
-
- def __str__(self):
- e_msg = "Cannot create TAP device %s" % self.ifname
- if self.details is not None:
- e_msg += ": %s" % self.details
- return e_msg
-
-
-class TAPBringUpError(NetError):
- def __init__(self, ifname):
- NetError.__init__(self, ifname)
- self.ifname = ifname
-
- def __str__(self):
- return "Cannot bring up TAP %s" % self.ifname
-
-
-class BRAddIfError(NetError):
- def __init__(self, ifname, brname, details):
- NetError.__init__(self, ifname, brname, details)
- self.ifname = ifname
- self.brname = brname
- self.details = details
-
- def __str__(self):
- return ("Can not add if %s to bridge %s: %s" %
- (self.ifname, self.brname, self.details))
-
-
-class HwAddrSetError(NetError):
- def __init__(self, ifname, mac):
- NetError.__init__(self, ifname, mac)
- self.ifname = ifname
- self.mac = mac
-
- def __str__(self):
- return "Can not set mac %s to interface %s" % (self.mac, self.ifname)
-
-
-class HwAddrGetError(NetError):
- def __init__(self, ifname):
- NetError.__init__(self, ifname)
- self.ifname = ifname
-
- def __str__(self):
- return "Can not get mac of interface %s" % self.ifname
-
-
-class Env(UserDict.IterableUserDict):
- """
- A dict-like object containing global objects used by tests.
- """
- def __init__(self, filename=None, version=0):
- """
- Create an empty Env object or load an existing one from a file.
-
- If the version recorded in the file is lower than version, or if some
- error occurs during unpickling, or if filename is not supplied,
- create an empty Env object.
-
- @param filename: Path to an env file.
- @param version: Required env version (int).
- """
- UserDict.IterableUserDict.__init__(self)
- empty = {"version": version}
- if filename:
- self._filename = filename
- try:
- if os.path.isfile(filename):
- f = open(filename, "r")
- env = cPickle.load(f)
- f.close()
- if env.get("version", 0) >= version:
- self.data = env
- else:
- logging.warning("Incompatible env file found. Not using it.")
- self.data = empty
- else:
- # No previous env file found, proceed...
- self.data = empty
- # Almost any exception can be raised during unpickling, so let's
- # catch them all
- except Exception, e:
- logging.warning(e)
- self.data = empty
- else:
- self.data = empty
-
-
- def save(self, filename=None):
- """
- Pickle the contents of the Env object into a file.
-
- @param filename: Filename to pickle the dict into. If not supplied,
- use the filename from which the dict was loaded.
- """
- filename = filename or self._filename
- f = open(filename, "w")
- cPickle.dump(self.data, f)
- f.close()
-
-
- def get_all_vms(self):
- """
- Return a list of all VM objects in this Env object.
- """
- return [o for o in self.values() if is_vm(o)]
-
-
- def get_vm(self, name):
- """
- Return a VM object by its name.
-
- @param name: VM name.
- """
- return self.get("vm__%s" % name)
-
-
- def register_vm(self, name, vm):
- """
- Register a VM in this Env object.
-
- @param name: VM name.
- @param vm: VM object.
- """
- self["vm__%s" % name] = vm
-
-
- def unregister_vm(self, name):
- """
- Remove a given VM.
-
- @param name: VM name.
- """
- del self["vm__%s" % name]
-
-
- def register_installer(self, installer):
- """
- Register a installer that was just run
-
- The installer will be available for other tests, so that
- information about the installed KVM modules and qemu-kvm can be used by
- them.
- """
- self['last_installer'] = installer
-
-
- def previous_installer(self):
- """
- Return the last installer that was registered
- """
- return self.get('last_installer')
-
-
-class Params(UserDict.IterableUserDict):
- """
- A dict-like object passed to every test.
- """
- def objects(self, key):
- """
- Return the names of objects defined using a given key.
-
- @param key: The name of the key whose value lists the objects
- (e.g. 'nics').
- """
- return self.get(key, "").split()
-
-
- def object_params(self, obj_name):
- """
- Return a dict-like object containing the parameters of an individual
- object.
-
- This method behaves as follows: the suffix '_' + obj_name is removed
- from all key names that have it. Other key names are left unchanged.
- The values of keys with the suffix overwrite the values of their
- suffixless versions.
-
- @param obj_name: The name of the object (objects are listed by the
- objects() method).
- """
- suffix = "_" + obj_name
- new_dict = self.copy()
- for key in self:
- if key.endswith(suffix):
- new_key = key.split(suffix)[0]
- new_dict[new_key] = self[key]
- return new_dict
-
-
-# Functions related to MAC/IP addresses
-
-def _open_mac_pool(lock_mode):
- lock_file = open("/tmp/mac_lock", "w+")
- fcntl.lockf(lock_file, lock_mode)
- pool = shelve.open("/tmp/address_pool")
- return pool, lock_file
-
-
-def _close_mac_pool(pool, lock_file):
- pool.close()
- fcntl.lockf(lock_file, fcntl.LOCK_UN)
- lock_file.close()
-
-
-def _generate_mac_address_prefix(mac_pool):
- """
- Generate a random MAC address prefix and add it to the MAC pool dictionary.
- If there's a MAC prefix there already, do not update the MAC pool and just
- return what's in there. By convention we will set KVM autotest MAC
- addresses to start with 0x9a.
-
- @param mac_pool: The MAC address pool object.
- @return: The MAC address prefix.
- """
- if "prefix" in mac_pool:
- prefix = mac_pool["prefix"]
- else:
- r = random.SystemRandom()
- prefix = "9a:%02x:%02x:%02x:" % (r.randint(0x00, 0xff),
- r.randint(0x00, 0xff),
- r.randint(0x00, 0xff))
- mac_pool["prefix"] = prefix
- return prefix
-
-
-def generate_mac_address(vm_instance, nic_index):
- """
- Randomly generate a MAC address and add it to the MAC address pool.
-
- Try to generate a MAC address based on a randomly generated MAC address
- prefix and add it to a persistent dictionary.
- key = VM instance + NIC index, value = MAC address
- e.g. {'20100310-165222-Wt7l:0': '9a:5d:94:6a:9b:f9'}
-
- @param vm_instance: The instance attribute of a VM.
- @param nic_index: The index of the NIC.
- @return: MAC address string.
- """
- mac_pool, lock_file = _open_mac_pool(fcntl.LOCK_EX)
- key = "%s:%s" % (vm_instance, nic_index)
- if key in mac_pool:
- mac = mac_pool[key]
- else:
- prefix = _generate_mac_address_prefix(mac_pool)
- r = random.SystemRandom()
- while key not in mac_pool:
- mac = prefix + "%02x:%02x" % (r.randint(0x00, 0xff),
- r.randint(0x00, 0xff))
- if mac in mac_pool.values():
- continue
- mac_pool[key] = mac
- _close_mac_pool(mac_pool, lock_file)
- return mac
-
-
-def free_mac_address(vm_instance, nic_index):
- """
- Remove a MAC address from the address pool.
-
- @param vm_instance: The instance attribute of a VM.
- @param nic_index: The index of the NIC.
- """
- mac_pool, lock_file = _open_mac_pool(fcntl.LOCK_EX)
- key = "%s:%s" % (vm_instance, nic_index)
- if key in mac_pool:
- del mac_pool[key]
- _close_mac_pool(mac_pool, lock_file)
-
-
-def set_mac_address(vm_instance, nic_index, mac):
- """
- Set a MAC address in the pool.
-
- @param vm_instance: The instance attribute of a VM.
- @param nic_index: The index of the NIC.
- """
- mac_pool, lock_file = _open_mac_pool(fcntl.LOCK_EX)
- mac_pool["%s:%s" % (vm_instance, nic_index)] = mac
- _close_mac_pool(mac_pool, lock_file)
-
-
-def get_mac_address(vm_instance, nic_index):
- """
- Return a MAC address from the pool.
-
- @param vm_instance: The instance attribute of a VM.
- @param nic_index: The index of the NIC.
- @return: MAC address string.
- """
- mac_pool, lock_file = _open_mac_pool(fcntl.LOCK_SH)
- mac = mac_pool.get("%s:%s" % (vm_instance, nic_index))
- _close_mac_pool(mac_pool, lock_file)
- return mac
-
-
-def verify_ip_address_ownership(ip, macs, timeout=10.0):
- """
- Use arping and the ARP cache to make sure a given IP address belongs to one
- of the given MAC addresses.
-
- @param ip: An IP address.
- @param macs: A list or tuple of MAC addresses.
- @return: True iff ip is assigned to a MAC address in macs.
- """
- # Compile a regex that matches the given IP address and any of the given
- # MAC addresses
- mac_regex = "|".join("(%s)" % mac for mac in macs)
- regex = re.compile(r"\b%s\b.*\b(%s)\b" % (ip, mac_regex), re.IGNORECASE)
-
- # Check the ARP cache
- o = commands.getoutput("%s -n" % find_command("arp"))
- if regex.search(o):
- return True
-
- # Get the name of the bridge device for arping
- o = commands.getoutput("%s route get %s" % (find_command("ip"), ip))
- dev = re.findall("dev\s+\S+", o, re.IGNORECASE)
- if not dev:
- return False
- dev = dev[0].split()[-1]
-
- # Send an ARP request
- o = commands.getoutput("%s -f -c 3 -I %s %s" %
- (find_command("arping"), dev, ip))
- return bool(regex.search(o))
-
-
-# Utility functions for dealing with external processes
-
-def find_command(cmd):
- for dir in ["/usr/local/sbin", "/usr/local/bin",
- "/usr/sbin", "/usr/bin", "/sbin", "/bin"]:
- file = os.path.join(dir, cmd)
- if os.path.exists(file):
- return file
- raise ValueError('Missing command: %s' % cmd)
-
-
-def pid_exists(pid):
- """
- Return True if a given PID exists.
-
- @param pid: Process ID number.
- """
- try:
- os.kill(pid, 0)
- return True
- except:
- return False
-
-
-def safe_kill(pid, signal):
- """
- Attempt to send a signal to a given process that may or may not exist.
-
- @param signal: Signal number.
- """
- try:
- os.kill(pid, signal)
- return True
- except:
- return False
-
-
-def kill_process_tree(pid, sig=signal.SIGKILL):
- """Signal a process and all of its children.
-
- If the process does not exist -- return.
-
- @param pid: The pid of the process to signal.
- @param sig: The signal to send to the processes.
- """
- if not safe_kill(pid, signal.SIGSTOP):
- return
- children = commands.getoutput("ps --ppid=%d -o pid=" % pid).split()
- for child in children:
- kill_process_tree(int(child), sig)
- safe_kill(pid, sig)
- safe_kill(pid, signal.SIGCONT)
-
-
-def get_git_branch(repository, branch, srcdir, commit=None, lbranch=None):
- """
- Retrieves a given git code repository.
-
- @param repository: Git repository URL
- """
- logging.info("Fetching git [REP '%s' BRANCH '%s' COMMIT '%s'] -> %s",
- repository, branch, commit, srcdir)
- if not os.path.exists(srcdir):
- os.makedirs(srcdir)
- os.chdir(srcdir)
-
- if os.path.exists(".git"):
- utils.system("git reset --hard")
- else:
- utils.system("git init")
-
- if not lbranch:
- lbranch = branch
-
- utils.system("git fetch -q -f -u -t %s %s:%s" %
- (repository, branch, lbranch))
- utils.system("git checkout %s" % lbranch)
- if commit:
- utils.system("git checkout %s" % commit)
-
- h = utils.system_output('git log --pretty=format:"%H" -1')
- try:
- desc = "tag %s" % utils.system_output("git describe")
- except error.CmdError:
- desc = "no tag found"
-
- logging.info("Commit hash for %s is %s (%s)", repository, h.strip(), desc)
- return srcdir
-
-
-def check_kvm_source_dir(source_dir):
- """
- Inspects the kvm source directory and verifies its disposition. In some
- occasions build may be dependant on the source directory disposition.
- The reason why the return codes are numbers is that we might have more
- changes on the source directory layout, so it's not scalable to just use
- strings like 'old_repo', 'new_repo' and such.
-
- @param source_dir: Source code path that will be inspected.
- """
- os.chdir(source_dir)
- has_qemu_dir = os.path.isdir('qemu')
- has_kvm_dir = os.path.isdir('kvm')
- if has_qemu_dir:
- logging.debug("qemu directory detected, source dir layout 1")
- return 1
- if has_kvm_dir and not has_qemu_dir:
- logging.debug("kvm directory detected, source dir layout 2")
- return 2
- else:
- raise error.TestError("Unknown source dir layout, cannot proceed.")
-
-
-# Functions and classes used for logging into guests and transferring files
-
-class LoginError(Exception):
- def __init__(self, msg, output):
- Exception.__init__(self, msg, output)
- self.msg = msg
- self.output = output
-
- def __str__(self):
- return "%s (output: %r)" % (self.msg, self.output)
-
-
-class LoginAuthenticationError(LoginError):
- pass
-
-
-class LoginTimeoutError(LoginError):
- def __init__(self, output):
- LoginError.__init__(self, "Login timeout expired", output)
-
-
-class LoginProcessTerminatedError(LoginError):
- def __init__(self, status, output):
- LoginError.__init__(self, None, output)
- self.status = status
-
- def __str__(self):
- return ("Client process terminated (status: %s, output: %r)" %
- (self.status, self.output))
-
-
-class LoginBadClientError(LoginError):
- def __init__(self, client):
- LoginError.__init__(self, None, None)
- self.client = client
-
- def __str__(self):
- return "Unknown remote shell client: %r" % self.client
-
-
-class SCPError(Exception):
- def __init__(self, msg, output):
- Exception.__init__(self, msg, output)
- self.msg = msg
- self.output = output
-
- def __str__(self):
- return "%s (output: %r)" % (self.msg, self.output)
-
-
-class SCPAuthenticationError(SCPError):
- pass
-
-
-class SCPAuthenticationTimeoutError(SCPAuthenticationError):
- def __init__(self, output):
- SCPAuthenticationError.__init__(self, "Authentication timeout expired",
- output)
-
-
-class SCPTransferTimeoutError(SCPError):
- def __init__(self, output):
- SCPError.__init__(self, "Transfer timeout expired", output)
-
-
-class SCPTransferFailedError(SCPError):
- def __init__(self, status, output):
- SCPError.__init__(self, None, output)
- self.status = status
-
- def __str__(self):
- return ("SCP transfer failed (status: %s, output: %r)" %
- (self.status, self.output))
-
-
-def _remote_login(session, username, password, prompt, timeout=10):
- """
- Log into a remote host (guest) using SSH or Telnet. Wait for questions
- and provide answers. If timeout expires while waiting for output from the
- child (e.g. a password prompt or a shell prompt) -- fail.
-
- @brief: Log into a remote host (guest) using SSH or Telnet.
-
- @param session: An Expect or ShellSession instance to operate on
- @param username: The username to send in reply to a login prompt
- @param password: The password to send in reply to a password prompt
- @param prompt: The shell prompt that indicates a successful login
- @param timeout: The maximal time duration (in seconds) to wait for each
- step of the login procedure (i.e. the "Are you sure" prompt, the
- password prompt, the shell prompt, etc)
- @raise LoginTimeoutError: If timeout expires
- @raise LoginAuthenticationError: If authentication fails
- @raise LoginProcessTerminatedError: If the client terminates during login
- @raise LoginError: If some other error occurs
- """
- password_prompt_count = 0
- login_prompt_count = 0
-
- while True:
- try:
- match, text = session.read_until_last_line_matches(
- [r"[Aa]re you sure", r"[Pp]assword:\s*$", r"[Ll]ogin:\s*$",
- r"[Cc]onnection.*closed", r"[Cc]onnection.*refused",
- r"[Pp]lease wait", r"[Ww]arning", prompt],
- timeout=timeout, internal_timeout=0.5)
- if match == 0: # "Are you sure you want to continue connecting"
- logging.debug("Got 'Are you sure...', sending 'yes'")
- session.sendline("yes")
- continue
- elif match == 1: # "password:"
- if password_prompt_count == 0:
- logging.debug("Got password prompt, sending '%s'", password)
- session.sendline(password)
- password_prompt_count += 1
- continue
- else:
- raise LoginAuthenticationError("Got password prompt twice",
- text)
- elif match == 2: # "login:"
- if login_prompt_count == 0 and password_prompt_count == 0:
- logging.debug("Got username prompt; sending '%s'", username)
- session.sendline(username)
- login_prompt_count += 1
- continue
- else:
- if login_prompt_count > 0:
- msg = "Got username prompt twice"
- else:
- msg = "Got username prompt after password prompt"
- raise LoginAuthenticationError(msg, text)
- elif match == 3: # "Connection closed"
- raise LoginError("Client said 'connection closed'", text)
- elif match == 4: # "Connection refused"
- raise LoginError("Client said 'connection refused'", text)
- elif match == 5: # "Please wait"
- logging.debug("Got 'Please wait'")
- timeout = 30
- continue
- elif match == 6: # "Warning added RSA"
- logging.debug("Got 'Warning added RSA to known host list")
- continue
- elif match == 7: # prompt
- logging.debug("Got shell prompt -- logged in")
- break
- except aexpect.ExpectTimeoutError, e:
- raise LoginTimeoutError(e.output)
- except aexpect.ExpectProcessTerminatedError, e:
- raise LoginProcessTerminatedError(e.status, e.output)
-
-
-def remote_login(client, host, port, username, password, prompt, linesep="\n",
- log_filename=None, timeout=10):
- """
- Log into a remote host (guest) using SSH/Telnet/Netcat.
-
- @param client: The client to use ('ssh', 'telnet' or 'nc')
- @param host: Hostname or IP address
- @param port: Port to connect to
- @param username: Username (if required)
- @param password: Password (if required)
- @param prompt: Shell prompt (regular expression)
- @param linesep: The line separator to use when sending lines
- (e.g. '\\n' or '\\r\\n')
- @param log_filename: If specified, log all output to this file
- @param timeout: The maximal time duration (in seconds) to wait for
- each step of the login procedure (i.e. the "Are you sure" prompt
- or the password prompt)
- @raise LoginBadClientError: If an unknown client is requested
- @raise: Whatever _remote_login() raises
- @return: A ShellSession object.
- """
- if client == "ssh":
- cmd = ("ssh -o UserKnownHostsFile=/dev/null "
- "-o PreferredAuthentications=password -p %s %s@%s" %
- (port, username, host))
- elif client == "telnet":
- cmd = "telnet -l %s %s %s" % (username, host, port)
- elif client == "nc":
- cmd = "nc %s %s" % (host, port)
- else:
- raise LoginBadClientError(client)
-
- logging.debug("Trying to login with command '%s'", cmd)
- session = aexpect.ShellSession(cmd, linesep=linesep, prompt=prompt)
- try:
- _remote_login(session, username, password, prompt, timeout)
- except:
- session.close()
- raise
- if log_filename:
- session.set_output_func(log_line)
- session.set_output_params((log_filename,))
- return session
-
-
-def wait_for_login(client, host, port, username, password, prompt, linesep="\n",
- log_filename=None, timeout=240, internal_timeout=10):
- """
- Make multiple attempts to log into a remote host (guest) until one succeeds
- or timeout expires.
-
- @param timeout: Total time duration to wait for a successful login
- @param internal_timeout: The maximal time duration (in seconds) to wait for
- each step of the login procedure (e.g. the "Are you sure" prompt
- or the password prompt)
- @see: remote_login()
- @raise: Whatever remote_login() raises
- @return: A ShellSession object.
- """
- logging.debug("Attempting to log into %s:%s using %s (timeout %ds)",
- host, port, client, timeout)
- end_time = time.time() + timeout
- while time.time() < end_time:
- try:
- return remote_login(client, host, port, username, password, prompt,
- linesep, log_filename, internal_timeout)
- except LoginError, e:
- logging.debug(e)
- time.sleep(2)
- # Timeout expired; try one more time but don't catch exceptions
- return remote_login(client, host, port, username, password, prompt,
- linesep, log_filename, internal_timeout)
-
-
-def _remote_scp(session, password_list, transfer_timeout=600, login_timeout=10):
- """
- Transfer file(s) to a remote host (guest) using SCP. Wait for questions
- and provide answers. If login_timeout expires while waiting for output
- from the child (e.g. a password prompt), fail. If transfer_timeout expires
- while waiting for the transfer to complete, fail.
-
- @brief: Transfer files using SCP, given a command line.
-
- @param session: An Expect or ShellSession instance to operate on
- @param password_list: Password list to send in reply to the password prompt
- @param transfer_timeout: The time duration (in seconds) to wait for the
- transfer to complete.
- @param login_timeout: The maximal time duration (in seconds) to wait for
- each step of the login procedure (i.e. the "Are you sure" prompt or
- the password prompt)
- @raise SCPAuthenticationError: If authentication fails
- @raise SCPTransferTimeoutError: If the transfer fails to complete in time
- @raise SCPTransferFailedError: If the process terminates with a nonzero
- exit code
- @raise SCPError: If some other error occurs
- """
- password_prompt_count = 0
- timeout = login_timeout
- authentication_done = False
-
- scp_type = len(password_list)
-
- while True:
- try:
- match, text = session.read_until_last_line_matches(
- [r"[Aa]re you sure", r"[Pp]assword:\s*$", r"lost connection"],
- timeout=timeout, internal_timeout=0.5)
- if match == 0: # "Are you sure you want to continue connecting"
- logging.debug("Got 'Are you sure...', sending 'yes'")
- session.sendline("yes")
- continue
- elif match == 1: # "password:"
- if password_prompt_count == 0:
- logging.debug("Got password prompt, sending '%s'" %
- password_list[password_prompt_count])
- session.sendline(password_list[password_prompt_count])
- password_prompt_count += 1
- timeout = transfer_timeout
- if scp_type == 1:
- authentication_done = True
- continue
- elif password_prompt_count == 1 and scp_type == 2:
- logging.debug("Got password prompt, sending '%s'" %
- password_list[password_prompt_count])
- session.sendline(password_list[password_prompt_count])
- password_prompt_count += 1
- timeout = transfer_timeout
- authentication_done = True
- continue
- else:
- raise SCPAuthenticationError("Got password prompt twice",
- text)
- elif match == 2: # "lost connection"
- raise SCPError("SCP client said 'lost connection'", text)
- except aexpect.ExpectTimeoutError, e:
- if authentication_done:
- raise SCPTransferTimeoutError(e.output)
- else:
- raise SCPAuthenticationTimeoutError(e.output)
- except aexpect.ExpectProcessTerminatedError, e:
- if e.status == 0:
- logging.debug("SCP process terminated with status 0")
- break
- else:
- raise SCPTransferFailedError(e.status, e.output)
-
-
-def remote_scp(command, password_list, log_filename=None, transfer_timeout=600,
- login_timeout=10):
- """
- Transfer file(s) to a remote host (guest) using SCP.
-
- @brief: Transfer files using SCP, given a command line.
-
- @param command: The command to execute
- (e.g. "scp -r foobar root@localhost:/tmp/").
- @param password_list: Password list to send in reply to a password prompt.
- @param log_filename: If specified, log all output to this file
- @param transfer_timeout: The time duration (in seconds) to wait for the
- transfer to complete.
- @param login_timeout: The maximal time duration (in seconds) to wait for
- each step of the login procedure (i.e. the "Are you sure" prompt
- or the password prompt)
- @raise: Whatever _remote_scp() raises
- """
- logging.debug("Trying to SCP with command '%s', timeout %ss",
- command, transfer_timeout)
- if log_filename:
- output_func = log_line
- output_params = (log_filename,)
- else:
- output_func = None
- output_params = ()
- session = aexpect.Expect(command,
- output_func=output_func,
- output_params=output_params)
- try:
- _remote_scp(session, password_list, transfer_timeout, login_timeout)
- finally:
- session.close()
-
-
-def scp_to_remote(host, port, username, password, local_path, remote_path,
- log_filename=None, timeout=600):
- """
- Copy files to a remote host (guest) through scp.
-
- @param host: Hostname or IP address
- @param username: Username (if required)
- @param password: Password (if required)
- @param local_path: Path on the local machine where we are copying from
- @param remote_path: Path on the remote machine where we are copying to
- @param log_filename: If specified, log all output to this file
- @param timeout: The time duration (in seconds) to wait for the transfer
- to complete.
- @raise: Whatever remote_scp() raises
- """
- command = ("scp -v -o UserKnownHostsFile=/dev/null "
- "-o PreferredAuthentications=password -r -P %s %s %s@%s:%s" %
- (port, local_path, username, host, remote_path))
- password_list = []
- password_list.append(password)
- return remote_scp(command, password_list, log_filename, timeout)
-
-
-
-def scp_from_remote(host, port, username, password, remote_path, local_path,
- log_filename=None, timeout=600):
- """
- Copy files from a remote host (guest).
-
- @param host: Hostname or IP address
- @param username: Username (if required)
- @param password: Password (if required)
- @param local_path: Path on the local machine where we are copying from
- @param remote_path: Path on the remote machine where we are copying to
- @param log_filename: If specified, log all output to this file
- @param timeout: The time duration (in seconds) to wait for the transfer
- to complete.
- @raise: Whatever remote_scp() raises
- """
- command = ("scp -v -o UserKnownHostsFile=/dev/null "
- "-o PreferredAuthentications=password -r -P %s %s@%s:%s %s" %
- (port, username, host, remote_path, local_path))
- password_list = []
- password_list.append(password)
- remote_scp(command, password_list, log_filename, timeout)
-
-
-def scp_between_remotes(src, dst, port, s_passwd, d_passwd, s_name, d_name,
- s_path, d_path, log_filename=None, timeout=600):
- """
- Copy files from a remote host (guest) to another remote host (guest).
-
- @param src/dst: Hostname or IP address of src and dst
- @param s_name/d_name: Username (if required)
- @param s_passwd/d_passwd: Password (if required)
- @param s_path/d_path: Path on the remote machine where we are copying
- from/to
- @param log_filename: If specified, log all output to this file
- @param timeout: The time duration (in seconds) to wait for the transfer
- to complete.
-
- @return: True on success and False on failure.
- """
- command = ("scp -v -o UserKnownHostsFile=/dev/null -o "
- "PreferredAuthentications=password -r -P %s %s@%s:%s %s@%s:%s" %
- (port, s_name, src, s_path, d_name, dst, d_path))
- password_list = []
- password_list.append(s_passwd)
- password_list.append(d_passwd)
- return remote_scp(command, password_list, log_filename, timeout)
-
-
-def copy_files_to(address, client, username, password, port, local_path,
- remote_path, log_filename=None, verbose=False, timeout=600):
- """
- Copy files to a remote host (guest) using the selected client.
-
- @param client: Type of transfer client
- @param username: Username (if required)
- @param password: Password (if requried)
- @param local_path: Path on the local machine where we are copying from
- @param remote_path: Path on the remote machine where we are copying to
- @param address: Address of remote host(guest)
- @param log_filename: If specified, log all output to this file (SCP only)
- @param verbose: If True, log some stats using logging.debug (RSS only)
- @param timeout: The time duration (in seconds) to wait for the transfer to
- complete.
- @raise: Whatever remote_scp() raises
- """
- if client == "scp":
- scp_to_remote(address, port, username, password, local_path,
- remote_path, log_filename, timeout)
- elif client == "rss":
- log_func = None
- if verbose:
- log_func = logging.debug
- c = rss_client.FileUploadClient(address, port, log_func)
- c.upload(local_path, remote_path, timeout)
- c.close()
-
-
-def copy_files_from(address, client, username, password, port, remote_path,
- local_path, log_filename=None, verbose=False, timeout=600):
- """
- Copy files from a remote host (guest) using the selected client.
-
- @param client: Type of transfer client
- @param username: Username (if required)
- @param password: Password (if requried)
- @param remote_path: Path on the remote machine where we are copying from
- @param local_path: Path on the local machine where we are copying to
- @param address: Address of remote host(guest)
- @param log_filename: If specified, log all output to this file (SCP only)
- @param verbose: If True, log some stats using logging.debug (RSS only)
- @param timeout: The time duration (in seconds) to wait for the transfer to
- complete.
- @raise: Whatever remote_scp() raises
- """
- if client == "scp":
- scp_from_remote(address, port, username, password, remote_path,
- local_path, log_filename, timeout)
- elif client == "rss":
- log_func = None
- if verbose:
- log_func = logging.debug
- c = rss_client.FileDownloadClient(address, port, log_func)
- c.download(remote_path, local_path, timeout)
- c.close()
-
-
-# The following are utility functions related to ports.
-
-def is_port_free(port, address):
- """
- Return True if the given port is available for use.
-
- @param port: Port number
- """
- try:
- s = socket.socket()
- #s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- if address == "localhost":
- s.bind(("localhost", port))
- free = True
- else:
- s.connect((address, port))
- free = False
- except socket.error:
- if address == "localhost":
- free = False
- else:
- free = True
- s.close()
- return free
-
-
-def find_free_port(start_port, end_port, address="localhost"):
- """
- Return a host free port in the range [start_port, end_port].
-
- @param start_port: First port that will be checked.
- @param end_port: Port immediately after the last one that will be checked.
- """
- for i in range(start_port, end_port):
- if is_port_free(i, address):
- return i
- return None
-
-
-def find_free_ports(start_port, end_port, count, address="localhost"):
- """
- Return count of host free ports in the range [start_port, end_port].
-
- @count: Initial number of ports known to be free in the range.
- @param start_port: First port that will be checked.
- @param end_port: Port immediately after the last one that will be checked.
- """
- ports = []
- i = start_port
- while i < end_port and count > 0:
- if is_port_free(i, address):
- ports.append(i)
- count -= 1
- i += 1
- return ports
-
-
-# An easy way to log lines to files when the logging system can't be used
-
-_open_log_files = {}
-_log_file_dir = "/tmp"
-
-
-def log_line(filename, line):
- """
- Write a line to a file. '\n' is appended to the line.
-
- @param filename: Path of file to write to, either absolute or relative to
- the dir set by set_log_file_dir().
- @param line: Line to write.
- """
- global _open_log_files, _log_file_dir
- if filename not in _open_log_files:
- path = get_path(_log_file_dir, filename)
- try:
- os.makedirs(os.path.dirname(path))
- except OSError:
- pass
- _open_log_files[filename] = open(path, "w")
- timestr = time.strftime("%Y-%m-%d %H:%M:%S")
- _open_log_files[filename].write("%s: %s\n" % (timestr, line))
- _open_log_files[filename].flush()
-
-
-def set_log_file_dir(dir):
- """
- Set the base directory for log files created by log_line().
-
- @param dir: Directory for log files.
- """
- global _log_file_dir
- _log_file_dir = dir
-
-
-# The following are miscellaneous utility functions.
-
-def get_path(base_path, user_path):
- """
- Translate a user specified path to a real path.
- If user_path is relative, append it to base_path.
- If user_path is absolute, return it as is.
-
- @param base_path: The base path of relative user specified paths.
- @param user_path: The user specified path.
- """
- if os.path.isabs(user_path):
- return user_path
- else:
- return os.path.join(base_path, user_path)
-
-
-def generate_random_string(length):
- """
- Return a random string using alphanumeric characters.
-
- @length: length of the string that will be generated.
- """
- r = random.SystemRandom()
- str = ""
- chars = string.letters + string.digits
- while length > 0:
- str += r.choice(chars)
- length -= 1
- return str
-
-def generate_random_id():
- """
- Return a random string suitable for use as a qemu id.
- """
- return "id" + generate_random_string(6)
-
-
-def generate_tmp_file_name(file, ext=None, dir='/tmp/'):
- """
- Returns a temporary file name. The file is not created.
- """
- while True:
- file_name = (file + '-' + time.strftime("%Y%m%d-%H%M%S-") +
- generate_random_string(4))
- if ext:
- file_name += '.' + ext
- file_name = os.path.join(dir, file_name)
- if not os.path.exists(file_name):
- break
-
- return file_name
-
-
-def format_str_for_message(str):
- """
- Format str so that it can be appended to a message.
- If str consists of one line, prefix it with a space.
- If str consists of multiple lines, prefix it with a newline.
-
- @param str: string that will be formatted.
- """
- lines = str.splitlines()
- num_lines = len(lines)
- str = "\n".join(lines)
- if num_lines == 0:
- return ""
- elif num_lines == 1:
- return " " + str
- else:
- return "\n" + str
-
-
-def wait_for(func, timeout, first=0.0, step=1.0, text=None):
- """
- If func() evaluates to True before timeout expires, return the
- value of func(). Otherwise return None.
-
- @brief: Wait until func() evaluates to True.
-
- @param timeout: Timeout in seconds
- @param first: Time to sleep before first attempt
- @param steps: Time to sleep between attempts in seconds
- @param text: Text to print while waiting, for debug purposes
- """
- start_time = time.time()
- end_time = time.time() + timeout
-
- time.sleep(first)
-
- while time.time() < end_time:
- if text:
- logging.debug("%s (%f secs)", text, (time.time() - start_time))
-
- output = func()
- if output:
- return output
-
- time.sleep(step)
-
- return None
-
-
-def get_hash_from_file(hash_path, dvd_basename):
- """
- Get the a hash from a given DVD image from a hash file
- (Hash files are usually named MD5SUM or SHA1SUM and are located inside the
- download directories of the DVDs)
-
- @param hash_path: Local path to a hash file.
- @param cd_image: Basename of a CD image
- """
- hash_file = open(hash_path, 'r')
- for line in hash_file.readlines():
- if dvd_basename in line:
- return line.split()[0]
-
-
-def run_tests(parser, job):
- """
- Runs the sequence of KVM tests based on the list of dictionaries
- generated by the configuration system, handling dependencies.
-
- @param parser: Config parser object.
- @param job: Autotest job object.
-
- @return: True, if all tests ran passed, False if any of them failed.
- """
- for i, d in enumerate(parser.get_dicts()):
- logging.info("Test %4d: %s" % (i + 1, d["shortname"]))
-
- status_dict = {}
- failed = False
-
- for dict in parser.get_dicts():
- if dict.get("skip") == "yes":
- continue
- dependencies_satisfied = True
- for dep in dict.get("dep"):
- for test_name in status_dict.keys():
- if not dep in test_name:
- continue
- # So the only really non-fatal state is WARN,
- # All the others make it not safe to proceed with dependency
- # execution
- if status_dict[test_name] not in ['GOOD', 'WARN']:
- dependencies_satisfied = False
- break
- test_iterations = int(dict.get("iterations", 1))
- test_tag = dict.get("shortname")
-
- if dependencies_satisfied:
- # Setting up profilers during test execution.
- profilers = dict.get("profilers", "").split()
- for profiler in profilers:
- job.profilers.add(profiler)
- # We need only one execution, profiled, hence we're passing
- # the profile_only parameter to job.run_test().
- profile_only = bool(profilers) or None
- current_status = job.run_test_detail(dict.get("vm_type"),
- params=dict,
- tag=test_tag,
- iterations=test_iterations,
- profile_only=profile_only)
- for profiler in profilers:
- job.profilers.delete(profiler)
- else:
- # We will force the test to fail as TestNA during preprocessing
- dict['dependency_failed'] = 'yes'
- current_status = job.run_test_detail(dict.get("vm_type"),
- params=dict,
- tag=test_tag,
- iterations=test_iterations)
-
- if not current_status:
- failed = True
- status_dict[dict.get("name")] = current_status
-
- return not failed
-
-
-def display_attributes(instance):
- """
- Inspects a given class instance attributes and displays them, convenient
- for debugging.
- """
- logging.debug("Attributes set:")
- for member in inspect.getmembers(instance):
- name, value = member
- attribute = getattr(instance, name)
- if not (name.startswith("__") or callable(attribute) or not value):
- logging.debug(" %s: %s", name, value)
-
-
-def get_full_pci_id(pci_id):
- """
- Get full PCI ID of pci_id.
-
- @param pci_id: PCI ID of a device.
- """
- cmd = "lspci -D | awk '/%s/ {print $1}'" % pci_id
- status, full_id = commands.getstatusoutput(cmd)
- if status != 0:
- return None
- return full_id
-
-
-def get_vendor_from_pci_id(pci_id):
- """
- Check out the device vendor ID according to pci_id.
-
- @param pci_id: PCI ID of a device.
- """
- cmd = "lspci -n | awk '/%s/ {print $3}'" % pci_id
- return re.sub(":", " ", commands.getoutput(cmd))
-
-
-def get_cpu_flags():
- """
- Returns a list of the CPU flags
- """
- flags_re = re.compile(r'^flags\s*:(.*)')
- for line in open('/proc/cpuinfo').readlines():
- match = flags_re.match(line)
- if match:
- return match.groups()[0].split()
- return []
-
-
-def get_cpu_vendor(cpu_flags=[], verbose=True):
- """
- Returns the name of the CPU vendor, either intel, amd or unknown
- """
- if not cpu_flags:
- cpu_flags = get_cpu_flags()
-
- if 'vmx' in cpu_flags:
- vendor = 'intel'
- elif 'svm' in cpu_flags:
- vendor = 'amd'
- else:
- vendor = 'unknown'
-
- if verbose:
- logging.debug("Detected CPU vendor as '%s'", vendor)
- return vendor
-
-
-def get_archive_tarball_name(source_dir, tarball_name, compression):
- '''
- Get the name for a tarball file, based on source, name and compression
- '''
- if tarball_name is None:
- tarball_name = os.path.basename(source_dir)
-
- if not tarball_name.endswith('.tar'):
- tarball_name = '%s.tar' % tarball_name
-
- if compression and not tarball_name.endswith('.%s' % compression):
- tarball_name = '%s.%s' % (tarball_name, compression)
-
- return tarball_name
-
-
-def archive_as_tarball(source_dir, dest_dir, tarball_name=None,
- compression='bz2', verbose=True):
- '''
- Saves the given source directory to the given destination as a tarball
-
- If the name of the archive is omitted, it will be taken from the
- source_dir. If it is an absolute path, dest_dir will be ignored. But,
- if both the destination directory and tarball anem is given, and the
- latter is not an absolute path, they will be combined.
-
- For archiving directory '/tmp' in '/net/server/backup' as file
- 'tmp.tar.bz2', simply use:
-
- >>> virt_utils.archive_as_tarball('/tmp', '/net/server/backup')
-
- To save the file it with a different name, say 'host1-tmp.tar.bz2'
- and save it under '/net/server/backup', use:
-
- >>> virt_utils.archive_as_tarball('/tmp', '/net/server/backup',
- 'host1-tmp')
-
- To save with gzip compression instead (resulting in the file
- '/net/server/backup/host1-tmp.tar.gz'), use:
-
- >>> virt_utils.archive_as_tarball('/tmp', '/net/server/backup',
- 'host1-tmp', 'gz')
- '''
- tarball_name = get_archive_tarball_name(source_dir,
- tarball_name,
- compression)
- if not os.path.isabs(tarball_name):
- tarball_path = os.path.join(dest_dir, tarball_name)
- else:
- tarball_path = tarball_name
-
- if verbose:
- logging.debug('Archiving %s as %s' % (source_dir,
- tarball_path))
-
- os.chdir(os.path.dirname(source_dir))
- tarball = tarfile.TarFile(name=tarball_path, mode='w')
- tarball = tarball.open(name=tarball_path, mode='w:%s' % compression)
- tarball.add(os.path.basename(source_dir))
- tarball.close()
-
-
-class Thread(threading.Thread):
- """
- Run a function in a background thread.
- """
- def __init__(self, target, args=(), kwargs={}):
- """
- Initialize the instance.
-
- @param target: Function to run in the thread.
- @param args: Arguments to pass to target.
- @param kwargs: Keyword arguments to pass to target.
- """
- threading.Thread.__init__(self)
- self._target = target
- self._args = args
- self._kwargs = kwargs
-
-
- def run(self):
- """
- Run target (passed to the constructor). No point in calling this
- function directly. Call start() to make this function run in a new
- thread.
- """
- self._e = None
- self._retval = None
- try:
- try:
- self._retval = self._target(*self._args, **self._kwargs)
- except:
- self._e = sys.exc_info()
- raise
- finally:
- # Avoid circular references (start() may be called only once so
- # it's OK to delete these)
- del self._target, self._args, self._kwargs
-
-
- def join(self, timeout=None, suppress_exception=False):
- """
- Join the thread. If target raised an exception, re-raise it.
- Otherwise, return the value returned by target.
-
- @param timeout: Timeout value to pass to threading.Thread.join().
- @param suppress_exception: If True, don't re-raise the exception.
- """
- threading.Thread.join(self, timeout)
- try:
- if self._e:
- if not suppress_exception:
- # Because the exception was raised in another thread, we
- # need to explicitly insert the current context into it
- s = error.exception_context(self._e[1])
- s = error.join_contexts(error.get_context(), s)
- error.set_exception_context(self._e[1], s)
- raise self._e[0], self._e[1], self._e[2]
- else:
- return self._retval
- finally:
- # Avoid circular references (join() may be called multiple times
- # so we can't delete these)
- self._e = None
- self._retval = None
-
-
-def parallel(targets):
- """
- Run multiple functions in parallel.
-
- @param targets: A sequence of tuples or functions. If it's a sequence of
- tuples, each tuple will be interpreted as (target, args, kwargs) or
- (target, args) or (target,) depending on its length. If it's a
- sequence of functions, the functions will be called without
- arguments.
- @return: A list of the values returned by the functions called.
- """
- threads = []
- for target in targets:
- if isinstance(target, tuple) or isinstance(target, list):
- t = Thread(*target)
- else:
- t = Thread(target)
- threads.append(t)
- t.start()
- return [t.join() for t in threads]
-
-
-class VirtLoggingConfig(logging_config.LoggingConfig):
- """
- Used with the sole purpose of providing convenient logging setup
- for the KVM test auxiliary programs.
- """
- def configure_logging(self, results_dir=None, verbose=False):
- super(VirtLoggingConfig, self).configure_logging(use_console=True,
- verbose=verbose)
-
-
-class PciAssignable(object):
- """
- Request PCI assignable devices on host. It will check whether to request
- PF (physical Functions) or VF (Virtual Functions).
- """
- def __init__(self, type="vf", driver=None, driver_option=None,
- names=None, devices_requested=None):
- """
- Initialize parameter 'type' which could be:
- vf: Virtual Functions
- pf: Physical Function (actual hardware)
- mixed: Both includes VFs and PFs
-
- If pass through Physical NIC cards, we need to specify which devices
- to be assigned, e.g. 'eth1 eth2'.
-
- If pass through Virtual Functions, we need to specify how many vfs
- are going to be assigned, e.g. passthrough_count = 8 and max_vfs in
- config file.
-
- @param type: PCI device type.
- @param driver: Kernel module for the PCI assignable device.
- @param driver_option: Module option to specify the maximum number of
- VFs (eg 'max_vfs=7')
- @param names: Physical NIC cards correspondent network interfaces,
- e.g.'eth1 eth2 ...'
- @param devices_requested: Number of devices being requested.
- """
- self.type = type
- self.driver = driver
- self.driver_option = driver_option
- if names:
- self.name_list = names.split()
- if devices_requested:
- self.devices_requested = int(devices_requested)
- else:
- self.devices_requested = None
-
-
- def _get_pf_pci_id(self, name, search_str):
- """
- Get the PF PCI ID according to name.
-
- @param name: Name of the PCI device.
- @param search_str: Search string to be used on lspci.
- """
- cmd = "ethtool -i %s | awk '/bus-info/ {print $2}'" % name
- s, pci_id = commands.getstatusoutput(cmd)
- if not (s or "Cannot get driver information" in pci_id):
- return pci_id[5:]
- cmd = "lspci | awk '/%s/ {print $1}'" % search_str
- pci_ids = [id for id in commands.getoutput(cmd).splitlines()]
- nic_id = int(re.search('[0-9]+', name).group(0))
- if (len(pci_ids) - 1) < nic_id:
- return None
- return pci_ids[nic_id]
-
-
- def _release_dev(self, pci_id):
- """
- Release a single PCI device.
-
- @param pci_id: PCI ID of a given PCI device.
- """
- base_dir = "/sys/bus/pci"
- full_id = get_full_pci_id(pci_id)
- vendor_id = get_vendor_from_pci_id(pci_id)
- drv_path = os.path.join(base_dir, "devices/%s/driver" % full_id)
- if 'pci-stub' in os.readlink(drv_path):
- cmd = "echo '%s' > %s/new_id" % (vendor_id, drv_path)
- if os.system(cmd):
- return False
-
- stub_path = os.path.join(base_dir, "drivers/pci-stub")
- cmd = "echo '%s' > %s/unbind" % (full_id, stub_path)
- if os.system(cmd):
- return False
-
- driver = self.dev_drivers[pci_id]
- cmd = "echo '%s' > %s/bind" % (full_id, driver)
- if os.system(cmd):
- return False
-
- return True
-
-
- def get_vf_devs(self):
- """
- Catch all VFs PCI IDs.
-
- @return: List with all PCI IDs for the Virtual Functions avaliable
- """
- if not self.sr_iov_setup():
- return []
-
- cmd = "lspci | awk '/Virtual Function/ {print $1}'"
- return commands.getoutput(cmd).split()
-
-
- def get_pf_devs(self):
- """
- Catch all PFs PCI IDs.
-
- @return: List with all PCI IDs for the physical hardware requested
- """
- pf_ids = []
- for name in self.name_list:
- pf_id = self._get_pf_pci_id(name, "Ethernet")
- if not pf_id:
- continue
- pf_ids.append(pf_id)
- return pf_ids
-
-
- def get_devs(self, count):
- """
- Check out all devices' PCI IDs according to their name.
-
- @param count: count number of PCI devices needed for pass through
- @return: a list of all devices' PCI IDs
- """
- if self.type == "vf":
- vf_ids = self.get_vf_devs()
- elif self.type == "pf":
- vf_ids = self.get_pf_devs()
- elif self.type == "mixed":
- vf_ids = self.get_vf_devs()
- vf_ids.extend(self.get_pf_devs())
- return vf_ids[0:count]
-
-
- def get_vfs_count(self):
- """
- Get VFs count number according to lspci.
- """
- # FIXME: Need to think out a method of identify which
- # 'virtual function' belongs to which physical card considering
- # that if the host has more than one 82576 card. PCI_ID?
- cmd = "lspci | grep 'Virtual Function' | wc -l"
- return int(commands.getoutput(cmd))
-
-
- def check_vfs_count(self):
- """
- Check VFs count number according to the parameter driver_options.
- """
- # Network card 82576 has two network interfaces and each can be
- # virtualized up to 7 virtual functions, therefore we multiply
- # two for the value of driver_option 'max_vfs'.
- expected_count = int((re.findall("(\d)", self.driver_option)[0])) * 2
- return (self.get_vfs_count == expected_count)
-
-
- def is_binded_to_stub(self, full_id):
- """
- Verify whether the device with full_id is already binded to pci-stub.
-
- @param full_id: Full ID for the given PCI device
- """
- base_dir = "/sys/bus/pci"
- stub_path = os.path.join(base_dir, "drivers/pci-stub")
- if os.path.exists(os.path.join(stub_path, full_id)):
- return True
- return False
-
-
- def sr_iov_setup(self):
- """
- Ensure the PCI device is working in sr_iov mode.
-
- Check if the PCI hardware device drive is loaded with the appropriate,
- parameters (number of VFs), and if it's not, perform setup.
-
- @return: True, if the setup was completed successfuly, False otherwise.
- """
- re_probe = False
- s, o = commands.getstatusoutput('lsmod | grep %s' % self.driver)
- if s:
- re_probe = True
- elif not self.check_vfs_count():
- os.system("modprobe -r %s" % self.driver)
- re_probe = True
- else:
- return True
-
- # Re-probe driver with proper number of VFs
- if re_probe:
- cmd = "modprobe %s %s" % (self.driver, self.driver_option)
- logging.info("Loading the driver '%s' with option '%s'",
- self.driver, self.driver_option)
- s, o = commands.getstatusoutput(cmd)
- if s:
- return False
- return True
-
-
- def request_devs(self):
- """
- Implement setup process: unbind the PCI device and then bind it
- to the pci-stub driver.
-
- @return: a list of successfully requested devices' PCI IDs.
- """
- base_dir = "/sys/bus/pci"
- stub_path = os.path.join(base_dir, "drivers/pci-stub")
-
- self.pci_ids = self.get_devs(self.devices_requested)
- logging.debug("The following pci_ids were found: %s", self.pci_ids)
- requested_pci_ids = []
- self.dev_drivers = {}
-
- # Setup all devices specified for assignment to guest
- for pci_id in self.pci_ids:
- full_id = get_full_pci_id(pci_id)
- if not full_id:
- continue
- drv_path = os.path.join(base_dir, "devices/%s/driver" % full_id)
- dev_prev_driver = os.path.realpath(os.path.join(drv_path,
- os.readlink(drv_path)))
- self.dev_drivers[pci_id] = dev_prev_driver
-
- # Judge whether the device driver has been binded to stub
- if not self.is_binded_to_stub(full_id):
- logging.debug("Binding device %s to stub", full_id)
- vendor_id = get_vendor_from_pci_id(pci_id)
- stub_new_id = os.path.join(stub_path, 'new_id')
- unbind_dev = os.path.join(drv_path, 'unbind')
- stub_bind = os.path.join(stub_path, 'bind')
-
- info_write_to_files = [(vendor_id, stub_new_id),
- (full_id, unbind_dev),
- (full_id, stub_bind)]
-
- for content, file in info_write_to_files:
- try:
- utils.open_write_close(file, content)
- except IOError:
- logging.debug("Failed to write %s to file %s", content,
- file)
- continue
-
- if not self.is_binded_to_stub(full_id):
- logging.error("Binding device %s to stub failed", pci_id)
- continue
- else:
- logging.debug("Device %s already binded to stub", pci_id)
- requested_pci_ids.append(pci_id)
- self.pci_ids = requested_pci_ids
- return self.pci_ids
-
-
- def release_devs(self):
- """
- Release all PCI devices currently assigned to VMs back to the
- virtualization host.
- """
- try:
- for pci_id in self.dev_drivers:
- if not self._release_dev(pci_id):
- logging.error("Failed to release device %s to host", pci_id)
- else:
- logging.info("Released device %s successfully", pci_id)
- except:
- return
-
-
-class KojiClient(object):
- """
- Stablishes a connection with the build system, either koji or brew.
-
- This class provides convenience methods to retrieve information on packages
- and the packages themselves hosted on the build system. Packages should be
- specified in the KojiPgkSpec syntax.
- """
-
- CMD_LOOKUP_ORDER = ['/usr/bin/brew', '/usr/bin/koji' ]
-
- CONFIG_MAP = {'/usr/bin/brew': '/etc/brewkoji.conf',
- '/usr/bin/koji': '/etc/koji.conf'}
-
-
- def __init__(self, cmd=None):
- """
- Verifies whether the system has koji or brew installed, then loads
- the configuration file that will be used to download the files.
-
- @type cmd: string
- @param cmd: Optional command name, either 'brew' or 'koji'. If not
- set, get_default_command() is used and to look for
- one of them.
- @raise: ValueError
- """
- if not KOJI_INSTALLED:
- raise ValueError('No koji/brew installed on the machine')
-
- # Instance variables used by many methods
- self.command = None
- self.config = None
- self.config_options = {}
- self.session = None
-
- # Set koji command or get default
- if cmd is None:
- self.command = self.get_default_command()
- else:
- self.command = cmd
-
- # Check koji command
- if not self.is_command_valid():
- raise ValueError('Koji command "%s" is not valid' % self.command)
-
- # Assuming command is valid, set configuration file and read it
- self.config = self.CONFIG_MAP[self.command]
- self.read_config()
-
- # Setup koji session
- server_url = self.config_options['server']
- session_options = self.get_session_options()
- self.session = koji.ClientSession(server_url,
- session_options)
-
-
- def read_config(self, check_is_valid=True):
- '''
- Reads options from the Koji configuration file
-
- By default it checks if the koji configuration is valid
-
- @type check_valid: boolean
- @param check_valid: whether to include a check on the configuration
- @raises: ValueError
- @returns: None
- '''
- if check_is_valid:
- if not self.is_config_valid():
- raise ValueError('Koji config "%s" is not valid' % self.config)
-
- config = ConfigParser.ConfigParser()
- config.read(self.config)
-
- basename = os.path.basename(self.command)
- for name, value in config.items(basename):
- self.config_options[name] = value
-
-
- def get_session_options(self):
- '''
- Filter only options necessary for setting up a cobbler client session
-
- @returns: only the options used for session setup
- '''
- session_options = {}
- for name, value in self.config_options.items():
- if name in ('user', 'password', 'debug_xmlrpc', 'debug'):
- session_options[name] = value
- return session_options
-
-
- def is_command_valid(self):
- '''
- Checks if the currently set koji command is valid
-
- @returns: True or False
- '''
- koji_command_ok = True
-
- if not os.path.isfile(self.command):
- logging.error('Koji command "%s" is not a regular file',
- self.command)
- koji_command_ok = False
-
- if not os.access(self.command, os.X_OK):
- logging.warning('Koji command "%s" is not executable: this is '
- 'not fatal but indicates an unexpected situation',
- self.command)
-
- if not self.command in self.CONFIG_MAP.keys():
- logging.error('Koji command "%s" does not have a configuration '
- 'file associated to it', self.command)
- koji_command_ok = False
-
- return koji_command_ok
-
-
- def is_config_valid(self):
- '''
- Checks if the currently set koji configuration is valid
-
- @returns: True or False
- '''
- koji_config_ok = True
-
- if not os.path.isfile(self.config):
- logging.error('Koji config "%s" is not a regular file', self.config)
- koji_config_ok = False
-
- if not os.access(self.config, os.R_OK):
- logging.error('Koji config "%s" is not readable', self.config)
- koji_config_ok = False
-
- config = ConfigParser.ConfigParser()
- config.read(self.config)
- basename = os.path.basename(self.command)
- if not config.has_section(basename):
- logging.error('Koji configuration file "%s" does not have a '
- 'section "%s", named after the base name of the '
- 'currently set koji command "%s"', self.config,
- basename, self.command)
- koji_config_ok = False
-
- return koji_config_ok
-
-
- def get_default_command(self):
- '''
- Looks up for koji or brew "binaries" on the system
-
- Systems with plain koji usually don't have a brew cmd, while systems
- with koji, have *both* koji and brew utilities. So we look for brew
- first, and if found, we consider that the system is configured for
- brew. If not, we consider this is a system with plain koji.
-
- @returns: either koji or brew command line executable path, or None
- '''
- koji_command = None
- for command in self.CMD_LOOKUP_ORDER:
- if os.path.isfile(command):
- koji_command = command
- break
- else:
- koji_command_basename = os.path.basename(koji_command)
- try:
- koji_command = os_dep.command(koji_command_basename)
- break
- except ValueError:
- pass
- return koji_command
-
-
- def get_pkg_info(self, pkg):
- '''
- Returns information from Koji on the package
-
- @type pkg: KojiPkgSpec
- @param pkg: information about the package, as a KojiPkgSpec instance
-
- @returns: information from Koji about the specified package
- '''
- info = {}
- if pkg.build is not None:
- info = self.session.getBuild(int(pkg.build))
- elif pkg.tag is not None and pkg.package is not None:
- builds = self.session.listTagged(pkg.tag,
- latest=True,
- inherit=True,
- package=pkg.package)
- if builds:
- info = builds[0]
- return info
-
-
- def is_pkg_valid(self, pkg):
- '''
- Checks if this package is altogether valid on Koji
-
- This verifies if the build or tag specified in the package
- specification actually exist on the Koji server
-
- @returns: True or False
- '''
- valid = True
- if pkg.build:
- if not self.is_pkg_spec_build_valid(pkg):
- valid = False
- elif pkg.tag:
- if not self.is_pkg_spec_tag_valid(pkg):
- valid = False
- else:
- valid = False
- return valid
-
-
- def is_pkg_spec_build_valid(self, pkg):
- '''
- Checks if build is valid on Koji
-
- @param pkg: a Pkg instance
- '''
- if pkg.build is not None:
- info = self.session.getBuild(int(pkg.build))
- if info:
- return True
- return False
-
-
- def is_pkg_spec_tag_valid(self, pkg):
- '''
- Checks if tag is valid on Koji
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- '''
- if pkg.tag is not None:
- tag = self.session.getTag(pkg.tag)
- if tag:
- return True
- return False
-
-
- def get_pkg_rpm_info(self, pkg, arch=None):
- '''
- Returns a list of infomation on the RPM packages found on koji
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- @type arch: string
- @param arch: packages built for this architecture, but also including
- architecture independent (noarch) packages
- '''
- if arch is None:
- arch = utils.get_arch()
- rpms = []
- info = self.get_pkg_info(pkg)
- if info:
- rpms = self.session.listRPMs(buildID=info['id'],
- arches=[arch, 'noarch'])
- if pkg.subpackages:
- rpms = [d for d in rpms if d['name'] in pkg.subpackages]
- return rpms
-
-
- def get_pkg_rpm_names(self, pkg, arch=None):
- '''
- Gets the names for the RPM packages specified in pkg
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- @type arch: string
- @param arch: packages built for this architecture, but also including
- architecture independent (noarch) packages
- '''
- if arch is None:
- arch = utils.get_arch()
- rpms = self.get_pkg_rpm_info(pkg, arch)
- return [rpm['name'] for rpm in rpms]
-
-
- def get_pkg_rpm_file_names(self, pkg, arch=None):
- '''
- Gets the file names for the RPM packages specified in pkg
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- @type arch: string
- @param arch: packages built for this architecture, but also including
- architecture independent (noarch) packages
- '''
- if arch is None:
- arch = utils.get_arch()
- rpm_names = []
- rpms = self.get_pkg_rpm_info(pkg, arch)
- for rpm in rpms:
- arch_rpm_name = koji.pathinfo.rpm(rpm)
- rpm_name = os.path.basename(arch_rpm_name)
- rpm_names.append(rpm_name)
- return rpm_names
-
-
- def get_pkg_urls(self, pkg, arch=None):
- '''
- Gets the urls for the packages specified in pkg
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- @type arch: string
- @param arch: packages built for this architecture, but also including
- architecture independent (noarch) packages
- '''
- info = self.get_pkg_info(pkg)
- rpms = self.get_pkg_rpm_info(pkg, arch)
- rpm_urls = []
- for rpm in rpms:
- rpm_name = koji.pathinfo.rpm(rpm)
- url = ("%s/%s/%s/%s/%s" % (self.config_options['pkgurl'],
- info['package_name'],
- info['version'], info['release'],
- rpm_name))
- rpm_urls.append(url)
- return rpm_urls
-
-
- def get_pkgs(self, pkg, dst_dir, arch=None):
- '''
- Download the packages
-
- @type pkg: KojiPkgSpec
- @param pkg: a package specification
- @type dst_dir: string
- @param dst_dir: the destination directory, where the downloaded
- packages will be saved on
- @type arch: string
- @param arch: packages built for this architecture, but also including
- architecture independent (noarch) packages
- '''
- rpm_urls = self.get_pkg_urls(pkg, arch)
- for url in rpm_urls:
- utils.get_file(url,
- os.path.join(dst_dir, os.path.basename(url)))
-
-
-DEFAULT_KOJI_TAG = None
-def set_default_koji_tag(tag):
- '''
- Sets the default tag that will be used
- '''
- global DEFAULT_KOJI_TAG
- DEFAULT_KOJI_TAG = tag
-
-
-def get_default_koji_tag():
- return DEFAULT_KOJI_TAG
-
-
-class KojiPkgSpec(object):
- '''
- A package specification syntax parser for Koji
-
- This holds information on either tag or build, and packages to be fetched
- from koji and possibly installed (features external do this class).
-
- New objects can be created either by providing information in the textual
- format or by using the actual parameters for tag, build, package and sub-
- packages. The textual format is useful for command line interfaces and
- configuration files, while using parameters is better for using this in
- a programatic fashion.
-
- The following sets of examples are interchangeable. Specifying all packages
- part of build number 1000:
-
- >>> from kvm_utils import KojiPkgSpec
- >>> pkg = KojiPkgSpec('1000')
-
- >>> pkg = KojiPkgSpec(build=1000)
-
- Specifying only a subset of packages of build number 1000:
-
- >>> pkg = KojiPkgSpec('1000:kernel,kernel-devel')
-
- >>> pkg = KojiPkgSpec(build=1000,
- subpackages=['kernel', 'kernel-devel'])
-
- Specifying the latest build for the 'kernel' package tagged with 'dist-f14':
-
- >>> pkg = KojiPkgSpec('dist-f14:kernel')
-
- >>> pkg = KojiPkgSpec(tag='dist-f14', package='kernel')
-
- Specifying the 'kernel' package using the default tag:
-
- >>> kvm_utils.set_default_koji_tag('dist-f14')
- >>> pkg = KojiPkgSpec('kernel')
-
- >>> pkg = KojiPkgSpec(package='kernel')
-
- Specifying the 'kernel' package using the default tag:
-
- >>> kvm_utils.set_default_koji_tag('dist-f14')
- >>> pkg = KojiPkgSpec('kernel')
-
- >>> pkg = KojiPkgSpec(package='kernel')
-
- If you do not specify a default tag, and give a package name without an
- explicit tag, your package specification is considered invalid:
-
- >>> print kvm_utils.get_default_koji_tag()
- None
- >>> print kvm_utils.KojiPkgSpec('kernel').is_valid()
- False
-
- >>> print kvm_utils.KojiPkgSpec(package='kernel').is_valid()
- False
- '''
-
- SEP = ':'
-
- def __init__(self, text='', tag=None, build=None,
- package=None, subpackages=[]):
- '''
- Instantiates a new KojiPkgSpec object
-
- @type text: string
- @param text: a textual representation of a package on Koji that
- will be parsed
- @type tag: string
- @param tag: a koji tag, example: Fedora-14-RELEASE
- (see U{http://fedoraproject.org/wiki/Koji#Tags_and_Targets})
- @type build: number
- @param build: a koji build, example: 1001
- (see U{http://fedoraproject.org/wiki/Koji#Koji_Architecture})
- @type package: string
- @param package: a koji package, example: python
- (see U{http://fedoraproject.org/wiki/Koji#Koji_Architecture})
- @type subpackages: list of strings
- @param subpackages: a list of package names, usually a subset of
- the RPM packages generated by a given build
- '''
-
- # Set to None to indicate 'not set' (and be able to use 'is')
- self.tag = None
- self.build = None
- self.package = None
- self.subpackages = []
-
- self.default_tag = None
-
- # Textual representation takes precedence (most common use case)
- if text:
- self.parse(text)
- else:
- self.tag = tag
- self.build = build
- self.package = package
- self.subpackages = subpackages
-
- # Set the default tag, if set, as a fallback
- if not self.build and not self.tag:
- default_tag = get_default_koji_tag()
- if default_tag is not None:
- self.tag = default_tag
-
-
- def parse(self, text):
- '''
- Parses a textual representation of a package specification
-
- @type text: string
- @param text: textual representation of a package in koji
- '''
- parts = text.count(self.SEP) + 1
- if parts == 1:
- if text.isdigit():
- self.build = text
- else:
- self.package = text
- elif parts == 2:
- part1, part2 = text.split(self.SEP)
- if part1.isdigit():
- self.build = part1
- self.subpackages = part2.split(',')
- else:
- self.tag = part1
- self.package = part2
- elif parts >= 3:
- # Instead of erroring on more arguments, we simply ignore them
- # This makes the parser suitable for future syntax additions, such
- # as specifying the package architecture
- part1, part2, part3 = text.split(self.SEP)[0:3]
- self.tag = part1
- self.package = part2
- self.subpackages = part3.split(',')
-
-
- def _is_invalid_neither_tag_or_build(self):
- '''
- Checks if this package is invalid due to not having either a valid
- tag or build set, that is, both are empty.
-
- @returns: True if this is invalid and False if it's valid
- '''
- return (self.tag is None and self.build is None)
-
-
- def _is_invalid_package_but_no_tag(self):
- '''
- Checks if this package is invalid due to having a package name set
- but tag or build set, that is, both are empty.
-
- @returns: True if this is invalid and False if it's valid
- '''
- return (self.package and not self.tag)
-
-
- def _is_invalid_subpackages_but_no_main_package(self):
- '''
- Checks if this package is invalid due to having a tag set (this is Ok)
- but specifying subpackage names without specifying the main package
- name.
-
- Specifying subpackages without a main package name is only valid when
- a build is used instead of a tag.
-
- @returns: True if this is invalid and False if it's valid
- '''
- return (self.tag and self.subpackages and not self.package)
-
-
- def is_valid(self):
- '''
- Checks if this package specification is valid.
-
- Being valid means that it has enough and not conflicting information.
- It does not validate that the packages specified actually existe on
- the Koji server.
-
- @returns: True or False
- '''
- if self._is_invalid_neither_tag_or_build():
- return False
- elif self._is_invalid_package_but_no_tag():
- return False
- elif self._is_invalid_subpackages_but_no_main_package():
- return False
-
- return True
-
-
- def describe_invalid(self):
- '''
- Describes why this is not valid, in a human friendly way
- '''
- if self._is_invalid_neither_tag_or_build():
- return 'neither a tag or build are set, and of them should be set'
- elif self._is_invalid_package_but_no_tag():
- return 'package name specified but no tag is set'
- elif self._is_invalid_subpackages_but_no_main_package():
- return 'subpackages specified but no main package is set'
-
- return 'unkwown reason, seems to be valid'
-
-
- def describe(self):
- '''
- Describe this package specification, in a human friendly way
-
- @returns: package specification description
- '''
- if self.is_valid():
- description = ''
- if not self.subpackages:
- description += 'all subpackages from %s ' % self.package
- else:
- description += ('only subpackage(s) %s from package %s ' %
- (', '.join(self.subpackages), self.package))
-
- if self.build:
- description += 'from build %s' % self.build
- elif self.tag:
- description += 'tagged with %s' % self.tag
- else:
- raise ValueError, 'neither build or tag is set'
-
- return description
- else:
- return ('Invalid package specification: %s' %
- self.describe_invalid())
-
-
- def __repr__(self):
- return ("<KojiPkgSpec tag=%s build=%s pkg=%s subpkgs=%s>" %
- (self.tag, self.build, self.package,
- ", ".join(self.subpackages)))
-
-
-def umount(src, mount_point, type):
- """
- Umount the src mounted in mount_point.
-
- @src: mount source
- @mount_point: mount point
- @type: file system type
- """
-
- mount_string = "%s %s %s" % (src, mount_point, type)
- if mount_string in file("/etc/mtab").read():
- umount_cmd = "umount %s" % mount_point
- try:
- utils.system(umount_cmd)
- return True
- except error.CmdError:
- return False
- else:
- logging.debug("%s is not mounted under %s", src, mount_point)
- return True
-
-
-def mount(src, mount_point, type, perm="rw"):
- """
- Mount the src into mount_point of the host.
-
- @src: mount source
- @mount_point: mount point
- @type: file system type
- @perm: mount premission
- """
- umount(src, mount_point, type)
- mount_string = "%s %s %s %s" % (src, mount_point, type, perm)
-
- if mount_string in file("/etc/mtab").read():
- logging.debug("%s is already mounted in %s with %s",
- src, mount_point, perm)
- return True
-
- mount_cmd = "mount -t %s %s %s -o %s" % (type, src, mount_point, perm)
- try:
- utils.system(mount_cmd)
- except error.CmdError:
- return False
-
- logging.debug("Verify the mount through /etc/mtab")
- if mount_string in file("/etc/mtab").read():
- logging.debug("%s is successfully mounted", src)
- return True
- else:
- logging.error("Can't find mounted NFS share - /etc/mtab contents \n%s",
- file("/etc/mtab").read())
- return False
-
-
-class GitRepoHelper(object):
- '''
- Helps to deal with git repos, mostly fetching content from a repo
- '''
- def __init__(self, uri, branch, destination_dir, commit=None, lbranch=None):
- '''
- Instantiates a new GitRepoHelper
-
- @type uri: string
- @param uri: git repository url
- @type branch: string
- @param branch: git remote branch
- @type destination_dir: string
- @param destination_dir: path of a dir where to save downloaded code
- @type commit: string
- @param commit: specific commit to download
- @type lbranch: string
- @param lbranch: git local branch name, if different from remote
- '''
- self.uri = uri
- self.branch = branch
- self.destination_dir = destination_dir
- self.commit = commit
- if lbranch is None:
- self.lbranch = branch
-
-
- def init(self):
- '''
- Initializes a directory for receiving a verbatim copy of git repo
-
- This creates a directory if necessary, and either resets or inits
- the repo
- '''
- if not os.path.exists(self.destination_dir):
- logging.debug('Creating directory %s for git repo %s',
- self.destination_dir, self.uri)
- os.makedirs(self.destination_dir)
-
- os.chdir(self.destination_dir)
-
- if os.path.exists('.git'):
- logging.debug('Resetting previously existing git repo at %s for '
- 'receiving git repo %s',
- self.destination_dir, self.uri)
- utils.system('git reset --hard')
- else:
- logging.debug('Initializing new git repo at %s for receiving '
- 'git repo %s',
- self.destination_dir, self.uri)
- utils.system('git init')
-
-
- def fetch(self):
- '''
- Performs a git fetch from the remote repo
- '''
- logging.info("Fetching git [REP '%s' BRANCH '%s'] -> %s",
- self.uri, self.branch, self.destination_dir)
- os.chdir(self.destination_dir)
- utils.system("git fetch -q -f -u -t %s %s:%s" % (self.uri,
- self.branch,
- self.lbranch))
-
-
- def checkout(self):
- '''
- Performs a git checkout for a given branch and start point (commit)
- '''
- os.chdir(self.destination_dir)
-
- logging.debug('Checking out local branch %s', self.lbranch)
- utils.system("git checkout %s" % self.lbranch)
-
- if self.commit is not None:
- logging.debug('Checking out commit %s', self.commit)
- utils.system("git checkout %s" % self.commit)
-
- h = utils.system_output('git log --pretty=format:"%H" -1').strip()
- try:
- desc = "tag %s" % utils.system_output("git describe")
- except error.CmdError:
- desc = "no tag found"
-
- logging.info("Commit hash for %s is %s (%s)", self.name, h, desc)
-
-
- def execute(self):
- '''
- Performs all steps necessary to initialize and download a git repo
-
- This includes the init, fetch and checkout steps in one single
- utility method.
- '''
- self.init()
- self.fetch()
- self.checkout()
-
-
-class GitRepoParamHelper(GitRepoHelper):
- '''
- Helps to deal with git repos specified in cartersian config files
-
- This class attempts to make it simple to manage a git repo, by using a
- naming standard that follows this basic syntax:
-
- <prefix>_name_<suffix>
-
- <prefix> is always 'git_repo' and <suffix> sets options for this git repo.
- Example for repo named foo:
-
- git_repo_foo_uri = git://git.foo.org/foo.git
- git_repo_foo_branch = master
- git_repo_foo_lbranch = master
- git_repo_foo_commit = bb5fb8e678aabe286e74c4f2993dc2a9e550b627
- '''
- def __init__(self, params, name, destination_dir):
- '''
- Instantiates a new GitRepoParamHelper
- '''
- self.params = params
- self.name = name
- self.destination_dir = destination_dir
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to this repo
-
- This method currently does everything that the parent class __init__()
- method does, that is, sets all instance variables needed by other
- methods. That means it's not strictly necessary to call parent's
- __init__().
- '''
- config_prefix = 'git_repo_%s' % self.name
- logging.debug('Parsing parameters for git repo %s, configuration '
- 'prefix is %s' % (self.name, config_prefix))
-
- self.uri = self.params.get('%s_uri' % config_prefix)
- logging.debug('Git repo %s uri: %s' % (self.name, self.uri))
-
- self.branch = self.params.get('%s_branch' % config_prefix, 'master')
- logging.debug('Git repo %s branch: %s' % (self.name, self.branch))
-
- self.lbranch = self.params.get('%s_lbranch' % config_prefix)
- if self.lbranch is None:
- self.lbranch = self.branch
- logging.debug('Git repo %s lbranch: %s' % (self.name, self.lbranch))
-
- self.commit = self.params.get('%s_commit' % config_prefix)
- if self.commit is None:
- logging.debug('Git repo %s commit is not set' % self.name)
- else:
- logging.debug('Git repo %s commit: %s' % (self.name, self.commit))
-
-
-class LocalSourceDirHelper(object):
- '''
- Helper class to deal with source code sitting somewhere in the filesystem
- '''
- def __init__(self, source_dir, destination_dir):
- '''
- @param source_dir:
- @param destination_dir:
- @return: new LocalSourceDirHelper instance
- '''
- self.source = source_dir
- self.destination = destination_dir
-
-
- def execute(self):
- '''
- Copies the source directory to the destination directory
- '''
- if os.path.isdir(self.destination):
- shutil.rmtree(self.destination)
-
- if os.path.isdir(self.source):
- shutil.copytree(self.source, self.destination)
-
-
-class LocalSourceDirParamHelper(LocalSourceDirHelper):
- '''
- Helps to deal with source dirs specified in cartersian config files
-
- This class attempts to make it simple to manage a source dir, by using a
- naming standard that follows this basic syntax:
-
- <prefix>_name_<suffix>
-
- <prefix> is always 'local_src' and <suffix> sets options for this source
- dir. Example for source dir named foo:
-
- local_src_foo_path = /home/user/foo
- '''
- def __init__(self, params, name, destination_dir):
- '''
- Instantiate a new LocalSourceDirParamHelper
- '''
- self.params = params
- self.name = name
- self.destination_dir = destination_dir
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to source dir
- '''
- config_prefix = 'local_src_%s' % self.name
- logging.debug('Parsing parameters for local source %s, configuration '
- 'prefix is %s' % (self.name, config_prefix))
-
- self.path = self.params.get('%s_path' % config_prefix)
- logging.debug('Local source directory %s path: %s' % (self.name,
- self.path))
- self.source = self.path
- self.destination = self.destination_dir
-
-
-class LocalTarHelper(object):
- '''
- Helper class to deal with source code in a local tarball
- '''
- def __init__(self, source, destination_dir):
- self.source = source
- self.destination = destination_dir
-
-
- def extract(self):
- '''
- Extracts the tarball into the destination directory
- '''
- if os.path.isdir(self.destination):
- shutil.rmtree(self.destination)
-
- if os.path.isfile(self.source) and tarfile.is_tarfile(self.source):
-
- name = os.path.basename(self.destination)
- temp_dir = os.path.join(os.path.dirname(self.destination),
- '%s.tmp' % name)
- logging.debug('Temporary directory for extracting tarball is %s' %
- temp_dir)
-
- if not os.path.isdir(temp_dir):
- os.makedirs(temp_dir)
-
- tarball = tarfile.open(self.source)
- tarball.extractall(temp_dir)
-
- #
- # If there's a directory at the toplevel of the tarfile, assume
- # it's the root for the contents, usually source code
- #
- tarball_info = tarball.members[0]
- if tarball_info.isdir():
- content_path = os.path.join(temp_dir,
- tarball_info.name)
- else:
- content_path = temp_dir
-
- #
- # Now move the content directory to the final destination
- #
- shutil.move(content_path, self.destination)
-
- else:
- raise OSError("%s is not a file or tar file" % self.source)
-
-
- def execute(self):
- '''
- Executes all action this helper is suposed to perform
-
- This is the main entry point method for this class, and all other
- helper classes.
- '''
- self.extract()
-
-
-class LocalTarParamHelper(LocalTarHelper):
- '''
- Helps to deal with source tarballs specified in cartersian config files
-
- This class attempts to make it simple to manage a tarball with source code,
- by using a naming standard that follows this basic syntax:
-
- <prefix>_name_<suffix>
-
- <prefix> is always 'local_tar' and <suffix> sets options for this source
- tarball. Example for source tarball named foo:
-
- local_tar_foo_path = /tmp/foo-1.0.tar.gz
- '''
- def __init__(self, params, name, destination_dir):
- '''
- Instantiates a new LocalTarParamHelper
- '''
- self.params = params
- self.name = name
- self.destination_dir = destination_dir
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to this local tar helper
- '''
- config_prefix = 'local_tar_%s' % self.name
- logging.debug('Parsing parameters for local tar %s, configuration '
- 'prefix is %s' % (self.name, config_prefix))
-
- self.path = self.params.get('%s_path' % config_prefix)
- logging.debug('Local source tar %s path: %s' % (self.name,
- self.path))
- self.source = self.path
- self.destination = self.destination_dir
-
-
-class RemoteTarHelper(LocalTarHelper):
- '''
- Helper that fetches a tarball and extracts it locally
- '''
- def __init__(self, source_uri, destination_dir):
- self.source = source_uri
- self.destination = destination_dir
-
-
- def execute(self):
- '''
- Executes all action this helper class is suposed to perform
-
- This is the main entry point method for this class, and all other
- helper classes.
-
- This implementation fetches the remote tar file and then extracts
- it using the functionality present in the parent class.
- '''
- name = os.path.basename(self.source)
- base_dest = os.path.dirname(self.destination_dir)
- dest = os.path.join(base_dest, name)
- utils.get_file(self.source, dest)
- self.source = dest
- self.extract()
-
-
-class RemoteTarParamHelper(RemoteTarHelper):
- '''
- Helps to deal with remote source tarballs specified in cartersian config
-
- This class attempts to make it simple to manage a tarball with source code,
- by using a naming standard that follows this basic syntax:
-
- <prefix>_name_<suffix>
-
- <prefix> is always 'local_tar' and <suffix> sets options for this source
- tarball. Example for source tarball named foo:
-
- remote_tar_foo_uri = http://foo.org/foo-1.0.tar.gz
- '''
- def __init__(self, params, name, destination_dir):
- '''
- Instantiates a new RemoteTarParamHelper instance
- '''
- self.params = params
- self.name = name
- self.destination_dir = destination_dir
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to this remote tar helper
- '''
- config_prefix = 'remote_tar_%s' % self.name
- logging.debug('Parsing parameters for remote tar %s, configuration '
- 'prefix is %s' % (self.name, config_prefix))
-
- self.uri = self.params.get('%s_uri' % config_prefix)
- logging.debug('Remote source tar %s uri: %s' % (self.name,
- self.uri))
- self.source = self.uri
- self.destination = self.destination_dir
-
-
-class PatchHelper(object):
- '''
- Helper that encapsulates the patching of source code with patch files
- '''
- def __init__(self, source_dir, patches):
- '''
- Initializes a new PatchHelper
- '''
- self.source_dir = source_dir
- self.patches = patches
-
-
- def download(self):
- '''
- Copies patch files from remote locations to the source directory
- '''
- for patch in self.patches:
- utils.get_file(patch, os.path.join(self.source_dir,
- os.path.basename(patch)))
-
-
- def patch(self):
- '''
- Patches the source dir with all patch files
- '''
- os.chdir(self.source_dir)
- for patch in self.patches:
- patch_file = os.path.join(self.source_dir,
- os.path.basename(patch))
- utils.system('patch -p1 < %s' % os.path.basename(patch))
-
-
- def execute(self):
- '''
- Performs all steps necessary to download patches and apply them
- '''
- self.download()
- self.patch()
-
-
-class PatchParamHelper(PatchHelper):
- '''
- Helps to deal with patches specified in cartersian config files
-
- This class attempts to make it simple to patch source coude, by using a
- naming standard that follows this basic syntax:
-
- [<git_repo>|<local_src>|<local_tar>|<remote_tar>]_<name>_patches
-
- <prefix> is either a 'local_src' or 'git_repo', that, together with <name>
- specify a directory containing source code to receive the patches. That is,
- for source code coming from git repo foo, patches would be specified as:
-
- git_repo_foo_patches = ['http://foo/bar.patch', 'http://foo/baz.patch']
-
- And for for patches to be applied on local source code named also foo:
-
- local_src_foo_patches = ['http://foo/bar.patch', 'http://foo/baz.patch']
- '''
- def __init__(self, params, prefix, source_dir):
- '''
- Initializes a new PatchParamHelper instance
- '''
- self.params = params
- self.prefix = prefix
- self.source_dir = source_dir
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to this set of patches
-
- This method currently does everything that the parent class __init__()
- method does, that is, sets all instance variables needed by other
- methods. That means it's not strictly necessary to call parent's
- __init__().
- '''
- logging.debug('Parsing patch parameters for prefix %s' % self.prefix)
- patches_param_key = '%s_patches' % self.prefix
-
- self.patches_str = self.params.get(patches_param_key, '[]')
- logging.debug('Patches config for prefix %s: %s' % (self.prefix,
- self.patches_str))
-
- self.patches = eval(self.patches_str)
- logging.debug('Patches for prefix %s: %s' % (self.prefix,
- ", ".join(self.patches)))
-
-
-class GnuSourceBuildInvalidSource(Exception):
- '''
- Exception raised when build source dir/file is not valid
- '''
- pass
-
-
-class GnuSourceBuildHelper(object):
- '''
- Handles software installation of GNU-like source code
-
- This basically means that the build will go though the classic GNU
- autotools steps: ./configure, make, make install
- '''
- def __init__(self, source, build_dir, prefix,
- configure_options=[]):
- '''
- @type source: string
- @param source: source directory or tarball
- @type prefix: string
- @param prefix: installation prefix
- @type build_dir: string
- @param build_dir: temporary directory used for building the source code
- @type configure_options: list
- @param configure_options: options to pass to configure
- @throws: GnuSourceBuildInvalidSource
- '''
- self.source = source
- self.build_dir = build_dir
- self.prefix = prefix
- self.configure_options = configure_options
- self.include_pkg_config_path()
-
-
- def include_pkg_config_path(self):
- '''
- Adds the current prefix to the list of paths that pkg-config searches
-
- This is currently not optional as there is no observed adverse side
- effects of enabling this. As the "prefix" is usually only valid during
- a test run, we believe that having other pkg-config files (*.pc) in
- either '<prefix>/share/pkgconfig' or '<prefix>/lib/pkgconfig' is
- exactly for the purpose of using them.
-
- @returns: None
- '''
- env_var = 'PKG_CONFIG_PATH'
-
- include_paths = [os.path.join(self.prefix, 'share', 'pkgconfig'),
- os.path.join(self.prefix, 'lib', 'pkgconfig')]
-
- if os.environ.has_key(env_var):
- paths = os.environ[env_var].split(':')
- for include_path in include_paths:
- if include_path not in paths:
- paths.append(include_path)
- os.environ[env_var] = ':'.join(paths)
- else:
- os.environ[env_var] = ':'.join(include_paths)
-
- logging.debug('PKG_CONFIG_PATH is: %s' % os.environ['PKG_CONFIG_PATH'])
-
-
- def get_configure_path(self):
- '''
- Checks if 'configure' exists, if not, return 'autogen.sh' as a fallback
- '''
- configure_path = os.path.abspath(os.path.join(self.source,
- "configure"))
- autogen_path = os.path.abspath(os.path.join(self.source,
- "autogen.sh"))
- if os.path.exists(configure_path):
- return configure_path
- elif os.path.exists(autogen_path):
- return autogen_path
- else:
- raise GnuSourceBuildInvalidSource('configure script does not exist')
-
-
- def get_available_configure_options(self):
- '''
- Return the list of available options of a GNU like configure script
-
- This will run the "configure" script at the source directory
-
- @returns: list of options accepted by configure script
- '''
- help_raw = utils.system_output('%s --help' % self.get_configure_path(),
- ignore_status=True)
- help_output = help_raw.split("\n")
- option_list = []
- for line in help_output:
- cleaned_line = line.lstrip()
- if cleaned_line.startswith("--"):
- option = cleaned_line.split()[0]
- option = option.split("=")[0]
- option_list.append(option)
-
- return option_list
-
-
- def enable_debug_symbols(self):
- '''
- Enables option that leaves debug symbols on compiled software
-
- This makes debugging a lot easier.
- '''
- enable_debug_option = "--disable-strip"
- if enable_debug_option in self.get_available_configure_options():
- self.configure_options.append(enable_debug_option)
- logging.debug('Enabling debug symbols with option: %s' %
- enable_debug_option)
-
-
- def get_configure_command(self):
- '''
- Formats configure script with all options set
-
- @returns: string with all configure options, including prefix
- '''
- prefix_option = "--prefix=%s" % self.prefix
- options = self.configure_options
- options.append(prefix_option)
- return "%s %s" % (self.get_configure_path(),
- " ".join(options))
-
-
- def configure(self):
- '''
- Runs the "configure" script passing apropriate command line options
- '''
- configure_command = self.get_configure_command()
- logging.info('Running configure on build dir')
- os.chdir(self.build_dir)
- utils.system(configure_command)
-
-
- def make(self):
- '''
- Runs "make" using the correct number of parallel jobs
- '''
- parallel_make_jobs = utils.count_cpus()
- make_command = "make -j %s" % parallel_make_jobs
- logging.info("Running make on build dir")
- os.chdir(self.build_dir)
- utils.system(make_command)
-
-
- def make_install(self):
- '''
- Runs "make install"
- '''
- os.chdir(self.build_dir)
- utils.system("make install")
-
-
- install = make_install
-
-
- def execute(self):
- '''
- Runs appropriate steps for *building* this source code tree
- '''
- self.configure()
- self.make()
-
-
-class GnuSourceBuildParamHelper(GnuSourceBuildHelper):
- '''
- Helps to deal with gnu_autotools build helper in cartersian config files
-
- This class attempts to make it simple to build source coude, by using a
- naming standard that follows this basic syntax:
-
- [<git_repo>|<local_src>]_<name>_<option> = value
-
- To pass extra options to the configure script, while building foo from a
- git repo, set the following variable:
-
- git_repo_foo_configure_options = --enable-feature
- '''
- def __init__(self, params, name, destination_dir, install_prefix):
- '''
- Instantiates a new GnuSourceBuildParamHelper
- '''
- self.params = params
- self.name = name
- self.destination_dir = destination_dir
- self.install_prefix = install_prefix
- self._parse_params()
-
-
- def _parse_params(self):
- '''
- Parses the params items for entries related to source directory
-
- This method currently does everything that the parent class __init__()
- method does, that is, sets all instance variables needed by other
- methods. That means it's not strictly necessary to call parent's
- __init__().
- '''
- logging.debug('Parsing gnu_autotools build parameters for %s' %
- self.name)
-
- configure_opt_key = '%s_configure_options' % self.name
- configure_options = self.params.get(configure_opt_key, '').split()
- logging.debug('Configure options for %s: %s' % (self.name,
- configure_options))
-
- self.source = self.destination_dir
- self.build_dir = self.destination_dir
- self.prefix = self.install_prefix
- self.configure_options = configure_options
- self.include_pkg_config_path()
-
-
-def install_host_kernel(job, params):
- """
- Install a host kernel, given the appropriate params.
-
- @param job: Job object.
- @param params: Dict with host kernel install params.
- """
- install_type = params.get('host_kernel_install_type')
-
- rpm_url = params.get('host_kernel_rpm_url')
-
- koji_cmd = params.get('host_kernel_koji_cmd')
- koji_build = params.get('host_kernel_koji_build')
- koji_tag = params.get('host_kernel_koji_tag')
-
- git_repo = params.get('host_kernel_git_repo')
- git_branch = params.get('host_kernel_git_branch')
- git_commit = params.get('host_kernel_git_commit')
- patch_list = params.get('host_kernel_patch_list')
- if patch_list:
- patch_list = patch_list.split()
- kernel_config = params.get('host_kernel_config')
-
- if install_type == 'rpm':
- logging.info('Installing host kernel through rpm')
- dst = os.path.join("/tmp", os.path.basename(rpm_url))
- k = utils.get_file(rpm_url, dst)
- host_kernel = job.kernel(k)
- host_kernel.install(install_vmlinux=False)
- host_kernel.boot()
-
- elif install_type in ['koji', 'brew']:
- k_deps = KojiPkgSpec(tag=koji_tag, package='kernel',
- subpackages=['kernel-devel', 'kernel-firmware'])
- k = KojiPkgSpec(tag=koji_tag, package='kernel',
- subpackages=['kernel'])
-
- c = KojiClient(koji_cmd)
- logging.info('Fetching kernel dependencies (-devel, -firmware)')
- c.get_pkgs(k_deps, job.tmpdir)
- logging.info('Installing kernel dependencies (-devel, -firmware) '
- 'through %s', install_type)
- k_deps_rpm_file_names = [os.path.join(job.tmpdir, rpm_file_name) for
- rpm_file_name in c.get_pkg_rpm_file_names(k_deps)]
- utils.run('rpm -U --force %s' % " ".join(k_deps_rpm_file_names))
-
- c.get_pkgs(k, job.tmpdir)
- k_rpm = os.path.join(job.tmpdir,
- c.get_pkg_rpm_file_names(k)[0])
- host_kernel = job.kernel(k_rpm)
- host_kernel.install(install_vmlinux=False)
- host_kernel.boot()
-
- elif install_type == 'git':
- logging.info('Chose to install host kernel through git, proceeding')
- repodir = os.path.join("/tmp", 'kernel_src')
- r = get_git_branch(git_repo, git_branch, repodir, git_commit)
- host_kernel = job.kernel(r)
- if patch_list:
- host_kernel.patch(patch_list)
- host_kernel.config(kernel_config)
- host_kernel.build()
- host_kernel.install()
- host_kernel.boot()
-
- else:
- logging.info('Chose %s, using the current kernel for the host',
- install_type)
-
-
-def if_nametoindex(ifname):
- """
- Map an interface name into its corresponding index.
- Returns 0 on error, as 0 is not a valid index
-
- @param ifname: interface name
- """
- index = 0
- ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
- ifr = struct.pack("16si", ifname, 0)
- r = fcntl.ioctl(ctrl_sock, SIOCGIFINDEX, ifr)
- index = struct.unpack("16si", r)[1]
- ctrl_sock.close()
- return index
-
-
-def vnet_hdr_probe(tapfd):
- """
- Check if the IFF_VNET_HDR is support by tun.
-
- @param tapfd: the file descriptor of /dev/net/tun
- """
- u = struct.pack("I", 0)
- try:
- r = fcntl.ioctl(tapfd, TUNGETFEATURES, u)
- except OverflowError:
- return False
- flags = struct.unpack("I", r)[0]
- if flags & IFF_VNET_HDR:
- return True
- else:
- return False
-
-
-def open_tap(devname, ifname, vnet_hdr=True):
- """
- Open a tap device and returns its file descriptor which is used by
- fd=<fd> parameter of qemu-kvm.
-
- @param ifname: TAP interface name
- @param vnet_hdr: Whether enable the vnet header
- """
- try:
- tapfd = os.open(devname, os.O_RDWR)
- except OSError, e:
- raise TAPModuleError(devname, "open", e)
- flags = IFF_TAP | IFF_NO_PI
- if vnet_hdr and vnet_hdr_probe(tapfd):
- flags |= IFF_VNET_HDR
-
- ifr = struct.pack("16sh", ifname, flags)
- try:
- r = fcntl.ioctl(tapfd, TUNSETIFF, ifr)
- except IOError, details:
- raise TAPCreationError(ifname, details)
- ifname = struct.unpack("16sh", r)[0].strip("\x00")
- return tapfd
-
-
-def add_to_bridge(ifname, brname):
- """
- Add a TAP device to bridge
-
- @param ifname: Name of TAP device
- @param brname: Name of the bridge
- """
- ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
- index = if_nametoindex(ifname)
- if index == 0:
- raise TAPNotExistError(ifname)
- ifr = struct.pack("16si", brname, index)
- try:
- r = fcntl.ioctl(ctrl_sock, SIOCBRADDIF, ifr)
- except IOError, details:
- raise BRAddIfError(ifname, brname, details)
- ctrl_sock.close()
-
-
-def bring_up_ifname(ifname):
- """
- Bring up an interface
-
- @param ifname: Name of the interface
- """
- ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
- ifr = struct.pack("16si", ifname, IFF_UP)
- try:
- fcntl.ioctl(ctrl_sock, SIOCSIFFLAGS, ifr)
- except IOError:
- raise TAPBringUpError(ifname)
- ctrl_sock.close()
-
-
-def if_set_macaddress(ifname, mac):
- """
- Set the mac address for an interface
-
- @param ifname: Name of the interface
- @mac: Mac address
- """
- ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
-
- ifr = struct.pack("256s", ifname)
- try:
- mac_dev = fcntl.ioctl(ctrl_sock, SIOCGIFHWADDR, ifr)[18:24]
- mac_dev = ":".join(["%02x" % ord(m) for m in mac_dev])
- except IOError, e:
- raise HwAddrGetError(ifname)
-
- if mac_dev.lower() == mac.lower():
- return
-
- ifr = struct.pack("16sH14s", ifname, 1,
- "".join([chr(int(m, 16)) for m in mac.split(":")]))
- try:
- fcntl.ioctl(ctrl_sock, SIOCSIFHWADDR, ifr)
- except IOError, e:
- logging.info(e)
- raise HwAddrSetError(ifname, mac)
- ctrl_sock.close()
diff --git a/client/virt/virt_utils_unittest.py b/client/virt/virt_utils_unittest.py
deleted file mode 100755
index 9a2c417..0000000
--- a/client/virt/virt_utils_unittest.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-import common
-from autotest_lib.client.virt import virt_utils
-
-class virt_utils_test(unittest.TestCase):
-
-
- def test_cpu_vendor_intel(self):
- flags = ['fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce',
- 'cx8', 'apic', 'sep', 'mtrr', 'pge', 'mca', 'cmov',
- 'pat', 'pse36', 'clflush', 'dts', 'acpi', 'mmx', 'fxsr',
- 'sse', 'sse2', 'ss', 'ht', 'tm', 'pbe', 'syscall', 'nx',
- 'lm', 'constant_tsc', 'arch_perfmon', 'pebs', 'bts',
- 'rep_good', 'aperfmperf', 'pni', 'dtes64', 'monitor',
- 'ds_cpl', 'vmx', 'smx', 'est', 'tm2', 'ssse3', 'cx16',
- 'xtpr', 'pdcm', 'sse4_1', 'xsave', 'lahf_lm', 'ida',
- 'tpr_shadow', 'vnmi', 'flexpriority']
- vendor = virt_utils.get_cpu_vendor(flags, False)
- self.assertEqual(vendor, 'intel')
-
-
- def test_cpu_vendor_amd(self):
- flags = ['fpu', 'vme', 'de', 'pse', 'tsc', 'msr', 'pae', 'mce',
- 'cx8', 'apic', 'mtrr', 'pge', 'mca', 'cmov', 'pat',
- 'pse36', 'clflush', 'mmx', 'fxsr', 'sse', 'sse2',
- 'ht', 'syscall', 'nx', 'mmxext', 'fxsr_opt', 'pdpe1gb',
- 'rdtscp', 'lm', '3dnowext', '3dnow', 'constant_tsc',
- 'rep_good', 'nonstop_tsc', 'extd_apicid', 'aperfmperf',
- 'pni', 'monitor', 'cx16', 'popcnt', 'lahf_lm',
- 'cmp_legacy', 'svm', 'extapic', 'cr8_legacy', 'abm',
- 'sse4a', 'misalignsse', '3dnowprefetch', 'osvw', 'ibs',
- 'skinit', 'wdt', 'cpb', 'npt', 'lbrv', 'svm_lock',
- 'nrip_save']
- vendor = virt_utils.get_cpu_vendor(flags, False)
- self.assertEqual(vendor, 'amd')
-
-
- def test_vendor_unknown(self):
- flags = ['non', 'sense', 'flags']
- vendor = virt_utils.get_cpu_vendor(flags, False)
- self.assertEqual(vendor, 'unknown')
-
-
- def test_get_archive_tarball_name(self):
- tarball_name = virt_utils.get_archive_tarball_name('/tmp',
- 'tmp-archive',
- 'bz2')
- self.assertEqual(tarball_name, 'tmp-archive.tar.bz2')
-
-
- def test_get_archive_tarball_name_absolute(self):
- tarball_name = virt_utils.get_archive_tarball_name('/tmp',
- '/var/tmp/tmp',
- 'bz2')
- self.assertEqual(tarball_name, '/var/tmp/tmp.tar.bz2')
-
-
- def test_get_archive_tarball_name_from_dir(self):
- tarball_name = virt_utils.get_archive_tarball_name('/tmp',
- None,
- 'bz2')
- self.assertEqual(tarball_name, 'tmp.tar.bz2')
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/client/virt/virt_vm.py b/client/virt/virt_vm.py
deleted file mode 100644
index 8815bf4..0000000
--- a/client/virt/virt_vm.py
+++ /dev/null
@@ -1,834 +0,0 @@
-import os, logging, time, glob, re
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-import virt_utils
-
-class VMError(Exception):
- pass
-
-
-class VMCreateError(VMError):
- def __init__(self, cmd, status, output):
- VMError.__init__(self, cmd, status, output)
- self.cmd = cmd
- self.status = status
- self.output = output
-
- def __str__(self):
- return ("VM creation command failed: %r (status: %s, "
- "output: %r)" % (self.cmd, self.status, self.output))
-
-
-class VMHashMismatchError(VMError):
- def __init__(self, actual, expected):
- VMError.__init__(self, actual, expected)
- self.actual_hash = actual
- self.expected_hash = expected
-
- def __str__(self):
- return ("CD image hash (%s) differs from expected one (%s)" %
- (self.actual_hash, self.expected_hash))
-
-
-class VMImageMissingError(VMError):
- def __init__(self, filename):
- VMError.__init__(self, filename)
- self.filename = filename
-
- def __str__(self):
- return "CD image file not found: %r" % self.filename
-
-
-class VMImageCheckError(VMError):
- def __init__(self, filename):
- VMError.__init__(self, filename)
- self.filename = filename
-
- def __str__(self):
- return "Errors found on image: %r" % self.filename
-
-
-class VMBadPATypeError(VMError):
- def __init__(self, pa_type):
- VMError.__init__(self, pa_type)
- self.pa_type = pa_type
-
- def __str__(self):
- return "Unsupported PCI assignable type: %r" % self.pa_type
-
-
-class VMPAError(VMError):
- def __init__(self, pa_type):
- VMError.__init__(self, pa_type)
- self.pa_type = pa_type
-
- def __str__(self):
- return ("No PCI assignable devices could be assigned "
- "(pci_assignable=%r)" % self.pa_type)
-
-
-class VMPostCreateError(VMError):
- def __init__(self, cmd, output):
- VMError.__init__(self, cmd, output)
- self.cmd = cmd
- self.output = output
-
-
-class VMHugePageError(VMPostCreateError):
- def __str__(self):
- return ("Cannot allocate hugepage memory (command: %r, "
- "output: %r)" % (self.cmd, self.output))
-
-
-class VMKVMInitError(VMPostCreateError):
- def __str__(self):
- return ("Cannot initialize KVM (command: %r, output: %r)" %
- (self.cmd, self.output))
-
-
-class VMDeadError(VMError):
- def __init__(self, reason='', detail=''):
- VMError.__init__(self)
- self.reason = reason
- self.detail = detail
-
- def __str__(self):
- msg = "VM is dead"
- if self.reason:
- msg += " reason: %s" % self.reason
- if self.detail:
- msg += " detail: %r" % self.detail
- return (msg)
-
-
-class VMDeadKernelCrashError(VMError):
- def __init__(self, kernel_crash):
- VMError.__init__(self, kernel_crash)
- self.kernel_crash = kernel_crash
-
- def __str__(self):
- return ("VM is dead due to a kernel crash:\n%s" % self.kernel_crash)
-
-
-class VMAddressError(VMError):
- pass
-
-
-class VMPortNotRedirectedError(VMAddressError):
- def __init__(self, port):
- VMAddressError.__init__(self, port)
- self.port = port
-
- def __str__(self):
- return "Port not redirected: %s" % self.port
-
-
-class VMAddressVerificationError(VMAddressError):
- def __init__(self, mac, ip):
- VMAddressError.__init__(self, mac, ip)
- self.mac = mac
- self.ip = ip
-
- def __str__(self):
- return ("Cannot verify MAC-IP address mapping using arping: "
- "%s ---> %s" % (self.mac, self.ip))
-
-
-class VMMACAddressMissingError(VMAddressError):
- def __init__(self, nic_index):
- VMAddressError.__init__(self, nic_index)
- self.nic_index = nic_index
-
- def __str__(self):
- return "No MAC address defined for NIC #%s" % self.nic_index
-
-
-class VMIPAddressMissingError(VMAddressError):
- def __init__(self, mac):
- VMAddressError.__init__(self, mac)
- self.mac = mac
-
- def __str__(self):
- return "Cannot find IP address for MAC address %s" % self.mac
-
-
-class VMMigrateError(VMError):
- pass
-
-
-class VMMigrateTimeoutError(VMMigrateError):
- pass
-
-
-class VMMigrateCancelError(VMMigrateError):
- pass
-
-
-class VMMigrateFailedError(VMMigrateError):
- pass
-
-class VMMigrateProtoUnsupportedError(VMMigrateError):
- pass
-
-
-class VMMigrateStateMismatchError(VMMigrateError):
- def __init__(self, src_hash, dst_hash):
- VMMigrateError.__init__(self, src_hash, dst_hash)
- self.src_hash = src_hash
- self.dst_hash = dst_hash
-
- def __str__(self):
- return ("Mismatch of VM state before and after migration (%s != %s)" %
- (self.src_hash, self.dst_hash))
-
-
-class VMRebootError(VMError):
- pass
-
-class VMStatusError(VMError):
- pass
-
-def get_image_filename(params, root_dir):
- """
- Generate an image path from params and root_dir.
-
- @param params: Dictionary containing the test parameters.
- @param root_dir: Base directory for relative filenames.
-
- @note: params should contain:
- image_name -- the name of the image file, without extension
- image_format -- the format of the image (qcow2, raw etc)
- """
- image_name = params.get("image_name", "image")
- image_format = params.get("image_format", "qcow2")
- if params.get("image_raw_device") == "yes":
- return image_name
- image_filename = "%s.%s" % (image_name, image_format)
- image_filename = virt_utils.get_path(root_dir, image_filename)
- return image_filename
-
-
-def create_image(params, root_dir):
- """
- Create an image using qemu_image.
-
- @param params: Dictionary containing the test parameters.
- @param root_dir: Base directory for relative filenames.
-
- @note: params should contain:
- image_name -- the name of the image file, without extension
- image_format -- the format of the image (qcow2, raw etc)
- image_cluster_size (optional) -- the cluster size for the image
- image_size -- the requested size of the image (a string
- qemu-img can understand, such as '10G')
- """
- qemu_img_cmd = virt_utils.get_path(root_dir, params.get("qemu_img_binary",
- "qemu-img"))
- qemu_img_cmd += " create"
-
- format = params.get("image_format", "qcow2")
- qemu_img_cmd += " -f %s" % format
-
- image_cluster_size = params.get("image_cluster_size", None)
- if image_cluster_size is not None:
- qemu_img_cmd += " -o cluster_size=%s" % image_cluster_size
-
- image_filename = get_image_filename(params, root_dir)
- qemu_img_cmd += " %s" % image_filename
-
- size = params.get("image_size", "10G")
- qemu_img_cmd += " %s" % size
-
- utils.system(qemu_img_cmd)
- return image_filename
-
-
-def remove_image(params, root_dir):
- """
- Remove an image file.
-
- @param params: A dict
- @param root_dir: Base directory for relative filenames.
-
- @note: params should contain:
- image_name -- the name of the image file, without extension
- image_format -- the format of the image (qcow2, raw etc)
- """
- image_filename = get_image_filename(params, root_dir)
- logging.debug("Removing image file %s", image_filename)
- if os.path.exists(image_filename):
- os.unlink(image_filename)
- else:
- logging.debug("Image file %s not found")
-
-
-def check_image(params, root_dir):
- """
- Check an image using the appropriate tools for each virt backend.
-
- @param params: Dictionary containing the test parameters.
- @param root_dir: Base directory for relative filenames.
-
- @note: params should contain:
- image_name -- the name of the image file, without extension
- image_format -- the format of the image (qcow2, raw etc)
-
- @raise VMImageCheckError: In case qemu-img check fails on the image.
- """
- vm_type = params.get("vm_type")
- if vm_type == 'kvm':
- image_filename = get_image_filename(params, root_dir)
- logging.debug("Checking image file %s", image_filename)
- qemu_img_cmd = virt_utils.get_path(root_dir,
- params.get("qemu_img_binary", "qemu-img"))
- image_is_qcow2 = params.get("image_format") == 'qcow2'
- if os.path.exists(image_filename) and image_is_qcow2:
- # Verifying if qemu-img supports 'check'
- q_result = utils.run(qemu_img_cmd, ignore_status=True)
- q_output = q_result.stdout
- check_img = True
- if not "check" in q_output:
- logging.error("qemu-img does not support 'check', "
- "skipping check")
- check_img = False
- if not "info" in q_output:
- logging.error("qemu-img does not support 'info', "
- "skipping check")
- check_img = False
- if check_img:
- try:
- utils.system("%s info %s" % (qemu_img_cmd, image_filename))
- except error.CmdError:
- logging.error("Error getting info from image %s",
- image_filename)
-
- cmd_result = utils.run("%s check %s" %
- (qemu_img_cmd, image_filename),
- ignore_status=True)
- # Error check, large chances of a non-fatal problem.
- # There are chances that bad data was skipped though
- if cmd_result.exit_status == 1:
- for e_line in cmd_result.stdout.splitlines():
- logging.error("[stdout] %s", e_line)
- for e_line in cmd_result.stderr.splitlines():
- logging.error("[stderr] %s", e_line)
- raise error.TestWarn("qemu-img check error. Some bad data "
- "in the image may have gone unnoticed")
- # Exit status 2 is data corruption for sure, so fail the test
- elif cmd_result.exit_status == 2:
- for e_line in cmd_result.stdout.splitlines():
- logging.error("[stdout] %s", e_line)
- for e_line in cmd_result.stderr.splitlines():
- logging.error("[stderr] %s", e_line)
- raise VMImageCheckError(image_filename)
- # Leaked clusters, they are known to be harmless to data
- # integrity
- elif cmd_result.exit_status == 3:
- raise error.TestWarn("Leaked clusters were noticed during "
- "image check. No data integrity "
- "problem was found though.")
-
- else:
- if not os.path.exists(image_filename):
- logging.debug("Image file %s not found, skipping check",
- image_filename)
- elif not image_is_qcow2:
- logging.debug("Image file %s not qcow2, skipping check",
- image_filename)
-
-
-class BaseVM(object):
- """
- Base class for all hypervisor specific VM subclasses.
-
- This class should not be used directly, that is, do not attempt to
- instantiate and use this class. Instead, one should implement a subclass
- that implements, at the very least, all methods defined right after the
- the comment blocks that are marked with:
-
- "Public API - *must* be reimplemented with virt specific code"
-
- and
-
- "Protected API - *must* be reimplemented with virt specific classes"
-
- The current proposal regarding methods naming convention is:
-
- - Public API methods: named in the usual way, consumed by tests
- - Protected API methods: name begins with a single underline, to be
- consumed only by BaseVM and subclasses
- - Private API methods: name begins with double underline, to be consumed
- only by the VM subclass itself (usually implements virt specific
- functionality: example: __make_qemu_command())
-
- So called "protected" methods are intended to be used only by VM classes,
- and not be consumed by tests. Theses should respect a naming convention
- and always be preceeded by a single underline.
-
- Currently most (if not all) methods are public and appears to be consumed
- by tests. It is a ongoing task to determine whether methods should be
- "public" or "protected".
- """
-
- #
- # Assuming that all low-level hypervisor have at least migration via tcp
- # (true for xen & kvm). Also true for libvirt (using xen and kvm drivers)
- #
- MIGRATION_PROTOS = ['tcp', ]
-
- def __init__(self, name, params):
- self.name = name
- self.params = params
-
- #
- # Assuming all low-level hypervisors will have a serial (like) console
- # connection to the guest. libvirt also supports serial (like) consoles
- # (virDomainOpenConsole). subclasses should set this to an object that
- # is or behaves like aexpect.ShellSession.
- #
- self.serial_console = None
-
- self._generate_unique_id()
-
-
- def _generate_unique_id(self):
- """
- Generate a unique identifier for this VM
- """
- while True:
- self.instance = (time.strftime("%Y%m%d-%H%M%S-") +
- virt_utils.generate_random_string(4))
- if not glob.glob("/tmp/*%s" % self.instance):
- break
-
-
- #
- # Public API - could be reimplemented with virt specific code
- #
- def verify_alive(self):
- """
- Make sure the VM is alive and that the main monitor is responsive.
-
- Can be subclassed to provide better information on why the VM is
- not alive (reason, detail)
-
- @raise VMDeadError: If the VM is dead
- @raise: Various monitor exceptions if the monitor is unresponsive
- """
- if self.is_dead():
- raise VMDeadError
-
-
- def get_mac_address(self, nic_index=0):
- """
- Return the MAC address of a NIC.
-
- @param nic_index: Index of the NIC
- @raise VMMACAddressMissingError: If no MAC address is defined for the
- requested NIC
- """
- nic_name = self.params.objects("nics")[nic_index]
- nic_params = self.params.object_params(nic_name)
- mac = (nic_params.get("nic_mac") or
- virt_utils.get_mac_address(self.instance, nic_index))
- if not mac:
- raise VMMACAddressMissingError(nic_index)
- return mac
-
-
- def verify_kernel_crash(self):
- """
- Find kernel crash message on the VM serial console.
-
- @raise: VMDeadKernelCrashError, in case a kernel crash message was
- found.
- """
- if self.serial_console is not None:
- data = self.serial_console.get_output()
- match = re.search(r"BUG:.*---\[ end trace .* \]---", data,
- re.DOTALL|re.MULTILINE)
- if match is not None:
- raise VMDeadKernelCrashError(match.group(0))
-
-
- def get_params(self):
- """
- Return the VM's params dict. Most modified params take effect only
- upon VM.create().
- """
- return self.params
-
-
- def get_serial_console_filename(self):
- """
- Return the serial console filename.
- """
- return "/tmp/serial-%s" % self.instance
-
-
- def get_testlog_filename(self):
- """
- Return the testlog filename.
- """
- return "/tmp/testlog-%s" % self.instance
-
-
- @error.context_aware
- def login(self, nic_index=0, timeout=10):
- """
- Log into the guest via SSH/Telnet/Netcat.
- If timeout expires while waiting for output from the guest (e.g. a
- password prompt or a shell prompt) -- fail.
-
- @param nic_index: The index of the NIC to connect to.
- @param timeout: Time (seconds) before giving up logging into the
- guest.
- @return: A ShellSession object.
- """
- error.context("logging into '%s'" % self.name)
- username = self.params.get("username", "")
- password = self.params.get("password", "")
- prompt = self.params.get("shell_prompt", "[\#\$]")
- linesep = eval("'%s'" % self.params.get("shell_linesep", r"\n"))
- client = self.params.get("shell_client")
- address = self.get_address(nic_index)
- port = self.get_port(int(self.params.get("shell_port")))
- log_filename = ("session-%s-%s.log" %
- (self.name, virt_utils.generate_random_string(4)))
- session = virt_utils.remote_login(client, address, port, username,
- password, prompt, linesep,
- log_filename, timeout)
- session.set_status_test_command(self.params.get("status_test_command",
- ""))
- return session
-
-
- def remote_login(self, nic_index=0, timeout=10):
- """
- Alias for login() for backward compatibility.
- """
- return self.login(nic_index, timeout)
-
-
- def wait_for_login(self, nic_index=0, timeout=240, internal_timeout=10):
- """
- Make multiple attempts to log into the guest via SSH/Telnet/Netcat.
-
- @param nic_index: The index of the NIC to connect to.
- @param timeout: Time (seconds) to keep trying to log in.
- @param internal_timeout: Timeout to pass to login().
- @return: A ShellSession object.
- """
- logging.debug("Attempting to log into '%s' (timeout %ds)", self.name,
- timeout)
- end_time = time.time() + timeout
- while time.time() < end_time:
- try:
- return self.login(nic_index, internal_timeout)
- except (virt_utils.LoginError, VMError), e:
- logging.debug(e)
- time.sleep(2)
- # Timeout expired; try one more time but don't catch exceptions
- return self.login(nic_index, internal_timeout)
-
-
- @error.context_aware
- def copy_files_to(self, host_path, guest_path, nic_index=0, verbose=False,
- timeout=600):
- """
- Transfer files to the remote host(guest).
-
- @param host_path: Host path
- @param guest_path: Guest path
- @param nic_index: The index of the NIC to connect to.
- @param verbose: If True, log some stats using logging.debug (RSS only)
- @param timeout: Time (seconds) before giving up on doing the remote
- copy.
- """
- error.context("sending file(s) to '%s'" % self.name)
- username = self.params.get("username", "")
- password = self.params.get("password", "")
- client = self.params.get("file_transfer_client")
- address = self.get_address(nic_index)
- port = self.get_port(int(self.params.get("file_transfer_port")))
- log_filename = ("transfer-%s-to-%s-%s.log" %
- (self.name, address,
- virt_utils.generate_random_string(4)))
- virt_utils.copy_files_to(address, client, username, password, port,
- host_path, guest_path, log_filename, verbose,
- timeout)
-
-
- @error.context_aware
- def copy_files_from(self, guest_path, host_path, nic_index=0,
- verbose=False, timeout=600):
- """
- Transfer files from the guest.
-
- @param host_path: Guest path
- @param guest_path: Host path
- @param nic_index: The index of the NIC to connect to.
- @param verbose: If True, log some stats using logging.debug (RSS only)
- @param timeout: Time (seconds) before giving up on doing the remote
- copy.
- """
- error.context("receiving file(s) from '%s'" % self.name)
- username = self.params.get("username", "")
- password = self.params.get("password", "")
- client = self.params.get("file_transfer_client")
- address = self.get_address(nic_index)
- port = self.get_port(int(self.params.get("file_transfer_port")))
- log_filename = ("transfer-%s-from-%s-%s.log" %
- (self.name, address,
- virt_utils.generate_random_string(4)))
- virt_utils.copy_files_from(address, client, username, password, port,
- guest_path, host_path, log_filename,
- verbose, timeout)
-
-
- @error.context_aware
- def serial_login(self, timeout=10):
- """
- Log into the guest via the serial console.
- If timeout expires while waiting for output from the guest (e.g. a
- password prompt or a shell prompt) -- fail.
-
- @param timeout: Time (seconds) before giving up logging into the guest.
- @return: ShellSession object on success and None on failure.
- """
- error.context("logging into '%s' via serial console" % self.name)
- username = self.params.get("username", "")
- password = self.params.get("password", "")
- prompt = self.params.get("shell_prompt", "[\#\$]")
- linesep = eval("'%s'" % self.params.get("shell_linesep", r"\n"))
- status_test_command = self.params.get("status_test_command", "")
-
- self.serial_console.set_linesep(linesep)
- self.serial_console.set_status_test_command(status_test_command)
-
- # Try to get a login prompt
- self.serial_console.sendline()
-
- virt_utils._remote_login(self.serial_console, username, password,
- prompt, timeout)
- return self.serial_console
-
-
- def wait_for_serial_login(self, timeout=240, internal_timeout=10):
- """
- Make multiple attempts to log into the guest via serial console.
-
- @param timeout: Time (seconds) to keep trying to log in.
- @param internal_timeout: Timeout to pass to serial_login().
- @return: A ShellSession object.
- """
- logging.debug("Attempting to log into '%s' via serial console "
- "(timeout %ds)", self.name, timeout)
- end_time = time.time() + timeout
- while time.time() < end_time:
- try:
- return self.serial_login(internal_timeout)
- except virt_utils.LoginError, e:
- logging.debug(e)
- time.sleep(2)
- # Timeout expired; try one more time but don't catch exceptions
- return self.serial_login(internal_timeout)
-
-
- def get_uuid(self):
- """
- Catch UUID of the VM.
-
- @return: None,if not specified in config file
- """
- if self.params.get("uuid") == "random":
- return self.uuid
- else:
- return self.params.get("uuid", None)
-
-
- def send_string(self, str):
- """
- Send a string to the VM.
-
- @param str: String, that must consist of alphanumeric characters only.
- Capital letters are allowed.
- """
- for char in str:
- if char.isupper():
- self.send_key("shift-%s" % char.lower())
- else:
- self.send_key(char)
-
-
- def get_cpu_count(self):
- """
- Get the cpu count of the VM.
- """
- session = self.login()
- try:
- return int(session.cmd(self.params.get("cpu_chk_cmd")))
- finally:
- session.close()
-
-
- def get_memory_size(self, cmd=None):
- """
- Get bootup memory size of the VM.
-
- @param check_cmd: Command used to check memory. If not provided,
- self.params.get("mem_chk_cmd") will be used.
- """
- session = self.login()
- try:
- if not cmd:
- cmd = self.params.get("mem_chk_cmd")
- mem_str = session.cmd(cmd)
- mem = re.findall("([0-9]+)", mem_str)
- mem_size = 0
- for m in mem:
- mem_size += int(m)
- if "GB" in mem_str:
- mem_size *= 1024
- elif "MB" in mem_str:
- pass
- else:
- mem_size /= 1024
- return int(mem_size)
- finally:
- session.close()
-
-
- def get_current_memory_size(self):
- """
- Get current memory size of the VM, rather than bootup memory.
- """
- cmd = self.params.get("mem_chk_cur_cmd")
- return self.get_memory_size(cmd)
-
-
- #
- # Public API - *must* be reimplemented with virt specific code
- #
- def is_alive(self):
- """
- Return True if the VM is alive and the management interface is responsive.
- """
- raise NotImplementedError
-
-
- def is_dead(self):
- """
- Return True if the the VM is dead.
- """
- raise NotImplementedError
-
-
- def get_address(self, index=0):
- """
- Return the IP address of a NIC of the guest
-
- @param index: Index of the NIC whose address is requested.
- @raise VMMACAddressMissingError: If no MAC address is defined for the
- requested NIC
- @raise VMIPAddressMissingError: If no IP address is found for the the
- NIC's MAC address
- @raise VMAddressVerificationError: If the MAC-IP address mapping cannot
- be verified (using arping)
- """
- raise NotImplementedError
-
-
- def clone(self, name, **params):
- """
- Return a clone of the VM object with optionally modified parameters.
-
- This method should be implemented by
- """
- raise NotImplementedError
-
-
- def destroy(self, gracefully=True, free_mac_addresses=True):
- """
- Destroy the VM.
-
- If gracefully is True, first attempt to shutdown the VM with a shell
- command. Then, attempt to destroy the VM via the monitor with a 'quit'
- command. If that fails, send SIGKILL to the qemu process.
-
- @param gracefully: If True, an attempt will be made to end the VM
- using a shell command before trying to end the qemu process
- with a 'quit' or a kill signal.
- @param free_mac_addresses: If True, the MAC addresses used by the VM
- will be freed.
- """
- raise NotImplementedError
-
-
- def migrate(self, timeout=3600, protocol="tcp", cancel_delay=None,
- offline=False, stable_check=False, clean=True,
- save_path="/tmp", dest_host="localhost", remote_port=None):
- """
- Migrate the VM.
-
- If the migration is local, the VM object's state is switched with that
- of the destination VM. Otherwise, the state is switched with that of
- a dead VM (returned by self.clone()).
-
- @param timeout: Time to wait for migration to complete.
- @param protocol: Migration protocol ('tcp', 'unix' or 'exec').
- @param cancel_delay: If provided, specifies a time duration after which
- migration will be canceled. Used for testing migrate_cancel.
- @param offline: If True, pause the source VM before migration.
- @param stable_check: If True, compare the VM's state after migration to
- its state before migration and raise an exception if they
- differ.
- @param clean: If True, delete the saved state files (relevant only if
- stable_check is also True).
- @save_path: The path for state files.
- @param dest_host: Destination host (defaults to 'localhost').
- @param remote_port: Port to use for remote migration.
- """
- raise NotImplementedError
-
-
- def reboot(self, session=None, method="shell", nic_index=0, timeout=240):
- """
- Reboot the VM and wait for it to come back up by trying to log in until
- timeout expires.
-
- @param session: A shell session object or None.
- @param method: Reboot method. Can be "shell" (send a shell reboot
- command) or "system_reset" (send a system_reset monitor command).
- @param nic_index: Index of NIC to access in the VM, when logging in
- after rebooting.
- @param timeout: Time to wait for login to succeed (after rebooting).
- @return: A new shell session object.
- """
- raise NotImplementedError
-
-
- # should this really be expected from VMs of all hypervisor types?
- def send_key(self, keystr):
- """
- Send a key event to the VM.
-
- @param: keystr: A key event string (e.g. "ctrl-alt-delete")
- """
- raise NotImplementedError
-
-
- def save_to_file(self, path):
- """
- Save the state of virtual machine to a file through migrate to
- exec
- """
- raise NotImplementedError
-
-
- def needs_restart(self, name, params, basedir):
- """
- Based on virt preprocessing information, decide whether the VM needs
- a restart.
- """
- raise NotImplementedError
diff --git a/contrib/virt/README b/contrib/virt/README
deleted file mode 100644
index fbf8ce7..0000000
--- a/contrib/virt/README
+++ /dev/null
@@ -1,74 +0,0 @@
-About this:
------------
-
-This module contains extensions to `atest` that proved to be useful
-when doing virtualization testing of multiple KVM versions, on multiple
-operating system versions (Fedora, RHEL5, RHEL6).
-
-It uses a simple templating mechanism, to inject extra configuration into
-the server control file, that will then end up on the cartesian config
-file parsing. These options can be set directly with the command line
-options `--extra-cartesian-config` or indirectly with other command line
-options such as `--koji-tag` and `--koji-pkg`.
-
-Some options, such as the koji ones, will trigger local validation, that
-is, errors such as specifying invalid packages will be caught right away,
-and the job won't be submitted. This is to prevent a typo from triggering
-a job that will fail and waste developer time.
-
-
-Instalation:
-------------
-
-1) copy (or link) the site_job.py file to <autotest_root>/cli/,
-usually /usr/local/autotest/cli.
-
-2) validate it is working by running:
-
- # <autotest_root>/cli/atest job create --help
-
-The output should include the added options:
-
-...
- -T, --template Control file is actually a template
- -x EXTRA_CARTESIAN_CONFIG, --extra-cartesian-config=EXTRA_CARTESIAN_CONFIG
- Add extra configuration to the cartesian config file
- --timestamp Add a timestamp to the name of the job
- --koji-arch=KOJI_ARCH
- Default architecture for packages that will be fetched
- from koji build. This will be combined with
- "noarch".This option is used to help to validate
- packages from the job submitting machine.
- --koji-tag=KOJI_TAG Sets a default koji tag for koji packages specified
- with --koji-pkg
- --koji-pkg=KOJI_PKG Packages to add to host installation based on koji
- build. This options may be specified multiple times.
-
-
-Usage Examples:
----------------
-
-These examples actually depend on local cartersian configuration, that is,
-they might not work out of the box in your autotest installation. Please
-use them only as a reference and adapt the examples to your scenario:
-
-1) To run a test of the upstream qemu git repo:
-
- # <autotest_root>/cli/atest job create -s -m "[email protected]" \
- -f "<autotest_root>/contrib/virt/control.template" -T --timestamp \
- -x 'only qemu-git..sanity' "Upstream qemu.git sanity"
-
-2) To run a test with specific packages built on koji:
-
- # <autotest_root>/cli/atest job create -s -m "[email protected]" \
- -f "<autotest_root>/contrib/virt/control.template" -T --timestamp \
- --koji-tag=f15 --koji-pkg=':qemu-kvm:qemu-kvm,qemu-img,qemu-kvm-tools' \
- --koji-pkg='seabios' --koji-pkg='vgabios' --koji-pkg=':gpxe:gpxe-roms-qemu' \
- --koji-pkg=':spice-server:spice-server' \
- -x 'only f15-koji..sanity' "Fedora 15 Koji Sanity"
-
-
-Contributed by (who to bug):
-----------------------------
-Cleber Rosa ([email protected])
-Lucas Meneghel Rodrigues ([email protected])
diff --git a/contrib/virt/control.template b/contrib/virt/control.template
deleted file mode 100644
index c978f14..0000000
--- a/contrib/virt/control.template
+++ /dev/null
@@ -1,47 +0,0 @@
-import logging, os, sys, fcntl
-kvm_test_dir = "/usr/local/autotest/client/tests/kvm"
-from autotest_lib.client.common_lib import cartesian_config
-
-def get_control(params, custom_cfg):
- control = '''
-import sys, os, logging
-os.environ['LANG'] = 'en_US.UTF-8'
-kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests', 'kvm')
-sys.path.append(kvm_test_dir)
-from autotest_lib.client.common_lib import cartesian_config
-from autotest_lib.client.virt import virt_utils
-
-kernel_install_params = %s
-custom_cfg = %s
-
-def step_init():
- job.next_step([step_test])
- virt_utils.install_host_kernel(job, kernel_install_params)
-
-def step_test():
- parser = cartesian_config.Parser()
- parser.parse_file(os.path.join(kvm_test_dir, "redhat.cfg"))
- for line in custom_cfg:
- parser.parse_string(line)
- virt_utils.run_tests(parser, job)
-''' % (params, custom_cfg)
- return control
-
-def run(machine):
- parser = cartesian_config.Parser()
- parser.parse_file(os.path.join(kvm_test_dir, "redhat.cfg"))
- custom_cfg = $custom_job_cfg
- for line in custom_cfg:
- parser.parse_string(line)
- generator = parser.get_dicts()
- params = generator.next()
- host = hosts.create_host(machine)
- profile = params.get('host_install_profile')
- timeout = int(params.get('host_install_timeout', 3600))
- if profile:
- host.install(profile=profile, timeout=timeout)
- at = autotest.Autotest(host)
- control = get_control(params, custom_cfg)
- at.run(control)
-
-job.parallel_simple(run, machines)
diff --git a/contrib/virt/site_job.py b/contrib/virt/site_job.py
deleted file mode 100644
index 98c738b..0000000
--- a/contrib/virt/site_job.py
+++ /dev/null
@@ -1,198 +0,0 @@
-import os, re, sys, pwd, time, socket, getpass
-import inspect, new, logging, string, tempfile
-
-from autotest_lib.cli import topic_common, action_common
-from autotest_lib.cli import job
-from autotest_lib.client.common_lib import logging_config
-from autotest_lib.client.virt import virt_utils
-
-logging_config.LoggingConfig().configure_logging(verbose=True)
-
-
-class site_job(job.job):
- pass
-
-
-class site_job_create(job.job_create):
- """
- Adds job manipulation including installing packages from brew
- """
-
- op_action = 'create'
-
- def __init__(self):
- super(site_job_create, self).__init__()
- self.parser.add_option('-T', '--template', action='store_true',
- help='Control file is actually a template')
- self.parser.add_option('-x', '--extra-cartesian-config',
- action='append',
- help='Add extra configuration to the cartesian '
- 'config file')
- self.parser.add_option('--timestamp', action='store_true',
- help='Add a timestamp to the name of the job')
- self.parser.add_option('--koji-arch', default='x86_64',
- help='Default architecture for packages '
- 'that will be fetched from koji build. '
- 'This will be combined with "noarch".'
- 'This option is used to help to validate '
- 'packages from the job submitting machine.')
- self.parser.add_option('--koji-tag', help='Sets a default koji tag '
- 'for koji packages specified with --koji-pkg')
- self.parser.add_option('--koji-pkg', action='append',
- help='Packages to add to host installation '
- 'based on koji build. This options may be '
- 'specified multiple times.')
- self.koji_client = None
-
-
- def parse(self):
- '''
- Parse options.
-
- If any brew options is specified, instantiate KojiDownloader
- '''
- (self.command_line_options,
- self.command_line_leftover) = super(site_job_create, self).parse()
-
- #
- # creating the new control file
- #
- if (self.command_line_options.template and
- self.command_line_options.control_file):
- generated_control_file = self._generate_control_file()
- self.data['control_file'] = open(generated_control_file).read()
-
- if self.command_line_options.koji_pkg:
- if self.koji_client is None:
- self.koji_client = virt_utils.KojiClient()
-
- return (self.command_line_options, self.command_line_leftover)
-
-
- def _process_options(self):
- '''
- Process all options given on command line
- '''
- all_options_valid = True
-
- self._set_koji_tag()
- if not self._check_koji_packages():
- all_options_valid = False
-
- return all_options_valid
-
-
- def _set_koji_tag(self):
- '''
- Sets the default koji tag.
-
- Configuration item on file is: koji_tag
- '''
- if self.command_line_options.koji_tag is not None:
- virt_utils.set_default_koji_tag(self.command_line_options.koji_tag)
-
-
- def _check_koji_packages(self):
- '''
- Check if packages specification are valid and exist on koji/brew
-
- Configuration item on file is: koji_pkgs
- '''
- all_packages_found = True
- if self.command_line_options.koji_pkg is not None:
- logging.debug('Checking koji packages specification')
- for pkg_spec_text in self.command_line_options.koji_pkg:
- pkg_spec = virt_utils.KojiPkgSpec(pkg_spec_text)
-
- if not (pkg_spec.is_valid() and
- self.koji_client.is_pkg_valid(pkg_spec)):
- logging.error('Koji package spec is not valid, skipping: '
- '%s' % pkg_spec)
- all_packages_found = False
- else:
- rpms = self.koji_client.get_pkg_rpm_info(
- pkg_spec,
- self.command_line_options.koji_arch)
- for subpackage in pkg_spec.subpackages:
- if subpackage not in [rpm['name'] for rpm in rpms]:
- logging.error('Package specified but not found in '
- 'koji: %s' % subpackage)
- all_packages_found = False
-
- rpms = ", ".join(rpm['nvr'] for rpm in rpms)
- logging.debug('Koji package spec is valid')
- logging.debug('Koji packages to be fetched and installed: '
- '%s' % rpms)
-
- return all_packages_found
-
- def _generate_job_config(self):
- '''
- Converts all options given on the command line to config file syntax
- '''
- extra = []
- if self.command_line_options.extra_cartesian_config:
- extra += self.command_line_options.extra_cartesian_config
-
- if self.command_line_options.koji_tag:
- extra.append("koji_tag = %s" % self.command_line_options.koji_tag)
-
- if self.command_line_options.koji_pkg:
- koji_pkgs = []
- for koji_pkg in self.command_line_options.koji_pkg:
- koji_pkgs.append('"%s"' % koji_pkg)
- extra.append("koji_pkgs = [%s]" % ', '.join(koji_pkgs))
-
- # add quotes...
- extra = ["'%s'" % e for e in extra]
- # ... and return as string that will be eval'd as a Python list
- return "[%s]" % ', '.join(extra)
-
-
- def _generate_control_file(self):
- '''
- Generates a controle file from a template
- '''
- custom_job_cfg = self._generate_job_config()
- input_file = self.command_line_options.control_file
- logging.debug('Generating control file from template: %s' % input_file)
- template = string.Template(open(input_file).read())
- output_fd, path = tempfile.mkstemp(prefix='atest_control_', dir='/tmp')
- logging.debug('Generated control file to be saved at: %s' % path)
- parameters_dict = {"custom_job_cfg": custom_job_cfg}
- control_file_text = template.substitute(parameters_dict)
- os.write(output_fd, control_file_text)
- os.close(output_fd)
- return path
-
-
- def execute(self):
- if not self._process_options():
- self.generic_error('Some command line options validation failed. '
- 'Aborting job creation.')
- return
-
- #
- # add timestamp to the jobname
- #
- if self.command_line_options.timestamp:
- logging.debug("Adding timestamp to jobname")
- timestamp = time.strftime(" %m-%d-%Y %H:%M:%S", time.localtime())
- self.jobname += timestamp
- self.data['name'] = self.jobname
-
- execute_results = super(site_job_create, self).execute()
- self.output(execute_results)
-
-
-for cls in [getattr(job, n) for n in dir(job) if not n.startswith("_")]:
- if not inspect.isclass(cls):
- continue
- cls_name = cls.__name__
- site_cls_name = 'site_' + cls_name
- if hasattr(sys.modules[__name__], site_cls_name):
- continue
- bases = (site_job, cls)
- members = {'__doc__': cls.__doc__}
- site_cls = new.classobj(site_cls_name, bases, members)
- setattr(sys.modules[__name__], site_cls_name, site_cls)