aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorahothan <ahothan@cisco.com>2018-10-10 23:20:44 -0700
committerahothan <ahothan@cisco.com>2018-10-11 09:43:45 -0700
commitcd455c418173a978f89bdbb83f79d15c5fa53e03 (patch)
tree1a63ccfa078e316ea9df9e66aa8bb6397aa989fb /test
parent391dcf76fefb747888a3411ae3b8df7b1ad26685 (diff)
Perform strict src mac check on ensure end to end
This is required when shared net is used and there are more VMs running than requested in the -scc Change-Id: I7599169739e6bb9b3e2377473377d5332ef2b68a Signed-off-by: ahothan <ahothan@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_chains.py10
-rw-r--r--test/test_nfvbench.py2
2 files changed, 11 insertions, 1 deletions
diff --git a/test/test_chains.py b/test/test_chains.py
index 14ed0b5..519748b 100644
--- a/test/test_chains.py
+++ b/test/test_chains.py
@@ -21,6 +21,7 @@ from mock import MagicMock
from mock import patch
from nfvbench.chain_runner import ChainRunner
+from nfvbench.chaining import ChainVnfPort
from nfvbench.compute import Compute
import nfvbench.credentials
from nfvbench.factory import BasicFactory
@@ -159,9 +160,18 @@ def _check_nfvbench_openstack(sc=ChainType.PVP, l2_loopback=False):
print res
assert res['status'] == 'OK'
+
+mac_seq = 0
+
+def _mock_get_mac(dummy):
+ global mac_seq
+ mac_seq += 1
+ return '01:00:00:00:00:%02x' % mac_seq
+
@patch.object(Compute, 'get_enabled_az_host_list', _mock_get_enabled_az_host_list)
@patch.object(Compute, 'find_image', _mock_find_image)
@patch.object(TrafficClient, 'skip_sleep', lambda x: True)
+@patch.object(ChainVnfPort, 'get_mac', _mock_get_mac)
@patch('nfvbench.chaining.Client')
@patch('nfvbench.chaining.neutronclient')
@patch('nfvbench.chaining.glanceclient')
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index b430436..f532bba 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -215,7 +215,7 @@ def test_config():
expected = fail_pair[1]
if expected is None:
expected = fail_pair[0]
- assert expected in e_info.value.message
+ assert expected in str(e_info)
# whitelist keys
flavor = {'flavor': {'vcpus': 2, 'ram': 8192, 'disk': 0,