From 51cc8781e52af0dc56f8195546c7a94f2c5fea0d Mon Sep 17 00:00:00 2001 From: melian Date: Thu, 28 May 2020 07:50:17 +0000 Subject: [PATCH 1/3] Slicing test documentation Signed-off-by: melian --- 02-osm-nfvi-test-plan.md | 205 +++++++++++++++++++++++++++++++++++---- SLICING-01.md | 141 +++++++++++++++++++++++++++ SLICING-02.md | 181 ++++++++++++++++++++++++++++++++++ 3 files changed, 510 insertions(+), 17 deletions(-) create mode 100644 SLICING-01.md create mode 100644 SLICING-02.md diff --git a/02-osm-nfvi-test-plan.md b/02-osm-nfvi-test-plan.md index 8f0abf7..8524bcd 100644 --- a/02-osm-nfvi-test-plan.md +++ b/02-osm-nfvi-test-plan.md @@ -593,47 +593,218 @@ NOTE: VNF Metrics collection for scaled instances is not supported. ### \[SLICING-01\] Basic Network Slicing -1. Onboard the packages and the Network Slice Template +1. Onboard the packages and the Network Slice Templates ```bash - osm vnfpkg-create slice_hackfest_vnf.tar.gz - osm nspkg-create slice_hackfest_ns.tar.gz - osm nst-create slice_hackfest_nst.yaml + osm vnfd-create slice_basic_vnf + osm vnfd-create slice_basic_middle_vnfd + osm nsd-create slice_basic_ns + osm nsd-create slice_basic_middle_nsd + osm netslice-template-create slice_basic_nst/slice_basic_nst.yaml ``` 2. Instantiate the Slice ```bash - osm nsi-create --nsi_name my_slice --nst_name slice_hackfest_nst --vim_account --config 'netslice-vld: [{name: slice_hackfest_vld_data, vim-network-name: }]' + osm nsi-create --nsi_name slicebasic --nst_name slice_basic_nst --vim_account --config '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: } ] }' + # Wait for the slice to be configured + osm nsi-list --filter name="slicebasic" ``` + +3. Get the slice Middle VNF IP address -3. Check that the Network services have been created. + ```bash + # Get the ns id of the middle ns (called slicebasic.slice_basic_nsd_2) + osm ns-list | grep slicebasic.slice_basic_nsd_2 | awk '{print $4}' + # Get the IP address of the first (and only) VNF in the ns: MGMT_IP + osm vnf-list --filter member-vnf-index-ref=1 | grep | awk '{print $14}' + ``` + +4. Test Ping to the middle VNF ```bash - osm nsi-list - osm ns-list |grep my_slice - osm nsi-show my_slice - # Look for nsr-ref-list. There should be 2 Network Services - osm ns-show - osm vnf-show --ns + ping -c 5 -W 1 /dev/null && echo OK ``` -4. SSH to the VNF +5. SSH to the middle VNF ```bash - osm vnf-show --ns ssh osm@ [pwd: osm4u] ``` -5. Delete the slice + +6. Get all the IP addresses of the slice ```bash - osm nsi-delete my_slice + # Get the list of ns of the slice + osm ns-list | grep slicebasic | awk '{print $4}' + # For each of the ns in the list, get the list of the VNFs + osm vnf-list | grep | awk '{print $2}' + # For each VNFs in the list, get the list of the IPs + osm vnf-show --filter vdur --literal | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort -t: -u -k1,1 + ``` + +7. Test first slice connectivity: Ping all the VMs in the slice + + ```bash + ssh osm@ [pwd: osm4u] + # For each of the IP addresses obtained in step #5 + ping -c 5 -W 1 > /dev/null && echo OK + ``` + +8. Stop the first slice intance + + ```bash + osm nsi-delete slicebasic + ``` + +9. Delete the template and packages + + ```bash + osm netslice-template-delete slice_basic_nst + osm netslice-template-delete slice_basic_nst2 + osm nsd-delete slice_basic_nsd + osm nsd-delete slice_basic_middle_nsd + osm vnfd-delete slice_basic_vnfd + osm vnfd-delete slice_basic_middle_vnfd ``` ### \[SLICING-02\] Complex Network Slicing -TODO: Under ellaboration. Similar to above, but with more components and shared NS. +1. Onboard the packages and the Network Slice Templates + + ```bash + osm vnfd-create slice_basic_vnf + osm vnfd-create slice_basic_middle_vnfd + osm nsd-create slice_basic_ns + osm nsd-create slice_basic_middle_nsd + osm netslice-template-create slice_basic_nst/slice_basic_nst.yaml + osm netslice-template-create slice_basic_nst/slice_basic_2nd_nst.yaml + ``` + +2. Instantiate the first Slice + + ```bash + osm nsi-create --nsi_name slicebasic --nst_name slice_basic_nst --vim_account --config '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: } ] }' + # Wait for the slice to be configured + osm nsi-list --filter name="slicebasic" + ``` + +3. Instantiate the second Slice + + ```bash + osm nsi-create --nsi_name sliceshared --nst_name slice_basic_nst2 --vim_account --config '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: } ] }' + # Wait for the slice to be configured + osm nsi-list --filter name="sliceshared" + ``` + + +4. Check that the Network services have been created. + + ```bash + # Count the Network services in the first slice + osm ns-list | grep slicebasic | wc -l + # Count the Network services in the second slice + osm ns-list | grep sliceshared | wc -l + # The addition should be 4 + ``` + +4. Get the slice Middle VNF IP address + + ```bash + # Get the ns id of the middle ns (called slicebasic.slice_basic_nsd_2) + osm ns-list | grep slicebasic.slice_basic_nsd_2 | awk '{print $4}' + # Get the IP address of the first (and only) VNF in the ns: MGMT_IP + osm vnf-list --filter member-vnf-index-ref=1 | grep | awk '{print $14}' + ``` + +5. Get all the IP addresses of the first slice + + ```bash + # Get the list of ns of the slice + osm ns-list | grep slicebasic | awk '{print $4}' + # For each of the ns in the list, get the list of the VNFs + osm vnf-list | grep | awk '{print $2}' + # For each VNFs in the list, get the list of the IPs + osm vnf-show --filter vdur --literal | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort -t: -u -k1,1 + ``` + +6. Test Ping to the middle VNF + + ```bash + ping -c 5 -W 1 /dev/null && echo OK + ``` + +7. SSH to the middle VNF + + ```bash + ssh osm@ [pwd: osm4u] + ``` + +8. Test first slice connectivity: Ping all the VMs in the slice + + ```bash + ssh osm@ [pwd: osm4u] + # For each of the IP addresses obtained in step #5 + ping -c 5 -W 1 > /dev/null && echo OK + ``` + +9. Stop the first slice intance + + ```bash + osm nsi-delete slicebasic + ``` + +10. Count the Network services remaining after deleting the first slice + + ```bash + # Count the Network services in the first slice + osm ns-list | grep slicebasic | wc -l + # Count the Network services in the second slice + osm ns-list | grep sliceshared | wc -l + # The addition should be 2 + ``` + +11. Get all the IP addresses of the second slice + + ```bash + # Get the list of ns of the slice + osm ns-list | grep sliceshared | awk '{print $4}' + # For each of the ns in the list, get the list of the VNFs + osm vnf-list | grep | awk '{print $2}' + # For each VNFs in the list, get the list of the IPs + osm vnf-show --filter vdur --literal | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort -t: -u -k1,1 + ``` + +12. Test second slice connectivity: Ping all the VMs in the slice + + ```bash + ssh osm@ [pwd: osm4u] + # For each of the IP addresses obtained in step #11 + ping -c 5 -W 1 > /dev/null && echo OK + ``` + +13. Stop the second slice intance + + ```bash + osm nsi-delete sliceshared + ``` + +14. Delete the template and packages + + ```bash + osm netslice-template-delete slice_basic_nst + osm netslice-template-delete slice_basic_nst2 + osm nsd-delete slice_basic_nsd + osm nsd-delete slice_basic_middle_nsd + osm vnfd-delete slice_basic_vnfd + osm vnfd-delete slice_basic_middle_vnfd + ``` + + +### \[SLICING-03\] Advanced Network Slicing + +TODO: Under ellaboration. Similar to above, but with day-2 operations ## Kubernetes and cloud-native diff --git a/SLICING-01.md b/SLICING-01.md new file mode 100644 index 0000000..8e48902 --- /dev/null +++ b/SLICING-01.md @@ -0,0 +1,141 @@ +# SLICING-01 Robot test + +## Description +Robot test to validate the most basic slicing process: Deploy a slice, verify the VMs are reachable within the slice and destroy everything. + +## Libraries needed + +- vnfd_lib.robot +- nsd_lib.robot +- nst_lib.robot +- nsi_lib.robot +- ns_lib.robot +- connectivity_lib.robot +- ssh_lib.robot + +## Variables + +- username = 'osm' +- password = 'osm4u' +- vnf_member_index = 1 +- nst_config = '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] }' +**NS and VNF descriptor package files** +- vnfd1_pkg = 'slice_basic_vnf' +- vnfd2_pkg = 'slice_basic_middle_vnfd' +- nsd1_pkg = 'slice_basic_ns' +- nsd2_pkg = 'slice_basic_middle_nsd' +- nst = 'slice_basic_nst.yaml' +**Instance names** +- slice_name = 'slicebasic' +- middle_ns_name = 'slicebasic.slice_basic_nsd_2' +**Descriptor names** + - nst_name = 'slice_basic_nst' + - vnfd1_name = 'slice_basic_vnfd' + - vnfd2_name = 'slice_basic_middle_vnfd' + - nsd1_name = 'slice_basic_nsd' + - nsd2_name = 'slice_basic_middle_nsd' +**SSH keys to be used** +- publickey = home + '/.ssh/id_rsa.pub' +- privatekey = home + '/.ssh/id_rsa' + +## Test steps + +1. Create Slice VNF Descriptors +Onboards all the VNFD packages required for the test: *vnfd1_pkg* and *vnfd2_pkg* (in the variables file) + + Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' + +2. Create Slice NS Descriptors +Onboards all the NSD packages required for the test: *nsd1_pkg* and *nsd2_pkg* (in the variables file) + + Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' + +3. Create Slice Template +Onboards the Network Slice Template: *nst* (in the variables file) + + Create NST '%{PACKAGES_FOLDER}/${nst}' + +4. Network Slice Instance Test +Instantiates the NST created in step #3 and sets the instantiation id as a suite variable (*nsi_id*) + + ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} + Set Suite Variable ${nsi_id} ${id} + +5. Get Middle Vnf Management Ip +Obtains the management IP of the slice middle VNF (name in the reources file) and sets the ip as a suite variable (*mgmt_vnf_ip*) + + ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 + ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} + Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} + +6. Get Slice Vnf Ip Adresses +Obtains the list of IPs addresses in the slice and sets the list as a suite variable (*slice_vnfs_ips*) + + # Get all the ns_id in the slice except the middle one to avoid self ping + @{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name} + log many @{slice_ns_list} + @{temp_list}= Create List + # For each ns_id in the list, get all the vnf_id and their IP addresses + FOR ${ns_id} IN @{slice_ns_list} + log ${ns_id} + @{vnf_id_list} Get Ns Vnf List ${ns_id} + # For each vnf_id in the list, get all its IP addresses + @{ns_ip_list} Get Ns Ip List @{vnf_id_list} + @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} + END + Log List ${temp_list} + Set Suite Variable ${slice_vnfs_ips} ${temp_list} + +7. Test Middle Ns Ping +Pings the slice middle vnf (*mgmt_vnf_ip*) + + Sleep 60s Waiting for the network to be up + # Ping to the middle VNF + Test Connectivity ${mgmt_vnf_ip} + +8. Test Middle Vnf SSH Access +SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file + + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} + +9. Test Slice Connectivity +SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file and pings all the IP addresses in the list (*slice_vnfs_ips*) + + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice_vnfs_ips} + +10. Stop Slice Instance +Stops the slice instance (*slice_name*) + + Delete NSI ${slice_name} + +11. Delete Slice Template +Deletes the NST (*nst_name*) from OSM + + Delete NST ${nst_name} + +12. Delete NS Descriptors +Deletes all the NSDs created for the test: *nsd1_name*, *nsd2_name* + + Delete NSD ${nsd1_name} + Delete NSD ${nsd2_name} + +13. Delete VNF Descriptors +Deletes all the VNFDs created for the test: *vnfd1_name*, *vnfd2_name* + + Delete VNFD ${vnfd1_name} + Delete VNFD ${vnfd2_name} + +## Cleanup +Test Suit Cleanup: Deleting Descriptors, instance and template + + Test Cleanup + Run Keyword If Test Failed Delete NST ${nst_name} + + Run Keyword If Test Failed Delete NSD ${nsd1_name} + Run Keyword If Test Failed Delete NSD ${nsd2_name} + + Run Keyword If Test Failed Delete VNFD ${vnfd1_name} + Run Keyword If Test Failed Delete VNFD ${vnfd2_name} diff --git a/SLICING-02.md b/SLICING-02.md new file mode 100644 index 0000000..6f510a1 --- /dev/null +++ b/SLICING-02.md @@ -0,0 +1,181 @@ +# SLICING-02 Robot test + +## Description +Robot test to validate the complex slicing process: Deploy two slices with a shared NS, verify all VNFs are reachable within its own slice, destroy the first slice and check the shared ns was not destroyed and the connectivity is complete within the remaining slice. + +## Libraries needed + +- vnfd_lib.robot +- nsd_lib.robot +- nst_lib.robot +- nsi_lib.robot +- ns_lib.robot +- connectivity_lib.robot +- ssh_lib.robot + +## Variables + +- username = 'osm' +- password = 'osm4u' +- vnf_member_index = 1 +- nst_config = '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] }' +**NS and VNF descriptor package files** +- vnfd1_pkg = 'slice_basic_vnf' +- vnfd2_pkg = 'slice_basic_middle_vnfd' +- nsd1_pkg = 'slice_basic_ns' +- nsd2_pkg = 'slice_basic_middle_nsd' +- nst = 'slice_basic_nst.yaml' +- nst2 = 'slice_basic_nst/slice_basic_2nd_nst.yaml' +**Instance names** +- slice_name = 'slicebasic' +- slice2_name = 'sliceshared' +- middle_ns_name = 'slicebasic.slice_basic_nsd_2' +**Descriptor names** +- nst_name = 'slice_basic_nst' +- nst2_name = 'slice_basic_nst2' +- vnfd1_name = 'slice_basic_vnfd' +- vnfd2_name = 'slice_basic_middle_vnfd' +- nsd1_name = 'slice_basic_nsd' +- nsd2_name = 'slice_basic_middle_nsd' +**SSH keys to be used** +- publickey = home + '/.ssh/id_rsa.pub' +- privatekey = home + '/.ssh/id_rsa' + +## Test steps + +1. Create Slice VNF Descriptors +Onboards all the VNFD packages required for the test: *vnfd1_pkg* and *vnfd2_pkg* (in the variables file) + + Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' + Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' + +2. Create Slice NS Descriptors +Onboards all the NSD packages required for the test: *nsd1_pkg* and *nsd2_pkg* (in the variables file) + + Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' + Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' + +3. Create Slice Template +Onboards the Network Slice Templates: *nst* and *nst2* (in the variables file) + + Create NST '%{PACKAGES_FOLDER}/${nst}' + Create NST '%{PACKAGES_FOLDER}/${nst2}' + +4. Network Slice One Instance Test +Instantiates the first NST created in step #3 and sets the instantiation id as a suite variable (*nsi_id*) +The slice contains 3 NS (1 shared) + + ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} + Set Suite Variable ${nsi_id} ${id} + +5. Network Slice Two Instance Test +Instantiates the second NST created in step #3 and sets the instantiation id as a suite variable (*nsi2_id*) +The slice contains 2 NS (1 shared) + + ${id}= Create Network Slice ${nst2_name} %{VIM_TARGET} ${slice2_name} ${nst_config} ${publickey} + Set Suite Variable ${nsi2_id} ${id} + +6. First Network Slice Ns Count +Count the number of network services deployed in both slices. The addition should be equal to 4. + + ${slice1_count}= Get Slice Ns Count ${slice_name} + ${slice2_count}= Get Slice Ns Count ${slice2_name} + ${together}= Evaluate ${slice1_count} + ${slice2_count} + Should Be Equal As Integers ${together} 4 + +7. Get Middle Vnf Management Ip +Obtains the management IP of the slice middle VNF (name in the reources file), which is the shared one, and sets the ip as a suite variable (*mgmt_vnf_ip*) + + ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 + ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} + Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} + +8. Get First Slice Vnf IPs + Obtains the list of IPs addresses in the first slice and sets the list as a suite variable (*slice1_vnfs_ips*) + + # Get all the ns_id in the slice except the middle one + @{ip_list} Get Slice Vnf Ip Addresses ${slice_name} + Set Suite Variable ${slice1_vnfs_ips} ${ip_list} + +9. Test Middle Ns Ping +Pings the slice middle vnf (*mgmt_vnf_ip*) + + Sleep 60s Waiting for the network to be up + # Ping to the middle VNF + Test Connectivity ${mgmt_vnf_ip} + +10. Test Middle Vnf SSH Access +SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file + + Sleep 30s Waiting ssh daemon to be up + Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} + +11. Test First Slice Connectivity +SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file and pings all the IP addresses in the list (*slice1_vnfs_ips*) + + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice1_vnfs_ips} + +12. Stop Slice One Instance +Stops the slice instance (slice_name) + + Delete NSI ${slice_name} + +13. Second Network Slice Ns Count + Counts the NS in both slice instances and should be equal to 2 + + ${slice1_count}= Get Slice Ns Count ${slice_name} + ${slice2_count}= Get Slice Ns Count ${slice2_name} + ${together}= Evaluate ${slice1_count} + ${slice2_count} + Should Be Equal As Integers ${together} 2 + +14. Get Second Slice Vnf IPs +Obtains the list of IPs addresses in the second slice and sets the list as a suite variable (slice2_vnfs_ips) + + # Get all the ns_id in the slice + @{ip_list} Get Slice Vnf Ip Addresses ${slice2_name} + Set Suite Variable ${slice2_vnfs_ips} ${ip_list} + +15. Test Second Slice Connectivity +SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file and pings all the IP addresses in the list (slice2_vnfs_ips) + + Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice2_vnfs_ips} + +16. Stop Slice Two Instance +Stops the slice instance (slice2_name) + + Delete NSI ${slice2_name} + +17. Delete Slice One Template +Deletes the NST (nst_name) from OSM + + Delete NST ${nst_name} + +18. Delete Slice Two Template +Deletes the NST (nst2_name) from OSM + + Delete NST ${nst2_name} + +19. Delete NS Descriptors +Deletes all the NSDs created for the test: *nsd1_name*, *nsd2_name* + + Delete NSD ${nsd1_name} + Delete NSD ${nsd2_name} + +20. Delete VNF Descriptors +Deletes all the VNFDs created for the test: *vnfd1_name*, *vnfd2_name* + + Delete VNFD ${vnfd1_name} + Delete VNFD ${vnfd2_name} + +## Cleanup +Test Suit Cleanup: Deleting Descriptors, instance and templates + + Test Cleanup + Run Keyword If Test Failed Delete NST ${nst_name} + Run Keyword If Test Failed Delete NST ${nst2_name} + + Run Keyword If Test Failed Delete NSD ${nsd1_name} + Run Keyword If Test Failed Delete NSD ${nsd2_name} + + Run Keyword If Test Failed Delete VNFD ${vnfd1_name} + Run Keyword If Test Failed Delete VNFD ${vnfd2_name} -- GitLab From 07e59e79b4a7ece1f5fd5cc59196badab15f72c2 Mon Sep 17 00:00:00 2001 From: melian Date: Thu, 28 May 2020 07:51:26 +0000 Subject: [PATCH 2/3] Slicing test documentation Signed-off-by: melian --- SLICING-01.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SLICING-01.md b/SLICING-01.md index 8e48902..6fb0eb1 100644 --- a/SLICING-01.md +++ b/SLICING-01.md @@ -29,11 +29,11 @@ Robot test to validate the most basic slicing process: Deploy a slice, verify th - slice_name = 'slicebasic' - middle_ns_name = 'slicebasic.slice_basic_nsd_2' **Descriptor names** - - nst_name = 'slice_basic_nst' - - vnfd1_name = 'slice_basic_vnfd' - - vnfd2_name = 'slice_basic_middle_vnfd' - - nsd1_name = 'slice_basic_nsd' - - nsd2_name = 'slice_basic_middle_nsd' +- nst_name = 'slice_basic_nst' +- vnfd1_name = 'slice_basic_vnfd' +- vnfd2_name = 'slice_basic_middle_vnfd' +- nsd1_name = 'slice_basic_nsd' +- nsd2_name = 'slice_basic_middle_nsd' **SSH keys to be used** - publickey = home + '/.ssh/id_rsa.pub' - privatekey = home + '/.ssh/id_rsa' -- GitLab From 22e980d22f386141df01c18314391713f94fb3e8 Mon Sep 17 00:00:00 2001 From: melian Date: Thu, 11 Jun 2020 13:54:33 +0000 Subject: [PATCH 3/3] Remove individual slicing tests docs Signed-off-by: melian --- SLICING-01.md | 141 --------------------------------------- SLICING-02.md | 181 -------------------------------------------------- 2 files changed, 322 deletions(-) delete mode 100644 SLICING-01.md delete mode 100644 SLICING-02.md diff --git a/SLICING-01.md b/SLICING-01.md deleted file mode 100644 index 6fb0eb1..0000000 --- a/SLICING-01.md +++ /dev/null @@ -1,141 +0,0 @@ -# SLICING-01 Robot test - -## Description -Robot test to validate the most basic slicing process: Deploy a slice, verify the VMs are reachable within the slice and destroy everything. - -## Libraries needed - -- vnfd_lib.robot -- nsd_lib.robot -- nst_lib.robot -- nsi_lib.robot -- ns_lib.robot -- connectivity_lib.robot -- ssh_lib.robot - -## Variables - -- username = 'osm' -- password = 'osm4u' -- vnf_member_index = 1 -- nst_config = '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] }' -**NS and VNF descriptor package files** -- vnfd1_pkg = 'slice_basic_vnf' -- vnfd2_pkg = 'slice_basic_middle_vnfd' -- nsd1_pkg = 'slice_basic_ns' -- nsd2_pkg = 'slice_basic_middle_nsd' -- nst = 'slice_basic_nst.yaml' -**Instance names** -- slice_name = 'slicebasic' -- middle_ns_name = 'slicebasic.slice_basic_nsd_2' -**Descriptor names** -- nst_name = 'slice_basic_nst' -- vnfd1_name = 'slice_basic_vnfd' -- vnfd2_name = 'slice_basic_middle_vnfd' -- nsd1_name = 'slice_basic_nsd' -- nsd2_name = 'slice_basic_middle_nsd' -**SSH keys to be used** -- publickey = home + '/.ssh/id_rsa.pub' -- privatekey = home + '/.ssh/id_rsa' - -## Test steps - -1. Create Slice VNF Descriptors -Onboards all the VNFD packages required for the test: *vnfd1_pkg* and *vnfd2_pkg* (in the variables file) - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' - Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' - -2. Create Slice NS Descriptors -Onboards all the NSD packages required for the test: *nsd1_pkg* and *nsd2_pkg* (in the variables file) - - Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' - Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' - -3. Create Slice Template -Onboards the Network Slice Template: *nst* (in the variables file) - - Create NST '%{PACKAGES_FOLDER}/${nst}' - -4. Network Slice Instance Test -Instantiates the NST created in step #3 and sets the instantiation id as a suite variable (*nsi_id*) - - ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi_id} ${id} - -5. Get Middle Vnf Management Ip -Obtains the management IP of the slice middle VNF (name in the reources file) and sets the ip as a suite variable (*mgmt_vnf_ip*) - - ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 - ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} - -6. Get Slice Vnf Ip Adresses -Obtains the list of IPs addresses in the slice and sets the list as a suite variable (*slice_vnfs_ips*) - - # Get all the ns_id in the slice except the middle one to avoid self ping - @{slice_ns_list} Get Slice Ns List Except One ${slice_name} ${middle_ns_name} - log many @{slice_ns_list} - @{temp_list}= Create List - # For each ns_id in the list, get all the vnf_id and their IP addresses - FOR ${ns_id} IN @{slice_ns_list} - log ${ns_id} - @{vnf_id_list} Get Ns Vnf List ${ns_id} - # For each vnf_id in the list, get all its IP addresses - @{ns_ip_list} Get Ns Ip List @{vnf_id_list} - @{temp_list}= Combine Lists ${temp_list} ${ns_ip_list} - END - Log List ${temp_list} - Set Suite Variable ${slice_vnfs_ips} ${temp_list} - -7. Test Middle Ns Ping -Pings the slice middle vnf (*mgmt_vnf_ip*) - - Sleep 60s Waiting for the network to be up - # Ping to the middle VNF - Test Connectivity ${mgmt_vnf_ip} - -8. Test Middle Vnf SSH Access -SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file - - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} - -9. Test Slice Connectivity -SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file and pings all the IP addresses in the list (*slice_vnfs_ips*) - - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice_vnfs_ips} - -10. Stop Slice Instance -Stops the slice instance (*slice_name*) - - Delete NSI ${slice_name} - -11. Delete Slice Template -Deletes the NST (*nst_name*) from OSM - - Delete NST ${nst_name} - -12. Delete NS Descriptors -Deletes all the NSDs created for the test: *nsd1_name*, *nsd2_name* - - Delete NSD ${nsd1_name} - Delete NSD ${nsd2_name} - -13. Delete VNF Descriptors -Deletes all the VNFDs created for the test: *vnfd1_name*, *vnfd2_name* - - Delete VNFD ${vnfd1_name} - Delete VNFD ${vnfd2_name} - -## Cleanup -Test Suit Cleanup: Deleting Descriptors, instance and template - - Test Cleanup - Run Keyword If Test Failed Delete NST ${nst_name} - - Run Keyword If Test Failed Delete NSD ${nsd1_name} - Run Keyword If Test Failed Delete NSD ${nsd2_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd1_name} - Run Keyword If Test Failed Delete VNFD ${vnfd2_name} diff --git a/SLICING-02.md b/SLICING-02.md deleted file mode 100644 index 6f510a1..0000000 --- a/SLICING-02.md +++ /dev/null @@ -1,181 +0,0 @@ -# SLICING-02 Robot test - -## Description -Robot test to validate the complex slicing process: Deploy two slices with a shared NS, verify all VNFs are reachable within its own slice, destroy the first slice and check the shared ns was not destroyed and the connectivity is complete within the remaining slice. - -## Libraries needed - -- vnfd_lib.robot -- nsd_lib.robot -- nst_lib.robot -- nsi_lib.robot -- ns_lib.robot -- connectivity_lib.robot -- ssh_lib.robot - -## Variables - -- username = 'osm' -- password = 'osm4u' -- vnf_member_index = 1 -- nst_config = '{netslice-vld: [ {name: slice_vld_mgmt, vim-network-name: %{VIM_MGMT_NET}} ] }' -**NS and VNF descriptor package files** -- vnfd1_pkg = 'slice_basic_vnf' -- vnfd2_pkg = 'slice_basic_middle_vnfd' -- nsd1_pkg = 'slice_basic_ns' -- nsd2_pkg = 'slice_basic_middle_nsd' -- nst = 'slice_basic_nst.yaml' -- nst2 = 'slice_basic_nst/slice_basic_2nd_nst.yaml' -**Instance names** -- slice_name = 'slicebasic' -- slice2_name = 'sliceshared' -- middle_ns_name = 'slicebasic.slice_basic_nsd_2' -**Descriptor names** -- nst_name = 'slice_basic_nst' -- nst2_name = 'slice_basic_nst2' -- vnfd1_name = 'slice_basic_vnfd' -- vnfd2_name = 'slice_basic_middle_vnfd' -- nsd1_name = 'slice_basic_nsd' -- nsd2_name = 'slice_basic_middle_nsd' -**SSH keys to be used** -- publickey = home + '/.ssh/id_rsa.pub' -- privatekey = home + '/.ssh/id_rsa' - -## Test steps - -1. Create Slice VNF Descriptors -Onboards all the VNFD packages required for the test: *vnfd1_pkg* and *vnfd2_pkg* (in the variables file) - - Create VNFD '%{PACKAGES_FOLDER}/${vnfd1_pkg}' - Create VNFD '%{PACKAGES_FOLDER}/${vnfd2_pkg}' - -2. Create Slice NS Descriptors -Onboards all the NSD packages required for the test: *nsd1_pkg* and *nsd2_pkg* (in the variables file) - - Create NSD '%{PACKAGES_FOLDER}/${nsd1_pkg}' - Create NSD '%{PACKAGES_FOLDER}/${nsd2_pkg}' - -3. Create Slice Template -Onboards the Network Slice Templates: *nst* and *nst2* (in the variables file) - - Create NST '%{PACKAGES_FOLDER}/${nst}' - Create NST '%{PACKAGES_FOLDER}/${nst2}' - -4. Network Slice One Instance Test -Instantiates the first NST created in step #3 and sets the instantiation id as a suite variable (*nsi_id*) -The slice contains 3 NS (1 shared) - - ${id}= Create Network Slice ${nst_name} %{VIM_TARGET} ${slice_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi_id} ${id} - -5. Network Slice Two Instance Test -Instantiates the second NST created in step #3 and sets the instantiation id as a suite variable (*nsi2_id*) -The slice contains 2 NS (1 shared) - - ${id}= Create Network Slice ${nst2_name} %{VIM_TARGET} ${slice2_name} ${nst_config} ${publickey} - Set Suite Variable ${nsi2_id} ${id} - -6. First Network Slice Ns Count -Count the number of network services deployed in both slices. The addition should be equal to 4. - - ${slice1_count}= Get Slice Ns Count ${slice_name} - ${slice2_count}= Get Slice Ns Count ${slice2_name} - ${together}= Evaluate ${slice1_count} + ${slice2_count} - Should Be Equal As Integers ${together} 4 - -7. Get Middle Vnf Management Ip -Obtains the management IP of the slice middle VNF (name in the reources file), which is the shared one, and sets the ip as a suite variable (*mgmt_vnf_ip*) - - ${middle_ns_id}= Run and Return RC and Output osm ns-list | grep ${middle_ns_name} | awk '{print $4}' 2>&1 - ${vnf_ip} Get Vnf Management Ip Address ${middle_ns_id}[1] ${vnf_member_index} - Set Suite Variable ${mgmt_vnf_ip} ${vnf_ip} - -8. Get First Slice Vnf IPs - Obtains the list of IPs addresses in the first slice and sets the list as a suite variable (*slice1_vnfs_ips*) - - # Get all the ns_id in the slice except the middle one - @{ip_list} Get Slice Vnf Ip Addresses ${slice_name} - Set Suite Variable ${slice1_vnfs_ips} ${ip_list} - -9. Test Middle Ns Ping -Pings the slice middle vnf (*mgmt_vnf_ip*) - - Sleep 60s Waiting for the network to be up - # Ping to the middle VNF - Test Connectivity ${mgmt_vnf_ip} - -10. Test Middle Vnf SSH Access -SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file - - Sleep 30s Waiting ssh daemon to be up - Test SSH Connection ${mgmt_vnf_ip} ${username} ${password} ${privatekey} - -11. Test First Slice Connectivity -SSH access to the slice middle vnf (*mgmt_vnf_ip*) with the credentials provided in the variables file and pings all the IP addresses in the list (*slice1_vnfs_ips*) - - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice1_vnfs_ips} - -12. Stop Slice One Instance -Stops the slice instance (slice_name) - - Delete NSI ${slice_name} - -13. Second Network Slice Ns Count - Counts the NS in both slice instances and should be equal to 2 - - ${slice1_count}= Get Slice Ns Count ${slice_name} - ${slice2_count}= Get Slice Ns Count ${slice2_name} - ${together}= Evaluate ${slice1_count} + ${slice2_count} - Should Be Equal As Integers ${together} 2 - -14. Get Second Slice Vnf IPs -Obtains the list of IPs addresses in the second slice and sets the list as a suite variable (slice2_vnfs_ips) - - # Get all the ns_id in the slice - @{ip_list} Get Slice Vnf Ip Addresses ${slice2_name} - Set Suite Variable ${slice2_vnfs_ips} ${ip_list} - -15. Test Second Slice Connectivity -SSH access to the slice middle vnf (mgmt_vnf_ip) with the credentials provided in the variables file and pings all the IP addresses in the list (slice2_vnfs_ips) - - Ping Many ${mgmt_vnf_ip} ${username} ${password} ${privatekey} @{slice2_vnfs_ips} - -16. Stop Slice Two Instance -Stops the slice instance (slice2_name) - - Delete NSI ${slice2_name} - -17. Delete Slice One Template -Deletes the NST (nst_name) from OSM - - Delete NST ${nst_name} - -18. Delete Slice Two Template -Deletes the NST (nst2_name) from OSM - - Delete NST ${nst2_name} - -19. Delete NS Descriptors -Deletes all the NSDs created for the test: *nsd1_name*, *nsd2_name* - - Delete NSD ${nsd1_name} - Delete NSD ${nsd2_name} - -20. Delete VNF Descriptors -Deletes all the VNFDs created for the test: *vnfd1_name*, *vnfd2_name* - - Delete VNFD ${vnfd1_name} - Delete VNFD ${vnfd2_name} - -## Cleanup -Test Suit Cleanup: Deleting Descriptors, instance and templates - - Test Cleanup - Run Keyword If Test Failed Delete NST ${nst_name} - Run Keyword If Test Failed Delete NST ${nst2_name} - - Run Keyword If Test Failed Delete NSD ${nsd1_name} - Run Keyword If Test Failed Delete NSD ${nsd2_name} - - Run Keyword If Test Failed Delete VNFD ${vnfd1_name} - Run Keyword If Test Failed Delete VNFD ${vnfd2_name} -- GitLab