summaryrefslogtreecommitdiffstats
path: root/xci/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'xci/playbooks')
-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)18
-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
5 files changed, 19 insertions, 11 deletions
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..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
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"