summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-31 15:43:42 +0300
committerimarom <imarom@cisco.com>2016-03-31 15:51:18 +0300
commit300ca9bcaa3309665421efd5ed51c49f9b81006d (patch)
tree3cd798b8fbde6a664cc258e2048e0ba2901de6e4 /scripts
parent32b6b28437504ce80182f48cc99dd40f5feb626f (diff)
new test only on loopback non virtual
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/regression/stateless_tests/stl_client_test.py22
-rw-r--r--scripts/automation/trex_control_plane/stl/examples/stl_imix.py2
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py2
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py2
4 files changed, 17 insertions, 11 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_client_test.py b/scripts/automation/regression/stateless_tests/stl_client_test.py
index fa10be38..132109c0 100644
--- a/scripts/automation/regression/stateless_tests/stl_client_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_client_test.py
@@ -4,6 +4,7 @@ from trex_stl_lib.api import *
import os, sys
import glob
+
def get_error_in_percentage (golden, value):
return abs(golden - value) / float(golden)
@@ -11,7 +12,6 @@ def get_stl_profiles ():
profiles_path = os.path.join(CTRexScenario.scripts_path, 'stl/')
profiles = glob.glob(profiles_path + "/*.py") + glob.glob(profiles_path + "yaml/*.yaml")
-
return profiles
@@ -20,6 +20,7 @@ class STLClient_Test(CStlGeneral_Test):
def setUp(self):
CStlGeneral_Test.setUp(self)
+
assert 'bi' in CTRexScenario.stl_ports_map
self.c = CTRexScenario.stl_trex
@@ -52,7 +53,7 @@ class STLClient_Test(CStlGeneral_Test):
def test_basic_single_burst (self):
- try:
+ try:
b1 = STLStream(name = 'burst',
packet = self.pkt,
mode = STLTXSingleBurst(total_pkts = 100,
@@ -219,6 +220,11 @@ class STLClient_Test(CStlGeneral_Test):
def test_all_profiles (self):
+
+ if self.is_virt_nics or not self.is_loopback:
+ print("skipping for non loopback / virtual")
+ return
+
try:
self.c.set_port_attr(ports = [self.tx_port, self.rx_port], promiscuous = True)
@@ -228,7 +234,7 @@ class STLClient_Test(CStlGeneral_Test):
p1 = STLProfile.load(profile, port_id = self.tx_port)
p2 = STLProfile.load(profile, port_id = self.rx_port)
- if p1.needs_rx_caps():
+ if p1.has_flow_stats():
print("profile needs RX caps - skipping...")
continue
@@ -237,7 +243,7 @@ class STLClient_Test(CStlGeneral_Test):
self.c.clear_stats()
- self.c.start(ports = [self.tx_port, self.rx_port], mult = "50%")
+ self.c.start(ports = [self.tx_port, self.rx_port], mult = "30%")
time.sleep(100 / 1000.0)
if p1.is_pauseable() and p2.is_pauseable():
@@ -251,12 +257,12 @@ class STLClient_Test(CStlGeneral_Test):
stats = self.c.get_stats()
- assert self.tx_port in stats
- assert self.rx_port in stats
+ assert self.tx_port in stats, '{0} - no stats for TX port'.format(profile)
+ assert self.rx_port in stats, '{0} - no stats for RX port'.format(profile)
- assert stats[self.tx_port]['opackets'] == stats[self.rx_port]['ipackets']
+ assert stats[self.tx_port]['opackets'] == stats[self.rx_port]['ipackets'], '{0} - number of TX packets differ from RX packets'.format(profile)
- assert stats[self.rx_port]['opackets'] == stats[self.tx_port]['ipackets']
+ assert stats[self.rx_port]['opackets'] == stats[self.tx_port]['ipackets'], '{0} - number of TX packets differ from RX packets'.format(profile)
self.c.remove_all_streams(ports = [self.tx_port, self.rx_port])
diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_imix.py b/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
index 0ca932c8..ecf0fe69 100644
--- a/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
+++ b/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
@@ -16,7 +16,7 @@ def imix_test (server, mult):
# create client
- c = STLClient(server = server, verbose_level = LoggerApi.VERBOSE_REGULAR)
+ c = STLClient(server = server)
passed = True
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
index 812aea98..d5e1e44a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
@@ -2069,7 +2069,7 @@ class STLClient(object):
self.logger.log(format_text("No active traffic on provided ports\n", 'bold'))
return
- self.stop(ports, rx_delay_ms = 2000)
+ self.stop(ports)
# true means print time
return True
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
index a75ba044..2bd98d4a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
@@ -835,7 +835,7 @@ class STLProfile(object):
def is_pauseable (self):
return all([x.get_mode() == "Continuous" for x in (self.get_streams())])
- def needs_rx_caps (self):
+ def has_flow_stats (self):
return any([x.has_flow_stats() for x in self.get_streams()])
@staticmethod