From mboxrd@z Thu Jan 1 00:00:00 1970
From: Lucas Meneghel Rodrigues
Subject: [PATCH 2/3] KVM test: Infrastructure cleanups
Date: Mon, 24 Jan 2011 02:22:20 -0200
Message-ID: <1295842941-11557-3-git-send-email-lmr@redhat.com>
References: <1295842941-11557-1-git-send-email-lmr@redhat.com>
Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues
To: autotest@test.kernel.org
Return-path:
Received: from mx1.redhat.com ([209.132.183.28]:6353 "EHLO mx1.redhat.com"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1751346Ab1AXEWb (ORCPT );
Sun, 23 Jan 2011 23:22:31 -0500
In-Reply-To: <1295842941-11557-1-git-send-email-lmr@redhat.com>
Sender: kvm-owner@vger.kernel.org
List-ID:
Following the same logic as the previous patch, go through
the modules and clean up unneeded modules from the core
infrastructure. Obviously only the safe, low-hanging fruit
cleanups were made.
Signed-off-by: Lucas Meneghel Rodrigues
---
client/tests/kvm/cd_hash.py | 2 +-
client/tests/kvm/get_started.py | 4 +-
client/tests/kvm/html_report.py | 58 ++++++++++++++++----------------
client/tests/kvm/installer.py | 6 ++--
client/tests/kvm/kvm.py | 2 +-
client/tests/kvm/kvm_config.py | 2 +-
client/tests/kvm/kvm_preprocessing.py | 4 +-
client/tests/kvm/kvm_test_utils.py | 14 ++++----
client/tests/kvm/kvm_utils.py | 41 ++++++++++++-----------
client/tests/kvm/kvm_vm.py | 50 +++++++++++++++++-----------
client/tests/kvm/scan_results.py | 2 +-
client/tests/kvm/stepeditor.py | 35 +++++++++++++-------
client/tests/kvm/test_setup.py | 2 +-
13 files changed, 122 insertions(+), 100 deletions(-)
diff --git a/client/tests/kvm/cd_hash.py b/client/tests/kvm/cd_hash.py
index bcd14dc..04f8cbe 100755
--- a/client/tests/kvm/cd_hash.py
+++ b/client/tests/kvm/cd_hash.py
@@ -8,7 +8,7 @@ Program that calculates several hashes for a given CD image.
import os, sys, optparse, logging
import common
import kvm_utils
-from autotest_lib.client.common_lib import logging_config, logging_manager
+from autotest_lib.client.common_lib import logging_manager
from autotest_lib.client.bin import utils
diff --git a/client/tests/kvm/get_started.py b/client/tests/kvm/get_started.py
index 126d8a7..5ce7349 100755
--- a/client/tests/kvm/get_started.py
+++ b/client/tests/kvm/get_started.py
@@ -5,10 +5,10 @@ Program to help setup kvm test environment
@copyright: Red Hat 2010
"""
-import os, sys, optparse, logging, shutil
+import os, sys, logging, shutil
import common, kvm_utils
from autotest_lib.client.common_lib import logging_manager
-from autotest_lib.client.bin import utils, os_dep
+from autotest_lib.client.bin import utils
def check_iso(url, destination, hash):
diff --git a/client/tests/kvm/html_report.py b/client/tests/kvm/html_report.py
index ebc9c12..8b4b109 100755
--- a/client/tests/kvm/html_report.py
+++ b/client/tests/kvm/html_report.py
@@ -11,7 +11,7 @@ import os, sys, re, getopt, time, datetime, commands
import common
-format_css="""
+format_css = """
html,body {
padding:0;
color:#222;
@@ -180,7 +180,7 @@ font-size: 13px;}
"""
-table_js="""
+table_js = """
/**
* Copyright (c)2005-2007 Matt Kruse (javascripttoolbox.com)
*
@@ -1380,11 +1380,11 @@ function processList(ul) {
## input and create a single html formatted result page. ##
#################################################################
-stimelist=[]
+stimelist = []
def make_html_file(metadata, results, tag, host, output_file_name, dirname):
- html_prefix="""
+ html_prefix = """
@@ -1405,7 +1405,7 @@ return true;
-"""%(format_css, table_js, maketree_js)
+""" % (format_css, table_js, maketree_js)
if output_file_name:
@@ -1427,13 +1427,13 @@ return true;
total_failed = 0
total_passed = 0
for res in results:
- total_executed+=1
+ total_executed += 1
if res['status'] == 'GOOD':
- total_passed+=1
+ total_passed += 1
else:
- total_failed+=1
+ total_failed += 1
stat_str = 'No test cases executed'
- if total_executed>0:
+ if total_executed > 0:
failed_perct = int(float(total_failed)/float(total_executed)*100)
stat_str = ('From %d tests executed, %d have passed (%d%% failures)' %
(total_executed, total_passed, failed_perct))
@@ -1486,15 +1486,15 @@ id="t1" class="stats table-autosort:4 table-autofilter table-stripeclass:alterna
if res['log']:
#chop all '\n' from log text (to prevent html errors)
rx1 = re.compile('(\s+)')
- log_text = rx1.sub(' ',res['log'])
+ log_text = rx1.sub(' ', res['log'])
# allow only a-zA-Z0-9_ in html title name
# (due to bug in MS-explorer)
rx2 = re.compile('([^a-zA-Z_0-9])')
- updated_tag = rx2.sub('_',res['title'])
+ updated_tag = rx2.sub('_', res['title'])
- html_body_text = '%s%s'%(str(updated_tag),log_text)
- print >> output, '| Info | '%(str(updated_tag),str(html_body_text))
+ html_body_text = '%s%s' % (str(updated_tag), log_text)
+ print >> output, 'Info | ' % (str(updated_tag), str(html_body_text))
else:
print >> output, ' | '
# print execution time
@@ -1514,7 +1514,7 @@ id="t1" class="stats table-autosort:4 table-autofilter table-stripeclass:alterna
print >> output, '
'
print >> output, '