diff --git a/testenv/ChangeLog b/testenv/ChangeLog index 879685aa..6b58f183 100644 --- a/testenv/ChangeLog +++ b/testenv/ChangeLog @@ -1,3 +1,10 @@ +2013-12-25 Darshit Shah + + * WgetTest.py (CommonMehtods.exec_wget): Catch and handle exception if the + Wget executable is not found at src/wget + (HTTPTest.call_test): In case of error during execution, remove all existing + servers before quitting + 2013-12-15 Darshit Shah * WgetTest.py (HTTPTest.HTTP_setup): Rename to Server_setup so it can be diff --git a/testenv/WgetTest.py b/testenv/WgetTest.py index a856cd81..09c1d852 100644 --- a/testenv/WgetTest.py +++ b/testenv/WgetTest.py @@ -40,7 +40,11 @@ class CommonMethods: cmd_line = self.get_cmd_line (options, urls, domain_list) params = shlex.split (cmd_line) print (params) - retcode = call (params) + try: + retcode = call (params) + except FileNotFoundError as filenotfound: + raise TestFailed ( + "The Wget Executable does not exist at the expected path") return retcode def get_cmd_line (self, options, urls, domain_list): @@ -270,7 +274,11 @@ class HTTPTest (CommonMethods): raise TestFailed ("Test Option " + test_func + " unknown.") getattr (self, test_func) (test_params[test_func]) - self.act_retcode = self.exec_wget (self.options, self.urls, self.domain_list) + try: + self.act_retcode = self.exec_wget (self.options, self.urls, self.domain_list) + except TestFailed as tf: + self.stop_HTTP_Server () + raise TestFailed (tf.__str__ ()) self.stop_HTTP_Server () def post_hook_call (self, post_hook):