Fix ovnaction cnitype key value
[multicloud/k8s.git] / kud / tests / ovn4nfv.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2018
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 source _common.sh
15 source _common_test.sh
16 source _functions.sh
17
18 csar_id=a1c5b53e-d7ab-11e8-85b7-525400e8c29a
19
20 # Setup
21 populate_CSAR_ovn4nfv $csar_id
22
23 pushd ${CSAR_DIR}/${csar_id}
24 for net in ovn-priv-net ovn-port-net; do
25     echo "Create OVN Network $net network"
26     kubectl apply -f $net.yaml
27 done
28 kubectl apply -f onap-ovn4nfvk8s-network.yaml
29 setup $ovn4nfv_deployment_name
30
31 # Test
32 deployment_pod=$(kubectl get pods | grep  $ovn4nfv_deployment_name | awk '{print $1}')
33 echo "===== $deployment_pod details ====="
34 kubectl exec -it $deployment_pod -- ip a
35
36 ovn_nic=$(kubectl exec -it $deployment_pod -- ip a )
37 if [[ $ovn_nic != *"net1"* ]]; then
38     echo "The $deployment_pod pod doesn't contain the net1 nic"
39     exit 1
40 else
41     echo "Test Completed!"
42 fi
43
44 # Teardown
45 teardown $ovn4nfv_deployment_name
46 for net in ovn-priv-net ovn-port-net; do
47     echo "Delete OVN Network $net network"
48     kubectl delete -f $net.yaml
49 done
50 popd