From: Fatih Degirmenci Date: Wed, 24 Jan 2018 15:08:57 +0000 (+0100) Subject: xci: Integrate functest X-Git-Tag: 6.0.0~177 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F51053%2F1;p=releng-xci.git xci: Integrate functest This change integrates functest in most easiest and messy way to get it up and running to bring functest into CI. The reason for this is that there are strange failures during functest healthcheck and it is important to look into those rather than beautifying how functest is integrated at this phase. Change-Id: I42e993be4aa15da022fa1e0069338447780f177e Signed-off-by: Fatih Degirmenci --- diff --git a/xci/playbooks/roles/prepare-functest/defaults/main.yml b/xci/playbooks/roles/run-functest/defaults/main.yml similarity index 100% rename from xci/playbooks/roles/prepare-functest/defaults/main.yml rename to xci/playbooks/roles/run-functest/defaults/main.yml diff --git a/xci/playbooks/roles/prepare-functest/tasks/main.yml b/xci/playbooks/roles/run-functest/tasks/main.yml similarity index 83% rename from xci/playbooks/roles/prepare-functest/tasks/main.yml rename to xci/playbooks/roles/run-functest/tasks/main.yml index 9a380cd1..8ca2b7ba 100644 --- a/xci/playbooks/roles/prepare-functest/tasks/main.yml +++ b/xci/playbooks/roles/run-functest/tasks/main.yml @@ -16,17 +16,17 @@ command: "ip addr add {{ gateway_ip_mask }} brd {{ broadcast_ip }} dev {{ gateway_interface }}" when: gateway_ip_result|failed -- name: prepare script to create networks for functest - template: - src: prepare-functest.sh.j2 - dest: /root/prepare-functest.sh - mode: 0755 - -- name: Create networks - shell: "/root/prepare-functest.sh" - - name: prepare environment file for functest template: src: env.j2 dest: /root/env mode: 0755 + +- name: prepare the script to create networks and run functest + template: + src: run-functest.sh.j2 + dest: /root/run-functest.sh + mode: 0755 + +- name: execute the script + shell: "/root/run-functest.sh" diff --git a/xci/playbooks/roles/prepare-functest/templates/env.j2 b/xci/playbooks/roles/run-functest/templates/env.j2 similarity index 100% rename from xci/playbooks/roles/prepare-functest/templates/env.j2 rename to xci/playbooks/roles/run-functest/templates/env.j2 diff --git a/xci/playbooks/roles/prepare-functest/templates/prepare-functest.sh.j2 b/xci/playbooks/roles/run-functest/templates/run-functest.sh.j2 similarity index 56% rename from xci/playbooks/roles/prepare-functest/templates/prepare-functest.sh.j2 rename to xci/playbooks/roles/run-functest/templates/run-functest.sh.j2 index febe8369..071dbca4 100644 --- a/xci/playbooks/roles/prepare-functest/templates/prepare-functest.sh.j2 +++ b/xci/playbooks/roles/run-functest/templates/run-functest.sh.j2 @@ -10,3 +10,10 @@ openstack --insecure subnet create --network {{ external_network }} \ --allocation-pool {{ allocation_pool }} \ --subnet-range {{ subnet_cidr }} --gateway {{ gateway_ip }} \ --no-dhcp {{ subnet_name }} + +mkdir ~/images && cd ~/images && wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img && cd ~ + +sudo docker run --env-file env \ + -v $(pwd)/openrc:/home/opnfv/functest/conf/openstack.creds \ + -v $(pwd)/images:/home/opnfv/functest/images \ + opnfv/functest-healthcheck diff --git a/xci/playbooks/prepare-tests.yml b/xci/playbooks/run-functest.yml similarity index 84% rename from xci/playbooks/prepare-tests.yml rename to xci/playbooks/run-functest.yml index ee30094d..8b3b29a1 100644 --- a/xci/playbooks/prepare-tests.yml +++ b/xci/playbooks/run-functest.yml @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Setup functest installing required packages and create the public network +- name: Prepare the environment for functest and run tests hosts: opnfv + user: root roles: - - role: "prepare-functest" + - role: "run-functest"