aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java b/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java
index ac046188..7a25e77b 100644
--- a/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java
+++ b/fabric-discovery-plugin/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/fabricdiscovery/TestFabricDiscoveryPlugin.java
@@ -55,4 +55,25 @@ public class TestFabricDiscoveryPlugin {
}
}
+ @Test
+ public void validateParameterEnableFailure() throws Exception {
+ SvcLogicContext ctx = new SvcLogicContext();
+ String stream = C_STREAM;
+ final String W_ENABLE_STR = "bad enable parameter";
+
+ Map<String, String> p = new HashMap<>();
+ p.put("stream", stream);
+ p.put("enable", W_ENABLE_STR);
+
+ FabricDiscoveryPlugin fdp = new FabricDiscoveryPlugin();
+ try {
+ fdp.processDcNotificationStream(p, ctx);
+ LOG.info("Connection to Stream:{} succeeded.", stream);
+ } catch (Exception e) {
+ LOG.info("Received Exception while connecting to Fabric Discovery notification server: {}", e.getMessage());
+ } finally {
+ Assert.assertEquals("Failure", ctx.getAttribute(FB_DISCOVERY_STATUS));
+ }
+ }
+
}
4'>144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
# Copyright © 2017 Amdocs, Bell Canada
#
# 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: extensions/v1beta1
kind: Deployment
metadata:
  name: {{ include "common.fullname" . }}
  namespace: {{ include "common.namespace" . }}
  labels:
    app: {{ include "common.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: {{ include "common.name" . }}
        release: {{ .Release.Name }}
    spec:
      initContainers:
      - command:
        - /root/job_complete.py
        args:
        - --job-name
        - {{ include "common.fullname" . }}-galera-config
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        name: {{ include "common.name" . }}-readiness
      containers:
        - name: {{ include "common.name" . }}
          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
          ports:
          - containerPort: {{ .Values.service.internalPort }}
          # disable liveness probe when breakpoints set in debugger
          # so K8s doesn't restart unresponsive container
          {{- if eq .Values.liveness.enabled true }}
          livenessProbe:
            tcpSocket:
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
            periodSeconds: {{ .Values.liveness.periodSeconds }}
          {{ end -}}
          readinessProbe:
            tcpSocket:
              port: {{ .Values.service.internalPort }}
            initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
            periodSeconds: {{ .Values.readiness.periodSeconds }}
          env:
            - name: ASDC_CLIENT_REST_HOST
              value: sdc-be.{{ include "common.namespace" . }}
            - name: ASDC_CLIENT_REST_AUTH
              value: "{{ .Values.config.asdcclientrestauth }}"
            - name: ASDC_CLIENT_REST_PORT
              value: "{{ .Values.config.asdcclientrestport }}"
            - name: ASDC_CLIENT_REST_PROTOCOL
              value: "https"
            - name: VID_AAI_URL
              value: https://aai.{{ include "common.namespace" . }}:{{ .Values.config.vidaaiport }}
            - name: VID_ECOMP_SHARED_CONTEXT_REST_URL
              value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/context
            - name: VID_MSO_SERVER_URL
              value: http://so.{{ include "common.namespace" . }}:{{ .Values.config.msoport }}/onap/so/infra
            - name: VID_MSO_PASS
              value: "{{ .Values.config.vidmsopass }}"
            - name: MSO_DME2_SERVER_URL
              value: "{{ .Values.config.msodme2serverurl }}"
            - name: MSO_DME2_ENABLED
              value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
            - name: VID_ECOMP_REDIRECT_URL
              value: https://{{ .Values.config.portalhost }}:{{ .Values.config.onapport }}/ONAPPORTAL/login.htm
            - name: VID_ECOMP_REST_URL
              value: https://portal-app:{{ .Values.config.onapportrest }}/ONAPPORTAL/auxapi
            - name: VID_ROLE_ACCESS_CENTRALIZED
              value: "{{ .Values.config.roleaccesscentralized }}"
            - name: VID_CONTACT_US_LINK
              value: "{{ .Values.config.vidcontactuslink }}"
            - name: VID_KEYSTORE_PASSWORD
              value: {{ .Values.config.vidkeystorepassword | quote }}
            - name: VID_UEB_URL_LIST
              value: message-router.{{ include "common.namespace" . }}
            - name: VID_MYSQL_HOST
              value: {{ index .Values "mariadb-galera" "service" "name" }}
            - name: VID_MYSQL_PORT
              value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}"
            - name: VID_MYSQL_DBNAME
              value: {{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
            - name: VID_MYSQL_USER
              value: {{ index .Values "mariadb-galera" "config" "userName" }}
            - name: VID_MYSQL_PASS
              valueFrom:
                secretKeyRef:
                  name: {{ template "common.fullname" . }}-db
                  key: db-user-password
              #valueFrom:
              #  secretKeyRef: {name: {{ include "common.fullname" . }}, key: vid-password}
            - name: VID_MYSQL_MAXCONNECTIONS
              value: "{{ .Values.config.vidmysqlmaxconnections }}"
          volumeMounts:
          - mountPath: /opt/app/vid/etc
            name: vid-certs
          - mountPath: /etc/localtime
            name: localtime
            readOnly: true
          - mountPath: /var/log/onap
            name: vid-logs
          - mountPath: /tmp/logback.xml
            name: vid-logback
            subPath: logback.xml
          resources:
{{ include "common.resources" . | indent 12 }}
        {{- if .Values.nodeSelector }}
        nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
        {{- end -}}
        {{- if .Values.affinity }}
        affinity:
{{ toYaml .Values.affinity | indent 10 }}
        {{- end }}
      # side car containers
        - name: filebeat-onap
          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
          volumeMounts:
          - mountPath: /usr/share/filebeat/filebeat.yml
            name: filebeat-conf
            subPath: filebeat.yml
          - mountPath: /var/log/onap
            name: vid-logs
          - mountPath: /usr/share/filebeat/data
            name: vid-data-filebeat
      volumes:
        - name: vid-certs
          secret:
            secretName: {{ include "common.fullname" . }}-certs
        - name: localtime
          hostPath:
            path: /etc/localtime
        - name: filebeat-conf
          configMap:
            name: {{ include "common.fullname" . }}-filebeat-configmap
        - name: vid-logs
          emptyDir: {}
        - name: vid-data-filebeat
          emptyDir: {}
        - name: vid-logback
          configMap:
            name: {{ include "common.fullname" . }}-log-configmap
      imagePullSecrets:
      - name: "{{ include "common.namespace" . }}-docker-registry-key"