Now fixing the places where we're raising string exceptions on the
client code. The patch also fixes identation errors in the iostat
profiler and error.py'>error.py.
Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1158 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/dacapo/dacapo.py b/client/tests/dacapo/dacapo.py
index 4dfca7d..c8122d2 100644
--- a/client/tests/dacapo/dacapo.py
+++ b/client/tests/dacapo/dacapo.py
@@ -94,5 +94,7 @@
try:
system('java -jar %s %s' % (self.dacapo_pkg, self.args))
except:
- raise TestError, \
+ e_msg = \
'Test %s has failed, command line options "%s"' % (test, self.args)
+ raise TestError(e_msg)
+
diff --git a/client/tests/disktest/disktest.py b/client/tests/disktest/disktest.py
index 219b3a7..85c2997 100755
--- a/client/tests/disktest/disktest.py
+++ b/client/tests/disktest/disktest.py
@@ -41,8 +41,8 @@
self.chunk_mb = chunk_mb
self.memory_mb = memtotal()/1024
if self.memory_mb > chunk_mb:
- raise "Too much RAM (%dMB) for this test to work" % \
- self.memory_mb
+ e_msg = "Too much RAM (%dMB) for this test to work" % self.memory_mb
+ raise TestError(e_msg)
chunks = (1024 * gigabytes) / chunk_mb
@@ -57,5 +57,5 @@
if (retval != 0):
errors.append(retval)
if errors:
- raise "Errors from children: %s" % errors
-
+ raise TestError("Errors from children: %s" % errors)
+
diff --git a/client/tests/parallel_dd/parallel_dd.py b/client/tests/parallel_dd/parallel_dd.py
index 2c06d73..679188b 100755
--- a/client/tests/parallel_dd/parallel_dd.py
+++ b/client/tests/parallel_dd/parallel_dd.py
@@ -71,7 +71,7 @@
try:
self.fs.unmount()
finally:
- raise
+ raise TestError('Unable to umount filesystem')
self.fs.unmount()
self.fs_write_rate = self.megabytes / (time.time() - start)
@@ -83,7 +83,7 @@
try:
self.fs.unmount()
finally:
- raise
+ raise TestError('Unable to mount filesystem')
read_in()
self.fs_read_rate = self.megabytes / (time.time() - start)
self.fs.unmount()
diff --git a/client/tests/raisetest/raisetest.py b/client/tests/raisetest/raisetest.py
index 36c6bea..63f9b8d 100755
--- a/client/tests/raisetest/raisetest.py
+++ b/client/tests/raisetest/raisetest.py
@@ -5,4 +5,4 @@
version = 1
def execute(self):
- raise 'Arrrrrrrrggggh. You are DOOOMED'
+ raise TestError('Arrrrrrrrggggh. You are DOOOMED')
diff --git a/client/tests/sysbench/sysbench.py b/client/tests/sysbench/sysbench.py
index 71cc465..334114b 100644
--- a/client/tests/sysbench/sysbench.py
+++ b/client/tests/sysbench/sysbench.py
@@ -38,7 +38,7 @@
try:
system(self.sudo + '/bin/true')
except:
- raise 'Unable to run as nobody'
+ raise TestError('Unable to run as nobody')
if (db_type == 'pgsql'):
self.execute_pgsql(build, num_threads, max_time, \
@@ -86,7 +86,7 @@
cmd = cmd + ' --oltp-read-only=on'
profilers = self.job.profilers
- if not profilers.only():
+ if not profilers.only():
system(cmd + ' run')
# Do a profiling run if necessary
@@ -98,7 +98,7 @@
profilers.report(self)
except:
system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
- raise
+ raise TestError('Unable to start postgreSQL')
system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
@@ -154,7 +154,7 @@
profilers.report(self)
except:
system(bin + '/mysqladmin shutdown')
- raise
+ raise TestError('Unable to start mySQL')
system(bin + '/mysqladmin shutdown')