[vFW_CNF_CDS] Provide Helm Tests for CNF
[demo.git] / heat / vFW_CNF_CDS / templates / helm / vpkg / 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.vpg_name_0 }}-test"
12   labels:
13     vnf-name: {{ .Values.vnf_name }}
14     vf-module-name: {{ .Values.vpg_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             }
35     spec:
36       restartPolicy: Never
37       containers:
38         - name: "ping-test-eth1"
39           image: busybox
40           command:
41             - /bin/sh
42             - -exc
43             - "ping -c {{ .Values.Tests.ping_count }} -I eth1 {{ .Values.vpg_int_private1_ip_0 }}"
44 {{- end -}}