summaryrefslogtreecommitdiffstats
path: root/vagrant/tests
diff options
context:
space:
mode:
Diffstat (limited to 'vagrant/tests')
-rwxr-xr-xvagrant/tests/_common.sh334
-rwxr-xr-xvagrant/tests/_functions.sh62
-rwxr-xr-xvagrant/tests/integration_cFW.sh4
-rwxr-xr-xvagrant/tests/integration_vFW.sh2
-rwxr-xr-xvagrant/tests/integration_vcFW.sh13
-rwxr-xr-xvagrant/tests/ovn4nfv.sh46
-rwxr-xr-xvagrant/tests/plugin.sh2
7 files changed, 350 insertions, 113 deletions
diff --git a/vagrant/tests/_common.sh b/vagrant/tests/_common.sh
index ac226da0..620c00af 100755
--- a/vagrant/tests/_common.sh
+++ b/vagrant/tests/_common.sh
@@ -21,6 +21,27 @@ virtlet_image=virtlet.cloud/fedora
virtlet_deployment_name=virtlet-deployment
plugin_deployment_name=plugin-deployment
plugin_service_name=plugin-service
+ovn4nfv_deployment_name=ovn4nfv-deployment
+onap_private_net=onap-private-net
+unprotected_private_net=unprotected-private-net
+protected_private_net=protected-private-net
+ovn_multus_network_name=ovn-networkobj
+
+# vFirewall vars
+demo_artifacts_version=1.3.0
+vfw_private_ip_0='192.168.10.3'
+vfw_private_ip_1='192.168.20.2'
+vfw_private_ip_2='10.10.100.3'
+vpg_private_ip_0='192.168.10.2'
+vpg_private_ip_1='10.0.100.2'
+vsn_private_ip_0='192.168.20.3'
+vsn_private_ip_1='10.10.100.4'
+dcae_collector_ip='10.0.4.1'
+dcae_collector_port='8081'
+protected_net_gw='192.168.20.100'
+protected_net_cidr='192.168.20.0/24'
+protected_private_net_cidr='192.168.10.0/24'
+onap_private_net_cidr='10.10.0.0/16'
# populate_CSAR_containers_vFW() - This function creates the content of CSAR file
# required for vFirewal using only containers
@@ -33,59 +54,59 @@ function populate_CSAR_containers_vFW {
cat << META > metadata.yaml
resources:
network:
- - unprotected-private-net-cidr-network.yaml
- - protected-private-net-cidr-network.yaml
- - onap-private-net-cidr-network.yaml
+ - $unprotected_private_net.yaml
+ - $protected_private_net.yaml
+ - $onap_private_net.yaml
deployment:
- $packetgen_deployment_name.yaml
- $firewall_deployment_name.yaml
- $sink_deployment_name.yaml
META
- cat << NET > unprotected-private-net-cidr-network.yaml
+ cat << NET > $unprotected_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: unprotected-private-net-cidr
+ name: $unprotected_private_net
spec:
config: '{
"name": "unprotected",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "192.168.10.0/24"
+ "subnet": "$protected_private_net_cidr"
}
}'
NET
- cat << NET > protected-private-net-cidr-network.yaml
+ cat << NET > $protected_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: protected-private-net-cidr
+ name: $protected_private_net
spec:
config: '{
"name": "protected",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "192.168.20.0/24"
+ "subnet": "$protected_net_cidr"
}
}'
NET
- cat << NET > onap-private-net-cidr-network.yaml
+ cat << NET > $onap_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: onap-private-net-cidr
+ name: $onap_private_net
spec:
config: '{
"name": "onap",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "10.10.0.0/16"
+ "subnet": "$onap_private_net_cidr"
}
}'
NET
@@ -108,8 +129,8 @@ spec:
app: vFirewall
annotations:
k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ { "name": "$unprotected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth2" }
]'
spec:
containers:
@@ -141,9 +162,9 @@ spec:
app: vFirewall
annotations:
k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth2" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth3" }
+ { "name": "$unprotected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$protected_private_net", "interfaceRequest": "eth2" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth3" }
]'
spec:
containers:
@@ -166,14 +187,16 @@ spec:
selector:
matchLabels:
app: vFirewall
+ context: darkstat
template:
metadata:
labels:
app: vFirewall
+ context: darkstat
annotations:
k8s.v1.cni.cncf.io/networks: '[
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ { "name": "$protected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth2" }
]'
spec:
containers:
@@ -182,6 +205,15 @@ spec:
imagePullPolicy: IfNotPresent
tty: true
stdin: true
+ securityContext:
+ privileged: true
+ - name: darkstat
+ image: electrocucaracha/darkstat
+ imagePullPolicy: IfNotPresent
+ tty: true
+ stdin: true
+ ports:
+ - containerPort: 667
DEPLOYMENT
popd
}
@@ -199,17 +231,17 @@ function populate_CSAR_vms_containers_vFW {
cat << META > metadata.yaml
resources:
network:
- - unprotected-private-net-cidr-network.yaml
- - protected-private-net-cidr-network.yaml
- - onap-private-net-cidr-network.yaml
+ - onap-ovn4nfvk8s-network.yaml
+ onapNetwork:
+ - $unprotected_private_net.yaml
+ - $protected_private_net.yaml
+ - $onap_private_net.yaml
deployment:
- $packetgen_deployment_name.yaml
- $firewall_deployment_name.yaml
- $sink_deployment_name.yaml
service:
- sink-service.yaml
- ingress:
- - sink-ingress.yaml
META
cat << SERVICE > sink-service.yaml
@@ -217,8 +249,6 @@ apiVersion: v1
kind: Service
metadata:
name: sink-service
- labels:
- app: vFirewall
spec:
type: NodePort
ports:
@@ -229,71 +259,66 @@ spec:
context: darkstat
SERVICE
- cat << INGRESS > sink-ingress.yaml
-apiVersion: extensions/v1beta1
-kind: Ingress
-metadata:
- name: sink-ingress
-spec:
- rules:
- - host: sink.vfirewall.demo.com
- http:
- paths:
- - backend:
- serviceName: sink-service
- servicePort: 667
-INGRESS
-
- cat << NET > unprotected-private-net-cidr-network.yaml
+ cat << MULTUS_NET > onap-ovn4nfvk8s-network.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: unprotected-private-net-cidr
+ name: $ovn_multus_network_name
spec:
config: '{
- "name": "unprotected",
- "type": "bridge",
- "ipam": {
- "type": "host-local",
- "subnet": "192.168.10.0/24"
- }
-}'
+ "cniVersion": "0.3.1",
+ "name": "ovn4nfv-k8s-plugin",
+ "type": "ovn4nfvk8s-cni"
+ }'
+MULTUS_NET
+
+ cat << NET > $unprotected_private_net.yaml
+apiVersion: v1
+kind: onapNetwork
+metadata:
+ name: $unprotected_private_net
+ cnitype : ovn4nfvk8s
+spec:
+ name: $unprotected_private_net
+ subnet: $protected_private_net_cidr
+ gateway: 192.168.10.1/24
NET
- cat << NET > protected-private-net-cidr-network.yaml
-apiVersion: "k8s.cni.cncf.io/v1"
-kind: NetworkAttachmentDefinition
+ cat << NET > $protected_private_net.yaml
+apiVersion: v1
+kind: onapNetwork
metadata:
- name: protected-private-net-cidr
+ name: $protected_private_net
+ cnitype : ovn4nfvk8s
spec:
- config: '{
- "name": "protected",
- "type": "bridge",
- "ipam": {
- "type": "host-local",
- "subnet": "192.168.20.0/24"
- }
-}'
+ name: $protected_private_net
+ subnet: $protected_net_cidr
+ gateway: $protected_net_gw/24
NET
- cat << NET > onap-private-net-cidr-network.yaml
-apiVersion: "k8s.cni.cncf.io/v1"
-kind: NetworkAttachmentDefinition
+ cat << NET > $onap_private_net.yaml
+apiVersion: v1
+kind: onapNetwork
metadata:
- name: onap-private-net-cidr
+ name: $onap_private_net
+ cnitype : ovn4nfvk8s
spec:
- config: '{
- "name": "onap",
- "type": "bridge",
- "ipam": {
- "type": "host-local",
- "subnet": "10.10.0.0/16"
- }
-}'
+ name: $onap_private_net
+ subnet: $onap_private_net_cidr
+ gateway: 10.10.0.1/16
NET
proxy="apt:"
- cloud_init_proxy=""
+ cloud_init_proxy="
+ - export demo_artifacts_version=$demo_artifacts_version
+ - export vfw_private_ip_0=$vfw_private_ip_0
+ - export vsn_private_ip_0=$vsn_private_ip_0
+ - export protected_net_cidr=$protected_net_cidr
+ - export dcae_collector_ip=$dcae_collector_ip
+ - export dcae_collector_port=$dcae_collector_port
+ - export protected_net_gw=$protected_net_gw
+ - export protected_private_net_cidr=$protected_private_net_cidr
+"
if [[ -n "${http_proxy+x}" ]]; then
proxy+="
http_proxy: $http_proxy"
@@ -350,9 +375,10 @@ spec:
VirtletSSHKeys: |
$ssh_key
VirtletRootVolumeSize: 5Gi
- k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
+ ovnNetwork: '[
+ { "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:
@@ -417,10 +443,11 @@ spec:
VirtletSSHKeys: |
$ssh_key
VirtletRootVolumeSize: 5Gi
- k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth2" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth3" }
+ k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
+ ovnNetwork: '[
+ { "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:
@@ -463,9 +490,10 @@ spec:
app: vFirewall
context: darkstat
annotations:
- k8s.v1.cni.cncf.io/networks: '[
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ k8s.v1.cni.cncf.io/networks: '[{ "name": "$ovn_multus_network_name"}]'
+ ovnNetwork: '[
+ { "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:
@@ -499,65 +527,74 @@ function populate_CSAR_vms_vFW {
cat << META > metadata.yaml
resources:
network:
- - unprotected-private-net-cidr-network.yaml
- - protected-private-net-cidr-network.yaml
- - onap-private-net-cidr-network.yaml
+ - $unprotected_private_net.yaml
+ - $protected_private_net.yaml
+ - $onap_private_net.yaml
deployment:
- $packetgen_deployment_name.yaml
- $firewall_deployment_name.yaml
- $sink_deployment_name.yaml
META
- cat << NET > unprotected-private-net-cidr-network.yaml
+ cat << NET > $unprotected_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: unprotected-private-net-cidr
+ name: $unprotected_private_net
spec:
config: '{
"name": "unprotected",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "192.168.10.0/24"
+ "subnet": "$protected_private_net_cidr"
}
}'
NET
- cat << NET > protected-private-net-cidr-network.yaml
+ cat << NET > $protected_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: protected-private-net-cidr
+ name: $protected_private_net
spec:
config: '{
"name": "protected",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "192.168.20.0/24"
+ "subnet": "$protected_net_cidr"
}
}'
NET
- cat << NET > onap-private-net-cidr-network.yaml
+ cat << NET > $onap_private_net.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
- name: onap-private-net-cidr
+ name: $onap_private_net
spec:
config: '{
"name": "onap",
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "10.10.0.0/16"
+ "subnet": "$onap_private_net_cidr"
}
}'
NET
proxy="apt:"
- cloud_init_proxy=""
+ cloud_init_proxy="
+ - export demo_artifacts_version=$demo_artifacts_version
+ - export vfw_private_ip_0=$vfw_private_ip_0
+ - export vsn_private_ip_0=$vsn_private_ip_0
+ - export protected_net_cidr=$protected_net_cidr
+ - export dcae_collector_ip=$dcae_collector_ip
+ - export dcae_collector_port=$dcae_collector_port
+ - export protected_net_gw=$protected_net_gw
+ - export protected_private_net_cidr=$protected_private_net_cidr
+"
if [[ -n "${http_proxy+x}" ]]; then
proxy+="
http_proxy: $http_proxy"
@@ -615,8 +652,8 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ { "name": "$unprotected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth2" }
]'
kubernetes.io/target-runtime: virtlet.cloud
spec:
@@ -682,9 +719,9 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[
- { "name": "unprotected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth2" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth3" }
+ { "name": "$unprotected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$protected_private_net", "interfaceRequest": "eth2" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth3" }
]'
kubernetes.io/target-runtime: virtlet.cloud
spec:
@@ -748,8 +785,8 @@ spec:
$ssh_key
VirtletRootVolumeSize: 5Gi
k8s.v1.cni.cncf.io/networks: '[
- { "name": "protected-private-net-cidr", "interfaceRequest": "eth1" },
- { "name": "onap-private-net-cidr", "interfaceRequest": "eth2" }
+ { "name": "$protected_private_net", "interfaceRequest": "eth1" },
+ { "name": "$onap_private_net", "interfaceRequest": "eth2" }
]'
kubernetes.io/target-runtime: virtlet.cloud
spec:
@@ -805,7 +842,7 @@ spec:
"type": "bridge",
"ipam": {
"type": "host-local",
- "subnet": "10.10.0.0/16"
+ "subnet": "$onap_private_net_cidr"
}
}'
NET
@@ -972,3 +1009,88 @@ SERVICE
popd
}
+# populate_CSAR_ovn4nfv() - Create content used for OVN4NFV functional test
+function populate_CSAR_ovn4nfv {
+ local csar_id=$1
+
+ _checks_args $csar_id
+ pushd ${CSAR_DIR}/${csar_id}
+
+ cat << META > metadata.yaml
+resources:
+ onap_network:
+ - ovn-port-net.yaml
+ - ovn-priv-net.yaml
+ network:
+ - onap-ovn4nfvk8s-network.yaml
+ deployment:
+ - $ovn4nfv_deployment_name.yaml
+META
+
+ cat << MULTUS_NET > onap-ovn4nfvk8s-network.yaml
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: $ovn_multus_network_name
+spec:
+ config: '{
+ "cniVersion": "0.3.1",
+ "name": "ovn4nfv-k8s-plugin",
+ "type": "ovn4nfvk8s-cni"
+ }'
+MULTUS_NET
+
+ cat << NETWORK > ovn-port-net.yaml
+apiVersion: v1
+kind: onapNetwork
+metadata:
+ name: ovn-port-net
+ cnitype : ovn4nfvk8s
+spec:
+ name: ovn-port-net
+ subnet: 172.16.33.0/24
+ gateway: 172.16.33.1/24
+NETWORK
+
+ cat << NETWORK > ovn-priv-net.yaml
+apiVersion: v1
+kind: onapNetwork
+metadata:
+ name: ovn-priv-net
+ cnitype : ovn4nfvk8s
+spec:
+ name: ovn-priv-net
+ subnet: 172.16.44.0/24
+ gateway: 172.16.44.1/24
+NETWORK
+
+ cat << DEPLOYMENT > $ovn4nfv_deployment_name.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: $ovn4nfv_deployment_name
+ labels:
+ app: ovn4nfv
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: ovn4nfv
+ template:
+ metadata:
+ labels:
+ 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"}]'
+ spec:
+ containers:
+ - name: $ovn4nfv_deployment_name
+ image: "busybox"
+ command: ["top"]
+ stdin: true
+ tty: true
+DEPLOYMENT
+ popd
+}
diff --git a/vagrant/tests/_functions.sh b/vagrant/tests/_functions.sh
index c359e729..fe69b07b 100755
--- a/vagrant/tests/_functions.sh
+++ b/vagrant/tests/_functions.sh
@@ -12,6 +12,66 @@ set -o errexit
set -o nounset
set -o pipefail
+function _get_ovn_central_address {
+ ansible_ifconfig=$(ansible ovn-central[0] -i $test_folder/../inventory/hosts.ini -m shell -a "ifconfig eth1 |grep \"inet addr\" |awk '{print \$2}' |awk -F: '{print \$2}'")
+ if [[ $ansible_ifconfig != *CHANGED* ]]; then
+ echo "Fail to get the OVN central IP address from eth1 nic"
+ exit
+ fi
+ echo "$(echo ${ansible_ifconfig#*>>} | tr '\n' ':')6641"
+}
+
+# install_ovn_deps() - Install dependencies required for tests that require OVN
+function install_ovn_deps {
+ if ! $(yq --version &>/dev/null); then
+ sudo -E pip install yq
+ fi
+ if ! $(ovn-nbctl --version &>/dev/null); then
+ source /etc/os-release || source /usr/lib/os-release
+ case ${ID,,} in
+ *suse)
+ ;;
+ ubuntu|debian)
+ sudo apt-get install -y apt-transport-https
+ echo "deb https://packages.wand.net.nz $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/wand.list
+ sudo curl https://packages.wand.net.nz/keyring.gpg -o /etc/apt/trusted.gpg.d/wand.gpg
+ sudo apt-get update
+ sudo apt install -y ovn-common
+ ;;
+ rhel|centos|fedora)
+ ;;
+ esac
+ fi
+}
+
+# init_network() - This function creates the OVN resouces required by the test
+function init_network {
+ local fname=$1
+ local router_name="ovn4nfv-master"
+
+ name=$(cat $fname | yq '.spec.name' | xargs)
+ subnet=$(cat $fname | yq '.spec.subnet' | xargs)
+ gateway=$(cat $fname | yq '.spec.gateway' | xargs)
+ ovn_central_address=$(_get_ovn_central_address)
+
+ router_mac=$(printf '00:00:00:%02X:%02X:%02X' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))
+ ovn-nbctl --may-exist --db tcp:$ovn_central_address ls-add $name -- set logical_switch $name other-config:subnet=$subnet external-ids:gateway_ip=$gateway
+ ovn-nbctl --may-exist --db tcp:$ovn_central_address lrp-add $router_name rtos-$name $router_mac $gateway
+ ovn-nbctl --may-exist --db tcp:$ovn_central_address lsp-add $name stor-$name -- set logical_switch_port stor-$name type=router options:router-port=rtos-$name addresses=\"$router_mac\"
+}
+
+# cleanup_network() - This function removes the OVN resources created for the test
+function cleanup_network {
+ local fname=$1
+
+ name=$(cat $fname | yq '.spec.name' | xargs)
+ ovn_central_address=$(_get_ovn_central_address)
+
+ for cmd in "ls-del $name" "lrp-del rtos-$name" "lsp-del stor-$name"; do
+ ovn-nbctl --if-exist --db tcp:$ovn_central_address $cmd
+ done
+}
+
function _checks_args {
if [[ -z $1 ]]; then
echo "Missing CSAR ID argument"
@@ -67,7 +127,7 @@ function setup {
for deployment_name in $@; do
recreate_deployment $deployment_name
done
-
+ sleep 5
for deployment_name in $@; do
wait_deployment $deployment_name
done
diff --git a/vagrant/tests/integration_cFW.sh b/vagrant/tests/integration_cFW.sh
index 0077c73d..92c280b9 100755
--- a/vagrant/tests/integration_cFW.sh
+++ b/vagrant/tests/integration_cFW.sh
@@ -21,8 +21,8 @@ csar_id=4f726e2a-b74a-11e8-ad7c-525400feed2
populate_CSAR_containers_vFW $csar_id
pushd ${CSAR_DIR}/${csar_id}
-for network in unprotected-private-net-cidr-network protected-private-net-cidr-network onap-private-net-cidr-network; do
- kubectl apply -f $network.yaml
+for resource in $unprotected_private_net $protected_private_net $onap_private_net; do
+ kubectl apply -f $resource.yaml
done
setup $packetgen_deployment_name $firewall_deployment_name $sink_deployment_name
diff --git a/vagrant/tests/integration_vFW.sh b/vagrant/tests/integration_vFW.sh
index e0f7075e..962f9f75 100755
--- a/vagrant/tests/integration_vFW.sh
+++ b/vagrant/tests/integration_vFW.sh
@@ -24,7 +24,7 @@ fi
populate_CSAR_vms_vFW $csar_id
pushd ${CSAR_DIR}/${csar_id}
-for resource in unprotected-private-net-cidr-network protected-private-net-cidr-network onap-private-net-cidr-network; do
+for resource in $unprotected_private_net $protected_private_net $onap_private_net; do
kubectl apply -f $resource.yaml
done
setup $packetgen_deployment_name $firewall_deployment_name $sink_deployment_name
diff --git a/vagrant/tests/integration_vcFW.sh b/vagrant/tests/integration_vcFW.sh
index 4fadfa23..15cffcb8 100755
--- a/vagrant/tests/integration_vcFW.sh
+++ b/vagrant/tests/integration_vcFW.sh
@@ -18,13 +18,19 @@ 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
populate_CSAR_vms_containers_vFW $csar_id
pushd ${CSAR_DIR}/${csar_id}
-for resource in unprotected-private-net-cidr-network protected-private-net-cidr-network onap-private-net-cidr-network sink-service sink-ingress; do
+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
+done
+for resource in onap-ovn4nfvk8s-network sink-service; do
kubectl apply -f $resource.yaml
done
setup $packetgen_deployment_name $firewall_deployment_name $sink_deployment_name
@@ -40,7 +46,10 @@ for deployment_name in $packetgen_deployment_name $firewall_deployment_name; do
echo "=== Virtlet details ===="
echo "$(kubectl plugin virt virsh dumpxml $vm | grep VIRTLET_)\n"
done
-popd
# 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
+#done
+popd
diff --git a/vagrant/tests/ovn4nfv.sh b/vagrant/tests/ovn4nfv.sh
new file mode 100755
index 00000000..37fddfd8
--- /dev/null
+++ b/vagrant/tests/ovn4nfv.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2018
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+source _common.sh
+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
+done
+kubectl apply -f onap-ovn4nfvk8s-network.yaml
+setup $ovn4nfv_deployment_name
+
+# Test
+deployment_pod=$(kubectl get pods | grep $ovn4nfv_deployment_name | awk '{print $1}')
+echo "===== $deployment_pod details ====="
+kubectl exec -it $deployment_pod -- ip a
+multus_nic=$(kubectl exec -it $deployment_pod -- ifconfig | grep "net1")
+if [ -z "$multus_nic" ]; then
+ echo "The $deployment_pod pod doesn't contain the net1 nic"
+ exit 1
+fi
+
+# Teardown
+teardown $ovn4nfv_deployment_name
+cleanup_network ovn-priv-net.yaml
+cleanup_network ovn-port-net.yaml
+popd
diff --git a/vagrant/tests/plugin.sh b/vagrant/tests/plugin.sh
index 16d8d306..55be1686 100755
--- a/vagrant/tests/plugin.sh
+++ b/vagrant/tests/plugin.sh
@@ -88,7 +88,7 @@ echo "VNF details $vnf_details"
echo "Deleting $vnf_id VNF Instance"
curl -X DELETE "${base_url}${cloud_region_id}/${namespace}/${vnf_id}"
-if [[ -n $(curl -s -X GET "${base_url}${cloud_region_id}/${namespace}/${vnf_id}") ]]; then
+if [[ 200 -eq $(curl -o /dev/null -w %{http_code} -s -X GET "${base_url}${cloud_region_id}/${namespace}/${vnf_id}") ]]; then
echo "VNF Instance not deleted"
exit 1
fi