Automation Framework and Test Harness
Automation Framework All Automation Framework sources are under the <AF-TH-install-dir>/automation_framework directory. The /device folder contains Python scripts for adding uCPE device(s), receiving uCPE events' reports, removing a uCPE device, waiting for a uCPE device to connect to the Enea Edge Management, as well as scripts for adding and removing an offline configuration store. This folder also contains scripts for uploading and removing an NFVA image into the Enea Edge Management, and for installing and activating a NFVA image on a uCPE Device. The /customScripts folder contains Python scripts for uploading custom scripts onto the Enea Edge Management and uCPE device(s), for removing custom scripts from the Enea Edge Management and uCPE device(s). The /network folder contains Python scripts for binding or unbinding a network interface to and from a uCPE device (DPDK or SR-IOV), creating or deleting an OVS network bridge, or dumping network interface information about the available interfaces. Three of the scripts mentioned here (binding, creating, deleting) are also applicable for an Offline Configuration Store. Commands within the network folder that include the option -o allow the user to perform the action in an offline configuration store alternative available for use at a later setup time. Commands that include the -n option refer to a uCPE device, with the operation being performed on uCPE device. All options contain either -n, -o or both. One of them must always be provided, if both are provided, -o has priority, and -n is thus ignored. The /unittestSuite folder contains JSON files for complex scenarios (multiple operations), as well as Python unit-test class and loader scripts for generating specific test cases for the available Python scripts. The generated test cases are injected into the Python unit-test suite class to be run using the Python unit-test framework. The /unittestSuite/config folder contains configuration files in JSON format that describe the list of test cases for a particular Python script. Each defined test case is a dictionary that must contain the test case name and arguments to be passed to the Python script for running the test case. The /unittestSuite/vnf_config directory contains symlinks for the Fortigate license file and for the /vnf_config/fortigateImage folder. The /vnf folder contains Python scripts for onboarding and offboarding a VNF image, instantiating a VNF, controlling a VNF instance or destroying an existing one. The eneaUcpeMgr.py file acts as a library for the (Python) Automation Framework scripts. It contains common functions and unit-test configuration options.
Python Unit-Test Suite The Python unit-test class defined in the unittestSuite.py script provides a way to automate the execution of specific test cases for each supported Python script. This class requires a test suite configuration JSON file that contains a dictionary list of the Python scripts to be processed. Each dictionary must contain the path of the Python script to be loaded and the path to the file describing the test cases to be performed against the designated script. Steps for running the Python unit-test suite on the Enea Edge Management are provided below.
Script Options $ python unittestSuite.py -h Usage: unittestSuite.py [options] Run selected unit-test suite against Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -n DEVICENAME, --deviceName=DEVICENAME Name of vCPE device (Virtual Infrastructure Manager) -s SUITEFILE, --suite=SUITEFILE Test suite configuration file in JSON format -d DESCRIPTION, --description=DESCRIPTION Test suite description -o OFFLINE, --offline=OFFLINE Offline Configuration(ZTP) Mandatory options: -H/--host, -n/--deviceName, -s/--suiteFile, -d/--description
Configuring Unit-Test JSON File The Unit-Test suite JSON configuration file contains a list of dictionaries. Each dictionary indicates the path of the Python module to load and the test case's configuration file to be executed against the loaded module. Below is a sample unit-test configuration file, describing the Fortigate deployment scenario fortigateDeploy.json, found in <AF-TH-install-dir>/automation_framework/unittestSuite: [ { "config": "config/waitDeviceUp.json", "module": "../device/waitDeviceUp.py" }, { "config": "config/bindNetworkInterface.json", "module": "../network/bindNetworkInterface.py" }, { "config": "config/newNetworkBridge.json", "module": "../network/newNetworkBridge.py" }, { "config": "config/onboardVNFRaw.json", "module": "../vnf/onboardVNFRaw.py" }, { "config": "config/instantiateVNFI.json", "module": "../vnf/instantiateVNFI.py" }, { "config": "config/controlVNFI.json", "module": "../vnf/controlVNFI.py" } ] Below is a sample unit-test configuration file, describing the Fortigate cleanup scenario fortigateCleanup.json: [ { "config": "config/destroyVNFI.json", "module": "../vnf/destroyVNFI.py" }, { "config": "config/delNetworkBridge.json", "module": "../network/delNetworkBridge.py" }, { "config": "config/unbindNetworkInterface.json", "module": "../network/unbindNetworkInterface.py" }, { "config": "config/offboardVNF.json", "module": "../vnf/offboardVNF.py" } ] The config key contains the path to the test case's configuration file. The module key contains the path to the Python script to be executed.
Unit-Test Configuration Options Unit-test behavior can be tweaked through setting any of the following options. This is done through the eneaUcpeMgr.py file: # Defaults for the framework username = "admin" password = "admin" host = None deviceName = None directory = "." ftpUsername = "ftp" ftpPassword = "ftp" ftpPort = "2021" # Stop the test run on the first error or failure failfast = True # Logging levels ordered by the highest severity: # CRITICAL 50 # ERROR 40 # WARNING 30 # INFO 20 # DEBUG 10 # NOTSET 0 fileLoggingLevel = logging.DEBUG consoleLoggingLevel = logging.INFO eneaUcpeMgr.py Options Option Description username The user authentication used to log into the Enea Edge Management. This can be overwritten by setting the Python unit-test suite command line option -u. password The password used to log into the Enea Edge Management. This can be overwritten by setting the Python unit-test suite command line option -p. host The IP address of the Enea Edge Management host. This can be overwritten by setting the Python unit-test suite command line option -H. devicename The name of the vCPE agent against which tests will be performed. This can be overwritten by setting the Python unit-test suite command line option -n. ftpUsername The user authentication used for the FTP connection when onboarding a VNF image. This can be overwritten by setting the Python script command line option -f. ftpPassword The password used for the FTP connection when onboarding a VNF image. This can be overwritten by setting the Python script command line option -w. ftpPort The port used for the FTP connection when onboarding a VNF image. This can be overwritten by setting the Python script command line option -P. failfast Describes the unit-test execution behavior on the first error or failure encountered. fileLoggingLevel Sets the file logging level. consoleLoggingLevel Sets the console logging level.
Python Unit-Test Suite Logging Logging messages are displayed in the console and also saved to the specified log file. They are shown depending on the chosen logging level. Logging messages are ranked by their severity level:CRITICAL 50 ERROR 40 WARNING 30 INFO 20 DEBUG 10 NOTSET 0 Logging messages less severe than the set logging level will be ignored. Setting the console logging level to INFO is done through the consoleLoggingLevel option:consoleLoggingLevel = logging.INFOSetting the file logging level to DEBUG is done through the fileLoggingLevel option:fileLoggingLevel = logging.DEBUG
Running Python Unit-Test Suite Please update all JSON configuration files to use the name of your vCPE agent device. In the following chapters, intelc3850-2 is used as an example. Below you'll find sample unit-test command line options for running the Fortigate deployment scenario: $ python unittestSuite.py -u admin -p admin -H localhost -n intelc3850-2 -s fortigateDeploy.json -d "Fortigate deployment scenario" Setting the console logging level to DEBUG: consoleLoggingLevel = logging.DEBUG Expected Output: 2020-04-15 07:58:40,668 - DEBUG: Started logging Running Fortigate deployment scenario... test 001: Wait VCPE Agent device be up (__main__.UnittestSuite) ... 2020-04-15 07:58:40,681 - INFO: Wait uCPE device 2020-04-15 07:58:40,722 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:58:40,723 - DEBUG: Session token is: 280028c0-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:58:40,746 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:58:40,747 - DEBUG: Wait for device 'intelc3850-2' to connect 2020-04-15 07:58:41,769 - DEBUG: HACK: sleep 30s more 2020-04-15 07:59:11,791 - DEBUG: HACK: continue 2020-04-15 07:59:11,792 - INFO: Status: Connected 2020-04-15 07:59:11,793 - INFO: Done 2020-04-15 07:59:11,827 - DEBUG: Logging out and exiting... ok test 002: Bind lan NIC to DPDK (__main__.UnittestSuite) ... 2020-04-15 07:59:11,832 - INFO: Bind NIC 2020-04-15 07:59:11,868 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:11,870 - DEBUG: Session token is: 3a90a960-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:11,897 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:11,898 - DEBUG: Bind NIC 'eno6' to dpdk 2020-04-15 07:59:12,952 - INFO: Done 2020-04-15 07:59:12,983 - DEBUG: Logging out and exiting... ok test 003: Bind wan NIC to DPDK (__main__.UnittestSuite) ... 2020-04-15 07:59:12,986 - INFO: Bind NIC 2020-04-15 07:59:13,023 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:13,025 - DEBUG: Session token is: 3b410da0-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:13,048 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:13,050 - DEBUG: Bind NIC 'eno8' to dpdk 2020-04-15 07:59:14,365 - INFO: Done 2020-04-15 07:59:14,392 - DEBUG: Logging out and exiting... ok test 004: Creating network bridge LAN (__main__.UnittestSuite) ... 2020-04-15 07:59:14,395 - INFO: New OVS network bridge 2020-04-15 07:59:14,428 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:14,429 - DEBUG: Session token is: 3c174961-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:14,452 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:14,453 - DEBUG: Create new OVS network bridge 'lan_br' 2020-04-15 07:59:14,454 - DEBUG: Attaching interface 'eno6' to bridge 'lan_br' 2020-04-15 07:59:21,751 - INFO: Done 2020-04-15 07:59:21,779 - DEBUG: Logging out and exiting... ok test 005: Creating network bridge WAN (__main__.UnittestSuite) ... 2020-04-15 07:59:21,782 - INFO: New OVS network bridge 2020-04-15 07:59:21,818 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:21,819 - DEBUG: Session token is: 407ec231-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:21,845 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:21,846 - DEBUG: Create new OVS network bridge 'wan_br' 2020-04-15 07:59:21,847 - DEBUG: Attaching interface 'eno8' to bridge 'wan_br' 2020-04-15 07:59:22,813 - INFO: Done 2020-04-15 07:59:22,845 - DEBUG: Logging out and exiting... ok test 006: Onboarding Fortigate VNF (wizard API) (__main__.UnittestSuite) ... 2020-04-15 07:59:22,849 - INFO: Onboard wizard 2020-04-15 07:59:22,885 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:22,886 - DEBUG: Session token is: 4121b8f1-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:22,890 - DEBUG: FTP file '../../vnf_image/fortios.qcow2' on host \ 'localhost', port '2021' 2020-04-15 07:59:23,127 - DEBUG: Onboard VNF raw: fortios.qcow2 2020-04-15 07:59:27,107 - INFO: Done 2020-04-15 07:59:27,140 - DEBUG: Logging out and exiting... ok test 007: Instantiate Fortigate VNF (__main__.UnittestSuite) ... 2020-04-15 07:59:27,144 - INFO: Instantiate VNF 2020-04-15 07:59:27,182 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:27,184 - DEBUG: Session token is: 43b16480-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:27,207 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:27,281 - DEBUG: Found VNF descriptor with name 'fortigateImage' 2020-04-15 07:59:27,286 - DEBUG: Reading file content as text: \ vnf_config/fortigateImage/fortigateFW.conf 2020-04-15 07:59:27,359 - DEBUG: Encrypt file content: \ vnf_config/fortigateImage/fortigateFW.conf 2020-04-15 07:59:27,364 - DEBUG: Reading file content as text: \ vnf_config/fortigateImage/fortigateLicense.lic 2020-04-15 07:59:27,407 - DEBUG: Encrypt file content: \ vnf_config/fortigateImage/fortigateLicense.lic 2020-04-15 07:59:27,409 - DEBUG: Instantiate fortigateImage VNF on 'intelc3850-2' 2020-04-15 07:59:32,720 - INFO: Done 2020-04-15 07:59:32,747 - DEBUG: Logging out and exiting... ok test 008: Pause Fortigate VNF instance (__main__.UnittestSuite) ... 2020-04-15 07:59:32,840 - INFO: Control VNF 2020-04-15 07:59:32,877 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:32,880 - DEBUG: Session token is: 47166170-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:32,904 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:32,954 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2020-04-15 07:59:32,955 - DEBUG: Control VNF instance 'intelc3850-2', command: pause 2020-04-15 07:59:33,114 - INFO: Done 2020-04-15 07:59:33,138 - DEBUG: Logging out and exiting... ok test 009: Resume Fortigate VNF instance (__main__.UnittestSuite) ... 2020-04-15 07:59:33,142 - INFO: Control VNF 2020-04-15 07:59:33,174 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:33,177 - DEBUG: Session token is: 4743b300-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:33,209 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:33,257 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2020-04-15 07:59:33,258 - DEBUG: Control VNF instance 'intelc3850-2', command: resume 2020-04-15 07:59:33,365 - INFO: Done 2020-04-15 07:59:33,389 - DEBUG: Logging out and exiting... ok test 010: Stop Fortigate VNF instance (__main__.UnittestSuite) ... 2020-04-15 07:59:33,393 - INFO: Control VNF 2020-04-15 07:59:33,436 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:33,438 - DEBUG: Session token is: 476aea10-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:33,467 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:33,511 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2020-04-15 07:59:33,513 - DEBUG: Control VNF instance 'intelc3850-2', command: stop 2020-04-15 07:59:33,865 - INFO: Done 2020-04-15 07:59:33,891 - DEBUG: Logging out and exiting... ok test 011: Start Fortigate VNF instance (__main__.UnittestSuite) ... 2020-04-15 07:59:33,895 - INFO: Control VNF 2020-04-15 07:59:33,931 - DEBUG: Login successful on host 'localhost' 2020-04-15 07:59:33,932 - DEBUG: Session token is: 47b70e41-7ede-11ea-a9a8-02429dc76bdd 2020-04-15 07:59:33,956 - DEBUG: Found device with name 'intelc3850-2' 2020-04-15 07:59:34,013 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2020-04-15 07:59:34,015 - DEBUG: Control VNF instance 'intelc3850-2', command: start 2020-04-15 07:59:36,599 - INFO: Done 2020-04-15 07:59:36,623 - DEBUG: Logging out and exiting... ok ---------------------------------------------------------------------- Ran 11 tests in 55.946s OK Below you'll find sample unit-test command line options for running the Fortigate cleanup scenario: $ python unittestSuite.py -u admin -p admin -H localhost -n intelc3850-2 -s fortigateCleanup.json -d "Fortigate cleanup scenario" Setting the console logging level to INFO: consoleLoggingLevel = logging.INFO Expected Output: Running Fortigate cleanup scenario... test 001: Destroying Fortigate VNF (__main__.UnittestSuite) ... 2020-04-15 08:03:40,756 - INFO: Destroy VNF 2020-04-15 08:03:41,358 - INFO: Done ok test 002: Deleting network bridge LAN (__main__.UnittestSuite) ... 2020-04-15 08:03:41,494 - INFO: Delete OVS network bridge 2020-04-15 08:03:41,731 - INFO: Done ok test 003: Deleting network bridge WAN (__main__.UnittestSuite) ... 2020-04-15 08:03:41,766 - INFO: Delete OVS network bridge 2020-04-15 08:03:43,270 - INFO: Done ok test 004: Unbind lan NIC from DPDK (__main__.UnittestSuite) ... 2020-04-15 08:03:43,375 - INFO: Unbind NIC 2020-04-15 08:03:45,405 - INFO: Done ok test 005: Unbind wan NIC from DPDK (__main__.UnittestSuite) ... 2020-04-15 08:03:45,434 - INFO: Unbind NIC 2020-04-15 08:03:47,633 - INFO: Done ok test 006: Offboarding Fortigate VNF (__main__.UnittestSuite) ... 2020-04-15 08:03:47,701 - INFO: Offboard VNF 2020-04-15 08:03:47,919 - INFO: Done ok ---------------------------------------------------------------------- Ran 6 tests in 7.192s OK
Adding a uCPE Device Steps for adding, configuring and running a uCPE device onto the Enea Edge Management are described below .
Script Options $ python addDevice.py -h Usage: addDevice.py [options] Add a uCPE device in Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f DEVICEFILE, --file=DEVICEFILE File containing uCPE Information in JSON format Mandatory options: -H/--host, -f/--file
Configuring the JSON File The JSON configuration file needed for adding a uCPE device should contain a list of dictionaries. Each dictionary indicates the test case name and the arguments passed to the addDevice Python module. Sample configuration file in JSON format: [ { "name": "Add VCPE Agent device ", "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json" } ] Sample intelc3850-2.json configuration file: { "name": "intelc3850-2", "deviceGroupingTags": " ", "description": "", "address": "172.24.12.114", "version": "2.4.0", "port": "22", "username": "root", "password": "root", "certificate": null, "passphrase": null, "callHome": "false", "maintMode": "false", "deviceId": "intelc3850-2" }
Running the Python Module The addDevice Python module can be executed independently by running the following command: $ python addDevice.py -u admin -p admin -H localhost -f config/device.json 2019-03-07 17:33:10,755 - DEBUG: Started logging 2019-03-07 17:33:10,756 - INFO: Add uCPE device 2019-03-07 17:33:10,975 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:10,979 - DEBUG: Session token is: 508b6ea2-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:11,049 - DEBUG: Add new device 'intelc3850-2' to Enea Edge Management host 2019-03-07 17:33:11,483 - INFO: Done 2019-03-07 17:33:11,501 - DEBUG: Logging out and exiting....
Removing a uCPE Device Steps for removing a uCPE device from the Enea Edge Management are described below.
Script Options $ python removeDevice.py -h Usage: removeDevice.py [options] Remove a uCPE from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f DEVICEFILE, --file=DEVICEFILE File containing uCPE Information in JSON format Mandatory options: -H/--host, -f/--file
Configuring the JSON File The JSON configuration file needed to remove a uCPE device should contain a list of dictionaries. Each dictionary indicates the test case name and the arguments passed to the removeDevice Python module. Sample unit-test JSON file format: [ { "name": "Remove VCPE Agent device ", "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json" } ] Sample intelc3850-2.json configuration file: { "name": "intelc3850-2" }
Running the Python Module The removeDevice Python module can be executed individually by running the following command: $ python removeDevice.py -u admin -p admin -H localhost -f ../../lab_config/intelc3850-2/intelc3850-2.json 2019-03-07 17:33:56,834 - DEBUG: Started logging 2019-03-07 17:33:56,835 - INFO: Remove uCPE device 2019-03-07 17:33:56,856 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:56,856 - DEBUG: Session token is: 6bebcb43-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:56,856 - DEBUG: Delete device 'intelc3850-2' from Enea Edge Management host 2019-03-07 17:33:56,875 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 17:33:57,159 - INFO: Done 2019-03-07 17:33:57,171 - DEBUG: Logging out and exiting...
Waiting a uCPE Device Steps and details for how to Wait a uCPE device to connect to the Enea Edge Management after installation, are described below.
Script Options $ python waitDeviceUp.py -h Usage: waitDeviceUp.py [options] Wait for uCPE to connect to the Enea Edge Management after installation. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f DEVICEFILE, --file=DEVICEFILE File containing uCPE Information in JSON format -t TIMEOUT, --timeout=TIMEOUT Time in seconds for maximum wait period, default = instant Mandatory options: -H/--host, -f/--file
Configuring the JSON File The JSON configuration file needed to wait a uCPE device should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the waitDeviceUp Python module. Sample unit-test JSON file format: [ { "name": "Wait VCPE Agent device be up", "args": "-f ../../lab_config/intelc3850-2/intelc3850-2.json -t 60" } ] Sample intelc3850-2.json configuration file: { "name": "intelc3850-2" }
Running the Python Module The waitDeviceUp Python module can be executed individually by running the following command line:$ python waitDeviceUp.py -u admin -p admin -H localhost -t 60 -f ../../lab_config/intelc3850-2/intelc3850-2.json 2019-03-07 18:03:21,132 - DEBUG: Started logging 2019-03-07 18:03:21,133 - INFO: Wait uCPE device 2019-03-07 18:03:21,149 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:21,149 - DEBUG: Session token is: 8785b1a0-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:21,157 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 18:03:21,157 - DEBUG: Wait for device 'intelc3850-2' to connect 2019-03-07 18:03:29,356 - DEBUG: Status: Connected 2019-03-07 18:03:29,356 - INFO: Done 2019-03-07 18:03:29,365 - DEBUG: Logging out and exiting...
Enabling or Disabling the DPDK Steps and details on how to enable or disable the DPDK are explained below.
Script Options $ python configDPDK.py -h Usage: configDPDK.py [options] Configure DPDK Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -s STATE, --state=STATE Enable/Disable -n DEVICENAME, --device-name=DEVICENAME Name of the device -o STORENAME, --store-name=STORENAME Name of the store Mandatory options: -H/--host, -s/--state, -n/--device-name or -o/--store-name
Running the Python Module The configDPDK Python module can be executed individually by running the following command lines: To Enable DPDK: $ python configDPDK.py -s enable -n intelc3850-2 2020-01-06 08:35:16,820 - DEBUG: Started logging 2020-01-06 08:35:16,821 - INFO: Configure DPDK 2020-01-06 08:35:16,870 - DEBUG: Login successful on host '172.24.3.90' 2020-01-06 08:35:16,871 - DEBUG: Session token is: 601149e0-3089-11ea-b0c7-525400b7889f 2020-01-06 08:35:16,894 - DEBUG: Found device with name 'inteld1521-1' 2020-01-06 08:35:16,895 - DEBUG: Set DPDK state to enable 2020-01-06 08:35:16,936 - INFO: Done 2020-01-06 08:35:16,961 - DEBUG: Logging out and exiting... To Disable DPDK: $ python configDPDK.py -s disable -n intelc3850-2 2020-01-06 08:33:57,157 - DEBUG: Started logging 2020-01-06 08:33:57,158 - INFO: Configure DPDK 2020-01-06 08:33:57,215 - DEBUG: Login successful on host '172.24.3.90' 2020-01-06 08:33:57,216 - DEBUG: Session token is: 3096e670-3089-11ea-b0c7-525400b7889f 2020-01-06 08:33:57,239 - DEBUG: Found device with name 'inteld1521-1' 2020-01-06 08:33:57,241 - DEBUG: Set DPDK state to disable 2020-01-06 08:33:57,284 - INFO: Done 2020-01-06 08:33:57,310 - DEBUG: Logging out and exiting...
Binding a Network Interface How to Bind a physical network interface to a DPDK, Standard or SR-IOV is detailed below.
Script Options $ python bindNetworkInterface.py -h Usage: bindNetworkInterface.py [options] Binds a physical network interface to a DPDK or SR-IOV. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f NICFILE, --file=NICFILE File containing network interface Information in JSON format -n DEVICENAME, --device-name=DEVICENAME Name of the device -o STORENAME, --store-name=STORENAME Name of the store Mandatory options: -H/--host, -f/--file, -n/--device-name or -o/--store-name
Configuring the JSON File The JSON configuration file needed to bind a physical network interface should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the bindNetworkInterface Python module. Sample unit-test JSON file format:[ { "name": "Bind lan NIC to DPDK", "args": "-f ../../lab_config/intelc3850-2/lan_nic.json" }, { "name": "Bind wan NIC to DPDK", "args": "-f ../../lab_config/intelc3850-2/wan_nic.json" }, { "name": "Bind wan/lan NIC to SR-IOV", "args": "-f ../../lab_config/intelc3850-2/sriov_nic.json" }, { "name": "Bind wan/lan NIC to Standard", "args": "-f ../../lab_config/intelc3850-2/std_nic.json" } ]Sample lan_nic.json configuration file:{ "name": "enp4s0f0", "type": "dpdk", "subType": "vfio-pci" }Sample wan_nic.json configuration file:{ "name": "enp4s0f1", "type": "dpdk", "subType": "vfio-pci" }Sample sriov_nic.json configuration file:{ "name": "enp4s0f1", "type": "sr-iov", "subType": "adapter-pool", "sriovNumVfs": "2" }Sample std_nic.json configuration file:{ "name": "eno2", "type": "standard" }
Running the Python Module The bindNetworkInterface Python module can be executed individually by running the following command line: $ python bindNetworkInterface.py -u admin -p admin -H localhost -f ../../lab_config/intelc3850-2/lan_nic.json -n intelc3850-2 2019-03-07 18:03:29,365 - DEBUG: Started logging 2019-03-07 18:03:29,366 - INFO: Bind NIC 2019-03-07 18:03:29,406 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:29,406 - DEBUG: Session token is: 8c719cb0-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:29,415 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 18:03:29,415 - DEBUG: Bind NIC '0000:01:00.1' 2019-03-07 18:03:30,030 - INFO: Done 2019-03-07 18:03:30,067 - DEBUG: Logging out and exiting...
Unbinding a Network Interface How to Unbind a physical network interface from a DPDK or SR-IOV is described below.
Script Options $ python unbindNetworkInterface.py -h Usage: unbindNetworkInterface.py [options] Unbinds a physical interface to the DPDK or SR-IOV. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f NICFILE, --file=NICFILE File containing network interface Information in JSON format -n DEVICENAME, --device-name=DEVICENAME Name of the device Mandatory options: -H/--host, -f/--file, -n/--device-name
Configuring the JSON File The JSON configuration file needed to unbind a network interface should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the unbindNetworkInterface Python module. Sample unit-test JSON file format:[ { "name": "Unbind lan NIC from DPDK", "args": "-f ../../lab_config/intelc3850-2/lan_nic.json" }, { name": "Unbind wan NIC from DPDK", "args": "-f ../../lab_config/intelc3850-2/wan_nic.json" } ] Sample lan_nic.json configuration file: { "name": "enp4s0f0", "type": "dpdk" } Sample wan_nic.json configuration file: { "name": "enp4s0f1", "type": "dpdk", }
Running the Python Module The unbindNetworkInterface Python module can be executed individually by running the following command line: $ python unbindNetworkInterface.py -u admin -p admin -H localhost -f ../../lab_config/intelc3850-2/lan_nic.json -n intelc3850-2 2019-03-07 17:33:54,377 - DEBUG: Started logging 2019-03-07 17:33:54,378 - INFO: Unbind NIC 2019-03-07 17:33:54,431 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:54,432 - DEBUG: Session token is: 6a77a1d1-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:54,467 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 17:33:54,468 - DEBUG: Unbind NIC '0000:01:00.1' 2019-03-07 17:33:55,616 - INFO: Done 2019-03-07 17:33:55,659 - DEBUG: Logging out and exiting...
Getting a Network Interface Details and steps on how to List the network interfaces for a device, are described below.
Script Options $ python getNetworkInterfaces.py -h 2019-07-04 16:35:50,496 - DEBUG: Started logging 2019-07-04 16:35:50,496 - INFO: Dump NICs Usage: getNetworkInterfaces.py [options] Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -n DEVICENAME, --device-name=DEVICENAME Name of the uCPE to get network / interfaces from Mandatory options: -H/--host, -n/--device-name
Running the Python Module The getNetworkInterfaces Python module can be executed individually by running the following command: $ python getNetworkInterfaces.py -H localhost -n intelc3850-2 2020-01-07 05:58:03,630 - DEBUG: Started logging 2020-01-07 05:58:03,630 - INFO: Dump NICs 2020-01-07 05:58:03,687 - DEBUG: Login successful on host '172.24.3.90' 2020-01-07 05:58:03,688 - DEBUG: Session token is: 93dd3cd0-313c-11ea-b0c7-525400b7889f 2020-01-07 05:58:03,715 - DEBUG: Found device with name 'intelc3850-2' 2020-01-07 05:58:03,717 - DEBUG: ----------------External Network Interfaces for intelc3850-2---------------- 2020-01-07 05:58:07,622 - DEBUG: eno4 DpdkTypes: [u'igb_uio', u'vfio-pci'] \ MacAddress: 0c:c4:7a:fb:85:dfsriov(7) 2020-01-07 05:58:07,624 - DEBUG: 2020-01-07 05:58:07,656 - DEBUG: ----------------Configured External Network Interfaces for intelc3850-2---------------- 2020-01-07 05:58:07,657 - DEBUG: eno3 DpdkType: vfio-pci ID: \ 47556b22-b5c2-4acb-b3cb-09b1f024b3a7 2020-01-07 05:58:07,658 - DEBUG: enp1s0f1 DpdkType: vfio-pci ID: \ 2c06b4f7-6814-4432-8765-a9d0cd5303c1 2020-01-07 05:58:07,659 - DEBUG: enp1s0f0 DpdkTypes: [u'igb_uio', u'vfio-pci'] \ MacAddress: ac:1f:6b:2d:ee:58sriov(63) 2020-01-07 05:58:07,660 - DEBUG: 2020-01-07 05:58:07,690 - DEBUG: ----------------Configured External Network Interfaces for intelc3850-2---------------- 2020-01-07 05:58:07,691 - DEBUG: eno3 DpdkType: vfio-pci ID: \ 47556b22-b5c2-4acb-b3cb-09b1f024b3a7 2020-01-07 05:58:07,692 - DEBUG: enp1s0f1 DpdkType: vfio-pci ID: \ 2c06b4f7-6814-4432-8765-a9d0cd5303c1 2020-01-07 05:58:07,693 - DEBUG: eno2 DpdkTypes: [u'igb_uio', u'vfio-pci'] \ MacAddress: 0c:c4:7a:fb:85:ddsriov(7) 2020-01-07 05:58:07,695 - DEBUG: 2020-01-07 05:58:07,724 - DEBUG: ----------------Configured External Network Interfaces for intelc3850-2---------------- 2020-01-07 05:58:07,725 - DEBUG: eno3 DpdkType: vfio-pci ID: \ 47556b22-b5c2-4acb-b3cb-09b1f024b3a7 2020-01-07 05:58:07,726 - DEBUG: enp1s0f1 DpdkType: vfio-pci ID: \ 2c06b4f7-6814-4432-8765-a9d0cd5303c1 2020-01-07 05:58:07,727 - DEBUG: eno1 DpdkTypes: [u'igb_uio', u'vfio-pci'] \ MacAddress: 0c:c4:7a:fb:85:dcsriov(7) 2020-01-07 05:58:07,728 - DEBUG: 2020-01-07 05:58:07,760 - DEBUG: ----------------Configured External Network Interfaces for intelc3850-2---------------- 2020-01-07 05:58:07,761 - DEBUG: eno3 DpdkType: vfio-pci ID: \ 47556b22-b5c2-4acb-b3cb-09b1f024b3a7 2020-01-07 05:58:07,761 - DEBUG: enp1s0f1 DpdkType: vfio-pci ID: \ 2c06b4f7-6814-4432-8765-a9d0cd5303c1 2020-01-07 05:58:07,762 - DEBUG: 2020-01-07 05:58:07,763 - INFO: Done 2020-01-07 05:58:07,787 - DEBUG: Logging out and exiting...
Creating an OVS Network Bridge Instructions on how to Create an OVS Bridge on a device are detailed below.
Script Options $ python newNetworkBridge.py -h Usage: newNetworkBridge.py [options] Create an OVS Bridge on a device. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f OVSFILE, --file=OVSFILE File containing OVS bridge Information in JSON format -n DEVICENAME, --device-name=DEVICENAME Name of the device -o STORENAME, --store-name=STORENAME Name of the store Mandatory options: -H/--host, -f/--file, -n/--device-name or -o/--store-name
Configuring the JSON File The JSON configuration file needed to create a new network bridge should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the newNetworkBridge Python module. Sample unit-test JSON file format: [ { "name": "Creating network bridge LAN ", "args": "-f ../../lab_config/intelc3850-2/lan_br.json" }, { "name": "Creating network bridge WAN ", "args": "-f ../../lab_config/intelc3850-2/wan_br.json" } ] Sample lan_br.json configuration file: { "name": "lan_br", "interfaces": ["enp4s0f0"] } Sample wan_br.json configuration file: { "name": "wan_br", "interfaces": ["enp4s0f1"] }
Running the Python Module The newNetworkBridge Python module can be executed individually by running the following command line: $ python newNetworkBridge.py -u admin -p admin -H localhost -f ../../lab_config/intelc3850-2/lan_br.json -n intelc3850-2 2019-03-07 18:03:30,767 - DEBUG: Started logging 2019-03-07 18:03:30,768 - INFO: New OVS network bridge 2019-03-07 18:03:30,801 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:30,801 - DEBUG: Session token is: 8d454061-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:30,811 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 18:03:30,812 - DEBUG: Create new OVS network bridge 'lan_br' 2019-03-07 18:03:37,358 - INFO: Done 2019-03-07 18:03:37,402 - DEBUG: Logging out and exiting...
Deleting an OVS Network Bridge How to Delete an OVS Bridge from a device is detailed in the following.
Script Options $ python delNetworkBridge.py -h Usage: delNetworkBridge.py [options] Delete an OVS Bridge from a device. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f OVSFILE, --file=OVSFILE File containing OVS bridge Information in JSON format -n DEVICENAME, --device-name=DEVICENAME Name of the device -o STORENAME, --store-name=STORENAME Name of the store Mandatory options: -H/--host, -f/--file, -n/--device-name or -o/--store-name
Configuring the JSON File The JSON configuration file needed to delete a network bridge should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the delNetworkBridge Python module. Sample unit-test JSON file format: [ { "name": "Deleting network bridge LAN ", "args": "-f ../../lab_config/intelc3850-2/lan_br.json" }, { "name": "Deleting network bridge WAN ", "args": "-f ../../lab_config/intelc3850-2/wan_br.json" } ] Sample lan_br.json configuration file: { "name" : "lan_br" } Sample wan_br.json configuration file: { "name" : "wan_br" }
Running the Python Module The delNetworkBridge Python module can be executed individually by running the following command line: $ python delNetworkBridge.py -u admin -p admin -H localhost -f ../../lab_config/intelc3850-2/lan_br.json -n intelc3850-2 2019-03-07 17:33:51,712 - DEBUG: Started logging 2019-03-07 17:33:51,713 - INFO: Delete OVS network bridge 2019-03-07 17:33:51,751 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:51,752 - DEBUG: Session token is: 68e08711-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:51,768 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 17:33:51,768 - DEBUG: Delete OVS network bridge 'lan_br' 2019-03-07 17:33:52,839 - INFO: Done 2019-03-07 17:33:52,872 - DEBUG: Logging out and exiting...
Onboarding a VNF Image Raw How to Onboard a VNF image in the Enea Edge Management based upon its raw constituents, is detailed in depth below.
Script Options $ python onboardVNFRaw.py -h Usage: onboardVNFRaw.py [options] Onboard a VNF in Enea Edge Management based upon its raw constituents. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f FTPUSERNAME, --ftpUsername=FTPUSERNAME Username for FTP -w FTPPASSWORD, --ftpPassword=FTPPASSWORD FTP password -P FTPPORT, --ftpPort=FTPPORT FTP port -i IMAGEPATH, --imagePath=IMAGEPATH VNF image path -b IMAGEINFO, --imageInfo=IMAGEINFO File name of VNF image information in JSON format Mandatory options: -H/--host, -b/--imageInfo, -i/--imagePath
Configuring the JSON File The JSON configuration file needed to onboard a VNF image Raw should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the onboardVNFRaw Python module. Sample unit-test JSON file format: [ { "name": "Onboarding Fortigate VNF (wizard API)", "args": "-b ../../vnf_config/fortigateImage/fortigateImage.json -i ../../vnf_images/fortios.qcow2" } ] Sample fortigateImage.json configuration file:{ "name" : "fortigateImage", "version" : "1.0", "description" : "Fortigate VNF Image", "provider" : "Fortinet, Inc", "numVcpus" : 1, "imageFormat" : "QCOW2", "memoryInMb" : 1024, "storageInGb" : 20, "image" : "fortios.qcow2", "interfaces" : [ { "name" : "external", "type" : "PhysicalPort", "description" : "External interface" }, { "name" : "in", "type" : "PhysicalPort", "description" : "Incoming interface" }, { "name" : "out", "type" : "PhysicalPort", "description" : "Outgoing interface" } ], "cloudInitDataSource" : "ConfigDrive", "cloudInitDriveType" : "cdrom", "cloudInitContentParams" : [ { "path" : "License", "description" : "Operational license" } ] }
Running the Python Module The onboardVNFRaw Python module can be executed individually by running the following command line: $ python onboardVNFRaw.py -u admin -p admin -f ftp -w ftp -H localhost -b b ../../vnf_config/fortigateImage/fortigateImage.json -i ../../vnf_images/fortios.qcow2 2019-03-07 18:03:37,791 - DEBUG: Started logging 2019-03-07 18:03:37,792 - INFO: Onboard wizard 2019-03-07 18:03:37,859 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:37,859 - DEBUG: Session token is: 91770330-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:37,860 - DEBUG: FTP file '../../vnf_images/fortios.qcow2' on host 'localhost', port '2021' 2019-03-07 18:03:38,027 - DEBUG: Onboard VNF raw: fortios.qcow2 2019-03-07 18:03:41,701 - INFO: Done 2019-03-07 18:03:41,748 - DEBUG: Logging out and exiting...
Offboarding a VNF Steps on how to Offboard a VNF from the Enea Edge Management are detailed below.
Script Options $ python offboardVNF.py -h Usage: offboardVNF.py [options] Offboard a VNF from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -n VNFDNAME, --vnfdName=VNFDNAME Name of VNF descriptor to offboard Mandatory options: -H/--host, -n/--vnfdName
Configuring the JSON File The JSON configuration file needed to offboard a VNF should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the offboardVNF Python module. Sample unit-test JSON file format: [ { "name": "Offboarding Fortigate VNF ", "args": "-n fortigateImage" } ]
Running the Python Module The offboardVNF Python module can be executed individually by running the following command line: $ python offboardVNF.py -u admin -p admin -H localhost -n fortigateImage 2019-03-07 17:33:56,523 - DEBUG: Started logging 2019-03-07 17:33:56,524 - INFO: Offboard VNF 2019-03-07 17:33:56,557 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:56,557 - DEBUG: Session token is: 6bbe2b90-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:56,682 - DEBUG: Found VNF descriptor with name 'fortigateImage' 2019-03-07 17:33:56,683 - DEBUG: Offboard VNF: fortigateImage 2019-03-07 17:33:56,811 - INFO: Done 2019-03-07 17:33:56,834 - DEBUG: Logging out and exiting...
Instantiating a VNF Instantiating a VNF via the Enea Edge Management is detailed below.
Script Options $ python instantiateVNFI.py -h Usage: instantiateVNFI.py [options] Instantiate a VNF via Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -t VNFTYPE, --vnfType=VNFTYPE VNF Type (Name of VNF descriptor) -n VIMDEVICENAME, --device-name=VIMDEVICENAME Name of the device -f PROPSFILE, --file=PROPSFILE File containing VNF instance properties in JSON format Mandatory options: -H/--host, -t/--vnfType, -n/--device-name, -f/--file
Configuring the JSON File The JSON configuration file needed to instantiate a VNF should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the instantiateVNFI Python module. Sample unit-test JSON file format: [ { "name": "Instantiate Fortigate VNF ", "args": "-t fortigateImage -f ../../vnf_config/fortigateImage/fortigateFWInstance.json" } ] The VNF instance JSON configuration file is specific to each VNF.
Running the Python Module The instantiateVNFI Python module can be executed individually by running the following command line: $ python instantiateVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -t fortigateImage -f ../../vnf_config/fortigateImage/fortigateFWInstance.json 2019-03-07 18:03:41,777 - DEBUG: Started logging 2019-03-07 18:03:41,778 - INFO: Instantiate VNF 2019-03-07 18:03:41,813 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:41,815 - DEBUG: Session token is: 93d69e10-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:41,834 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 18:03:41,878 - DEBUG: Found VNF descriptor with name 'fortigateImage' 2019-03-07 18:03:41,888 - DEBUG: Encrypt string content: cloudInit("vnf_config/fortigateImage/fortigateFW.conf") 2019-03-07 18:03:41,889 - DEBUG: Encrypt string content: License("vnf_config/fortigateImage/fortigateLicense.lic") 2019-03-07 18:03:41,889 - DEBUG: Instantiate fortigateImage VNF on 'intelc3850-2' 2019-03-07 18:03:49,887 - INFO: Done 2019-03-07 18:03:49,921 - DEBUG: Logging out and exiting...
Controlling a VNF Instance How to Control a VNF instance from the Enea Edge Management is detailed below. If a sequence of commands aiming to change the state of the VNF (start/stop/suspend/shutdown) is issued rapidly, certain VNFs might become unresponsive. Depending on the actual VNF, the time required between life-cycle operations may vary from several seconds to half a minute or even more. If a VNF becomes unresponsive, the only possible action is to "Force Delete" the instance from the Enea Edge Management.
Script Options $ python controlVNFI.py -h Usage: controlVNFI.py [options] Controls a VNF instance from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME Name of VNF instance -n VIMDEVICENAME, --device-name=VIMDEVICENAME Name of the device -c COMMAND, --command=COMMAND Control command (stop, start, pause or resume) Mandatory options: -H/--host, -i/--vnfInstanceName, -n/--device-name, -c/--command
Configuring the JSON File The JSON configuration file needed to control a VNF instance should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the controlVNFI Python module. Sample unit-test JSON file format: [ { "name": "Pause Fortigate VNF instance", "args": "-i fortigateFWInstance -c pause" }, { "name": "Resume Fortigate VNF instance", "args": "-i fortigateFWInstance -c resume" }, { "name": "Stop Fortigate VNF instance ", "args": "-i fortigateFWInstance -c stop" }, { "name": "Start Fortigate VNF instance", "args": "-i fortigateFWInstance -c start" } ]
Running the Python Module The controlVNFI Python module can be executed individually by running the following command line: $ python controlVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -i fortigateFWInstance -c stop 2019-03-07 18:03:51,991 - DEBUG: Started logging 2019-03-07 18:03:51,992 - INFO: Control VNF 2019-03-07 18:03:52,031 - DEBUG: Login successful on host 'localhost' 2019-03-07 18:03:52,031 - DEBUG: Session token is: 99ed9ba3-40f2-11e9-a81f525400d08e1d 2019-03-07 18:03:52,046 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 18:03:52,073 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2019-03-07 18:03:52,073 - DEBUG: Control VNF instance 'intelc3850-2', command: stop 2019-03-07 18:03:53,011 - INFO: Done 2019-03-07 18:03:53,047 - DEBUG: Logging out and exiting...
Destroying a VNF Instance Steps and options on how to Destroy a VNF instance from the Enea Edge Management are described below.
Script Options $ python destroyVNFI.py -h Usage: destroyVNFI.py [options] Destroys a VNF instance from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME Name of VNF instance -n VIMDEVICENAME, --device-name=VIMDEVICENAME Name of the device Mandatory options: -H/--host, -i/--vnfInstanceName, -n/--device-name
Configuring the JSON File The JSON configuration file needed to destroy a VNF instance should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the destroyVNFI Python module. Sample unit-test JSON file format:[ { "name": "Destroying Fortigate VNF ", "args": "-i fortigateFWInstance" } ]
Running the Python Module The destroyVNFI Python module can be executed individually by running the following command line: $ python destroyVNFI.py -u admin -p admin -H localhost -n intelc3850-2 -i fortigateFWInstance 2019-03-07 17:33:51,025 - DEBUG: Started logging 2019-03-07 17:33:51,026 - INFO: Destroy VNF 2019-03-07 17:33:51,119 - DEBUG: Login successful on host 'localhost' 2019-03-07 17:33:51,119 - DEBUG: Session token is: 68803ea5-40ee-11e9-a81f525400d08e1d 2019-03-07 17:33:51,128 - DEBUG: Found device with name 'intelc3850-2' 2019-03-07 17:33:51,148 - DEBUG: Found VNF instance with name 'fortigateFWInstance' 2019-03-07 17:33:51,149 - DEBUG: Destroy VNF: fortigateFWInstance 2019-03-07 17:33:51,655 - INFO: Done 2019-03-07 17:33:51,712 - DEBUG: Logging out and exiting...
Uploading a Enea Edge image onto the Enea Edge Management Steps and options on how to Upload a Enea Edge image onto the Enea Edge Management are described below.
Script Options $ python uploadImage.py -h Upload NFVA image on Enea Edge Management Usage: uploadImage.py [options] Upload NFVA image on Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f FILENAME, --fileName=FILENAME Path to NFVA image file name -m MODULE, --module=MODULE Module name (default is: VcpeAgent) -t UPGRADETYPE, --upgradeType=UPGRADETYPE Upgrade Type depends on architecture: xeon_d or atom_c3000 Mandatory options: -H/--host, -f/--fileName, -m/--module, -t/--upgradeType
Configuring the JSON File The JSON configuration file needed to upload a Enea Edge image should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the uploadImage Python module. Sample unit-test JSON file format:[ { "name": "Upload NFVA image on Enea Edge Management", "args": "-f /tmp/enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 -t xeon_d" } ]
Running the Python Module The uploadImage Python module can be executed individually by running the following command line: $ python uploadImage.py -u admin -p admin -H localhost \ -f /tmp/enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 -t xeon_d 2020-02-28 11:38:42,754 - DEBUG: Started logging 2020-02-28 11:38:42,755 - INFO: Upload NFVA image on Enea Edge Management 2020-02-28 11:38:43,307 - DEBUG: Login successful on host 'localhost' 2020-02-28 11:38:43,308 - DEBUG: Session token is: 7da3f960-5a16-11ea-a3de-5652b3ac1c30 2020-02-28 11:41:29,148 - INFO: Verify image validation flag 2020-02-28 11:41:29,149 - INFO: Valid flag: True 2020-02-28 11:41:29,344 - INFO: The image \ 'enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2' was successfully uploaded 2020-02-28 11:41:29,344 - INFO: Done 2020-02-28 11:41:29,388 - DEBUG: Logging out and exiting...
Deleting a Enea Edge image file from the Enea Edge Management Steps and options on how to Delete a Enea Edge image from the Enea Edge Management are described below.
Script Options $ python deleteUpgradeFile.py -h Delete NFVA image from Enea Edge Management Usage: deleteUpgradeFile.py [options] Delete NFVA image from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -i IMAGENAME, --imageName=IMAGENAME NFVA Image name -m MODULE, --module=MODULE Module name - default is VcpeAgent Mandatory options: -H/--host, -i/--imageName, -m/--module.
Configuring the JSON File The JSON configuration file needed to delete a Enea Edge image should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the deleteUpgradeFile Python module. Sample unit-test JSON file format:[ { "name": "Delete NFVA image on Enea Edge Management", "args": "-i enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2" } ]
Running the Python Module The deleteUpgradeFile Python module can be executed individually by running the following command line: $ python deleteUpgradeFile.py -u admin -p admin -H localhost -i \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 2020-02-28 12:06:20,111 - DEBUG: Started logging 2020-02-28 12:06:20,112 - INFO: Delete NFVA image from Enea Edge Management 2020-02-28 12:06:20,210 - DEBUG: Login successful on host 'localhost' 2020-02-28 12:06:20,211 - DEBUG: Session token is: 594b2d50-5a1a-11ea-a3de-5652b3ac1c30 2020-02-28 12:06:20,255 - INFO: The image \ 'enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2' was successfully found 2020-02-28 12:06:20,256 - INFO: The oid for \ 'enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2' image name is as follows: \ VcpeAgent/xeon_d/enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 2020-02-28 12:06:20,449 - INFO: The 'enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2' \ image was successfully removed 2020-02-28 12:06:20,479 - INFO: Done 2020-02-28 12:06:20,517 - DEBUG: Logging out and exiting...
Installing and activating a Enea Edge image on an uCPE device from the Enea Edge Management Steps and options on how to Install and Activate a Enea Edge image on an uCPE device from the Enea Edge Management are described below.
Script Options $ python installAndActivate.py -h Install and activate NFVA image from Enea Edge Management Usage: installAndActivate.py [options] Install and activate NFVA image from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -i IMAGENAME, --imageName=IMAGENAME Image name -m MODULE, --module=MODULE Module name -- VcpeAgent -t UPGRADETYPE, --upgradeType=UPGRADETYPE Upgrade Type -- xeon_d or atom_c3000 -d DEVICENAME, --deviceName=DEVICENAME Device Name Mandatory options: -H/--host, -i/--imageName, -t/--upgradeType, -d/--deviceName, -m/--module
Configuring the JSON File The JSON configuration file needed to install and activate a Enea Edge image on a uCPE device from the Enea Edge Management should contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the installAndActivate Python module. Sample unit-test JSON file format: [ { "name": "Install and activate NFVA image on uCPE device from Enea Edge Management", "args": "-i enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 -t xeon_d -d inteld1521-16" } ]
Running the Python Module The installAndActivate Python module can be executed individually by running the following command line: $ python installAndActivate.py -u admin -p admin -H localhost -i \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 -t xeon_d -d inteld1521-16 2020-02-28 12:36:46,137 - DEBUG: Started logging 2020-02-28 12:36:46,138 - INFO: Install and activate NFVA image from Enea Edge Management 2020-02-28 12:36:46,288 - DEBUG: Login successful on host 'localhost' 2020-02-28 12:36:46,288 - DEBUG: Session token is: 99b7cde0-5a1e-11ea-a3de-5652b3ac1c30 2020-02-28 12:36:46,325 - DEBUG: Found device with name 'inteld1521-16' 2020-02-28 12:36:46,459 - INFO: Display info about NFVA installation \ [inteld1521-16:1001:172.24.12.152] Install Started 2020-02-28 12:36:46,492 - INFO: Transferring Image: \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 2020-02-28 12:36:56,552 - INFO: Verifying Release [1] 2020-02-28 12:37:06,599 - INFO: Verifying Release [2] 2020-02-28 12:37:16,652 - INFO: Validating Upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 2020-02-28 12:37:26,713 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [3] 2020-02-28 12:37:36,770 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [5] 2020-02-28 12:37:46,819 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [7] 2020-02-28 12:37:56,879 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [9] 2020-02-28 12:38:06,920 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [11] 2020-02-28 12:38:16,975 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [13] 2020-02-28 12:38:27,019 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [15] 2020-02-28 12:38:37,091 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [18] 2020-02-28 12:38:47,133 - INFO: Validating upgrade to \ enea-nfv-access-xeon-d.rootfs.ostree.tar.bz2 [20] 2020-02-28 12:38:57,186 - INFO: Waiting for release to become active 2020-02-28 12:39:07,231 - INFO: Upgrade Request Complete 2020-02-28 12:39:17,242 - INFO: Installation completed! 2020-02-28 12:39:17,243 - INFO: Done 2020-02-28 12:39:17,294 - DEBUG: Logging out and exiting...
Clearing information about completed upgrades of uCPE devices from the Enea Edge Management Steps and options on how to clear information about completed upgrades of uCPE devices from the Enea Edge Management are described below.
Script Options $ python clearCompletedUpgradesInfo.py -h Clear info about completed upgrades Usage: clearCompletedUpgradesInfo.py [options] Clear info about completed upgrades Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address Mandatory options: -H/--host
Configuring the JSON File No JSON configuration file is needed to clear information about completed upgrades of uCPE devices from the Enea Edge Management. The clearCompletedUpgradesInfo Python module can be run without a JSON file as a parameter.
Running the Python Module The clearCompletedUpgradesInfo Python module can be executed individually by running the following command line: $ python clearCompletedUpgradesInfo.py -u admin -p admin -H localhost 2020-02-28 12:51:55,861 - DEBUG: Started logging 2020-02-28 12:51:55,862 - INFO: Clear info about completed upgrades 2020-02-28 12:51:55,950 - DEBUG: Login successful on host 'localhost' 2020-02-28 12:51:55,951 - DEBUG: Session token is: b7eb83e0-5a20-11ea-a3de-5652b3ac1c30 2020-02-28 12:51:55,993 - INFO: Done 2020-02-28 12:51:56,025 - DEBUG: Logging out and exiting...
Uploading a Custom Script to the Enea Edge Management Steps and options on how to upload a custom script to the Enea Edge Management are described below.
Script Options $ python customScripts/upload.py -h 2020-04-14 10:26:23,582 - INFO: Upload Custom Script Usage: upload.py [options] Add a Custom Script to Enea Edge Management Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -f CUSTOMSCRIPT, --file=CUSTOMSCRIPT Custom Script File -e PHASE, --phase=PHASE Execution phase. Must be one of the following: once- before-startup | always-before-startup | once-after- startup | always-after-startup Mandatory options: -H/--host, -f/--file, -e/--phase
Configuring the JSON File The JSON configuration file needed to upload a Custom Script to the Enea Edge Management must contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the customScripts/upload Python module. Sample unit-test JSON file format: [ { "name": "Uploading a Custom Script to the Enea Edge Management", "args": "-f ../../lab_config/customScripts/test_success_after_always \ -e always-after-startup" } ]
Running the Python Module The customScripts/upload Python module can be executed individually by running the following command line: $ python automation_framework/customScripts/upload.py \ -f lab_config/customScripts/test_success_after_always -e always-after-startup 2020-04-14 14:08:02,824 - DEBUG: Started logging 2020-04-14 14:08:02,915 - INFO: Upload Custom Script 2020-04-14 14:08:02,994 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:08:02,995 - DEBUG: Session token is: 97544990-7e48-11ea-835c-02423a1c239f 2020-04-14 14:08:02,996 - DEBUG: Upload test_success_after_always to Enea Edge Management. \ Content: #!/bin/bash echo test_success_after_always 2020-04-14 14:08:03,138 - INFO: Done 2020-04-14 14:08:03,169 - DEBUG: Logging out and exiting...
Uploading a Custom Script from the Enea Edge Management to a Device Steps and options on how to upload a custom script from the Enea Edge Management to a Device are described below.
Script Options $ python customScripts/uploadOnDevice.py -h 2020-04-14 10:27:05,614 - INFO: Upload Custom Script on Device Usage: uploadOnDevice.py [options] Add a Custom Script to a Device Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -c CUSTOMSCRIPTNAME, --customScriptName=CUSTOMSCRIPTNAME Custom Script Name that resides on Enea Edge Management -e PHASE, --phase=PHASE Execution phase. Must be one of the following: once- before-startup | always-before-startup | once-after- startup | always-after-startup -n DEVICENAME, --device-name=DEVICENAME Name of the device -r, --reboot Reboot the device after uploading Mandatory options: -H/--host, -c/--customScriptName, -e/--phase, -n/--device-name
Configuring the JSON File The JSON configuration file needed to upload a Custom Script from the Enea Edge Management to a Device must contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the customScripts/uploadOnDevice Python module. Sample unit-test JSON file format: [ { "name": "Uploading a Custom Script from Enea Edge Management to device", "args": "-c test_success_after_always -e always-after-startup -n inteld1521-6" } ]
Running the Python Module The customScripts/uploadOnDevice Python module can be executed individually by running the following command line: $ python automation_framework/customScripts/uploadOnDevice.py -c \ test_success_after_always -e always-after-startup -n inteld1521-6 2020-04-14 14:26:26,205 - DEBUG: Started logging 2020-04-14 14:26:26,206 - INFO: Upload Custom Script on Device 2020-04-14 14:26:26,251 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:26:26,252 - DEBUG: Session token is: 28ebcb10-7e4b-11ea-835c-02423a1c239f 2020-04-14 14:26:26,286 - DEBUG: Found device with name 'inteld1521-6' 2020-04-14 14:26:26,287 - DEBUG: Upload test_success_after_always to inteld1521-6 2020-04-14 14:26:26,314 - INFO: Done 2020-04-14 14:26:26,341 - DEBUG: Logging out and exiting...
Removing a Custom Script from the Enea Edge Management Steps and options on how to remove a custom script from the Enea Edge Management are described below.
Script Options $ python customScripts/delete.py -h 2020-04-14 14:36:52,010 - INFO: Delete Custom Script on Enea Edge Management Usage: delete.py [options] Delete a Custom Script from a Device Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -c CUSTOMSCRIPTNAME, --customScriptName=CUSTOMSCRIPTNAME Custom Script Name that resides on a Device -e PHASE, --phase=PHASE Execution phase. Must be one of the following: once- before-startup | always-before-startup | once-after- startup | always-after-startup Mandatory options: -H/--host, -e/--phase
Configuring the JSON File The JSON configuration file needed to remove a Custom Script from the Enea Edge Managementdid you mean device or Enea Edge Management? must contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the customScripts/delete Python module. Sample unit-test JSON file format: [ { "name": "Removing a Custom Script from Enea Edge Management", "args": "-c test_success_after_always -e always-after-startup" } ]
Running the Python Module The customScripts/delete Python module can be executed individually by running the following command line: $ python automation_framework/customScripts/delete.py -c \ test_success_after_always -e always-after-startup 2020-04-14 14:39:22,042 - DEBUG: Started logging 2020-04-14 14:39:22,042 - INFO: Delete Custom Script on Enea Edge Management 2020-04-14 14:39:22,081 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:39:22,082 - DEBUG: Session token is: f75a83a0-7e4c-11ea-835c-02423a1c239f 2020-04-14 14:39:22,099 - DEBUG: Found custom script: 'test_success_after_always' 2020-04-14 14:39:22,099 - DEBUG: Delete script test_success_after_always, \ phase always-after-startup from Enea Edge Management 2020-04-14 14:39:22,118 - INFO: Done 2020-04-14 14:39:22,135 - DEBUG: Logging out and exiting...
Removing a Custom Script from a Device Steps and options on how to remove a custom script from a device are described below.
Script Options $ python customScripts/deleteOnDevice.py -h 2020-04-14 10:27:23,536 - INFO: Delete Custom Script on Device Usage: deleteOnDevice.py [options] Delete a Custom Script from a Device Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -c CUSTOMSCRIPTNAME, --customScriptName=CUSTOMSCRIPTNAME Custom Script Name that resides on a Device -e PHASE, --phase=PHASE Execution phase. Must be one of the following: once- before-startup | always-before-startup | once-after- startup | always-after-startup -n DEVICENAME, --device-name=DEVICENAME Name of the device Mandatory options: -H/--host, -n/--device-name
Configuring the JSON File The JSON configuration file needed to remove a Custom Script from a device must contain a list of dictionaries. Each dictionary indicates the test case name and the test case arguments passed to the customScripts/deleteOnDevice Python module. Sample unit-test JSON file format: [ { "name": "Removing a Custom Script from device", "args": "-c test_success_after_always -e always-after-startup -n inteld1521-6" } ]
Running the Python Module The customScripts/deleteOnDevice Python module can be executed individually by running the following command line: $ python automation_framework/customScripts/deleteOnDevice.py -c \ test_success_after_always -e always-after-startup -n inteld1521-6 2020-04-14 14:33:52,288 - DEBUG: Started logging 2020-04-14 14:33:52,288 - INFO: Delete Custom Script on Device 2020-04-14 14:33:52,327 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:33:52,327 - DEBUG: Session token is: 32cde4f0-7e4c-11ea-835c-02423a1c239f 2020-04-14 14:33:52,349 - DEBUG: Found device with name 'inteld1521-6' 2020-04-14 14:33:52,349 - DEBUG: Delete test_success_after_always, \ phase always-after-startup from inteld1521-6 2020-04-14 14:33:52,373 - INFO: Done 2020-04-14 14:33:52,391 - DEBUG: Logging out and exiting...
Custom Script - Full Example All Python API used in this example are described in detail in the following sections. The list of custom scripts can be found in <AF-TH-install-dir>/lab_config/customScripts: test_fail_after_always. Phase: always-after-startup. test_fail_after_once. Phase: once-after-startup. test_fail_before_always. Phase: always-before-startup. test_fail_before_once. Phase: once-before-startup. test_success_after_always. Phase: always-after-startup. test_success_after_once. Phase: once-after-startup. test_success_before_always. Phase: always-before-startup. test_success_before_once. Phase: once-before-startup. The following example uses the test_success_after_always custom script.
Uploading a Custom Script to the Enea Edge Management $ python automation_framework/customScripts/upload.py \ -f lab_config/customScripts/test_success_after_always -e always-after-startup 2020-04-14 14:08:02,824 - DEBUG: Started logging 2020-04-14 14:08:02,915 - INFO: Upload Custom Script 2020-04-14 14:08:02,994 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:08:02,995 - DEBUG: Session token is: 97544990-7e48-11ea-835c-02423a1c239f 2020-04-14 14:08:02,996 - DEBUG: Upload test_success_after_always to Enea Edge Management. \ Content: #!/bin/bash echo test_success_after_always 2020-04-14 14:08:03,138 - INFO: Done 2020-04-14 14:08:03,169 - DEBUG: Logging out and exiting...
Uploading a Custom Script from the Enea Edge Management to a Device $ python automation_framework/customScripts/uploadOnDevice.py -c \ test_success_after_always -e always-after-startup -n inteld1521-6 2020-04-14 14:26:26,205 - DEBUG: Started logging 2020-04-14 14:26:26,206 - INFO: Upload Custom Script on Device 2020-04-14 14:26:26,251 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:26:26,252 - DEBUG: Session token is: 28ebcb10-7e4b-11ea-835c-02423a1c239f 2020-04-14 14:26:26,286 - DEBUG: Found device with name 'inteld1521-6' 2020-04-14 14:26:26,287 - DEBUG: Upload test_success_after_always to inteld1521-6 2020-04-14 14:26:26,314 - INFO: Done 2020-04-14 14:26:26,341 - DEBUG: Logging out and exiting...
Removing a Custom Script from a Device $ python automation_framework/customScripts/deleteOnDevice.py -c \ test_success_after_always -e always-after-startup -n inteld1521-6 2020-04-14 14:33:52,288 - DEBUG: Started logging 2020-04-14 14:33:52,288 - INFO: Delete Custom Script on Device 2020-04-14 14:33:52,327 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:33:52,327 - DEBUG: Session token is: 32cde4f0-7e4c-11ea-835c-02423a1c239f 2020-04-14 14:33:52,349 - DEBUG: Found device with name 'inteld1521-6' 2020-04-14 14:33:52,349 - DEBUG: Delete test_success_after_always, \ phase always-after-startup from inteld1521-6 2020-04-14 14:33:52,373 - INFO: Done 2020-04-14 14:33:52,391 - DEBUG: Logging out and exiting...
Removing a Custom Script from the Enea Edge Management $ python automation_framework/customScripts/delete.py -c \ test_success_after_always -e always-after-startup 2020-04-14 14:39:22,042 - DEBUG: Started logging 2020-04-14 14:39:22,042 - INFO: Delete Custom Script on Enea Edge Management 2020-04-14 14:39:22,081 - DEBUG: Login successful on host '172.24.3.109' 2020-04-14 14:39:22,082 - DEBUG: Session token is: f75a83a0-7e4c-11ea-835c-02423a1c239f 2020-04-14 14:39:22,099 - DEBUG: Found custom script: 'test_success_after_always' 2020-04-14 14:39:22,099 - DEBUG: Delete script test_success_after_always, \ phase always-after-startup from Enea Edge Management 2020-04-14 14:39:22,118 - INFO: Done 2020-04-14 14:39:22,135 - DEBUG: Logging out and exiting...
Adding an Offline Configuration Store Steps and options on how to add a Config Store in the Enea Edge Management are described below.
Script Options To add a config store in the Enea Edge Management use the addConfigStore.py script detailed below. Bear in mind a CONFIGSTORE json file is needed to successfully run the script in order to add an offline configuration store.
Configuring the JSON file Example of a CONFIGSTORE json file: { "descr": "intelc3850-2", "version": "2.4.0", "deviceGroupingTags": "", "deviceId": "intelc3850-2", "name": "intelc3850-2" }
Running the Python Module Adding an offline config store in the Enea Edge Management using the command line: python automation_framework/device/addConfigStore.py -f \ lab_config/inteld1521-16/store.json 2020-10-16 09:35:51,084 - INFO: Add offline config store 2020-10-16 09:35:51,160 - INFO: Done
Uploading an Offline Configuration Store to an uCPE Device Steps and options on how to upload a config store to a device are described below.
Script options To upload a config store to a uCPE Device use the uploadConfigStore.py script detailed below. python uploadConfigStore.py -h Usage: uploadConfigStore.py [options] Upload offline configuration to uCPE Device. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -s STORE, --store=STORE Offline config store name -d DEVICE, --device=DEVICE Device Name Mandatory options: -H/--host, -s/--store, -d/--device
Running the Python Modules python automation_framework/device/uploadConfigStore.py -s inteld1521-16 \ -d inteld1521-16 2020-10-16 09:37:29,074 - INFO: Upload offline configuration to uCPE Device 2020-10-16 09:37:49,321 - INFO: The 'inteld1521-16' config store was successfully \ uploaded on device! 2020-10-16 09:37:49,322 - INFO: Done
Checking the Upload of an Offline Configuration Store Steps and options on how to check an upload of a Config Store to a Device are described below.
Script options To check an upload a config store to a uCPE Device use the getUploadStatus.py script detailed below. python getUploadStatus.py -h Usage: getUploadStatus.py [options] Get upload offline configure status on uCPE Device. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -d DEVICE, --device=DEVICE Device Name Mandatory options: -H/--host, -d/--device
Running the Python Modules python automation_framework/device/getUploadStatus.py -d inteld1521-16 2020-10-16 09:38:33,388 - INFO: Get upload offline configure status on uCPE Device 2020-10-16 09:38:33,486 - INFO: Successful: True 2020-10-16 09:38:33,487 - INFO: Store name: inteld1521-16 2020-10-16 09:38:33,488 - INFO: In progress: False 2020-10-16 09:38:33,489 - INFO: A config store was successfully uploaded on device! 2020-10-16 09:38:33,490 - INFO: Done
Removing an Offline Configuration Store in the Enea Edge Management Steps and options on how to remove an upload of a Config Store from the Enea Edge Management are described below. Modifications of an Offline Configurations Store are not possible post deployment in the Enea Edge Management, as there is no option for changing script states (e.g. changing the DPDK state in the configDPDK.py python script or unbinding interfaces). The offline store must be deleted and the new state(s)/changes added in, before being deployed anew. This was not deemed necessary for the current ZTP functionality.
Script options To remove a config store from the Enea Edge Management use the removeConfigStore.py script detailed below. python removeConfigStore.py -h Usage: removeConfigStore.py [options] Remove a config store from Enea Edge Management. Options: --version show program's version number and exit -h, --help show this help message and exit -u USERNAME, --username=USERNAME Enea Edge Management login username -p PASSWORD, --password=PASSWORD Enea Edge Management login password -H HOST, --host=HOST Enea Edge Management host name or IP address -o STORENAME, --store-name=STORENAME Name of the Offline Config Store Mandatory options: -H/--host, -o/--store-name
Running the Python Modules python automation_framework/device/removeConfigStore.py -o inteld1521-16 2020-10-16 09:39:39,127 - INFO: Remove offline config store 2020-10-16 09:39:39,289 - INFO: Done
Test Harness All Test Harness sources are under the <AF-TH-install-dir> directory and the host file is the Ansible inventory file. See the complete tree listing at the beginning of this chapter for details. The Ansible based Test Harness represents an example of how to structure all the files needed for creating automated test cases using the AF and provides a way to implement them. The ansible.cfg file contains an example of the Ansible default configuration. It offers the possibility to display the Ansible console output in different ways, by setting the stdout_callback option to selective or debug. The default value for this option is set to selective to print only certain tasks. It is recommended to switch to debug when a test fails. By setting the parameter any_errors_fatal to True, task failures will be considered fatal errors (the play execution will stop). and why would this stop of play execution help in this debugging scenario All Playbooks that execute AF python modules run on localhost. New entries have to be created for direct communication over SSH with the boards, as done in the [fortigateFW] example. The setup_env.sh script sets up the testHarness test environment by creating testHarness-venv python virtualenv, executing requests needed by Automation Framework python modules and installing Ansible. The Ansible package version installed in the test environment is 2.9.6. The playbooks are based on this version of Ansible. The /playbooks directory contains all the implemented Ansible Playbooks. For more details please refer to the Sample Test Cases Chapter in the Manual. The /uCPEM_config directory stores JSON configuration files needed for the setup of the Enea Edge Management used by TH. One configuration file is needed per Enea Edge Management installation, to be used in the TH. The /vnf_image directory stores the VNF Images needed by the Ansible Playbooks (i.e. the sample test cases). The /lab_config directory stores the JSON configuration files related to a device (devices, NICs and bridges) as well as sample custom scripts. Each subfolder should be named exactly like the device name and should contain all the related configuration files needed for the test cases to be run on it. The /vnf_config directory stores the configuration files related to a VNF Descriptor and VNF instances. Typically these include a VNF Image JSON, VNF Instance JSON, VNF license and any other files required by the type of the VNF. Each subfolder should be named exactly like the name of the VNF Descriptor and should contain all the related configuration files needed for test cases to be run using this VNF. The /log directory is created when the setup_env.sh is run. When test cases are run, the Ansible and the Python logs are stored in the ansible.log and debug.log files, respectively.