diff options
-rw-r--r-- | docker/Dockerfile | 1 | ||||
-rw-r--r-- | docker/vnf/Dockerfile | 2 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/clearwater_ims_base.py | 21 |
3 files changed, 13 insertions, 11 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 8c7e4b0fc..0e896d6d2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,6 +38,7 @@ build-essential \ bundler \ crudini \ curl \ +dnsmasq \ gcc \ git \ libffi-dev \ diff --git a/docker/vnf/Dockerfile b/docker/vnf/Dockerfile index 70c13ab29..d4f18c476 100644 --- a/docker/vnf/Dockerfile +++ b/docker/vnf/Dockerfile @@ -3,7 +3,7 @@ FROM opnfv/functest-core ARG VIMS_TAG=stable RUN apk --no-cache add --update \ - ruby ruby-dev ruby-bundler ruby-irb ruby-rdoc \ + ruby ruby-dev ruby-bundler ruby-irb ruby-rdoc dnsmasq \ procps git g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev && \ git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test /src/vims-test && \ rm -r /src/vims-test/.git && \ diff --git a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py index 1c3f69c6d..8851f7a48 100644 --- a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py +++ b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py @@ -10,7 +10,9 @@ import json import logging import os import pkg_resources +import shlex import shutil +import subprocess import time import requests @@ -109,18 +111,17 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): bono_ip=None, ellis_ip=None, signup_code='secret'): self.logger.info('Run Clearwater live test') - nameservers = ft_utils.get_resolvconf_ns() - resolvconf = ['{0}{1}{2}'.format(os.linesep, 'nameserver ', ns) - for ns in nameservers] - self.logger.debug('resolvconf: %s', resolvconf) dns_file = '/etc/resolv.conf' dns_file_bak = '/etc/resolv.conf.bak' + self.logger.debug('Backup %s -> %s', dns_file, dns_file_bak) shutil.copy(dns_file, dns_file_bak) - script = ('echo -e "nameserver {0}{1}" > {2};' - 'cd {3};' - 'rake test[{4}] SIGNUP_CODE={5}' - .format(dns_ip, - ''.join(resolvconf), + cmd = ("dnsmasq -d -u root --server=/clearwater.opnfv/{0} " + "-r /etc/resolv.conf.bak".format(dns_ip)) + dnsmasq_process = subprocess.Popen(shlex.split(cmd)) + script = ('echo -e "nameserver {0}" > {1};' + 'cd {2};' + 'rake test[{3}] SIGNUP_CODE={4}' + .format('127.0.0.1', dns_file, self.test_dir, public_domain, @@ -135,7 +136,7 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): ft_utils.execute_command(cmd, error_msg='Clearwater live test failed', output_file=output_file) - + dnsmasq_process.kill() with open(dns_file_bak, 'r') as bak_file: result = bak_file.read() with open(dns_file, 'w') as f: |