From 47875a6f01fa9dc1738d4c4a29ad75e12e251077 Mon Sep 17 00:00:00 2001
From: Christian Trautman <ctrautma@redhat.com>
Date: Wed, 20 Apr 2016 15:30:42 -0400
Subject: bidirectional value: Fix inconsistency for bidir param

Fixes bi-directional param and enforces string type in
testcase configuration. Modifies all instance where bi
directional value is used to string.

 * Changes documentation to specify value type as needed
 * Changes traffic defaults to use string for bidir value
 * Fixes testcases configuration files to use bidir as str
 * Change testcase conf documentation to note enforcement
   of string type
 * Sets bidir to title format to keep consitency in traffic
   profile when passed to traffic generators
 * Fix pvp/pvvp check for bidir value
 * Raise exception if testcase configuration is not set
   as str for bidir value
 * Change Xena bi-dir check to string compare instead of
   typecasting to boolean to compare.

JIRA: VSPERF-282

Change-Id: I7c91fcd7333a1d1e1371bfd31700c01d7da268b5
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
---
 conf/01_testcases.conf             |  8 +++++---
 conf/integration/01_testcases.conf | 40 +++++++++++++++++++-------------------
 2 files changed, 25 insertions(+), 23 deletions(-)

(limited to 'conf')

diff --git a/conf/01_testcases.conf b/conf/01_testcases.conf
index 148171fd..23a3ae57 100755
--- a/conf/01_testcases.conf
+++ b/conf/01_testcases.conf
@@ -28,10 +28,12 @@
 # "Frame Modification": "vlan"     # One of the supported frame modifications:
 #                                  # vlan, mpls, mac, dscp, ttl, ip_addr,
 #                                  # ip_port.
-# "biDirectional": [true|false],   # Specifies if generated traffic will be
-#                                  # full-duplex (true) or half-duplex (false)
+# "biDirectional": ["True"|"False"]
+#                                  # Specifies if generated traffic will be
+#                                  # full-duplex (True) or half-duplex (False)
 #                                  # It can be overridden by cli option bidirectional.
-#                                  # Default value is "false".
+#                                  # Default value is "False". Must be of type
+#                                  # string.
 # "MultiStream": 0-65535           # Optional. Defines number of flows simulated
 #                                  # by traffic generator. Value 0 disables
 #                                  # MultiStream feature
diff --git a/conf/integration/01_testcases.conf b/conf/integration/01_testcases.conf
index e9257ae0..2edbe08b 100644
--- a/conf/integration/01_testcases.conf
+++ b/conf/integration/01_testcases.conf
@@ -136,7 +136,7 @@ INTEGRATION_TESTS = [
         "Name": "overlay_p2p_tput",
         "Traffic Type": "rfc2544",
         "Deployment": "op2p",
-        "biDirectional": False,
+        "biDirectional": 'False',
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "encapsulation",
         "Description": "Overlay Encapsulation Throughput RFC2544 Test",
@@ -145,7 +145,7 @@ INTEGRATION_TESTS = [
         "Name": "overlay_p2p_cont",
         "Traffic Type": "continuous",
         "Deployment": "op2p",
-        "biDirectional": False,
+        "biDirectional": 'False',
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "encapsulation",
         "Description": "Overlay Encapsulation Continuous Stream",
@@ -154,7 +154,7 @@ INTEGRATION_TESTS = [
         "Name": "overlay_p2p_decap_tput",
         "Traffic Type": "rfc2544",
         "Deployment": "op2p",
-        "biDirectional": False,
+        "biDirectional": 'False',
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "decapsulation",
         "Description": "Overlay Decapsulation Throughput RFC2544 Test",
@@ -163,7 +163,7 @@ INTEGRATION_TESTS = [
         "Name": "overlay_p2p_decap_cont",
         "Traffic Type": "continuous",
         "Deployment": "op2p",
-        "biDirectional": False,
+        "biDirectional": 'False',
         "Tunnel Type": SUPPORTED_TUNNELING_PROTO[0],
         "Tunnel Operation": "decapsulation",
         "Description": "Overlay Decapsulation Continuous Stream",
@@ -264,7 +264,7 @@ INTEGRATION_TESTS = [
         "Description": "vSwitch - configure switch and execute RFC2544 throughput test",
         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
                      [
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : 'True'}],
                      ] +
                      STEP_VSWITCH_P2P_FLOWS_FINIT
     },
@@ -274,7 +274,7 @@ INTEGRATION_TESTS = [
         "Description": "vSwitch - configure switch and execute RFC2544 back2back test",
         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
                      [
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : 'True'}],
                      ] +
                      STEP_VSWITCH_P2P_FLOWS_FINIT
     },
@@ -284,7 +284,7 @@ INTEGRATION_TESTS = [
         "Description": "vSwitch - configure switch and execute continuous stream test",
         "TestSteps": STEP_VSWITCH_P2P_FLOWS_INIT +
                      [
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
                      ] +
                      STEP_VSWITCH_P2P_FLOWS_FINIT
     },
@@ -306,7 +306,7 @@ INTEGRATION_TESTS = [
         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
                      [
                         ['vnf', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : 'True'}],
                         ['vnf', 'stop'],
                      ] +
                      STEP_VSWITCH_PVP_FLOWS_FINIT
@@ -318,7 +318,7 @@ INTEGRATION_TESTS = [
         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
                      [
                         ['vnf', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : 'True'}],
                         ['vnf', 'stop'],
                      ] +
                      STEP_VSWITCH_PVP_FLOWS_FINIT
@@ -330,7 +330,7 @@ INTEGRATION_TESTS = [
         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
                      [
                         ['vnf', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
                         ['vnf', 'stop'],
                      ] +
                      STEP_VSWITCH_PVP_FLOWS_FINIT
@@ -342,9 +342,9 @@ INTEGRATION_TESTS = [
         "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
                      [
                         ['vnf', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : True}],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : True}],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : 'True'}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : 'True'}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
                         ['vnf', 'stop'],
                      ] +
                      STEP_VSWITCH_PVP_FLOWS_FINIT
@@ -370,7 +370,7 @@ INTEGRATION_TESTS = [
                      [
                         ['vnf1', 'start'],
                         ['vnf2', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : 'True'}],
                         ['vnf1', 'stop'],
                         ['vnf2', 'stop'],
                      ] +
@@ -384,7 +384,7 @@ INTEGRATION_TESTS = [
                      [
                         ['vnf1', 'start'],
                         ['vnf2', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : 'True'}],
                         ['vnf1', 'stop'],
                         ['vnf2', 'stop'],
                      ] +
@@ -398,7 +398,7 @@ INTEGRATION_TESTS = [
                      [
                         ['vnf1', 'start'],
                         ['vnf2', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
                         ['vnf1', 'stop'],
                         ['vnf2', 'stop'],
                      ] +
@@ -412,9 +412,9 @@ INTEGRATION_TESTS = [
                      [
                         ['vnf1', 'start'],
                         ['vnf2', 'start'],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : True}],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : True}],
-                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'throughput', 'bidir' : 'True'}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'back2back', 'bidir' : 'True'}],
+                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
                         ['vnf1', 'stop'],
                         ['vnf2', 'stop'],
                      ] +
@@ -434,7 +434,7 @@ INTEGRATION_TESTS = [
 #        "TestSteps": STEP_VSWITCH_PVP_FLOWS_INIT +
 #                     [
 #                        ['vnf', 'start'],
-#                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : True}],
+#                        ['trafficgen', 'send_traffic', {'traffic_type' : 'continuous', 'bidir' : 'True'}],
 #                        ['vnf', 'stop'],
 #                     ] +
 #                     STEP_VSWITCH_PVP_FLOWS_FINIT
-- 
cgit 1.2.3-korg