Merge "[CORD-2550] Adding progran service to cavium profile"
diff --git a/mcord-cavium.yml b/mcord-cavium.yml
index 4fb1561..d4d5239 100644
--- a/mcord-cavium.yml
+++ b/mcord-cavium.yml
@@ -317,12 +317,12 @@
     checksum: "sha256:ebf007ba3ec1043b7cd011fc6668e2a1d1d4c69c41071e8513ab355df7a057cb"
 
   - name: "image-mme"
-    url: "http://www.vicci.org/cord/c3po-mme1-comp.qcow2.20180118"
-    checksum: "sha256:d6979505967bbba5b6af2d48f833ddddefaf8c0e4fd23abf1853cb4b70615af5"
+    url: "http://www.vicci.org/cord/c3po-mme1-comp.qcow2.20180126"
+    checksum: "sha256:cca87562d44b7886c426da1e920ef9add9cb615504f60da17432ec825d81d3bb"
 
   - name: "image-hss"
-    url: "http://www.vicci.org/cord/c3po-hss1-comp.qcow2.20180118"
-    checksum: "sha256:9446fb91c9bf3486adc6453ca4cd1dd1e93c03a30d3864fd1511029694bf4b1c"
+    url: "http://www.vicci.org/cord/c3po-hss1-comp.qcow2.20180126"
+    checksum: "sha256:86ecb5846212547ecd1c3864b3f1a1b150d083026169acb1018e9b7e0ae95784"
 
   - name: "image-hss-db"
     url: "http://www.vicci.org/cord/c3po-dbn1-comp.qcow2.20180118"
diff --git a/test/roles/run-ng40/defaults/main.yml b/test/roles/run-ng40/defaults/main.yml
new file mode 100644
index 0000000..0253d35
--- /dev/null
+++ b/test/roles/run-ng40/defaults/main.yml
@@ -0,0 +1,19 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+mcord_ng40_license_email: do.not.distribute@opennetworking.org
+mcord_ng40_login: ng40
+mcord_ng40_password: ng40
\ No newline at end of file
diff --git a/test/roles/run-ng40/tasks/main.yml b/test/roles/run-ng40/tasks/main.yml
new file mode 100644
index 0000000..49dafaf
--- /dev/null
+++ b/test/roles/run-ng40/tasks/main.yml
@@ -0,0 +1,49 @@
+---
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+- name: Get ID of VM
+  shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep mysite_venb|cut -d '|' -f 2"
+  register: nova_id
+  tags:
+    - skip_ansible_lint # running a sub job
+
+- name: Get mgmt IP of VM
+  shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 '172\.27\.[[:digit:]]*\.[[:digit:]]*'"
+  register: mgmt_ip
+  tags:
+    - skip_ansible_lint # running a sub job
+
+- name: Get name of compute node
+  shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova show {{ nova_id.stdout }}|grep hypervisor_hostname|cut -d '|' -f 3"
+  register: node_name
+  tags:
+    - skip_ansible_lint # running a sub job
+
+- name: Write email address to file
+  shell: sshpass -p {{ mcord_ng40_password }} ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" {{ mcord_ng40_login }}@{{ mgmt_ip.stdout }} "sudo bash -c 'echo {{ mcord_ng40_license_email }} > /opt/ng4t/etc/email'"
+  tags:
+    - skip_ansible_lint # running a sub job
+
+- name: Run ./verify_quick.sh and check for VERDICT_PASS
+  shell: sshpass -p {{ mcord_ng40_password }} ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" {{ mcord_ng40_login }}@{{ mgmt_ip.stdout }} "./verify_quick.sh"
+  register: result
+  failed_when: "'VERDICT_PASS' not in result.stdout"
+  tags:
+    - skip_ansible_lint # running a sub job
+
+- name: Print result of test
+  debug:
+    var: result.stdout_lines
\ No newline at end of file