From 94dbd87d341ed72beb975b4b7b76135ea52d3b17 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Thu, 25 Feb 2016 09:00:00 +0100 Subject: Updates and fixes to the user guide Change-Id: I42198bbdf4f9e6f6f337761b6ff6900c4bb7f171 Signed-off-by: jose.lausuch --- docker/run_tests.sh | 2 +- docs/userguide/index.rst | 117 +++++++++++++++++-------------------- docs/userguide/introduction.rst | 5 +- docs/userguide/runfunctest.rst | 65 +++++++++++++-------- docs/userguide/troubleshooting.rst | 61 +++++++++---------- 5 files changed, 127 insertions(+), 123 deletions(-) diff --git a/docker/run_tests.sh b/docker/run_tests.sh index 0f9e8a30..95513d4f 100755 --- a/docker/run_tests.sh +++ b/docker/run_tests.sh @@ -25,7 +25,7 @@ where: -s|--serial run tests in one thread -t|--test run specific set of tests one or more of the following separated by comma: - vping_ssh,vping_userdata,odl,rally,tempest,vims,onos,promise,ovno + vping_ssh,vping_userdata,odl,onos,tempest,rally,vims,promise,doctor examples: diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index 3309896b..dcca57be 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -12,21 +12,25 @@ OPNFV FUNCTEST user guide Introduction ============ -The goal of this documents is to describe the Functest test cases as well as -provide a procedure about how to execute them. +The goal of this document is to describe the Functest test cases as well as +provide a procedure to execute them. A presentation has been created for the first OPNFV Summit `[4]`_. -It is assumed that Functest container has been properly installed `[1]`_. +This document is a continuation of the Functest Configuration Guide`[1]`_ and it +is assumed that the Functest Docker container is properly deployed. + +**IMPORTANT**: All the instructions described in this guide must be performed +inside the container. .. include:: ./introduction.rst -The different scenarios are described in the section hereafter. +The different test cases are described in the section hereafter. VIM (Virtualized Infrastructure Manager) ---------------------------------------- -vPing_SSH +vPing_ssh ^^^^^^^^^ Given the script **ping.sh**:: @@ -44,9 +48,11 @@ Given the script **ping.sh**:: sleep 1 done -The goal of this test is described as follows:: - vPing test case +The goal of this test is to establish an SSH connection using a floating IP +on the public network and verify that 2 instances can talk on a private network:: + + vPing_ssh test case +-------------+ +-------------+ | | | | | | Boot VM1 with IP1 | | @@ -76,7 +82,7 @@ The goal of this test is described as follows:: | | | | | | If ping: | | | | exit OK | | - | | else (timeout) | | + | | else (timeout): | | | | exit Failed | | | | | | +-------------+ +-------------+ @@ -87,7 +93,10 @@ It is the first basic use case which shall work on any deployment. vPing_userdata ^^^^^^^^^^^^^^ -The goal of this test can be described as follows:: +This test case is similar to vPing_ssh but without the use of floating ips +and the public network. It only checks that 2 instances can talk to each other +on a private network but it also verifies that the Nova metadata service is +properly working:: vPing_userdata test case +-------------+ +-------------+ @@ -113,10 +122,9 @@ The goal of this test can be described as follows:: | | | | +-------------+ +-------------+ -This scenario is similar to the previous one but it uses cloud-init (nova -metadata service) instead of floating IPs and SSH connection. When the second VM -boots it will execute the script automatically and the ping will be detected -capturing periodically the output in the console-log of the second VM. +When the second VM boots it will execute the script passed as userdata +automatically and the ping will be detected capturing periodically the output +in the console-log of the second VM. Tempest @@ -131,24 +139,24 @@ Tempest has batteries of tests for: * Other specific tests useful in validating an OpenStack deployment Functest uses Rally `[3]`_ to run the Tempest suite. -Rally generates automatically the Tempest configuration file (tempest.conf). -Before running the actual test cases, Functest creates the needed resources and -updates the appropriate parameters to the configuration file. +Rally generates automatically the Tempest configuration file **tempest.conf**. +Before running the actual test cases, +Functest creates the needed resources (user, tenant) and +updates the appropriate parameters into the configuration file. When the Tempest suite is executed, each test duration is measured and the full -console output is stored in the tempest.log file for further analysis. +console output is stored in a *log* file for further analysis. As an addition of Arno, Brahmaputra runs a customized set of Tempest test cases. -The list is specificed through *--tests-file* when running Rally. -This option has been introduced in Rally in version 0.1.2. +The list is specificed through *--tests-file* when executing the Rally command. +This option has been introduced in the version 0.1.2 of the Rally framework. -The customized test list is available in the Functest repo `[4]`_. -This list contains more than 200 Tempest test cases and can be divided +This customized list contains more than 200 Tempest test cases and can be divided into two main sections: - 1) Set of tempest smoke test cases + 1) Set of Tempest smoke test cases 2) Set of test cases from DefCore list `[8]`_ -The goal of the Tempest test suite is to check the basic functionalities of +The goal of the Tempest test suite is to check the basic functionalities of the different OpenStack components on an OPNFV fresh installation using the corresponding REST API interfaces. @@ -156,14 +164,14 @@ the corresponding REST API interfaces. Rally bench test suites ^^^^^^^^^^^^^^^^^^^^^^^ -Rally `[3]`_ is a benchmarking tool that answers the question:: +Rally `[3]`_ is a benchmarking tool that answers the question: - “How does OpenStack work at scale?”. +*How does OpenStack work at scale?* -The goal of this test suite is to benchmark the different OpenStack modules and +The goal of this test suite is to benchmark all the different OpenStack modules and get significant figures that could help to define Telco Cloud KPIs. -The OPNFV scenarios are based on the collection of the existing Rally scenarios: +The OPNFV Rally scenarios are based on the collection of the actual Rally scenarios: * authenticate * cinder @@ -182,7 +190,7 @@ SDN Controllers --------------- Brahmaputra introduces new SDN controllers. -There are currently 2 possible controllers: +There are currently 2 available controllers: * OpenDaylight (ODL) * ONOS @@ -242,7 +250,7 @@ TestON Framework is used to test the ONOS SDN controller functions. The test cases deal with L2 and L3 functions. The ONOS test suite can be run on any ONOS compliant scenario. -The test cases may be described as follows: +The test cases are described as follows: * onosfunctest: The main executable file contains the initialization of the docker environment and functions called by FUNCvirNetNB and @@ -286,6 +294,14 @@ Features vIMS ^^^^ +The IP Multimedia Subsystem or IP Multimedia Core Network Subsystem (IMS) is an +architectural framework for delivering IP multimedia services. + +vIMS has been integrated in Functest to demonstrate the capability to deploy a +relatively complex NFV scenario on the OPNFV platform. The deployment of a complete +functional VNF allows the test of most of the +essential functions needed for a NFV platform. + The goal of this test suite consists of: * deploy a VNF orchestrator (Cloudify) @@ -299,13 +315,7 @@ The Clearwater architecture is described as follows: :align: center :alt: vIMS architecture -Two types of information are stored in the Test Database: - * the duration of each step (orchestion deployment, VNF deployment and test) - * the test results - -The deployment of a complete functional VNF allows the test of most of the -essential functions needed for a NFV platform. Promise ^^^^^^^ @@ -340,47 +350,27 @@ The available 33 test cases can be grouped into 7 test suites: #. Cleanup test allocations: Destroys all allocations in OpenStack. -The specific parameters for Promise can be found in config_functest.yaml and -include:: - - promise: - general: - tenant_name: Name of the OpenStack tenant/project (e.g. promise) - tenant_description: Description of the OpenStack tenant (e.g. promise Functionality Testing) - user_name: Name of the user tenant (e.g. promiser) - user_pwd: Password of the user tenant (e.g. test) - image_name: Name of the software image (e.g. promise-img) - flavor_name: Name of the flavor (e.g. promise-flavor with 1 vCPU and 512 MB RAM) - flavor_vcpus: 1 - flavor_ram: 512 - flavor_disk: 0 -However, these parameters must not be changed, as they are the values expected -by the Promise test suite. - -Doctor -^^^^^^ -Doctor test case: Doctor-notification: immediate notification for fault -management. -The Doctor test is successful if the notification time is below 1 second. .. include:: ./runfunctest.rst Test results ============ -For Brahmaputra test results, see the functest results document at: -http://artifacts.opnfv.org/functest/brahmaputra/docs/results/index.html +For Brahmaputra test results, see the functest results document at `[12]`_ + +Note that the results are documented per scenario basis. Although most of the test +cases might show the same output, some of them are not supported by +certain scenario. Please select the appropriate scenario and compare the results +to the referenced in the documentation. Test Dashboard ============== -Based on results collected in CI, a test dashboard is dynamically generated: -https://www.opnfv.org/opnfvtestgraphs/per-test-projects/default +Based on results collected in CI, a test dashboard is dynamically generated. +The URL of this dashboard is TODO LF -A specific dashboard has been created for functest: -http://testresults.opnfv.org/dashboard/ .. include:: ./troubleshooting.rst @@ -399,6 +389,7 @@ References .. _`[9]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml .. _`[10]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/rally_cert/task.yaml .. _`[11]`: http://robotframework.org/ +.. _`[12]`: http://artifacts.opnfv.org/functest/brahmaputra/docs/results/index.html OPNFV main site: opnfvmain_. diff --git a/docs/userguide/introduction.rst b/docs/userguide/introduction.rst index ac149c70..03039ef8 100644 --- a/docs/userguide/introduction.rst +++ b/docs/userguide/introduction.rst @@ -8,7 +8,7 @@ Functest is the OPNFV project primarily targeting function testing. In the Continuous Integration pipeline, it is launched after an OPNFV fresh installation to validate and verify the basic functions of the infrastructure. -The current list of test suites can be distributed in 3 main domains VIM +The current list of test suites can be distributed in 3 main domains: VIM (Virtualised Infrastructure Manager), Controllers and Features. +----------------+----------------+-------------------------------------------+ @@ -82,9 +82,6 @@ OPNFV, since the Brahmaputra release, offers lots of potential combinations: Most of the tests are runnable on any combination, but some others might have restrictions imposed by the installers or the available deployed features. -Details on working with the functest suites can be found at -http://artifacts.opnfv.org/functest/brahmaputra/userguide/index.html - .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html .. _`Doctor User Guide`: http://artifacts.opnfv.org/opnfvdocs/brahmaputra/docs/userguide/featureusage-doctor.html diff --git a/docs/userguide/runfunctest.rst b/docs/userguide/runfunctest.rst index 8e4e4849..79364bfd 100644 --- a/docs/userguide/runfunctest.rst +++ b/docs/userguide/runfunctest.rst @@ -7,11 +7,16 @@ Executing the functest suites Manual testing -------------- -Once the Functest docker container is running and Functest environment ready -(through */home/opnfv/repos/functest/docker/prepare_env.sh* script), the system is -ready to run the tests. +This section assumes the following: + * The Functest Docker container is running + * The docker prompt is shown + * The Functest environment is ready (prepare_env.sh has been executed) -The script *run_tests.sh* launches the test in an automated way. +If any of the above steps is missing please refer to the Functest Config Guide +as they are a prerequisite and all the commands explained in this section **must** be +performed **inside the container**. + +The script **run_tests.sh** launches the test in an automated way. Although it is possible to execute the different tests manually, it is recommended to use the previous shell script which makes the call to the actual scripts with the appropriate parameters. @@ -32,7 +37,7 @@ several options:: -s|--serial run tests in one thread -t|--test run specific set of tests one or more of the following separated by comma: - vping_ssh,vping_userdata,odl,rally,tempest,vims,onos,promise,ovno + vping_ssh,vping_userdata,odl,onos,tempest,rally,vims,promise,doctor examples: run_tests.sh @@ -46,28 +51,38 @@ and special conditions to push data. The *-t* option can be used to specify the list of a desired test to be launched, by default Functest will launch all the test suites in the following order: -vPing, Tempest, vIMS, Rally. + + 1) vPing test cases + 2) Tempest suite + 3) SDN controller suites + 4) Feature project tests cases (Promise, Doctor, ...) + 5) vIMS suite + 6) Rally suite + +Please note that for some scenarios some test cases might not be launched. +Functest calculates automatically which test can be executed and which cannot given +the environment variable **DEPLOY_SCENARIO** to the docker container. A single or set of test may be launched at once using *-t * specifying the test name or names separated by commas in the following list: -*[vping,vping_userdata,odl,rally,tempest,vims,onos,promise]*. - -The *-n* option is used for preserving all the possible OpenStack resources created -by the tests after their execution. +*[vping_ssh,vping_userdata,odl,onos,rally,tempest,vims,promise,doctor]*. -Please note that Functest includes cleaning mechanism in order to remove -all the VIM resources except what was present before running any test. The script +Functest includes cleaning mechanism in order to remove +all the OpenStack resources except what was present before running any test. The script *$repos_dir/functest/testcases/VIM/OpenStack/CI/libraries/generate_defaults.py* is called once by *prepare_env.sh* when setting up the Functest environment to snapshot all the OpenStack resources (images, networks, volumes, security groups, tenants, users) so that an eventual cleanup does not remove any of this defaults. +The *-n* option is used for preserving all the possible OpenStack resources created +by the tests after their execution. + The *-s* option forces execution of test cases in a single thread. Currently this option affects Tempest test cases only and can be used e.g. for troubleshooting concurrency problems. -The script -*$repos_dir/functest/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py* +The script **clean_openstack.py** which is located in +*$repos_dir/functest/testcases/VIM/OpenStack/CI/libraries/* is normally called after a test execution if the *-n* is not specified. It is in charge of cleaning the OpenStack resources that are not specified in the defaults file generated previously which is stored in @@ -80,22 +95,22 @@ flag is not specified in the *run_tests.sh* command. The reason to include this cleanup meachanism in Functest is because some test suites such as Tempest or Rally create a lot of resources (users, tenants, networks, volumes etc.) that are not always properly cleaned, so this -cleaning function has been set to keep the system as clean as it was before a +function has been set to keep the system as clean as it was before a full Functest execution. Within the Tempest test suite it is possible to define which test cases to execute -by editing *test_list.txt* file before executing *run_tests.sh* script. This file +by editing **test_list.txt** file before executing **run_tests.sh** script. This file is located in *$repos_dir/functest/testcases/VIM/OpenStack/CI/custom_tests/test_list.txt* -Although *run_tests.sh* provides an easy way to run any test, it is possible to +Although **run_tests.sh** provides an easy way to run any test, it is possible to do a direct call to the desired test script. For example: - python $repos_dir/functest/testcases/vPing/vPing.py -d + python $repos_dir/functest/testcases/vPing/vPing_ssh.py -d Automated testing ----------------- -As mentioned in `[1]`, the *prepare-env.sh* and *run_test.sh* can be called within +As mentioned previously, the **prepare-env.sh** and **run_test.sh** can be called within the container from Jenkins. There are 2 jobs that automate all the manual steps explained in the previous section. One job runs all the tests and the other one allows testing test suite by test suite specifying the test name. The user might use one or @@ -108,8 +123,6 @@ detect whether a given test is runnable or not on the given scenario. Some Functest test suites cannot be systematically run (e.g. ODL suite can not be run on an ONOS scenario). - - CI provides some useful information passed to the container as environment variables: @@ -166,10 +179,12 @@ The order of execution is also described in the Functest configuration file:: The tests are executed in the following order: - * Basic scenario (vPing_ssh, vPing_userdata, Tempest) - * Controller suites: ODL or ONOS or OpenContrail - * Feature projects (promise, vIMS) - * Rally (benchmark scenario) + 1) vPing test cases + 2) Tempest suite + 3) SDN controller suites + 4) Feature project tests cases (Promise, Doctor, ...) + 5) vIMS suite + 6) Rally suite As explained before, at the end of an automated execution, the OpenStack resources might be eventually removed. diff --git a/docs/userguide/troubleshooting.rst b/docs/userguide/troubleshooting.rst index ac96bb93..d2145659 100644 --- a/docs/userguide/troubleshooting.rst +++ b/docs/userguide/troubleshooting.rst @@ -7,8 +7,8 @@ Troubleshooting This section gives some guidelines about how to troubleshoot the test cases owned by Functest. -**IMPORTANT**: The steps defined below must be executed inside the Functest Docker -container and after sourcing the OpenStack credentials:: +**IMPORTANT**: As in the previous section, the steps defined below must be +executed inside the Functest Docker container and after sourcing the OpenStack credentials:: . $creds @@ -23,28 +23,30 @@ This section covers the test cases related to the VIM (vPing, Tempest, Rally). vPing common ^^^^^^^^^^^^ -For both vPing test cases (vPing_SSH, and vPing_userdata), the first steps are +For both vPing test cases (**vPing_ssh**, and **vPing_userdata**), the first steps are similar: -* Create Glance image -* Create Network -* Create Security Group -* Create instances -After these actions, the test cases differ and will be explained in their section. + * Create Glance image + * Create Network + * Create Security Group + * Create instances -This test cases can be run inside the container as follows:: +After these actions, the test cases differ and will be explained in their respective section. + +These test cases can be run inside the container as follows:: $repos_dir/functest/docker/run_tests.sh -t vping_ssh $repos_dir/functest/docker/run_tests.sh -t vping_userdata -The *run_tests.sh* script is calling internally the vPing scripts, located in -*$repos_dir/functest/testcases/vPing/CI/libraries/vPing_ssh.py* or +The **run_tests.sh** script is basically calling internally the corresponding +vPing scripts, located in +*$repos_dir/functest/testcases/vPing/CI/libraries/vPing_ssh.py* and *$repos_dir/functest/testcases/vPing/CI/libraries/vPing_userdata.py* with the appropriate flags. After finishing the test execution, the corresponding script will remove all created resources in OpenStack (image, instances, network and security group). -When troubleshooting, it is handy sometimes to keep those resources in case the +When troubleshooting, it is advisable sometimes to keep those resources in case the test fails and a manual testing is needed. This can be achieved by adding the flag *-n*:: $repos_dir/functest/docker/run_tests.sh -n -t vping_ssh @@ -78,8 +80,8 @@ In this case, proceed to create it manually. These are some hints:: neutron security-group-rule-create sg-test --direction egress --ethertype IPv4 --protocol tcp --port-range-min 80 --port-range-max 80 --remote-ip-prefix 0.0.0.0/0 The next step is to create the instances. The image used is located in -*/home/opnfv/functest/data/cirros-0.3.4-x86_64-disk.img* and a glance image is created -with the name *functest-vping*. If booting the instances fails (i.e. the status +*/home/opnfv/functest/data/cirros-0.3.4-x86_64-disk.img* and a Glance image is created +with the name **functest-vping**. If booting the instances fails (i.e. the status is not **ACTIVE**), you can check why it failed by doing:: nova list @@ -87,11 +89,9 @@ is not **ACTIVE**), you can check why it failed by doing:: It might show some messages about the booting failure. To try that manually:: - net_id=$(neutron net-list | grep net-test | awk '{print $2}') - nova boot --flavor 2 --image functest-vping --nic net-id=$net_id nova-test + nova boot --flavor 2 --image functest-vping --nic net-id= nova-test -This will spawn a VM using the network created previously manually. If you want to use -the existing vPing network, just replace *net-test* by *vping-net*. +This will spawn a VM using the network created previously manually. In all the OPNFV tested scenarios from CI, it never has been a problem with the previous actions. Further possible problems are explained in the following sections. @@ -99,8 +99,8 @@ previous actions. Further possible problems are explained in the following secti vPing_SSH ^^^^^^^^^ This test case creates a floating IP on the external network and assigns it to -the second instance with name *opnfv-vping-2*. The purpose of this is to establish -a SSH connection to that instance to SCP a script that will ping the first insntace. +the second instance **opnfv-vping-2**. The purpose of this is to establish +a SSH connection to that instance and SCP a script that will ping the first instance. This script is located in the repository under *$repos_dir/functest/testcases/vPing/CI/libraries/ping.sh* and takes an IP as a parameter. When the SCP is completed, the test will do an SSH call to that script @@ -109,13 +109,13 @@ inside the second instance. Some problems can happen here:: vPing_ssh- ERROR - Cannot establish connection to IP xxx.xxx.xxx.xxx. Aborting If this is displayed, stop the test or wait for it to finish (if you have used the flag -*-n* in *run_tests.sh* explained previously) so that the test does not clean +*-n* in **run_tests.sh** explained previously) so that the test does not clean the OpenStack resources. It means that the Container can not reach the public -IP assigned to the instance *opnfv-vping-2*. There are many possible reasons, and +IP assigned to the instance **opnfv-vping-2**. There are many possible reasons, and they really depend on the chosen scenario. For most of the ODL-L3 and ONOS scenarios this has been noticed and it is a known limitation. -First, make sure that the instance *opnfv-vping-2* managed to get an IP from +First, make sure that the instance **opnfv-vping-2** succeeded to get an IP from the DHCP agent. It can be checked by doing:: nova console-log opnfv-vping-2 @@ -142,7 +142,8 @@ manually with the steps described above in the vPing common section with the add Further troubleshooting is out of scope of this document, as it might be due to -problems with the SDN controller. Contact the installer team members. +problems with the SDN controller. Contact the installer team members or send an +email to the corresponding OPNFV mailing list for more information. @@ -151,14 +152,14 @@ vPing_userdata This test case does not create any floating IP neither establishes an SSH connection. Instead, it uses nova-metadata service when creating an instance to pass the same script as before (ping.sh) but as 1-line text. This script -will be executed automatically when the second instance *opnfv-vping-2* is booted. +will be executed automatically when the second instance **opnfv-vping-2** is booted. The only known problem here for this test to fail is mainly the lack of support of cloud-init (nova-metadata service). Check the console of the instance:: nova console-log opnfv-vping-2 -If this text or similar is showed:: +If this text or similar is shown:: checking http://169.254.169.254/2009-04-04/instance-id failed 1/20: up 1.13. request failed @@ -184,9 +185,9 @@ If this text or similar is showed:: failed to read iid from metadata. tried 20 it means that the instance failed to read from the metadata service. Contact -the installer team members for more information. +the Functest or installer teams for more information. -Cloud-init in not supported on scenario dealing with ONOS and the tests have been +NOTE: Cloud-init in not supported on scenario dealing with ONOS and the tests have been excluded from CI in those scenarios. @@ -297,7 +298,7 @@ due to wrong return code. ONOS ^^^^ -TODO +Please refer to the ONOS documentation. OpenContrail ^^^^^^^^^^^^ @@ -338,4 +339,4 @@ described in the following table: Promise ^^^^^^^ -TODO +Please refer to the Promise documentation. -- cgit 1.2.3-korg