Add test to run dns local vm
Change-Id: Ic7d09c9a3c9c2382edb6ca0543711fef2385bfcb
diff --git a/tcp_tests/templates/local_dns/underlay--user-data1604.yaml b/tcp_tests/templates/local_dns/underlay--user-data1604.yaml
index 39ce86e..f60c4c2 100644
--- a/tcp_tests/templates/local_dns/underlay--user-data1604.yaml
+++ b/tcp_tests/templates/local_dns/underlay--user-data1604.yaml
@@ -49,6 +49,7 @@
############## Cloud repo01 node ##################
- echo "nameserver 172.18.208.44" >> /etc/resolv.conf;
- echo "nameserver 8.8.8.8" >> /etc/resolv.conf;
+ - export LOCAL_DNS_IP=$(ifconfig ens3 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
- which wget >/dev/null || (apt-get update; apt-get install -y wget);
- echo "deb [arch=amd64] http://apt.mirantis.com/xenial {{ REPOSITORY_SUITE }} salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
@@ -73,6 +74,7 @@
- cp /tmp/underpillar/states/*.sls /srv/salt/;
- cp /srv/pillar/top_localdns.sls /srv/pillar/top.sls;
- cp /srv/salt/top_localdns.sls /srv/salt/top.sls;
+ - find /srv/pillar/ -type f -exec sed -i "s/==LOCAL_DNS_IP==/${LOCAL_DNS_IP}/g" {} +
- salt-call --local --state-output=mixed state.sls dnsmasq;
- salt-call --local --state-output=mixed state.sls nginx;
########################################################
diff --git a/tcp_tests/tests/environment/test_local_dns.py b/tcp_tests/tests/environment/test_local_dns.py
new file mode 100644
index 0000000..fcc0978
--- /dev/null
+++ b/tcp_tests/tests/environment/test_local_dns.py
@@ -0,0 +1,27 @@
+# Copyright 2017 Mirantis, Inc.
+#
+# 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.
+
+import pytest
+
+from tcp_tests import logger
+
+LOG = logger.logger
+
+
+class TestLocalDns(object):
+ """Test class for deploy local dns_vm"""
+
+ @pytest.mark.fail_snapshot
+ def test_install_local_dns(self, config, underlay):
+ LOG.info("*************** DONE **************")