summaryrefslogtreecommitdiffstats
path: root/xci/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'xci/playbooks')
-rw-r--r--xci/playbooks/get-opnfv-scenario-requirements.yml7
-rw-r--r--xci/playbooks/roles/run-functest/defaults/main.yml (renamed from xci/playbooks/roles/prepare-functest/defaults/main.yml)0
-rw-r--r--xci/playbooks/roles/run-functest/tasks/main.yml (renamed from xci/playbooks/roles/prepare-functest/tasks/main.yml)25
-rw-r--r--xci/playbooks/roles/run-functest/templates/env.j2 (renamed from xci/playbooks/roles/prepare-functest/templates/env.j2)0
-rw-r--r--xci/playbooks/roles/run-functest/templates/run-functest.sh.j2 (renamed from xci/playbooks/roles/prepare-functest/templates/prepare-functest.sh.j2)7
-rw-r--r--xci/playbooks/run-functest.yml (renamed from xci/playbooks/prepare-tests.yml)5
6 files changed, 31 insertions, 13 deletions
diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml
index 7eaa43de..c04348e3 100644
--- a/xci/playbooks/get-opnfv-scenario-requirements.yml
+++ b/xci/playbooks/get-opnfv-scenario-requirements.yml
@@ -114,11 +114,12 @@
- set_fact:
deploy_scenario_flavor: "{{ (XCI_FLAVOR in deploy_scenario_installer.flavors) | bool }}"
when:
+ - deploy_scenario_installer is defined
- deploy_scenario_installer
- set_fact:
deploy_scenario_distro: "{{ (XCI_DISTRO in deploy_scenario_installer.distros) | bool }}"
when:
- - deploy_scenario_installer
+ - deploy_scenario_flavor is defined
- deploy_scenario_flavor
when: deploy_scenario is defined
@@ -135,7 +136,9 @@
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ''
when:
- - deploy_scenario is not defined or not deploy_scenario_distro
+ - deploy_scenario is not defined or
+ deploy_scenario_distro is not defined or
+ (deploy_scenario_distro is defined and not deploy_scenario_distro)
vars:
ansible_python_interpreter: "/usr/bin/python"
diff --git a/xci/playbooks/roles/prepare-functest/defaults/main.yml b/xci/playbooks/roles/run-functest/defaults/main.yml
index a3638302..a3638302 100644
--- a/xci/playbooks/roles/prepare-functest/defaults/main.yml
+++ b/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
index 9a380cd1..3dc8e0bb 100644
--- a/xci/playbooks/roles/prepare-functest/tasks/main.yml
+++ b/xci/playbooks/roles/run-functest/tasks/main.yml
@@ -16,17 +16,24 @@
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: install required packages
+ package:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - wget
+
+- 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
index 87093325..87093325 100644
--- a/xci/playbooks/roles/prepare-functest/templates/env.j2
+++ b/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
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
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"