Sample Test Cases The test cases specified in this chapter are implemented as a Sample Test Suite included in the TH.
VNF, Device and Network Smoke Test Cases The following is an automated test suite that acts as basic smoke tests for Enea NFV Access, and as a sanity-check test suite for the AF and TH.
VNF - Onboard_VNF_Image<remark>all titles are formated with underscores can this be changed or should it be left as is?</remark> Description: Onboarding a VNF Image into the uCPE Manager. For details please refer to: <AF-TH-install-dir>/playbooks/onboardVNFImage.yml <AF-TH-install-dir>/automation_framework/vnf/onboardVNFRaw.py Preconditions: Add the VNF Image in the vnf_image folder in the QCOW2 format: <AF-TH-install-dir>/vnf_image/<VNF-Image-name>.qcow2 A VNF Image JSON configuration file is created: <AF-TH-install-dir>/vnf_config/<VNF-Descriptor-name>/<VNF-Descriptor-name>.jsonExample:<AF-TH-install-dir>/vnf_config/fortigateImage/fortigateImage.json Action: Run the onboardVNFImage.yml Ansible Playbook with the <VNF-Image-name> and the <VNF-Descriptor-name> as extra-vars: ansible-playbook playbooks/onboardVNFImage.yml -e "vnfb=<VNF-Image-name> \ vnfd=<VNF-Descriptor-name>" Result: Output of the test case run using the Test Harness:# Onboard VNF Image task result <VNF-Descriptor-name> successfully onboarded!Note: The test will not fail if the VNF Image is already onboarded. The output will instead contain: # debug <VNF-Descriptor-name> already onboarded!
VNF - Onboard_VNF_Bundle<remark>since we're removing mention of bundles is this section still relevant?</remark> Description: Onboarding a VNF Bundle into the uCPE Manager. For details please refer to: <AF-TH-install-dir>/playbooks/onboardVNFBundle.yml <AF-TH-install-dir>/automation_framework/vnf/onboardVNF.py Precondition: Add the VNF Bundle in the vnf_image folder in the zip format: <AF-TH-install-dir>/vnf_image/<VNF-Bundle-name>.zip Action: Run the onboardVNFBundle.yml Ansible Playbook with the <VNF-Bundle-name> as extra-vars: ansible-playbook playbooks/onboardVNFBundle.yml -e "vnfb=<VNF-Bundle-name>" Result: Output of the test case run using the Test Harness: # Onboard VNF Bundle task result <VNF-Bundle-name> successfully onboarded!Note: The test will not fail if the VNF Bundle is already onboarded. The output will instead contain: # debug <VNF-Bundle-name> already onboarded!
VNF - Offboard_VNF Description: Removing a VNF Descriptor from the uCPE Manager. For details please refer to: <AF-TH-install-dir>/playbooks/offboardVNF.yml <AF-TH-install-dir>/automation_framework/vnf/offboardVNF.py Precondition: The VNF has been previously onboarded in the uCPE Manager instance. Action: Run the offboardVNF.yml Ansible Playbook with the <VNF-Descriptor-name> as extra-vars: ansible-playbook playbooks/offboardVNF.yml -e "vnfd=<VNF-Descriptor-name>" Result: Output of the test case run using the Test Harness: # Remove Descriptor task result <VNF-Descriptor-name> was removed!Note: The test will not fail if the VNF Descriptor does not exist. The output will instead contain: # debug No Descriptor with name <VNF-Descriptor-name>!
Device - Add_Device Description: Adding a uCPE device to the uCPE Manager. For details please refer to: <AF-TH-install-dir>/playbooks/addDevice.yml <AF-TH-install-dir>/automation_framework/device/addDevice.py Precondition: A device JSON configuration file must be created: <AF-TH-install-dir>/lab_config/<Device-name>/<Device-name>.json Example: <AF-TH-install-dir>/lab_config/intelc3850-2/intelc3850-2.json Action: Run the addDevice.yml Ansible playbook with the <Device-name> as extra-vars: ansible-playbook playbooks/addDevice.yml -e "device=<Device-name>" Result: Output of the test case run using the Test Harness: # Add Device task result <Device-name> device was added!Note: The test will not fail if the device already exists. The output will instead contain: # debug <Device-name> device already exists!
Device - Remove_Device Description: Removing a uCPE device from the uCPE Manager. For details please refer to: <AF-TH-install-dir>/playbooks/removeDevice.yml <AF-TH-install-dir>/automation_framework/device/removeDevice.py Preconditions: The device has to be previously added to the uCPE Manager instance. The device JSON configuration file must exist: <AF-TH-install-dir>/lab_config/<Device-name>/<Device-name>.json Action: Run the removeDevice.yml Ansible Playbook with the <Device-name> as extra-vars: ansible-playbook playbooks/removeDevice.yml -e "device=<Device-name>" Result: Output of the test case run using the Test Harness:# Remove Device task result <Device-name> device was removed! Note: The test will not fail if the device does not exist. The output will contain: # debug <Device-name> device was not found!
Network - Bind_NIC Description: Binding a physical network interface (NIC) to a device. For details please refer to: <AF-TH-install-dir>/playbooks/bindNIC.yml <AF-TH-install-dir>/automation_framework/network/bindNetworkInterface.py Preconditions: A device must have been previously added to the uCPE Manager instance. A NIC JSON configuration file must exist: <AF-TH-install-dir>/lab_config/<Device-name>/<NIC>.json Example: <AF-TH-install-dir>/lab_config/intelc3850-2/wan_nic.json <AF-TH-install-dir>/lab_config/intelc3850-2/lan_nic.json Action: Run the bindNIC.yml Ansible Playbook with the <Device-name> and <NIC> as extra-vars: ansible-playbook playbooks/bindNIC.yml -e "device=<Device-name> nic=<NIC>" Result: Output of the test case run using the Test Harness:# Bind NIC task result <NIC> binded successfully! Note: The test will not fail if the NIC is already bound, it will be unbound and bound again with the provided configuration.
Network - Unbind_NIC Description: Unbinding a physical network interface (NIC) from a device. For details please refer to: <AF-TH-install-dir>/playbooks/unbindNIC.yml <AF-TH-install-dir>/automation_framework/network/unbindNetworkInterface.py Preconditions: A NIC is bound to a device in a uCPE Manager instance. A NIC JSON configuration file exists: <AF-TH-install-dir>/lab_config/<Device-name>/<NIC>.json Action: Run the unbindNIC.yml Ansible Playbook with the <Device-name> and <NIC> as extra-vars: ansible-playbook playbooks/unbindNIC.yml -e "device=<Device-name> nic=<NIC>" Result: Output of the test case run using the Test Harness: # Unbind NIC task result <NIC> unbinded! Note: The test will not fail if the NIC is not bound. The output will instead contain:# debug <NIC> is not binded!
Network - Create_Bridge Description: Creating an OVS network bridge on a uCPE device. For details please refer to: <AF-TH-install-dir>/playbooks/addBridge.yml <AF-TH-install-dir>/automation_framework/network/newNetworkBridge.py Preconditions: A NIC is bound to a device in a uCPE Manager instance. A Bridge JSON configuration file exists:<AF-TH-install-dir>/lab_config/<Device-name>/<Bridge-name>.json Example:<AF-TH-install-dir>/lab_config/intelc3850-2/wan_br.json <AF-TH-install-dir>/lab_config/intelc3850-2/lan_br.json Action: Run the addBridge.yml Ansible Playbook with the <Device-name> and the <Bridge-name> as extra-vars: ansible-playbook playbooks/addBridge.yml -e "device=<Device-name> bridge=<Bridge-name>" Result: Output of the test case run using the Test Harness: # Add Bridge task result <Bridge-name> network bridge was added!Note: The test will not fail if there already exists a bridge with the same name. It will be deleted and the bridge will be created again with the provided configuration.
Network - Remove_Bridge Description: Removing an OVS network bridge from a uCPE device. For details please refer to: <AF-TH-install-dir>/playbooks/deleteBridge.yml <AF-TH-install-dir>/automation_framework/network/delNetworkBridge.py Preconditions: A Bridge exists in a uCPE Manager instance. A Bridge JSON configuration file exists: <AF-TH-install-dir>/lab_config/<Device-name>/<Bridge-name>.json Action: Run the deleteBridge.yml Ansible Playbook with the <Device-name> and the <Bridge-name> as extra-vars: ansible-playbook playbooks/deleteBridge.yml -e "device=<Device-name> \ bridge=<Bridge-name>" Result: Output of the test case run using the Test Harness: # Delete Bridge task result <Bridge-name> network bridge was deleted!Note: The test will not fail if the bridge does not exist: # debug <Bridge-name> bridge not found!
VNF Deployment and Lifecycle The following details the automated suite that handles the testing of the instantiation, lifecycle and destruction of a VNF for Enea NFV Access.
Instantiate_VNFI Description: Creating a VNF instance on a uCPE device. For details please refer to: <AF-TH-install-dir>/playbooks/instantiateVNFI.yml <AF-TH-install-dir>/automation_framework/vnf/instantiateVNFI.py Preconditions: A VNF Image is onboarded and a device is added to the uCPE Manager. Depending on the VNF, other steps may be required. A VNFI JSON configuration file exists: <AF-TH-install-dir>/vnf_config/<VNF-Descriptor-name>/<VNFI-name>.json Example: <AF-TH-install-dir>/vnf_config/fortigateImage/fortigateFWInstance.json Action: Run the instantiateVNFI.yml Ansible Playbook with the <Device-name>, <VNF-Descriptor-name> and the <VNFI-name> as extra-vars: ansible-playbook playbooks/instantiateVNFI.yml -e "device=<Device-name> \ vnfd=<VNF-Descriptor-name> vnfi=<VNFI-name>" Result: Output of the test case run using the Test Harness: # Instantiate VNF task result <VNFI-name> was instantiated!Note: The test will not fail if the VNF instance already exists. The output will instead contain: # debug <VNFI-name> already exists!
Control_VNFI Description: Changing the status of a VNF instance (Pause, Resume, Stop, Start). For details please refer to: <AF-TH-install-dir>/playbooks/controlVNFI.yml <AF-TH-install-dir>/automation_framework/vnf/controlVNFI.py Precondition: A VNF is instantiated on a uCPE device. Action: Run the controlVNFI.yml Ansible Playbook with the <Device-name>, <VNFI-name> and the <Command> as extra-vars: ansible-playbook playbooks/controlVNFI.yml -e "device=<Device-name> \ vnfi=<VNFI-name> status=<Command>"Where Command = { pause | resume | stop | start } Result: Output of the test case run using the Test Harness: # Change VNFI Status task result <VNFI-name> status was set to <Command>Note: The test will not fail if the VNF instance does not exist or if the specified command is not valid. Depending on the case, the output will contain: # debug <VNFI-name> was not found!or# debug Invalid VNF Instance control command specified - <Command>
Destroy_VNFI Description: Destroying a VNF instance from a uCPE device. For details please refer to: <AF-TH-install-dir>/playbooks/destroyVNFI.yml <AF-TH-install-dir>/automation_framework/vnf/destroyVNFI.py Precondition: A VNF is instantiated on a uCPE device. Action: Run the destroyVNFI.yml Ansible Playbook with the <Device-name> and the <VNFI-name> as extra-vars: ansible-playbook playbooks/destroyVNFI.yml -e "device=<Device-name> vnfi=<VNFI-name>"Result: Output of the test case run using the Test Harness:# Destroy VNFI task result <VNFI-name> was destroyed!Note: The test will not fail if the VNF instance does not exist. The output will instead contain: # debug <VNFI-name> was not found!
Service Creation and Lifecycle This test suite contains more complex test cases designed to verify service creation and service lifecycle management. These test cases also serve as examples of how different services can be deployed using the Automation Framework (AF) and the Test Harness (TH).
Fortigate VNF as a Firewall This test case was implemented in two different ways to exemplify both methods supported by the AF and TH to deploy such services. Prerequisites needed in order to deploy the FortiGate VNF as a Firewall: Onboard the FortiGate VNF Image. Add a uCPE device. Bind 2 physical interfaces: wan_nic (this physical interface has to be connected to the Lab Network) and lan_nic. Create 2 bridges: wan_br (using the wan_nic interface) and lan_br (using the lan_nic interface). Instantiate the FortiGate VNF using the basic Firewall configuration and the FortiGate License. For more information please refer to the "FortiGate VNF as a Firewall" chapter from the "Enea NFV Access Example Use-cases" manual. olink needed here The license and configuration files for the FortiGate VNF are not included in the TH and should be obtained from Enea.
FortigateFWInstance Test Description: Instantiate the FortiGate VNF as a Firewall and test it using an isolated network namespace. This example was implemented with the "Test Harness" method, based on Ansible Playbooks. For details please refer to: <AF-TH-install-dir>/playbooks/fortigateFWService/instantiateFortigateFW.yml <AF-TH-install-dir>/playbooks/fortigateFWService/testFortigateFWInstance.yml <AF-TH-install-dir>/playbooks/fortigateFWService/cleanupTestFortigateFWInstance.yml <AF-TH-install-dir>/playbooks/fortigateFWService/cleanupFortigateFWInstance.yml Preconditions: Add the Fortigate VNF Image (fortios.qcow2) to the vnf_image folder. The device JSON configuration file is created: <AF-TH-install-dir>/lab_config/<Device-name>/<Device-name>.json. Add device settings in the hosts Ansible inventory file under [fortigateFW] and remove the intelc3850-2 example. Example: intelc3850-2 ansible_host=172.24.12.114 ansible_port=22 \ ansible_user=root ansible_pass=root NIC JSON configuration files are created: <AF-TH-install-dir>/lab_config/<Device-name>/wan_nic.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_nic.json Bridge JSON configuration files are created: <AF-TH-install-dir>/lab_config/<Device-name>/wan_br.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_br.json Download the FortiGate VNF Firewall basic configuration file from Enea, copy it into the <AF-TH-install-dir>/vnf_config/fortigateImage directory and rename it to fortigateFW.conf. Retrieve the FortiGate VNF license file from Fortinet or Enea, copy it into the <AF-TH-install-dir>/vnf_config/fortigateImage directory and rename it to fortigateLicense.lic. Please refer to the "FortiGate VNF as a Firewall" chapter from the Enea NFV Access Example Use-cases manual.olink Action: Run the instantiateFortigateFW.yml Ansible Playbook with the <Device-name> as extra-vars:ansible-playbook playbooks/fortigateFWService/instantiateFortigateFW.yml \ -e "device=<Device-name>" Result: Output of the test case run using the Test Harness: # Test FortigateFWInstance task result FortigateFWInstance tested successfully! Cleanup: Run the cleanupFortigateFWInstance.yml Ansible Playbook with the <Device-name> as extra-vars: ansible-playbook playbooks/fortigateFWService/cleanupFortigateFWInstance.yml \ -e "device=<Device-name>"
DeployFortigateFW Scenario Description: Deploy the Fortigate VNF as a Firewall. This example was implemented with the "Automation Framework" method, based on the unittestSuite.py Python module. For details please refer to: <AF-TH-install-dir>/playbooks/unittestSuiteTest/deployFortigateFWScenario.yml <AF-TH-install-dir>/playbooks/unittestSuiteTest/cleanupFortigateFWScenario.yml <AF-TH-install-dir>/automation_framework/unittestSuite directory. Preconditions: Add the FortiGate VNF Image (fortios.qcow2) to the vnf_image folder. The device JSON configuration file is created: <AF-TH-install-dir>/lab_config/<Device-name>/<Device-name>.json. The NIC JSON configuration files are created: <AF-TH-install-dir>/lab_config/<Device-name>/wan_nic.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_nic.json The Bridge JSON configuration files are created: <AF-TH-install-dir>/lab_config/<Device-name>/wan_br.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_br.json Download the FortiGate VNF Firewall basic configuration from Enea, copy it into the <AF-TH-install-dir>/vnf_config/fortigateImage directory and rename it to fortigateFW.conf. Retrieve the FortiGate VNF license file from Fortinet or Enea, copy it into the <AF-TH-install-dir>/vnf_config/fortigateImage directory and rename it to fortigateLicense.lic. For more details, please refer to: The "FortiGate VNF as a Firewall" chapter from the Enea NFV Access Example Use-cases manual.olink needed The "Python Unit-Test Suite" chapter from the Enea NFV Access Automation Framework and Test Harness User Guide. Action: Run the deployFortigateFWScenario.yml Ansible Playbook with the <Device-name> as extra-vars: ansible-playbook playbooks/unittestSuiteTest/deployFortigateFWScenario.yml \ -e "device=<Device-name>" Result: Output of the test case run using the Test Harness: # unittestSuite Deploy Test task result FortigateFW Scenario deployed successfully! Cleanup: Run the cleanupFortigateFWScenario.yml Ansible Playbook with the <Device-name> as extra-vars: ansible-playbook playbooks/unittestSuiteTest/cleanupFortigateFWScenario.yml \ -e "device=<Device-name>"
chainedVNFsService Description: This sample test case corresponds to the "VNF Chaining Example Use-case" from the Enea NFV Access Example Use-cases manual. For details please refer to: <AF-TH-install-dir>/playbooks/chainedVNFsService/chainedVNFsService.yml <AF-TH-install-dir>/playbooks/chainedVNFsService/testChainedVNFsService.yml <AF-TH-install-dir>/playbooks/chainedVNFsService/cleanupChainedVNFsService.yml Preconditions: Add the Fortigate VNF Image (fortios.qcow2) to the vnf_image folder. Add the Juniper vSRX VNF Image (juniper.qcow2) to the vnf_image folder. The device JSON configuration file(s) is created, e.g.: <AF-TH-install-dir>/lab_config/<Device-name>/<Device-name>.json. Add device settings in the hosts Ansible inventory file under [chainedVNFs]. Keep both devices, the "site1" and "site2" entries, and update the values for ansible_host, ansible_port, ansible_user and ansible_pass, as applicable. Example: site1 ansible_host=172.24.14.157 ansible_port=22 ansible_user=root \ ansible_pass=root site2 ansible_host=172.24.14.50 ansible_port=22 ansible_user=root \ ansible_pass=root NIC JSON configuration files are created for each of the devices, where mgmt_nic is connected to the DHCP from the Lab Network and wan_nic is connected back to back to the other device: <AF-TH-install-dir>/lab_config/<Device-name>/mgmt_nic.json <AF-TH-install-dir>/lab_config/<Device-name>/wan_nic.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_nic.json Bridge JSON configuration files are created for each of the devices: <AF-TH-install-dir>/lab_config/<Device-name>/vnf_mgmt_br.json <AF-TH-install-dir>/lab_config/<Device-name>/sfc_br.json <AF-TH-install-dir>/lab_config/<Device-name>/wan_br.json <AF-TH-install-dir>/lab_config/<Device-name>/lan_br.json Note that sample configuration files needed for devices' NICs and bridges can be found in: <AF-TH-install-dir>/lab_config/inteld1521-1 and <AF-TH-install-dir>/lab_config/inteld1521-2. Retrieve the FortiGate VNF Firewall basic configuration files from Enea (FortiFW-Site1.conf and FortiFW-Site2.conf), and copy them into the <AF-TH-install-dir>/vnf_config/fortigateFWImage directory. Retrieve the FortiGate VNF license file from Fortinet or Enea, copy it into the <AF-TH-install-dir>/vnf_config/fortigateFWImage directory and rename it to fortigateLicense.lic. Retrieve the Juniper vSRX basic configuration files from Enea (vSRX-Site1.iso and vSRX-Site2.iso), and copy them into the <AF-TH-install-dir>/vnf_config/junipervSRXImage directory. Retrieve the vSRX-domain-update-script from Enea and copy it into the junipervSRXImage directory. Please refer to the "VNF Chaining Example Use-case" chapter from the Enea NFV Access Example Use-cases manual for additional information about preconditions.olink to this chapter Action: Run the chainedVNFsService.yml Ansible Playbook as follows:ansible-playbook playbooks/chainedVNFsService/chainedVNFsService.yml \ -e "site1=inteld1521-1 site2=inteld1521-2 arch=XeonD" Note that "arch" may either be { XeonD | AtomC } depending on the target set chosen. Result: Output of the test case run using the Test Harness: # testChainedVNFsService task result ****************************************************************************** * site1 - changed=False ---------------------------------------------- ---- <site1_lan-ip> ---> <site2_lan-ip> LAN-to-LAN connectivity (through VPN tunnel)tested successfully! Cleanup: Run the cleanupChainedVNFsService.yml Ansible Playbook as follows: ansible-playbook playbooks/chainedVNFsService/cleanupChainedVNFsService.yml \ -e "site1=inteld1521-1 site2=inteld1521-2 arch=XeonD"