aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2018-01-19 10:06:14 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-19 10:06:14 +0000
commit78de0c6b53db31ae0d77aaa79de015a73e981895 (patch)
tree35e0e4a451d8bd3a4ca8b2857221955cb30424c1 /tools
parent3e4a1be91d487d4a73fc80f1c3f23ebf78c15953 (diff)
parent17a932044bd9924fc4ea041b217c1814148a5533 (diff)
Merge "trex: Improve error handling"
Diffstat (limited to 'tools')
-rw-r--r--tools/pkt_gen/trex/trex.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/pkt_gen/trex/trex.py b/tools/pkt_gen/trex/trex.py
index 5ce87b1d..cfe54b78 100644
--- a/tools/pkt_gen/trex/trex.py
+++ b/tools/pkt_gen/trex/trex.py
@@ -126,9 +126,14 @@ class Trex(ITrafficGenerator):
'T-Rex: Cannot locate Trex program at %s within %s' \
% (self._trex_host_ip_addr, self._trex_base_dir))
- self._stlclient = STLClient(username=self._trex_user, server=self._trex_host_ip_addr,
- verbose_level=0)
- self._stlclient.connect()
+ try:
+ self._stlclient = STLClient(username=self._trex_user, server=self._trex_host_ip_addr,
+ verbose_level=0)
+ self._stlclient.connect()
+ except STLError:
+ raise RuntimeError('T-Rex: Cannot connect to T-Rex server. Please check if it is '
+ 'running and that firewall allows connection to TCP port 4501.')
+
self._logger.info("T-Rex: Trex host successfully found...")
def disconnect(self):