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, and waiting for a uCPE device to connect to the uCPE
Manager.
The /network folder contains Python scripts for
binding or unbinding a network interface to/from a uCPE device (DPDK or
SR-IOV), creating or deleting an OVS network bridge, or dumping network
interface information about the available interfaces.
The /unittestSuite folder contains 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 /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 uCPE Manager
are provided below.
Script Options
$ python unittestSuite.py -h
Usage: unittestSuite.py [options]
Run selected unit-test suite against Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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
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:
[
{
"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 uCPE
Manager. This can be overwritten by setting the Python
unit-test suite command line option
-u.
password
The password used to log into the uCPE Manager. This
can be overwritten by setting the Python unit-test suite
command line option -p.
host
The IP address of the uCPE Manager 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
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: 2019-03-07 18:03:20,791 - DEBUG: Started logging
Running Fortigate deployment scenario...
test 001: Add VCPE Agent device (__main__.UnittestSuite) ...
2019-03-07 18:03:20,795 - INFO: Add uCPE device
2019-03-07 18:03:20,924 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:20,925 - DEBUG: Session token is: 876160c3-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:20,949 - DEBUG: Add new device 'intelc3850-2' to uCPE Manager host
2019-03-07 18:03:21,100 - INFO: Done
2019-03-07 18:03:21,133 - DEBUG: Logging out and exiting...
ok
test 002: Wait VCPE Agent device be up (__main__.UnittestSuite) ...
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...
ok
test 003: Bind lan NIC to DPDK (__main__.UnittestSuite) ...
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...
ok
test 004: Bind wan NIC to DPDK (__main__.UnittestSuite) ...
2019-03-07 18:03:30,068 - INFO: Bind NIC
2019-03-07 18:03:30,086 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:30,087 - DEBUG: Session token is: 8cd95f32-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:30,095 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:30,096 - DEBUG: Bind NIC 'enp4s0f1'
2019-03-07 18:03:30,729 - INFO: Done
2019-03-07 18:03:30,767 - DEBUG: Logging out and exiting...
ok
test 005: Creating network bridge LAN (__main__.UnittestSuite) ...
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...
ok
test 006: Creating network bridge WAN (__main__.UnittestSuite) ...
2019-03-07 18:03:37,402 - INFO: New OVS network bridge
2019-03-07 18:03:37,461 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:37,461 - DEBUG: Session token is: 913c4420-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:37,485 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:37,485 - DEBUG: Create new OVS network bridge 'wan_br'
2019-03-07 18:03:37,755 - INFO: Done
2019-03-07 18:03:37,792 - DEBUG: Logging out and exiting...
ok
test 007: Onboarding Fortigate VNF (wizard API) (__main__.UnittestSuite) ...
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_bundles/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...
ok
test 008: Instantiate Fortigate VNF (__main__.UnittestSuite) ...
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...
ok
test 009: Pause Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:49,923 - INFO: Control VNF
2019-03-07 18:03:49,982 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:49,983 - DEBUG: Session token is: 98b17220-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:49,991 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:50,031 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:50,031 - DEBUG: Control VNF instance 'intelc3850-2', command:
pause
2019-03-07 18:03:50,914 - INFO: Done
2019-03-07 18:03:50,933 - DEBUG: Logging out and exiting...
ok
test 010: Resume Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:50,933 - INFO: Control VNF
2019-03-07 18:03:50,992 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:50,992 - DEBUG: Session token is: 994c0473-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:51,005 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:51,023 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:51,024 - DEBUG: Control VNF instance 'intelc3850-2', command:
resume
2019-03-07 18:03:51,963 - INFO: Done
2019-03-07 18:03:51,991 - DEBUG: Logging out and exiting...
ok
test 011: Stop Fortigate VNF instance (__main__.UnittestSuite) ...
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...
ok
test 012: Start Fortigate VNF instance (__main__.UnittestSuite) ...
2019-03-07 18:03:53,048 - INFO: Control VNF
2019-03-07 18:03:53,080 - DEBUG: Login successful on host 'localhost'
2019-03-07 18:03:53,080 - DEBUG: Session token is: 9a8d8523-40f2-11e9-a81f525400d08e1d
2019-03-07 18:03:53,109 - DEBUG: Found device with name 'intelc3850-2'
2019-03-07 18:03:53,140 - DEBUG: Found VNF instance with name 'fortigateFWInstance'
2019-03-07 18:03:53,141 - DEBUG: Control VNF instance 'intelc3850-2', command:
start
2019-03-07 18:03:54,087 - INFO: Done
2019-03-07 18:03:54,123 - DEBUG: Logging out and exiting...
ok
----------------------------------------------------------------------
Ran 12 tests in 33.328s
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) ...
2019-03-07 18:04:55,997 - INFO: Destroy VNF
2019-03-07 18:04:56,668 - INFO: Done
ok
test 002: Deleting network bridge LAN (__main__.UnittestSuite) ...
2019-03-07 18:04:56,739 - INFO: Delete OVS network bridge
2019-03-07 18:04:57,908 - INFO: Done
ok
test 003: Deleting network bridge WAN (__main__.UnittestSuite) ...
2019-03-07 18:04:57,931 - INFO: Delete OVS network bridge
2019-03-07 18:04:59,464 - INFO: Done
ok
test 004: Unbind lan NIC from DPDK uCPE device (__main__.UnittestSuite) ...
2019-03-07 18:04:59,477 - INFO: Unbind NIC
2019-03-07 18:05:00,639 - INFO: Done
ok
test 005: Unbind wan NIC from DPDK uCPE device (__main__.UnittestSuite) ...
2019-03-07 18:05:00,658 - INFO: Unbind NIC
2019-03-07 18:05:01,533 - INFO: Done
ok
test 006: Offboarding Fortigate VNF (__main__.UnittestSuite) ...
2019-03-07 18:05:01,566 - INFO: Offboard VNF
2019-03-07 18:05:01,814 - INFO: Done
ok
test 007: Remove VCPE Agent device (__main__.UnittestSuite) ...
2019-03-07 18:05:01,853 - INFO: Remove uCPE device
2019-03-07 18:05:02,184 - INFO: Done
ok
----------------------------------------------------------------------
Ran 7 tests in 6.198s
OK
Adding a uCPE Device
Steps for adding, configuring and running a uCPE device onto the
uCPE manager are described below .
Script Options
$ python addDevice.py -h
Usage: addDevice.py [options]
Add a uCPE device in Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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",
"description": "",
"address": "192.168.1.100",
"port": "22",
"username": "root",
"password": "root",
"certificate": null,
"passphrase": null,
"maintMode": "false"
}
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 uCPE Manager 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 uCPE manager are
described below.
Script Options
$ python removeDevice.py -h
Usage: removeDevice.py [options]
Remove a uCPE from Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Manager
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
uCPE Manager after installation, are described below.
Script Options
$ python waitDeviceUp.py -h
Usage: waitDeviceUp.py [options]
Wait for uCPE to connect to the Enea uCPE Manager after installation.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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...
Printing the uCPE Device Log
Steps and details on how to Print the events log for a specific
uCPE device installed in the uCPE Manager, are explained below.
Script Options
$ python getEventsForUcpe.py -h
Usage: getEventsForUcpe.py [options]
Print the events log for a specific uCPE installed in Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-f DEVICEFILE, --file=DEVICEFILE File containing uCPE Information in JSON format
-s SEVERITY, --severity=SEVERITY Event severity level (Critical|Major|Minor)
Mandatory options:
-H/--host, -f/--file
Configuring the JSON File
Sample
intelc3850-2.json configuration
file:
{
"name": "intelc3850-2",
"description": "",
"address": "172.24.12.114",
"port": "22",
"username": "root",
"password": "root",
"certificate": null,
"passphrase": null,
"maintMode": "false"
}
Running the Python Module
The getEventsForUcpe Python module can be
executed individually by running the following command:
$ python getEventsForUcpe.py -H localhost -f \
../../lab_config/intelc3850-2/intelc3850-2.json
2019-07-04 13:48:31,289 - DEBUG: Started logging
2019-07-04 13:48:31,290 - INFO: Dump uCPE events
2019-07-04 13:48:31,336 - DEBUG: Login successful on host '172.24.3.108'
2019-07-04 13:48:31,336 - DEBUG: Session token is: a53c68d3-9e51-11e9-a715-5254007632e2
2019-07-04 13:48:31,356 - DEBUG: Found device with name 'intelc3850-2'
2019-07-04 13:48:31,357 - DEBUG:
Events on device: intelc3850-2 and severity: 1000
2019-07-04 13:48:31,450 - DEBUG: Dumping 1 events
2019-07-04 13:48:31,450 - DEBUG: Device Disconnected | Alarm | Device | None | \
2019-07-04 09:57:40.042
2019-07-04 13:48:31,469 - DEBUG: Dumping 0 events
2019-07-04 13:48:31,469 - INFO: Done
2019-07-04 13:48:31,488 - 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-s STATE, --state=STATE Enable/Disable
-n DEVICENAME, --device-name=DEVICENAME Name of the device
Mandatory options:
-H/--host, -s/--state
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, standard 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 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": "eno1",
"type": "srIov",
"subType": "passthrough | adapter-pool"
}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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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",
"args": "-f ../../lab_config/intelc3850-2/lan_nic.json"
},
{
name": "Unbind wan NIe",
Unbinds a physical interface to the DPDK or SR-IOV
"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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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
Mandatory options:
-H/--host, -f/--file, -n/--device-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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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
Mandatory options:
-H/--host, -f/--file, -n/--device-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
The specifics of how to Onboard a VNF image onto the Enea uCPE
Manager is detailed below.
Script Options
$ python onboardVNF.py -h
Usage: onboardVNF.py [options]
Onboard a VNF to Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-f FTPUSERNAME, --ftpUsername=FTPUSERNAME
Username for FTP
-w FTPPASSWORD, --ftpPassword=FTPPASSWORD
FTP password
-P FTPPORT, --ftpPort=FTPPORT
FTP port
-b VNFBUNDLE, --bundle=VNFBUNDLE
File name of VNF bundle in ZIP format
Mandatory options:
-H/--host, -b/--bundle
Configuring the JSON File
The JSON configuration file needed to onboard a VNF image should
contain a list of dictionaries. Each dictionary indicates the test
case name and the test case arguments passed to the
onboardVNF Python module.
Sample unit-test JSON file
format:[
{
"name": "Onboarding Fortigate VNF ",
"args": "-b ../../vnf_images/Fortigate.zip"
}
]
Running the Python Module
The onboardVNF Python module can be
executed individually by running the following command line:
$ python onboardVNF.py -u admin -p admin -f ftp -w ftp -H localhost -b
../../vnf_images/Fortigate.zip
2019-02-25 16:00:53,890 - DEBUG: Started logging
2019-02-25 16:00:53,890 - INFO: Onboard VNF
2019-02-25 16:00:53,985 - DEBUG: Login successful on host 'localhost'
2019-02-25 16:00:53,985 - DEBUG: Session token is: c421cd03-3905-11e9-a81f525400d08e1d
2019-02-25 16:00:53,994 - DEBUG: FTP file '../../vnf_images/Fortigate.zip' on host
'localhost', port '2021'
2019-02-25 16:00:54,229 - DEBUG: Onboard VNF: Fortigate
2019-02-25 16:00:56,836 - INFO: Done
2019-02-25 16:00:56,861 - DEBUG: Logging out and exiting...
Onboarding a VNF Image Raw
How to Onboard a VNF image in the uCPE Manager 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 uCPE Manager 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 bundle image path
-b BUNDLEINFO, --bundleInfo=BUNDLEINFO
File name of VNF bundle information in JSON format
Mandatory options:
-H/--host, -b/--bundleInfo, -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 uCPE Manager are detailed
below.
Script Options
$ python offboardVNF.py -h
Usage: offboardVNF.py [options]
Offboard a VNF from Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Manager is detailed below.
Script Options
$ python instantiateVNFI.py -h
Usage: instantiateVNFI.py [options]
Instantiate a VNF via Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-t VNFTYPE, --vnfType=VNFTYPE
VNF Type (Name of VNF descriptor)
-n DEVICENAME, --device-name=DEVICENAME
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 uCPE Manager is
detailed below.
Script Options
$ python controlVNFI.py -h
Usage: controlVNFI.py [options]
Controls a VNF instance from Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME
Name of VNF instance
-n DEVICENAME, --device-name=DEVICENAME
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
uCPE Manager are described below.
Script Options
$ python destroyVNFI.py -h
Usage: destroyVNFI.py [options]
Destroys a VNF instance from Enea uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-i VNFINSTANCENAME, --vnfInstanceName=VNFINSTANCENAME
Name of VNF instance
-n DEVICENAME, --device-name=DEVICENAME
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 NFV Access image onto the Enea uCPE Manager
Steps and options on how to Upload a NFV Access image onto the
Enea uCPE Manager are described below.
Script Options
$ python uploadImage.py -h
Upload NFVA image on uCPE Manager
Usage: uploadImage.py [options]
Upload NFVA image on uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 NFV Access 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 uCPE Manager",
"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 uCPE Manager
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 NFV Access image file from the Enea uCPE
Manager
Steps and options on how to Delete a NFV Access image from the
Enea uCPE Manager are described below.
Script Options
$ python deleteUpgradeFile.py -h
Delete NFVA image from uCPE Manager
Usage: deleteUpgradeFile.py [options]
Delete NFVA image from uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 NFV Access 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 uCPE Manager",
"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 uCPE Manager
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 NFV Access image on an uCPE device
from the Enea uCPE Manager
Steps and options on how to Install and Activate a NFV Access
image on an uCPE device from the Enea uCPE Manager are described
below.
Script Options
$ python installAndActivate.py -h
Install and activate NFVA image from uCPE Manager
Usage: installAndActivate.py [options]
Install and activate NFVA image from uCPE Manager.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 NFV
Access image on a uCPE device from the Enea uCPE Manager 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 uCPE Manager",
"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 uCPE Manager
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 uCPE Manager
Steps and options on how to clear information about completed
upgrades of uCPE devices from the Enea uCPE Manager 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Manager. 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 uCPE Manager
Steps and options on how to upload a custom script to the uCPE
Manager 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 uCPE Manager
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-u USERNAME, --username=USERNAME
Enea uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Manager 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 uCPE Manager",
"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 uCPE Manager. \
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 uCPE Manager to a
Device
Steps and options on how to upload a custom script from the uCPE
Manager 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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager host name or IP address
-c CUSTOMSCRIPTNAME, --customScriptName=CUSTOMSCRIPTNAME
Custom Script Name that resides on Enea uCPE Manager
-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 uCPE Manager 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 uCPE Manager 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 uCPE Manager
Steps and options on how to remove a custom script from the uCPE
Manager are described below.
Script Options
$ python customScripts/delete.py -h
2020-04-14 14:36:52,010 - INFO: Delete Custom Script on uCPE Manager
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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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 uCPE Managerdid you mean device or uCPE
Manager? 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 uCPE Manager",
"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 uCPE Manager
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 uCPE Manager
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 uCPE Manager login username
-p PASSWORD, --password=PASSWORD
Enea uCPE Manager login password
-H HOST, --host=HOST Enea uCPE Manager 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...
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
playbooks directory contains all the implemented Ansible Playbooks. For
more details please refer to chapter "Sample Test Cases" from the Enea NFV
Access System Test Specification document need an olink to that
chapter here..
The uCPEM_config directory stores JSON
configuration files needed for the setup of the uCPE Manager used by TH.
One configuration file is needed per uCPE Manager 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 (devicesclarify this
please, what devices do you mean?, NICs and bridges). 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. 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.