client config regression
authorIdo Barnea <[email protected]>
Sun, 27 Nov 2016 13:02:14 +0000 (15:02 +0200)
committerIdo Barnea <[email protected]>
Sun, 27 Nov 2016 13:02:14 +0000 (15:02 +0200)
Signed-off-by: Ido Barnea <[email protected]>
scripts/automation/regression/cfg/client_cfg.yaml [new file with mode: 0644]
scripts/automation/regression/stateful_tests/trex_client_cfg_test.py [new file with mode: 0644]
scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py

diff --git a/scripts/automation/regression/cfg/client_cfg.yaml b/scripts/automation/regression/cfg/client_cfg.yaml
new file mode 100644 (file)
index 0000000..8db8dfd
--- /dev/null
@@ -0,0 +1,40 @@
+#vlan: true
+vlan: false
+
+groups:
+
+-    ip_start  : 16.0.0.1
+     ip_end    : 16.0.1.255
+     initiator :
+                 next_hop: 1.1.1.1
+     responder :
+                 next_hop: 1.1.2.1
+
+     count     : 1
+
+-    ip_start  : 17.0.0.1
+     ip_end    : 17.0.1.255
+     initiator :
+                 next_hop: 1.1.3.1
+     responder :
+                 next_hop: 1.1.4.1
+
+     count     : 1
+
+-    ip_start  : 18.0.0.1
+     ip_end    : 18.0.1.255
+     initiator :
+                 next_hop: 1.1.5.1
+     responder :
+                 next_hop: 1.1.6.1
+
+     count     : 1
+
+-    ip_start  : 19.0.0.1
+     ip_end    : 19.0.1.255
+     initiator :
+                 next_hop: 1.1.7.1
+     responder :
+                 next_hop: 1.1.8.1
+
+     count     : 1
diff --git a/scripts/automation/regression/stateful_tests/trex_client_cfg_test.py b/scripts/automation/regression/stateful_tests/trex_client_cfg_test.py
new file mode 100644 (file)
index 0000000..4cdd7f5
--- /dev/null
@@ -0,0 +1,50 @@
+#!/router/bin/python
+from .trex_general_test import CTRexGeneral_Test
+from CPlatform import CStaticRouteConfig
+from .tests_exceptions import *
+#import sys
+import time
+from nose.tools import nottest
+
+# Testing client cfg ARP resolve. Actually, just need to check that TRex run finished with no errors.
+# If resolve will fail, TRex will exit with exit code != 0
+class CTRexClientCfg_Test(CTRexGeneral_Test):
+    """This class defines the IMIX testcase of the TRex traffic generator"""
+    def __init__(self, *args, **kwargs):
+        # super(CTRexClientCfg_Test, self).__init__()
+        CTRexGeneral_Test.__init__(self, *args, **kwargs)
+
+    def setUp(self):
+        super(CTRexClientCfg_Test, self).setUp() # launch super test class setUp process
+        pass
+
+    def test_client_cfg(self):
+        # test initializtion
+        if self.is_loopback:
+            return
+        else:
+            self.router.configure_basic_interfaces()
+            self.router.config_pbr(mode = "config")
+
+        ret = self.trex.start_trex(
+            c = 1,
+            m = 1,
+            d = 10,
+            f = 'cap2/dns.yaml',
+            v = 3,
+            client_cfg = 'automation/regression/cfg/client_cfg.yaml',
+            l = 1000)
+
+        trex_res = self.trex.sample_to_run_finish()
+
+        print("\nLATEST RESULT OBJECT:")
+        print(trex_res)
+
+        self.check_general_scenario_results(trex_res)
+
+    def tearDown(self):
+        CTRexGeneral_Test.tearDown(self)
+        pass
+
+if __name__ == "__main__":
+    pass
index e9d2b8a..5d992c6 100755 (executable)
@@ -150,10 +150,8 @@ class CTRexClient(object):
         user = user or self.__default_user
         try:
             d = int(d)
-            if d < 30 and not trex_development:  # test duration should be at least 30 seconds, unless trex_development flag is specified.
-                raise ValueError
         except ValueError:
-            raise ValueError('d parameter must be integer, specifying how long TRex run, and must be larger than 30 secs.')
+            raise ValueError('d parameter must be integer, specifying how long TRex run.')
 
         trex_cmd_options.update( {'f' : f, 'd' : d} )
         if not trex_cmd_options.get('l'):