aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2019-08-14 19:41:37 +0000
committerRitu Sood <ritu.sood@intel.com>2019-08-29 06:14:02 -0700
commitb5e4a8178fce6ab9d60f1c4e2cd9ec53cbd5d2f8 (patch)
treee7fc7f5a240389ed569f5f7cfc32253ada73b34b /kud/tests
parentdcace0784979890bb986fb078348b4b3ceef146c (diff)
Add support for Network Operator
ovn4nfvk8s plugin now uses operator sdk and controller runtime. It now includes support for Network operator. This patch includes changes needed in KUD for that. Signed-off-by: Ritu Sood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-684 Change-Id: I63dc971e257067c69c70a8996eaffd1a9d8a4c2c
Diffstat (limited to 'kud/tests')
-rwxr-xr-xkud/tests/_common.sh82
-rwxr-xr-xkud/tests/integration_vcFW.sh6
-rwxr-xr-xkud/tests/ovn4nfv.sh10
3 files changed, 51 insertions, 47 deletions
diff --git a/kud/tests/_common.sh b/kud/tests/_common.sh
index 044891dd..92c09b0d 100755
--- a/kud/tests/_common.sh
+++ b/kud/tests/_common.sh
@@ -277,39 +277,43 @@ spec:
MULTUS_NET
cat << NET > $unprotected_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
+
metadata:
name: $unprotected_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $unprotected_private_net
- subnet: $protected_private_net_cidr
- gateway: 192.168.10.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $protected_private_net_cidr
+ name: subnet1
+ gateway: 192.168.10.1/24
NET
cat << NET > $protected_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: $protected_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $protected_private_net
- subnet: $protected_net_cidr
- gateway: $protected_net_gw/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $protected_net_cidr
+ name: subnet1
+ gateway: $protected_net_gw/24
NET
cat << NET > $onap_private_net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: $onap_private_net
- cnitype : ovn4nfvk8s
spec:
- name: $onap_private_net
- subnet: $onap_private_net_cidr
- gateway: 10.10.0.1/16
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: $onap_private_net_cidr
+ name: subnet1
+ gateway: 10.10.0.1/16
NET
proxy="apt:"
@@ -381,10 +385,10 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$unprotected_private_net", "ipAddress": "$vpg_private_ip_0", "interface": "eth1" , "defaultGateway": "false"},
{ "name": "$onap_private_net", "ipAddress": "$vpg_private_ip_1", "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
@@ -449,11 +453,11 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$unprotected_private_net", "ipAddress": "$vfw_private_ip_0", "interface": "eth1" , "defaultGateway": "false"},
{ "name": "$protected_private_net", "ipAddress": "$vfw_private_ip_1", "interface": "eth2", "defaultGateway": "false" },
{ "name": "$onap_private_net", "ipAddress": "$vfw_private_ip_2", "interface": "eth3" , "defaultGateway": "false"}
- ]'
+ ]}'
kubernetes.io/target-runtime: virtlet.cloud
spec:
affinity:
@@ -506,10 +510,10 @@ spec:
context: darkstat
annotations:
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [
{ "name": "$protected_private_net", "ipAddress": "$vsn_private_ip_0", "interface": "eth1", "defaultGateway": "false" },
{ "name": "$onap_private_net", "ipAddress": "$vsn_private_ip_1", "interface": "eth2" , "defaultGateway": "false"}
- ]'
+ ]}'
spec:
containers:
- name: $sink_deployment_name
@@ -1060,27 +1064,29 @@ spec:
MULTUS_NET
cat << NETWORK > ovn-port-net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: ovn-port-net
- cnitype : ovn4nfvk8s
spec:
- name: ovn-port-net
- subnet: 172.16.33.0/24
- gateway: 172.16.33.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: 172.16.33.0/24
+ name: subnet1
+ gateway: 172.16.33.1/24
NETWORK
cat << NETWORK > ovn-priv-net.yaml
-apiVersion: v1
-kind: onapNetwork
+apiVersion: k8s.plugin.opnfv.org/v1alpha1
+kind: Network
metadata:
name: ovn-priv-net
- cnitype : ovn4nfvk8s
spec:
- name: ovn-priv-net
- subnet: 172.16.44.0/24
- gateway: 172.16.44.1/24
+ cniType : ovn4nfv
+ ipv4Subnets:
+ - subnet: 172.16.44.0/24
+ name: subnet1
+ gateway: 172.16.44.1/24
NETWORK
cat << DEPLOYMENT > $ovn4nfv_deployment_name.yaml
@@ -1101,8 +1107,8 @@ spec:
app: ovn4nfv
annotations:
k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
- ovnNetwork: '[{ "name": "ovn-port-net", "interface": "net0" , "defaultGateway": "false"},
- { "name": "ovn-priv-net", "interface": "net1" , "defaultGateway": "false"}]'
+ k8s.plugin.opnfv.org/nfn-network: '{ "type": "ovn4nfv", "interface": [{ "name": "ovn-port-net", "interface": "net0" , "defaultGateway": "false"},
+ { "name": "ovn-priv-net", "interface": "net1" , "defaultGateway": "false"}]}'
spec:
containers:
- name: $ovn4nfv_deployment_name
diff --git a/kud/tests/integration_vcFW.sh b/kud/tests/integration_vcFW.sh
index a4035207..af8039c4 100755
--- a/kud/tests/integration_vcFW.sh
+++ b/kud/tests/integration_vcFW.sh
@@ -19,7 +19,6 @@ source _functions.sh
csar_id=aa443e7e-c8ba-11e8-8877-525400b164ff
# Setup
-install_ovn_deps
if [[ ! -f $HOME/.ssh/id_rsa.pub ]]; then
echo -e "\n\n\n" | ssh-keygen -t rsa -N ""
fi
@@ -27,9 +26,8 @@ populate_CSAR_vms_containers_vFW $csar_id
pushd ${CSAR_DIR}/${csar_id}
for net in $unprotected_private_net $protected_private_net $onap_private_net; do
- cleanup_network $net.yaml
echo "Create OVN Network $net network"
- init_network $net.yaml
+ kubectl apply -f $net.yaml
done
for resource in onap-ovn4nfvk8s-network sink-service sink_configmap; do
kubectl apply -f $resource.yaml
@@ -51,6 +49,6 @@ done
# Teardown
#teardown $packetgen_deployment_name $firewall_deployment_name $sink_deployment_name
#for net in $unprotected_private_net $protected_private_net $onap_private_net; do
-# cleanup_network $net.yaml
+# kubectl delete -f $net.yaml
#done
popd
diff --git a/kud/tests/ovn4nfv.sh b/kud/tests/ovn4nfv.sh
index 6be6aae8..cd2664ad 100755
--- a/kud/tests/ovn4nfv.sh
+++ b/kud/tests/ovn4nfv.sh
@@ -18,14 +18,12 @@ source _functions.sh
csar_id=a1c5b53e-d7ab-11e8-85b7-525400e8c29a
# Setup
-install_ovn_deps
populate_CSAR_ovn4nfv $csar_id
pushd ${CSAR_DIR}/${csar_id}
for net in ovn-priv-net ovn-port-net; do
- cleanup_network $net.yaml
echo "Create OVN Network $net network"
- init_network $net.yaml
+ kubectl apply -f $net.yaml
done
kubectl apply -f onap-ovn4nfvk8s-network.yaml
setup $ovn4nfv_deployment_name
@@ -45,6 +43,8 @@ fi
# Teardown
teardown $ovn4nfv_deployment_name
-cleanup_network ovn-priv-net.yaml
-cleanup_network ovn-port-net.yaml
+for net in ovn-priv-net ovn-port-net; do
+ echo "Delete OVN Network $net network"
+ kubectl delete -f $net.yaml
+done
popd