Add control files used to test error handling scenarios that
an autotest client must deal with and classify properly.

Signed-off-by: Gregory Smith <gps@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2513 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/error_cleanup/control b/client/tests/error_cleanup/control
new file mode 100644
index 0000000..efebec2
--- /dev/null
+++ b/client/tests/error_cleanup/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for cleanup phase exception"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise an exception during cleanup().  This tests Autotest itself."""
+
+job.run_test('error_cleanup')
diff --git a/client/tests/error_cleanup/error_cleanup.py b/client/tests/error_cleanup/error_cleanup.py
new file mode 100644
index 0000000..9258522
--- /dev/null
+++ b/client/tests/error_cleanup/error_cleanup.py
@@ -0,0 +1,12 @@
+from autotest_lib.client.bin import test
+
+class error_cleanup(test.test):
+    version = 1
+
+
+    def execute(self):
+        pass
+
+
+    def cleanup(self):
+        raise NameError("test a bug in cleanup()")
diff --git a/client/tests/error_initialize/control b/client/tests/error_initialize/control
new file mode 100644
index 0000000..dbd54bd
--- /dev/null
+++ b/client/tests/error_initialize/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for initialize phase exception"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise an exception during initialize().  This tests Autotest itself."""
+
+job.run_test('error_initialize')
diff --git a/client/tests/error_initialize/error_initialize.py b/client/tests/error_initialize/error_initialize.py
new file mode 100644
index 0000000..adb05da
--- /dev/null
+++ b/client/tests/error_initialize/error_initialize.py
@@ -0,0 +1,12 @@
+from autotest_lib.client.bin import test
+
+class error_initialize(test.test):
+    version = 1
+
+
+    def initialize(self):
+        raise NameError("test a bug in initialize()")
+
+
+    def execute(self):
+        pass
diff --git a/client/tests/error_setup/control b/client/tests/error_setup/control
new file mode 100644
index 0000000..40d6f9c
--- /dev/null
+++ b/client/tests/error_setup/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for setup phase exception"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise an exception during setup().  This tests Autotest itself."""
+
+job.run_test('error_setup')
diff --git a/client/tests/error_setup/error_setup.py b/client/tests/error_setup/error_setup.py
new file mode 100644
index 0000000..1a3be4a
--- /dev/null
+++ b/client/tests/error_setup/error_setup.py
@@ -0,0 +1,11 @@
+from autotest_lib.client.bin import test
+
+class error_setup(test.test):
+    version = 1
+
+
+    def setup(self):
+        raise ValueError("test a bug in setup()")
+
+    def execute(self):
+        pass
diff --git a/client/tests/error_test_bug/control b/client/tests/error_test_bug/control
new file mode 100644
index 0000000..57a4f57
--- /dev/null
+++ b/client/tests/error_test_bug/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test of a buggy test class"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Simulate a buggy test.  This is for testing Autotest itself."""
+
+job.run_test('error_test_bug')
diff --git a/client/tests/error_test_bug/error_test_bug.py b/client/tests/error_test_bug/error_test_bug.py
new file mode 100644
index 0000000..ccb901c
--- /dev/null
+++ b/client/tests/error_test_bug/error_test_bug.py
@@ -0,0 +1,9 @@
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import test
+
+class error_test_bug(test.test):
+    version = 1
+
+
+    def execute(self):
+        raise RuntimeError("Woof Woof, Timmy's trapped in the well!")
diff --git a/client/tests/error_test_error/control b/client/tests/error_test_error/control
new file mode 100644
index 0000000..648828b
--- /dev/null
+++ b/client/tests/error_test_error/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for ERROR"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise a TestError.  This is for testing Autotest itself."""
+
+job.run_test('error_test_error')
diff --git a/client/tests/error_test_error/error_test_error.py b/client/tests/error_test_error/error_test_error.py
new file mode 100644
index 0000000..6b9b928
--- /dev/null
+++ b/client/tests/error_test_error/error_test_error.py
@@ -0,0 +1,9 @@
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import test
+
+class error_test_error(test.test):
+    version = 1
+
+
+    def execute(self):
+        raise error.TestError("This test always causes an error.")
diff --git a/client/tests/error_test_fail/control b/client/tests/error_test_fail/control
new file mode 100644
index 0000000..8d0c193
--- /dev/null
+++ b/client/tests/error_test_fail/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for FAIL"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise a TestFail.  This is for testing Autotest itself."""
+
+job.run_test('error_test_fail')
diff --git a/client/tests/error_test_fail/error_test_fail.py b/client/tests/error_test_fail/error_test_fail.py
new file mode 100644
index 0000000..7595004
--- /dev/null
+++ b/client/tests/error_test_fail/error_test_fail.py
@@ -0,0 +1,9 @@
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import test
+
+class error_test_fail(test.test):
+    version = 1
+
+
+    def execute(self):
+        raise error.TestFail("This test always fails.")
diff --git a/client/tests/error_test_na/control b/client/tests/error_test_na/control
new file mode 100644
index 0000000..df361a6
--- /dev/null
+++ b/client/tests/error_test_na/control
@@ -0,0 +1,11 @@
+AUTHOR = "Gregory Smith <gps@google.com>"
+EXPERIMENTAL = 'True'  # Not really, but this is only for testing autotest...
+                       # not testing _with_ autotest.
+NAME = "error test for TEST_NA"
+TEST_TYPE = "client"
+TEST_CLASS = "General"
+TEST_CATEGORY = "Functional"
+TIME = "SHORT"
+DOC = """Raise a TestNAError.  This is for testing Autotest itself."""
+
+job.run_test('error_test_na')
diff --git a/client/tests/error_test_na/error_test_na.py b/client/tests/error_test_na/error_test_na.py
new file mode 100644
index 0000000..1897a74
--- /dev/null
+++ b/client/tests/error_test_na/error_test_na.py
@@ -0,0 +1,9 @@
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import test
+
+class error_test_na(test.test):
+    version = 1
+
+
+    def execute(self):
+        raise error.TestNAError("This test can't run on this host.")