NFVBENCH-28 Set result values for NDR/PDR if they cannot be found within the given... 59/42459/1
authorKerim Gokarslan <kgokarsl@cisco.com>
Tue, 19 Sep 2017 22:33:46 +0000 (15:33 -0700)
committerKerim Gokarslan <kgokarsl@cisco.com>
Tue, 19 Sep 2017 22:33:46 +0000 (15:33 -0700)
Change-Id: Id8019c7f052c2b189f3ab6e39377f65fe00d9fee
Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
cleanup/__init__.py
client/__init__.py
docs/testing/user/userguide/conf.py
nfvbench/traffic_client.py
tox.ini

index fcaa79b..04924ec 100644 (file)
@@ -10,4 +10,4 @@
 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 # License for the specific language governing permissions and limitations
-# under the License.
\ No newline at end of file
+# under the License.
index fcaa79b..04924ec 100644 (file)
@@ -10,4 +10,4 @@
 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 # License for the specific language governing permissions and limitations
-# under the License.
\ No newline at end of file
+# under the License.
index 0aae169..5846b00 100644 (file)
@@ -1,5 +1,17 @@
 # Copyright 2017 Cisco Systems, Inc.  All rights reserved.
 #
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+#
 # NFVBench documentation build configuration file, created by
 # sphinx-quickstart on Thu Sep 29 14:25:18 2016.
 #
@@ -16,6 +28,9 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
+
+
+
 # import os
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
index 27ff227..4337ad3 100644 (file)
@@ -640,6 +640,21 @@ class TrafficClient(object):
                 })
                 right_targets[tag] = target
             else:
+                # initialize to 0 all fields of result for
+                # the worst case scenario of the binary search (if ndr/pdr is not found)
+                if tag not in results:
+                    results[tag] = dict.fromkeys(rates, 0)
+                    empty_stats = self.__format_output_stats(dict(stats))
+                    for key in empty_stats:
+                        if isinstance(empty_stats[key], dict):
+                            empty_stats[key] = dict.fromkeys(empty_stats[key], 0)
+                        else:
+                            empty_stats[key] = 0
+                    results[tag].update({
+                        'load_percent_per_direction': 0,
+                        'stats': empty_stats,
+                        'timestamp_sec': None
+                    })
                 left_targets[tag] = target
 
         # search lower half
diff --git a/tox.ini b/tox.ini
index 3120ac1..ea0894e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -37,6 +37,6 @@ show-source = True
 #H404: multi line docstring should start without a leading new line
 #H405: multi line docstring summary not separated with an empty line
 #H904: Wrap long lines in parentheses instead of a backslash
-ignore = E123,E125,H803,E302,E303,H233,H236,H302,H404,H405,H904
+ignore = E123,E125,H803,E302,E303,H104,H233,H236,H302,H404,H405,H904
 builtins = _
-exclude=venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
+exclude=venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,dib-venv