CORD-2905 Run XOS API tests using 'helm test xos-core'

Change-Id: I932fb727c1b06b9420fa430a2224cc0ac4c1568a
diff --git a/examples/candidate-tag-values.yaml b/examples/candidate-tag-values.yaml
index 7810141..73eb790 100644
--- a/examples/candidate-tag-values.yaml
+++ b/examples/candidate-tag-values.yaml
@@ -29,6 +29,8 @@
     tag: 'candidate'
   xos_ws:
     tag: 'candidate'
+  api_tester:
+    tag: 'candidate'
 
 image:
   rcordSynchronizer:
diff --git a/examples/filter-images.yaml b/examples/filter-images.yaml
index aa0411f..ff4b082 100644
--- a/examples/filter-images.yaml
+++ b/examples/filter-images.yaml
@@ -33,6 +33,7 @@
 - xosproject/addressmanager-synchronizer
 - xosproject/vsg-hw-synchronizer
 - xosproject/fabric-synchronizer
+- xosproject/xos-api-tester
 - nginx
 - node
 - postgres
diff --git a/examples/pull-always-values.yaml b/examples/pull-always-values.yaml
index 3ba39a8..21a3803 100644
--- a/examples/pull-always-values.yaml
+++ b/examples/pull-always-values.yaml
@@ -29,6 +29,8 @@
     pullPolicy: 'Always'
   xos_ws:
     pullPolicy: 'Always'
+  api_tester:
+    pullPolicy: 'Always'
 
 image:
   rcordSynchronizer:
diff --git a/xos-core/templates/tests/test-xos-core-api.yaml b/xos-core/templates/tests/test-xos-core-api.yaml
new file mode 100644
index 0000000..1797750
--- /dev/null
+++ b/xos-core/templates/tests/test-xos-core-api.yaml
@@ -0,0 +1,36 @@
+# 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.
+
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ .Release.Name }}-api-test"
+  annotations:
+    "helm.sh/hook": test-success
+spec:
+  containers:
+  - name: {{ .Release.Name }}-api-test
+    image: {{ .Values.images.api_tester.repository }}:{{ .Values.images.api_tester.tag }}
+    imagePullPolicy: {{ .Values.images.api_tester.pullPolicy }}
+    env:
+      - name: SERVER_IP
+        value: 'xos-chameleon'
+      - name: SERVER_PORT
+        value: '9101'
+      - name: USER
+        value: '{{ .Values.xosAdminUser }}'
+      - name: PASSWD
+        value: '{{ .Values.xosAdminPassword }}'
+    command: [ "pybot", "-L", "TRACE", "-d", "Log", "-T", "Ch_DeploymentTest.txt", "Ch_SiteTest.txt", "Ch_UsersTest.txt", "Ch_SliceTest.txt", "Ch_ServiceTest.txt" ]
+  restartPolicy: Never
diff --git a/xos-core/values.yaml b/xos-core/values.yaml
index ccb647c..5f2b6e6 100644
--- a/xos-core/values.yaml
+++ b/xos-core/values.yaml
@@ -47,6 +47,10 @@
     repository: xosproject/xos-ws
     tag: 'master'
     pullPolicy: 'IfNotPresent'
+  api_tester:
+    repository: xosproject/xos-api-tester
+    tag: 'master'
+    pullPolicy: 'IfNotPresent'
 
 node_ports:
   ws_service_port: 30008
@@ -58,6 +62,9 @@
   chameleon_service_port: 30006
   tosca_service_port: 30007
 
+xosAdminUser: &adminuser "admin@opencord.org"
+xosAdminPassword: &adminpass "letmein"
+
 configs:
   core_config:
     name: xos-core
@@ -140,8 +147,8 @@
 
     - model: core.User
       fields:
-        email: "admin@opencord.org"
-        password: "letmein"
+        email: *adminuser
+        password: *adminpass
         firstname: "XOS"
         lastname: "User"
         is_admin: True