From a7bb74c6f96f1e3c390bc92e8ec83ff763fdd9ef Mon Sep 17 00:00:00 2001 From: mrpa Date: Thu, 16 Apr 2020 12:27:40 +0200 Subject: In book-enea-nfv-access-auto-fw-th-user-guide New Sections 4.1.22-4.1.25 In book-enea-nfv-access-system-test-specification New Sections 3.1.16-3.1.19. Change-Id: I494eccc7339d1159c49a0d641023a1b564a67a54 Signed-off-by: mrpa --- .../doc/automation_framework_test_harness.xml | 310 ++++++++++++++++++++- .../doc/sample_test_cases.xml | 166 +++++++++++ 2 files changed, 474 insertions(+), 2 deletions(-) diff --git a/doc/book-enea-nfv-access-auto-fw-th-user-guide/doc/automation_framework_test_harness.xml b/doc/book-enea-nfv-access-auto-fw-th-user-guide/doc/automation_framework_test_harness.xml index 888db4a..b7de1af 100644 --- a/doc/book-enea-nfv-access-auto-fw-th-user-guide/doc/automation_framework_test_harness.xml +++ b/doc/book-enea-nfv-access-auto-fw-th-user-guide/doc/automation_framework_test_harness.xml @@ -2007,12 +2007,14 @@ Options: installAndActivate Python module. Sample unit-test JSON file - format:[ + 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" } -] +]
@@ -2117,6 +2119,310 @@ Options: 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... +
+
diff --git a/doc/book-enea-nfv-access-system-test-specification/doc/sample_test_cases.xml b/doc/book-enea-nfv-access-system-test-specification/doc/sample_test_cases.xml index 95d45ce..ab611a1 100644 --- a/doc/book-enea-nfv-access-system-test-specification/doc/sample_test_cases.xml +++ b/doc/book-enea-nfv-access-system-test-specification/doc/sample_test_cases.xml @@ -650,6 +650,172 @@ DEBUG: Set DPDK state to <enable/disable>Note: DPDK use cannot be disabled if DPDK interfaces are configured. The task will fail in this case.
+ +
+ Custom Scripts - Upload a Custom Script to the uCPE + Manager + + Description: Upload a Custom + Script to the uCPE Manager. For details please refer to: + + + + <AF-TH-install-dir>/playbooks/uploadCustomScript.yml. + + + + <AF-TH-install-dir>/automation_framework/customScripts/upload.py. + + + + Precondition: + + lab_config/customScripts must contain a Custom + Script file. + + Action: Run the + uploadCustomScript.yml Ansible Playbook with the + <scriptName> and + <phase> as extra-vars: ansible-playbook playbooks/uploadCustomScript.yml -e "scriptName=<scriptName> \ +phase= +<always-after-startup/once-after-startup/always-before-startup/once-before-startup>" + + Result: Output of the test case + run using the Test Harness: + + # Upload Custom Script task result +DEBUG: "{{ scriptName }} was uploaded to uCPE Manager!" +
+ +
+ Custom Scripts - Upload a Custom Script from the uCPE Manager to + a Device + + Description: Upload a Custom + Script from the uCPE Manager to a Device. For details please refer + to: + + + + <AF-TH-install-dir>/playbooks/uploadCustomScriptOnDevice.yml. + + + + <AF-TH-install-dir>/automation_framework/customScripts/uploadOnDevice.py. + + + + Preconditions: + + + + A device must have been previously added and connected to the + uCPE Manager instance. + + + + A Custom Script must have been previously added to the uCPE + Manager instance. + + + + Action: Run the + uploadCustomScriptOnDevice.yml Ansible Playbook + with the <scriptName>, + <phase> and + <deviceName> as extra-vars: ansible-playbook playbooks/uploadCustomScriptOnDevice.yml -e "scriptName=<scriptName> \ +phase= +<always-after-startup/once-after-startup/always-before-startup/once-before-startup> \ +device=<deviceName>" + + Result: Output of the test case + run using the Test Harness: + + # Upload Custom Script on Device task result +DEBUG: "{{ scriptName }} was uploaded to {{ device }}!" +
+ +
+ Custom Scripts - Remove a Custom Script from the uCPE + Manager + + Description: Remove a Custom + Script from the uCPE Manager. For details please refer to: + + + + <AF-TH-install-dir>/playbooks/removeCustomScript.yml. + + + + <AF-TH-install-dir>/automation_framework/customScripts/delete.py. + + + + Precondition: + + A Custom Script must have been previously added to the uCPE + Manager. + + Action: Run the + removeCustomScript.yml Ansible Playbook with the + <scriptName> and + <phase> as extra-vars: ansible-playbook playbooks/removeCustomScript.yml -e "scriptName=<scriptName> \ +phase= +<always-after-startup/once-after-startup/always-before-startup/once-before-startup>" + + Result: Output of the test case + run using the Test Harness: + + # Remove Custom Script in phase from uCPE Manager task result +DEBUG: "{{ scriptName }} from phase {{ phase }} was removed from uCPE Manager!" +
+ +
+ Custom Scripts - Remove a Custom Script from a Device + + Description: Remove a Custom + Script from a Device. For details please refer to: + + + + <AF-TH-install-dir>/playbooks/removeCustomScriptOnDevice.yml. + + + + <AF-TH-install-dir>/automation_framework/customScripts/deleteOnDevice.py. + + + + Preconditions: + + + + A device must have been previously added and connected to the + uCPE Manager instance. + + + + A Custom Script must have been previously added to the + Device. + + + + Action: Run the + removeCustomScriptOnDevice.yml Ansible Playbook + with the <scriptName>, + <phase> and and + <deviceName> as extra-vars: ansible-playbook playbooks/removeCustomScriptOnDevice.yml -e "scriptName=<scriptName> \ +phase= +<always-after-startup/once-after-startup/always-before-startup/once-before-startup> \ +device=<deviceName>" + + Result: Output of the test case + run using the Test Harness: + + # Remove Custom Script in phase from Device task result +DEBUG: "{{ scriptName }} from phase {{ phase }} was removed from {{ device }}!" +
-- cgit v1.2.3-54-g00ecf