Outdated need to install python2.7-dev in CircleCI
[functest-kubernetes.git] / README.md
1 # Functest
2
3 Network virtualization has dramatically modified our architectures which asks
4 for more automation and powerful testing tools like Functest, a collection of
5 state-of-the-art virtual infrastructure test suites, including automatic VNF
6 testing (cf.
7 [[1]](https://www.linuxfoundation.org/press-release/2019/05/opnfv-hunter-delivers-test-tools-ci-cd-framework-to-enable-common-nfvi-for-verifying-vnfs/)).
8
9 In context of OPNFV, Functest verifies any kind of OpenStack and Kubernetes
10 deployments including production environments. It conforms to upstream rules
11 and integrates smoothly lots of the test cases available in the opensource
12 market. It includes about 3000+ functional tests and 3 hours upstream API and
13 dataplane benchmarks. It’s completed by Virtual Network Function deployments
14 and testing (vIMS, vRouter and vEPC) to ensure that the platforms meet Network
15 Functions Virtualization requirements. Raspberry PI is also supported to verify
16 datacenters as the lowest cost (50 euros hardware and software included).
17
18 | Functest releases | Kubernetes releases       |
19 |-------------------|---------------------------|
20 | Hunter            | v1.13                     |
21 | Iruya             | v1.15                     |
22 | Jerma             | v1.17                     |
23 | Kali              | v1.19                     |
24 | **Leguer**        | **v1.20**                 |
25 | v1.21             | v1.21                     |
26 | Master            | v1.22.0-alpha.1 (rolling) |
27
28 ## Prepare your environment
29
30 cat env
31 ```
32 DEPLOY_SCENARIO=k8s-XXX
33 ```
34
35 ## Run healthcheck suite
36
37 ```bash
38 sudo docker run --env-file env \
39     -v $(pwd)/config:/root/.kube/config \
40     opnfv/functest-kubernetes-healthcheck:leguer
41 ```
42
43 ```
44 +-------------------+------------------+---------------------+------------------+----------------+
45 |     TEST CASE     |     PROJECT      |         TIER        |     DURATION     |     RESULT     |
46 +-------------------+------------------+---------------------+------------------+----------------+
47 |     k8s_quick     |     functest     |     healthcheck     |      00:13       |      PASS      |
48 |     k8s_smoke     |     functest     |     healthcheck     |      00:26       |      PASS      |
49 +-------------------+------------------+---------------------+------------------+----------------+
50 ```
51
52 ## Run smoke suite
53
54 ```bash
55 sudo docker run --env-file env \
56     -v $(pwd)/config:/root/.kube/config \
57     opnfv/functest-kubernetes-smoke:leguer
58 ```
59
60 ```
61 +----------------------------------+------------------+---------------+------------------+----------------+
62 |            TEST CASE             |     PROJECT      |      TIER     |     DURATION     |     RESULT     |
63 +----------------------------------+------------------+---------------+------------------+----------------+
64 |        xrally_kubernetes         |     functest     |     smoke     |      13:20       |      PASS      |
65 |              k8s_io              |     functest     |     smoke     |      26:56       |      PASS      |
66 |         k8s_conformance          |     functest     |     smoke     |      10:11       |      PASS      |
67 |      k8s_conformance_serial      |     functest     |     smoke     |      16:17       |      PASS      |
68 |        sig_api_machinery         |     functest     |     smoke     |      09:41       |      PASS      |
69 |     sig_api_machinery_serial     |     functest     |     smoke     |      01:22       |      PASS      |
70 |             sig_apps             |     functest     |     smoke     |      06:04       |      PASS      |
71 |         sig_apps_serial          |     functest     |     smoke     |      00:41       |      PASS      |
72 |             sig_auth             |     functest     |     smoke     |      10:05       |      PASS      |
73 |      sig_cluster_lifecycle       |     functest     |     smoke     |      00:37       |      PASS      |
74 |       sig_instrumentation        |     functest     |     smoke     |      00:03       |      PASS      |
75 |           sig_network            |     functest     |     smoke     |      03:20       |      PASS      |
76 |             sig_node             |     functest     |     smoke     |      04:53       |      PASS      |
77 |      sig_scheduling_serial       |     functest     |     smoke     |      08:01       |      PASS      |
78 |           sig_storage            |     functest     |     smoke     |      06:04       |      PASS      |
79 |        sig_storage_serial        |     functest     |     smoke     |      02:38       |      PASS      |
80 +----------------------------------+------------------+---------------+------------------+----------------+
81 ```
82
83 ## Run security suite
84
85 ```bash
86 sudo docker run --env-file env \
87     -v $(pwd)/config:/root/.kube/config \
88     opnfv/functest-kubernetes-security:leguer
89 ```
90
91 ```
92 +---------------------------+------------------+------------------+------------------+----------------+
93 |         TEST CASE         |     PROJECT      |       TIER       |     DURATION     |     RESULT     |
94 +---------------------------+------------------+------------------+------------------+----------------+
95 |        kube_hunter        |     functest     |     security     |      01:53       |      PASS      |
96 |     kube_bench_master     |     functest     |     security     |      00:12       |      PASS      |
97 |      kube_bench_node      |     functest     |     security     |      00:12       |      PASS      |
98 +---------------------------+------------------+------------------+------------------+----------------+
99 ```
100
101 ## Run benchmarking suite
102
103 ```bash
104 sudo docker run --env-file env \
105     -v $(pwd)/config:/root/.kube/config \
106     opnfv/functest-kubernetes-benchmarking:leguer
107 ```
108
109 ```
110 +--------------------------------+------------------+----------------------+------------------+----------------+
111 |           TEST CASE            |     PROJECT      |         TIER         |     DURATION     |     RESULT     |
112 +--------------------------------+------------------+----------------------+------------------+----------------+
113 |     xrally_kubernetes_full     |     functest     |     benchmarking     |      39:15       |      PASS      |
114 +--------------------------------+------------------+----------------------+------------------+----------------+
115 ```
116
117 ## Run cnf suite
118
119 ```bash
120 sudo docker run --env-file env \
121     -v $(pwd)/config:/root/.kube/config \
122     opnfv/functest-kubernetes-cnf:leguer
123 ```
124
125 ```
126 +-----------------------+------------------+--------------+------------------+----------------+
127 |       TEST CASE       |     PROJECT      |     TIER     |     DURATION     |     RESULT     |
128 +-----------------------+------------------+--------------+------------------+----------------+
129 |        k8s_vims       |     functest     |     cnf      |      22:11       |      PASS      |
130 |       helm_vims       |     functest     |     cnf      |      10:38       |      PASS      |
131 |     cnf_testsuite     |     functest     |     cnf      |      23:30       |      PASS      |
132 +-----------------------+------------------+--------------+------------------+----------------+
133 ```
134
135
136 ## Use on air gap environments (no access to Internet)
137
138 To test a Kubernetes without access to Internet, repository mirrors needs to be
139 provided.
140
141 Currently, all tests supports this feature except cnf conformance.
142
143 There's two ways for providing the repository mirrors:
144
145 - Give an environment variable (`MIRROR_REPO`) which gives a repository with
146   all needed images.
147 - Gives an environment variable per needed repo:
148   - `DOCKERHUB_REPO` for DockerHub repository (`docker.io`)
149   - `GCR_REPO` for Google Cloud repository (`gcr.io`)
150   - `K8S_GCR_REPO` for Kubernetes repository (`k8s.gcr.io`)
151   - `QUAY_REPO` for Quay repository (`quay.io`)
152
153 All needed images are given in
154 [functest-kubernetes/ci/images.txt](functest-kubernetes/ci/images.txt)
155
156 For e2e tests, `docker.io` is hardcoded. it does mean that you'll have to set up
157 a mirror on docker. An example on how to set it up on docker daemon is provided
158 here:
159 [daemon-configuration-file](
160 https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file)