Merge "Use httptest instead of http in unit tests"
[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 _functions.sh
16
17 csar_id=a1c5b53e-d7ab-11e8-85b7-525400e8c29a
18
19 # Setup
20 install_ovn_deps
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     cleanup_network $net.yaml
26     echo "Create OVN Network $net network"
27     init_network $net.yaml
28 done
29 kubectl apply -f onap-ovn4nfvk8s-network.yaml
30 setup $ovn4nfv_deployment_name
31
32 # Test
33 deployment_pod=$(kubectl get pods | grep  $ovn4nfv_deployment_name | awk '{print $1}')
34 echo "===== $deployment_pod details ====="
35 kubectl exec -it $deployment_pod -- ip a
36 multus_nic=$(kubectl exec -it $deployment_pod -- ifconfig | grep "net1")
37 if [ -z "$multus_nic" ]; then
38     echo "The $deployment_pod pod doesn't contain the net1 nic"
39     exit 1
40 fi
41
42 # Teardown
43 teardown $ovn4nfv_deployment_name
44 cleanup_network ovn-priv-net.yaml
45 cleanup_network ovn-port-net.yaml
46 popd