[PATCH V3 0/2] Debugreport tool test enhancement

V3->V2: Addressed ZHengsheng's comment by adding space in the end of " " V2->V1: Addressed Shaohe's comment V1: 1)We need a way to tune the debugreport timeout value 2)Skip the test if there is not debugreport tool Shu Ming (2): Skip the debug report test if there is no tool avaible Add a timeout tunning environment variable for debug report test tests/test_model.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 1.8.1.4

Skip the debug report test if there is no tool avaible Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_model.py b/tests/test_model.py index a38e3c6..4a78fbc 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -636,6 +636,10 @@ class ModelTests(unittest.TestCase): def test_debug_reports(self): inst = kimchi.model.Model('test:///default', objstore_loc=self.tmp_store) + + if not inst.get_capabilities()['system_report_tool']: + raise unittest.SkipTest("Without debug report tool") + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name. -- 1.8.1.4

Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com> On 01/15/2014 06:55 AM, Shu Ming wrote:
Skip the debug report test if there is no tool avaible
Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/tests/test_model.py b/tests/test_model.py index a38e3c6..4a78fbc 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -636,6 +636,10 @@ class ModelTests(unittest.TestCase): def test_debug_reports(self): inst = kimchi.model.Model('test:///default', objstore_loc=self.tmp_store) + + if not inst.get_capabilities()['system_report_tool']: + raise unittest.SkipTest("Without debug report tool") + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name.

It is helpful when the timeout happens and the tester can tune it Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_model.py b/tests/test_model.py index 4a78fbc..650b298 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -640,6 +640,11 @@ class ModelTests(unittest.TestCase): if not inst.get_capabilities()['system_report_tool']: raise unittest.SkipTest("Without debug report tool") + try: + timeout = int(os.environ['TEST_REPORT_TIMEOUT']) + except (ValueError, KeyError): + timeout = 120 + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name. @@ -656,12 +661,14 @@ class ModelTests(unittest.TestCase): task = inst.debugreports_create({'name': reportName}) rollback.prependDefer(inst.debugreport_delete, reportName) taskid = task['id'] - self._wait_task(inst, taskid, 60) + self._wait_task(inst, taskid, timeout) self.assertEquals('finished', inst.task_lookup(taskid)['status'], "It is not necessary an error. " "You may need to increase the " - "timeout number in _wait_task()") + "timeout number by " + "TEST_REPORT_TIMEOUT=200 " + "./run_tests.sh test_model") report_list = inst.debugreports_get_list() self.assertTrue(reportName in report_list) except OperationFailed, e: -- 1.8.1.4

Reviewed-by: Aline Manera <alinefm@linux.vnet.ibm.com> On 01/15/2014 06:55 AM, Shu Ming wrote:
It is helpful when the timeout happens and the tester can tune it
Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/test_model.py b/tests/test_model.py index 4a78fbc..650b298 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -640,6 +640,11 @@ class ModelTests(unittest.TestCase): if not inst.get_capabilities()['system_report_tool']: raise unittest.SkipTest("Without debug report tool")
+ try: + timeout = int(os.environ['TEST_REPORT_TIMEOUT']) + except (ValueError, KeyError): + timeout = 120 + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name. @@ -656,12 +661,14 @@ class ModelTests(unittest.TestCase): task = inst.debugreports_create({'name': reportName}) rollback.prependDefer(inst.debugreport_delete, reportName) taskid = task['id'] - self._wait_task(inst, taskid, 60) + self._wait_task(inst, taskid, timeout) self.assertEquals('finished', inst.task_lookup(taskid)['status'], "It is not necessary an error. " "You may need to increase the " - "timeout number in _wait_task()") + "timeout number by " + "TEST_REPORT_TIMEOUT=200 " + "./run_tests.sh test_model") report_list = inst.debugreports_get_list() self.assertTrue(reportName in report_list) except OperationFailed, e:
participants (2)
-
Aline Manera
-
Shu Ming