cord-tester deploy and verify phase overhaul for CiaB scenario.
The run of subscriber tests is disabled for now since running CiaB inside a head node VM fails ONOS start with insufficient memory.
Should work on physical head nodes.

Change-Id: Ib1dde64c8f7da80ff8d7a62a29c0cd14b59874f3
diff --git a/cord-tester-verify.yml b/cord-tester-verify.yml
index 1ac201f..b0f3818 100644
--- a/cord-tester-verify.yml
+++ b/cord-tester-verify.yml
@@ -1,6 +1,15 @@
 ---
 - hosts: all
+  sudo: True
   tasks:
     - name: Run fabric tests using cord-tester
       become: yes
-      command: "/home/{{ ansible_user }}/cord-tester/src/test/setup/cord-test.py run -e onos-fabric/onos-fabric --no-switch --prefix=docker-registry:5000 -t fabric"
\ No newline at end of file
+      shell: "{{ item }}"
+      args:
+        chdir: "/home/{{ ansible_user }}/cord-tester/src/test/setup"
+      with_items:
+        - ./cord-test.py run -e onos-fabric/onos-fabric --no-switch --prefix=docker-registry:5000 -t fabric
+        #- ./cord-test.py run --prefix=docker-registry:5000 --onos=docker-registry:5000/onosproject/onos:candidate --olt --start-switch -t cordSubscriber:subscriber_exchange.cord_test_subscriber_join_jump
+        - ./cord-test.py cleanup --olt --prefix=docker-registry:5000 --onos=docker-registry:5000/onosproject/onos:candidate
+        - docker kill cord-onos 2>/dev/null || true
+        - docker kill cord-radius 2>/dev/null || true
diff --git a/roles/prereq/defaults/main.yml b/roles/prereq/defaults/main.yml
index 731d94f..a2898c9 100644
--- a/roles/prereq/defaults/main.yml
+++ b/roles/prereq/defaults/main.yml
@@ -7,8 +7,9 @@
 # default install path
 docker_tools_path: '/usr/local/bin'
 docker_tools_pipework_exe_url: https://raw.githubusercontent.com/jpetazzo/pipework/master/pipework
-
+openvswitch_url: http://openvswitch.org/releases
+openvswitch_version: '2.5.0'
 #docker variables
 docker:
     registry: "{{ docker_registry | default('docker-registry:5000') }}"
-    image_version: "{{ docker_image_version | default('latest') }}"
\ No newline at end of file
+    image_version: "{{ docker_image_version | default('latest') }}"
diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml
index f8026ec..55918b2 100644
--- a/roles/prereq/tasks/main.yml
+++ b/roles/prereq/tasks/main.yml
@@ -11,22 +11,67 @@
     - python-scapy
     - python-pexpect
     - openvswitch-switch
+    - libssl-dev
+    - libffi-dev
 
 - name: Install Python Prerequisites for cord tester
   become: yes
   pip: name={{ item }} state=latest
   with_items:
     - nose
-    - scapy
     - monotonic
     - configObj
-    - docker-py
     - pyyaml
     - nsenter
     - pyroute2
     - netaddr
     - python-daemon
-    - scapy-ssl_tls
+    - robotframework
+    - robotframework-requests
+    - robotframework-sshlibrary
+
+- name: Install scapy
+  pip: name=scapy version=2.3.2 state=present
+
+- name: Install scapy-ssl_tls
+  pip: name=scapy-ssl_tls version=1.2.2 state=present
+
+- name: Install docker-py
+  pip: name=docker-py version=1.9.0 state=present
+
+- name: Install paramiko
+  pip: name=paramiko version=1.10.1 state=present
+
+- name: Download Openvswitch {{ openvswitch_version }}
+  become:  yes
+  get_url:
+    url: "{{ openvswitch_url }}/openvswitch-{{ openvswitch_version }}.tar.gz"
+    dest: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}.tar.gz"
+    force: yes
+
+- name:  Untar Openvswitch {{ openvswitch_version }}
+  become: yes
+  unarchive:
+    src=openvswitch-{{ openvswitch_version }}.tar.gz
+    dest=/home/{{ ansible_user }}
+
+- name: Build Openvswitch {{ openvswitch_version }}
+  become: yes
+  shell: "{{ item }}"
+  args:
+    chdir: "/home/{{ ansible_user }}/openvswitch-{{ openvswitch_version }}"
+  with_items:
+    - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-ssl
+    - make
+    - make install
+
+- name: Remove build files for Openvswitch {{ openvswitch_version }}
+  file:
+    path=/home/{{ ansible_user }}/{{ item }}
+    state=absent
+  with_items:
+    - "openvswitch-{{ openvswitch_version }}.tar.gz"
+    - "openvswitch-{{ openvswitch_version }}"
 
 - name: install Pipework
   sudo: True
@@ -59,3 +104,11 @@
     image: "{{ docker.registry }}/cord-test/quagga:{{ docker.image_version }}"
     pull: always
     state: absent
+
+- name: Pull onosproject
+  become: yes
+  docker:
+    name: cord-test-onos
+    image: "{{ docker.registry }}/onosproject/onos:{{ docker.image_version }}"
+    pull: always
+    state: absent