xci: Integrate functest 53/51053/1
authorFatih Degirmenci <fdegir@gmail.com>
Wed, 24 Jan 2018 15:08:57 +0000 (16:08 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Wed, 24 Jan 2018 15:08:57 +0000 (16:08 +0100)
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 <fdegir@gmail.com>
xci/playbooks/roles/run-functest/defaults/main.yml [moved from xci/playbooks/roles/prepare-functest/defaults/main.yml with 100% similarity]
xci/playbooks/roles/run-functest/tasks/main.yml [moved from xci/playbooks/roles/prepare-functest/tasks/main.yml with 83% similarity]
xci/playbooks/roles/run-functest/templates/env.j2 [moved from xci/playbooks/roles/prepare-functest/templates/env.j2 with 100% similarity]
xci/playbooks/roles/run-functest/templates/run-functest.sh.j2 [moved from xci/playbooks/roles/prepare-functest/templates/prepare-functest.sh.j2 with 56% similarity]
xci/playbooks/run-functest.yml [moved from xci/playbooks/prepare-tests.yml with 84% similarity]

   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"
@@ -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
similarity index 84%
rename from xci/playbooks/prepare-tests.yml
rename to xci/playbooks/run-functest.yml
index ee30094..8b3b29a 100644 (file)
@@ -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"