summaryrefslogtreecommitdiffstats
path: root/testapi/docs/developer/devguide/web-portal.rst
blob: 8c4bc6c0b794be83ad9a6612aa2c2686e73c28ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) 2017 ZTE Corp.

==========
Web portal
==========

**Web-portal of OPNFV Testapi**:

This project aims to provide the web interface for the Testapi framework. It uses the Restful APIs
of the testapi framework to provide front-end functionalities.

If you are interested in how TestAPI looks like, please visit OPNFV's official `TestAPI Server`__

.. __: http://testresults.opnfv.org/test

Pre-requsites
=============

In the web portal, we are using AngularJS(1.3.15) as the frontend framework with Bootstrap(v3) CSS.

Running locally
===============

Installation
^^^^^^^^^^^^

Web portal will be installed with the testapi framework. No extra installation.

.. code-block:: shell

    python setup.py install

Start Server
^^^^^^^^^^^^

.. code-block:: shell

    *opnfv-testapi [--config-file <config.ini>]*

If --config-file is provided, the specified configuration file will be employed
when starting the server, or else /etc/opnfv_testapi/config.ini will be utilized
by default.

After executing the command successfully, a TestAPI server will be started on
port 8000, to visit web portal, please access http://hostname:8000

Test
===============

There are few external requirements for the testing.
They are

1. npm : node package manager
    you can get the installation package for nodejs from the official `website`__

    .. __: https://nodejs.org/en/

2. grunt cli : Automation tool

.. code-block:: shell

    npm install -g grunt-cli

After installing global dependencies, you have to install the required local node modules.

.. code-block:: shell

    npm install

**Running tests**

.. code-block:: shell

    grunt e2e

Authentication
==============

The web portal is using Linux identity server as the Central Authentication Service. The following
diagram will explain the authentication process.

.. image:: /images/CAS-sequence.jpg
 :width: 600
 :alt: Workflow of the Athentication

When a new user initially logs into an application they won't have established a
session with the application. Instead of displaying a login form asking for the username and
password, the application (via the CAS Client) will redirect the browser to the linux foundation
login page. Linux foundation identity server then authenticates the user. If the authentication
fails, the Linux foundation login page is displayed again with an error message. So until
authentication succeeds, the user will not be returned to the application.

Authorization
=============

TestAPI has 3 level authorization layer. They are

**Public**

The public can view the resources(pod, project, testcase, result, deploy result, scenario).
They do not have the access to create, delete or modify the resources.

**User - Contributors**

Contributors level user can view all the resources(pod, project, testcase, result, deploy result,
scenario). They can create/delete/modify pod and scenario.

They do not have the access to create project or testcase.

**User - Submitter**

Submitter level user can view all the resources(pod, project, testcase, result, deploy result,
scenario). They can create/delete/modify pod and scenario.

If user want to create/modify/delete a project or testcase then user has to be in the Submitter
group for that specific project.

Currently, we can't create/modify/delete results or deploy results from the web portal.