diff options
author | Linda Wang <wangwulin@huawei.com> | 2018-03-05 03:14:23 +0000 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-03-07 03:36:40 +0100 |
commit | 530c678677cc314c159936fdf5e121e83fc1d0cc (patch) | |
tree | dc206cc94f933c696721b064ba00c48ce20e7872 /functest/tests/unit/openstack/vping/test_vping.py | |
parent | 8ea8434a1d02d57f61c34113b676d9f8f2530dde (diff) |
Add a new env var for nameserver
We should still consider that the nameserver must be handled by all
installers instead [1]:
- by configuring one or more DNS resolvers in dhcp_agent.ini
- by asking a local resolv
It eases setting the nameserver in testcases and then allows gating
them. 8.8.8.8 is still defined by default.
[1] https://docs.openstack.org/neutron/pike/admin/config-dns-res.html
Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: Id58dd5ebee612a0fce2ebc40f089769e60899416
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/vping/test_vping.py')
-rw-r--r-- | functest/tests/unit/openstack/vping/test_vping.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/vping/test_vping.py b/functest/tests/unit/openstack/vping/test_vping.py index 85e5ab9e8..3aaa4594a 100644 --- a/functest/tests/unit/openstack/vping/test_vping.py +++ b/functest/tests/unit/openstack/vping/test_vping.py @@ -29,6 +29,7 @@ from snaps.openstack.os_credentials import OSCreds from xtesting.core import testcase from functest.opnfv_tests.openstack.vping import vping_userdata, vping_ssh +from functest.utils import env class VPingUserdataTesting(unittest.TestCase): @@ -127,6 +128,11 @@ class VPingSSHTesting(unittest.TestCase): scp_client = mock.MagicMock(name='put') scp_client.put.return_value = None + subnet_config = SubnetConfig( + name='bar', + cidr='10.0.0.1/24', + dns_nameservers=[env.get('NAMESERVER')]) + with mock.patch('snaps.openstack.utils.deploy_utils.create_image', return_value=OpenStackImage(self.os_creds, None)), \ mock.patch('snaps.openstack.utils.deploy_utils.create_network', @@ -134,10 +140,7 @@ class VPingSSHTesting(unittest.TestCase): self.os_creds, NetworkConfig( name='foo', - subnet_settings=[ - SubnetConfig( - name='bar', - cidr='10.0.0.1/24')]))), \ + subnet_settings=[subnet_config]))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_vm_instance', return_value=OpenStackVmInstance( |