Merge "change loation of docker file & add version file"
diff --git a/test/README.md b/test/README.md
new file mode 100644
index 0000000..9e8126f
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,16 @@
+# M-CORD tests
+
+This directory contains a simple playbook for creating an M-CORD EPC and
+verifying that it comes up correctly.  It can be run on any node with Ansible
+installed and SSH connectivity to the master node of the openstack-helm
+installation.
+
+Invoke the playbook as follows, where "masternode" is the DNS name of the
+master node:
+
+```
+ansible-playbook -i masternode, mcord-cavium-test-playbook.yml
+```
+
+The comma after "masternode" is important; it allows Ansible to run the
+playbook on the remote node without having to specify an inventory file.
\ No newline at end of file
diff --git a/test/mcord-cavium-test-playbook.yml b/test/mcord-cavium-test-playbook.yml
index 794852a..46f5179 100644
--- a/test/mcord-cavium-test-playbook.yml
+++ b/test/mcord-cavium-test-playbook.yml
@@ -19,7 +19,7 @@
 # Tests CiaB cord-pod XOS configuration
 
 - name: Run base M-CORD tests
-  hosts: head
+  hosts: all
   become: no
   # These variables could be elevated to the profile. Think about
   # doing this after the E2E test framework is complete.
diff --git a/test/mcord-mwc-demo-playbook.yml b/test/mcord-mwc-demo-playbook.yml
index 71372c5..9950997 100644
--- a/test/mcord-mwc-demo-playbook.yml
+++ b/test/mcord-mwc-demo-playbook.yml
@@ -19,7 +19,7 @@
 # Set up XOS for the MWC 2018 demos
 
 - name: Run base M-CORD tests
-  hosts: head
+  hosts: all
   become: no
   # These variables could be elevated to the profile. Think about
   # doing this after the E2E test framework is complete.
diff --git a/test/roles/create-epc/defaults/main.yml b/test/roles/create-epc/defaults/main.yml
index 6d0c586..e9b5861 100644
--- a/test/roles/create-epc/defaults/main.yml
+++ b/test/roles/create-epc/defaults/main.yml
@@ -16,9 +16,9 @@
 
 # roles/create-epc/defaults/main.yml
 
-config_credentials_dir: "{{ playbook_dir }}/../../../../build/platform-install/credentials"
+xos_admin_user: "admin@opencord.org"
+xos_admin_pass: "letmein"
 
-xos_admin_user: "xosadmin@opencord.org"
-xos_admin_pass: "{{ lookup('file', config_credentials_dir ~ '/' ~ xos_admin_user) }}"
+epc_blueprint: "mcord_5"
 
-epc_blueprint: "build"
+xos_api_url: "http://xos-gui.default.svc.cluster.local:4000"
\ No newline at end of file
diff --git a/test/roles/create-epc/tasks/main.yml b/test/roles/create-epc/tasks/main.yml
index ddad05f..cbf5cf8 100644
--- a/test/roles/create-epc/tasks/main.yml
+++ b/test/roles/create-epc/tasks/main.yml
@@ -18,26 +18,29 @@
 
 - name: Check for EPC ServiceInstance
   uri:
-    url: http://localhost/xosapi/v1/vepc/vepcserviceinstances
+    url: "{{ xos_api_url }}/xosapi/v1/vepc/vepcserviceinstances"
     user: "{{ xos_admin_user }}"
     password: "{{ xos_admin_pass }}"
     return_content: yes
+    force_basic_auth: yes
   register: result
 
 - name: Get EPC Service ID
   uri:
-    url: http://localhost/xosapi/v1/vepc/vepcservices
+    url: "{{ xos_api_url }}/xosapi/v1/vepc/vepcservices"
     user: "{{ xos_admin_user }}"
     password: "{{ xos_admin_pass }}"
     return_content: yes
+    force_basic_auth: yes
   register: vepcservice
   when: not result.json["items"]
 
 - name: Create EPC
   uri:
-    url: http://localhost/xosapi/v1/vepc/vepcserviceinstances
+    url: "{{ xos_api_url }}/xosapi/v1/vepc/vepcserviceinstances"
     user: "{{ xos_admin_user }}"
     password: "{{ xos_admin_pass }}"
+    force_basic_auth: yes
     method: POST
     body:
       blueprint: "{{ epc_blueprint }}"
diff --git a/test/roles/create-internetemulator/defaults/main.yml b/test/roles/create-internetemulator/defaults/main.yml
index 2ef239f..434e68c 100644
--- a/test/roles/create-internetemulator/defaults/main.yml
+++ b/test/roles/create-internetemulator/defaults/main.yml
@@ -16,9 +16,6 @@
 
 # roles/create-internetemulator/defaults/main.yml
 
-config_credentials_dir: "{{ playbook_dir }}/../../../../build/platform-install/credentials"
-head_cord_profile_dir: "/opt/cord_profile"
-
-xos_admin_user: "xosadmin@opencord.org"
-xos_admin_pass: "{{ lookup('file', config_credentials_dir ~ '/' ~ xos_admin_user) }}"
-xos_tosca_url: "http://xos-tosca/xos-tosca"
+xos_admin_user: "admin@opencord.org"
+xos_admin_pass: "letmein"
+xos_tosca_url: "http://xos-tosca.default.svc.cluster.local:9102"
diff --git a/test/roles/create-internetemulator/tasks/main.yml b/test/roles/create-internetemulator/tasks/main.yml
index 94eea1d..30abc91 100644
--- a/test/roles/create-internetemulator/tasks/main.yml
+++ b/test/roles/create-internetemulator/tasks/main.yml
@@ -19,11 +19,11 @@
 - name: TOSCA to create internetemulator
   template:
     src: "internetemulator.yaml.j2"
-    dest: "{{ head_cord_profile_dir }}/internetemulator.yaml"
+    dest: "/tmp/internetemulator.yaml"
 
 - name: Read internetemulator.yaml
   slurp:
-    src: "{{ head_cord_profile_dir }}/internetemulator.yaml"
+    src: "/tmp/internetemulator.yaml"
   register: slurpfile
 
 - name: Add InternetEmulatorServiceInstance via TOSCA
@@ -36,6 +36,6 @@
     body: "{{ slurpfile['content'] | b64decode }}"
     status_code: 200
   register: result
-  until: result | success
+  until: result is success
   retries: 50
   delay: 5
diff --git a/test/roles/epc-synced/defaults/main.yml b/test/roles/epc-synced/defaults/main.yml
index f8747e3..fabcc1d 100644
--- a/test/roles/epc-synced/defaults/main.yml
+++ b/test/roles/epc-synced/defaults/main.yml
@@ -16,9 +16,9 @@
 
 # roles/epc-synced/defaults/main.yml
 
-config_credentials_dir: "{{ playbook_dir }}/../../../../build/platform-install/credentials"
-
-xos_admin_user: "xosadmin@opencord.org"
-xos_admin_pass: "{{ lookup('file', config_credentials_dir ~ '/' ~ xos_admin_user) }}"
+xos_admin_user: "admin@opencord.org"
+xos_admin_pass: "letmein"
 
 epc_sync_objects: []
+
+xos_api_url: "http://xos-gui.default.svc.cluster.local:4000"
diff --git a/test/roles/epc-synced/tasks/main.yml b/test/roles/epc-synced/tasks/main.yml
index 996a069..6552ae0 100644
--- a/test/roles/epc-synced/tasks/main.yml
+++ b/test/roles/epc-synced/tasks/main.yml
@@ -18,10 +18,11 @@
 
 - name: Wait for synchronizers to run
   uri:
-    url: http://localhost/xosapi/v1/{{ item }}
+    url: "{{ xos_api_url }}/xosapi/v1/{{ item }}"
     user: "{{ xos_admin_user }}"
     password: "{{ xos_admin_pass }}"
     return_content: yes
+    force_basic_auth: yes
   register: result
   until: result.json["items"] and result.json["items"][0]["backend_status"] == "OK"
   retries: 20
diff --git a/test/roles/test-mcord-base/tasks/main.yml b/test/roles/test-mcord-base/tasks/main.yml
index d4b5dd0..9e58925 100644
--- a/test/roles/test-mcord-base/tasks/main.yml
+++ b/test/roles/test-mcord-base/tasks/main.yml
@@ -17,11 +17,11 @@
 # Run tests to check that the base elements of M-CORD are present
 
 - name: Wait for networks to be synchronized
-  shell: source /opt/cord_profile/admin-openrc.sh; neutron net-list|grep '{{ item }}' > /dev/null
+  shell: export OS_CLOUD=openstack_helm; openstack network list|grep '{{ item }}' > /dev/null
   args:
     executable: /bin/bash
   register: result
-  until: result | success
+  until: result is success
   retries: 10
   delay: 60
   with_items: "{{ test_networks }}"
@@ -29,11 +29,11 @@
     - skip_ansible_lint # running a sub job
 
 - name: Wait for VMs to come up
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}.*\(ACTIVE\|ERROR\)' > /dev/null
+  shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*\(ACTIVE\|ERROR\)' > /dev/null
   args:
     executable: /bin/bash
   register: result
-  until: result | success
+  until: result is success
   retries: 10
   delay: 60
   with_items: "{{ test_services }}"
@@ -41,18 +41,18 @@
     - skip_ansible_lint # running a sub job
 
 - name: Delete any VMs that are in ERROR state (XOS will re-create them)
-  shell: source /opt/cord_profile/admin-openrc.sh; for vm in $(nova list --all-tenants|grep 'ERROR'|awk '{ print $2 }'); do nova delete $vm; done
+  shell: export OS_CLOUD=openstack_helm; for vm in $(openstack server list --all-projects|grep 'ERROR'|awk '{ print $2 }'); do openstack server delete $vm; done
   args:
     executable: /bin/bash
   tags:
     - skip_ansible_lint # running a sub job
 
 - name: Wait for VMs to come up
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item }}.*ACTIVE' > /dev/null
+  shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item }}.*ACTIVE' > /dev/null
   args:
     executable: /bin/bash
   register: result
-  until: result | success
+  until: result is success
   retries: 10
   delay: 60
   with_items: "{{ test_services }}"
@@ -60,7 +60,7 @@
     - skip_ansible_lint # running a sub job
 
 - name: Verify that VMs are properly networked
-  shell: source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null
+  shell: export OS_CLOUD=openstack_helm; openstack server list --all-projects|grep '{{ item.vm }}.*ACTIVE.*{{ item.network }}' > /dev/null
   args:
     executable: /bin/bash
   with_items: "{{ test_ports }}"