From: Peter C. <pc...@us...> - 2010-02-08 23:41:05
|
Update of /cvsroot/ipbench/ipbench2/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6528/src Modified Files: ipbench.py Log Message: Make more rubust in presence of errors -- make error output more friendly. But there's a long way to go! Index: ipbench.py =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/ipbench.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ipbench.py 3 Feb 2010 00:21:03 -0000 1.35 --- ipbench.py 8 Feb 2010 23:40:37 -0000 1.36 *************** *** 38,41 **** --- 38,44 ---- self.test_name = test_name self.test_ptr = test_ptr + if (self.test_args == None): + self.test_args = "" + dbprint("[IpbenchTestClient:__init__] : client " + self.hostname + " port " + `self.port` + " test_port " + `self.test_port` + " test_args " + self.test_args) *************** *** 105,109 **** status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("HELLO to " + self.hostname + " failed (" + status["code"] + " " + status["str"] + ")") self.send_command("LOAD " + self.test_name) status = self.parse_return_code() --- 108,112 ---- status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("HELLO to " + self.hostname + " failed (" + str(status["code"]) + " " + status["str"] + ")") self.send_command("LOAD " + self.test_name) status = self.parse_return_code() *************** *** 119,122 **** --- 122,135 ---- try: + if (self.test_port == None): + self.test_port = 0 + if (self.test_target == None): + raise IpBenchError("Must specify --test-target"); + if (self.test_args == None): + self.test_args = "" + + dbprint("[Setup]: target: " + self.test_target); + dbprint("[Setup]: port: " + str(self.test_port)); + dbprint("[Setup]: args: " + self.test_args); self.send_command("SETUP target::" + self.test_target + "||" + "port::" + `self.test_port` + "||" *************** *** 124,128 **** status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("SETUP to " + self.hostname + "failed (" + status["code"] + " " + status["str"] + ")") except IpbenchError: raise --- 137,141 ---- status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("SETUP to " + self.hostname + "failed (" + str(status["code"]) + " " + status["str"] + ")") except IpbenchError: raise *************** *** 195,199 **** status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("SETUP Failed (" + status["code"] + " " + status["str"] + ")") except IpbenchError: raise --- 208,212 ---- status = self.parse_return_code() if (status["code"] != 200): ! raise IpbenchError("SETUP Failed (" + str(status["code"]) + " " + status["str"] + ")") except IpbenchError: raise |