[vFW_CNF_CDS] Improve logging and fix tests typo
[demo.git] / heat / vFW_CNF_CDS / templates / helm / vfw / templates / tests / ping.yaml
1 ---
2 # Copyright © 2021 Samsung Electronics
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 {{- if eq .Values.Tests.enabled "yes" }}
8 apiVersion: batch/v1
9 kind: Job
10 metadata:
11   name: "{{ .Values.vfw_name_0 }}-test"
12   labels:
13     vnf-name: {{ .Values.vnf_name }}
14     vf-module-name: {{ .Values.vfw_name_0 }}
15     release: {{ .Release.Name }}
16     chart: {{ .Chart.Name }}
17   annotations:
18     "helm.sh/hook": test-success
19 spec:
20   completions: 1
21   template:
22     metadata:
23       annotations:
24         k8s.v1.cni.cncf.io/networks: "{{ .Values.net_attachment_definition }}"
25         k8s.plugin.opnfv.org/nfn-network: |
26             { "type": "ovn4nfv",
27               "interface": [
28                 {
29                   "name": {{ .Values.int_private1_net_id | quote }},
30                   "interface": "eth1" ,
31                   "defaultGateway": "false"
32                 },
33                 {
34                   "name": {{ .Values.int_private2_net_id | quote }},
35                   "interface": "eth2" ,
36                   "defaultGateway": "false"
37                 }
38               ]
39             }
40     spec:
41       restartPolicy: Never
42       containers:
43         - name: "ping-test-eth1"
44           image: busybox
45           command:
46             - /bin/sh
47             - -exc
48             - "ping -c {{ .Values.Tests.ping_count }} -I eth1 {{ .Values.vfw_int_private1_ip_0 }}"
49         - name: "ping-test-eth2"
50           image: busybox
51           command:
52             - /bin/sh
53             - -exc
54             - "ping -c {{ .Values.Tests.ping_count }} -I eth2 {{ .Values.vfw_int_private2_ip_0 }}"
55 {{- end -}}