summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/api/_static/.gitkeep0
-rw-r--r--docs/api/_templates/.gitkeep0
-rw-r--r--docs/api/apidoc/functest.core.rst3
-rw-r--r--docs/api/apidoc/functest.core.unit.rst7
-rw-r--r--docs/api/apidoc/functest.core.vnf.rst7
-rw-r--r--docs/api/apidoc/functest.core.vnf_base.rst7
-rw-r--r--docs/com/pres/framework/framework.md56
-rw-r--r--docs/testing/developer/internship/unit_tests/index.rst76
-rw-r--r--docs/testing/user/configguide/configguide.rst2
9 files changed, 139 insertions, 19 deletions
diff --git a/docs/api/_static/.gitkeep b/docs/api/_static/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/docs/api/_static/.gitkeep
diff --git a/docs/api/_templates/.gitkeep b/docs/api/_templates/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/docs/api/_templates/.gitkeep
diff --git a/docs/api/apidoc/functest.core.rst b/docs/api/apidoc/functest.core.rst
index 29c67e4e3..55c795be0 100644
--- a/docs/api/apidoc/functest.core.rst
+++ b/docs/api/apidoc/functest.core.rst
@@ -13,5 +13,6 @@ Submodules
functest.core.feature
functest.core.testcase
- functest.core.vnf_base
+ functest.core.vnf
+ functest.core.unit
diff --git a/docs/api/apidoc/functest.core.unit.rst b/docs/api/apidoc/functest.core.unit.rst
new file mode 100644
index 000000000..5dd6880ed
--- /dev/null
+++ b/docs/api/apidoc/functest.core.unit.rst
@@ -0,0 +1,7 @@
+functest.core.unit module
+=========================
+
+.. automodule:: functest.core.unit
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/api/apidoc/functest.core.vnf.rst b/docs/api/apidoc/functest.core.vnf.rst
new file mode 100644
index 000000000..9fd6b375c
--- /dev/null
+++ b/docs/api/apidoc/functest.core.vnf.rst
@@ -0,0 +1,7 @@
+functest.core.vnf module
+========================
+
+.. automodule:: functest.core.vnf
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/api/apidoc/functest.core.vnf_base.rst b/docs/api/apidoc/functest.core.vnf_base.rst
deleted file mode 100644
index 94b2eaa90..000000000
--- a/docs/api/apidoc/functest.core.vnf_base.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-functest.core.vnf_base module
-=============================
-
-.. automodule:: functest.core.vnf_base
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/com/pres/framework/framework.md b/docs/com/pres/framework/framework.md
index 3c1aae1b8..1b07a8e0b 100644
--- a/docs/com/pres/framework/framework.md
+++ b/docs/com/pres/framework/framework.md
@@ -252,6 +252,62 @@ run:
+## class Suite
+bases: TestCase
+
+base model for running unittest.TestSuite
+
+
+### run(**kwargs)
+
+- allows running any unittest.TestSuite
+- sets the following attributes required to push the results to DB:
+ - result
+ - start_time
+ - stop_time
+ - details
+
+
+
+## Your fourth test case
+
+
+### fourth.py
+
+```python
+#!/usr/bin/env python
+
+import unittest
+
+class TestStringMethods(unittest.TestCase):
+
+ def test_upper(self):
+ self.assertEqual('Hello World'.upper(),
+ 'HELLO WORLD')
+```
+
+
+### functest/ci/testcases.yaml
+
+```
+case_name: fourth
+project_name: functest
+criteria: 100
+blocking: true
+clean_flag: false
+description: ''
+dependencies:
+ installer: ''
+ scenario: ''
+run:
+ module: 'functest.core.unit'
+ class: 'Suite'
+ args:
+ name: 'fourth'
+```
+
+
+
## Euphrates
diff --git a/docs/testing/developer/internship/unit_tests/index.rst b/docs/testing/developer/internship/unit_tests/index.rst
index f969aa72d..a117c8609 100644
--- a/docs/testing/developer/internship/unit_tests/index.rst
+++ b/docs/testing/developer/internship/unit_tests/index.rst
@@ -25,41 +25,98 @@ Version history
| **Date** | **Ver.** | **Author** | **Comment** |
| | | | |
+------------+----------+------------------+------------------------+
-| 2016-??-?? | 0.0.1 | Morgan Richomme | Beginning of the |
+| 2016-11-14 | 0.0.1 | Morgan Richomme | Beginning of the |
| | | (Orange) | Internship |
+------------+----------+------------------+------------------------+
+| 2017-03-31 | 0.0.2 | Ashish Kumar | During the |
+| | | (IIIT Hyderabad) | Internship |
++------------+----------+------------------+------------------------+
Overview:
=========
-
+Functest project is developing and integrating functional test cases for OPNFV
+and it is part of OPNFV since the beginning. Functest develops its own testcases
+and framework. This framework includes several utility libraries. The Project is
+growing rapidly with more features, tests added as per requirement. It becomes
+the responsibility of every developer to maintain the integrity of code i.e. new
+patch should not break the previous functionality of the project. To automate this
+process of software development, we should write unit tests and add them to CI so
+that when a new patch is ready to merge, we shouldn't allow those which are breaking
+previous unit tests or decreasing the coverage.
Problem Statement:
------------------
-
+The goal of the intership consists in creating unit test suites on Functest code
+with good code coverage (>80%) and integrate it in continuous integration in order
+to consolidate existing code.
Curation Phase
--------------
+The curation phase was the first 3 to 4 weeks of the internship. This phase was to get
+familiar with the functest code and functionality and explore the solutions for unit
+testing in other projects and come up with the strategy for writing unit tests in functest.
-
+In this phase we decided,
+- Coverage should be 80%. There are some functions like __init__, getter, setter and other
+ private methods for which writing unit test is a tedious job, so we are leaving these methods
+ for now.
+- Do method wise testing for every module.
+- Use mock for external or third party services, system calls and other external library calls
+ which could impact the behaviour of system during the run of unit test.
+- Add it in jenkins as passing criteria for patches.
+- Write tests in modular way so that it can help to serve as a form of documentation.
Schedule:
=========
-
-
-
+--------------------------+------------------------------------------+
| **Date** | **Comment** |
| | |
+--------------------------+------------------------------------------+
-| December - January | ........ |
+| Nov 14th - Nov 28th | 1. Learn Functest Project Business |
+| | 2. Set up the development environment |
+| | 3. Run Functest code |
++--------------------------+------------------------------------------+
+| Nov 28th - Dec.9th | 1. Explore Unit Testing Strategy, |
+| | 2. Learn about Mock in python |
++--------------------------+------------------------------------------+
+| Dec 12th - Dec 23rd | Implement Unit Tests for CLI |
+| | |
++--------------------------+------------------------------------------+
+| Dec 26th - Jan 6th | Implement Unit Tests for Utils |
+| | |
++--------------------------+------------------------------------------+
+| Jan 9th - Jan 20th | Implement Unit Tests for CI |
+| | |
++--------------------------+------------------------------------------+
+| Jan 23rd - Feb 3rd | Implement Unit Tests for Core |
+| | |
++--------------------------+------------------------------------------+
+| Feb 6th - Feb 17th | Implement Unit Tests for |
+| | opnfv_tests/openstack/tempest |
+--------------------------+------------------------------------------+
-| January - february | ........ |
+| Feb 20th - Mar 3rd | Implement Unit Tests for |
+| | opnfv_tests/openstack/rally |
++--------------------------+------------------------------------------+
+| Mar 6th - Mar 17th | Implement Unit Tests for |
+| | opnfv_tests/vnf/ims |
++--------------------------+------------------------------------------+
+| Mar 20th - Mar 31st | Recheck and Increase Coverage for all |
+| | modules > 80% |
++--------------------------+------------------------------------------+
+| Apr 3rd - Apr 14th | Add CI Gating for unit tests |
+| | |
++--------------------------+------------------------------------------+
+| Apr 17th - Apr 28th | Use Tox Utility, Documentation |
+| | |
++--------------------------+------------------------------------------+
+| Apr 28th - End | Bug Fixing |
+| | |
+--------------------------+------------------------------------------+
@@ -67,4 +124,3 @@ References:
===========
.. _`[1]` : https://wiki.opnfv.org/display/DEV/Intern+Project%3A+Functest+unit+tests
-
diff --git a/docs/testing/user/configguide/configguide.rst b/docs/testing/user/configguide/configguide.rst
index 9a1749789..12dfd1059 100644
--- a/docs/testing/user/configguide/configguide.rst
+++ b/docs/testing/user/configguide/configguide.rst
@@ -74,7 +74,7 @@ executing the following sequence
#. Log in to container and execute the following command. Replace
the IP with installer address after the "-a" parameter::
- $REPOS_DIR/releng/utils/fetch_os_creds.sh \
+ fetch_os_creds.sh \
-d /home/opnfv/functest/conf/openstack.creds \
-i fuel \
-a 10.20.0.2 \