summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* #915 add test for too large HTTP request fieldsJavier Sánchez Parra2019-09-101-0/+29
| | | | | | | This test checks for wrong headers HTTP requests: 1. POST /clients with a content length larger than a signed int. 2. POST /clients with an auth token larger than 63 characters.
* #915 adds test for too large HTTP requestJavier Sánchez Parra2019-09-041-0/+19
| | | | | | | | This test checks for too large HTTP requests, for example: POST /clients with a body of 4096 bytes.
* #915 check ogAdmServer binary existence when running pythong testsJavier Sánchez Parra2019-08-281-0/+4
| | | | | | | | | | | Currently, if you try to run the python test without the ogAdmServer binary, it will throw an exception. This patch adds a check to ensure the existence of the ogAdmServer binary at the beginning of the script. # python3 run-tests.py You need to build the ogAdmServer binary to run these tests :-)
* #915 add missing brackets to WOL API test jsonJavier Sánchez Parra2019-08-281-2/+2
| | | | | Without the brackets the call works (200 response) but the ogAdmServer does not send the WOL packets.
* #915 adds tests for a non existent methodJavier Sánchez Parra2019-07-151-0/+30
| | | | | | | | | This test adds four new error test cases: 1. Non existent method with POST. 2. Non existent method with GET. 3. Non existent method with POST but with wrong API token. 4. Non existent method with POST but without json.
* #915 adds test for POST /software REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 adds test for POST /hardware REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 adds test for POST /refresh REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 adds test for POST /stop REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 adds test for POST /reboot REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 adds test for POST /poweroff REST APIJavier Sánchez Parra2019-07-151-0/+20
| | | | | | | This test covers two two scenarios: 1. Correct usage. 2. Incorrect usage, use this command with GET (this returns http 405).
* #915 tests correct command, /sessionJavier Sánchez Parra2019-07-151-1/+1
| | | | This should test /shell/run instead of /session
* #915 Improve test output using unittest discoverJavier Sánchez Parra2019-07-057-2/+1
| | | | | | | | * Call the tests with python module unittest. In particular, the discover function. * Rename tests files to meet the default requirements of discover function.
* #915 add POST software command to REST API in ogAdmServerOpenGnSys Support Team2019-07-031-0/+1
| | | | | | | | | | | | | This patch implements the command "software" that fetches the software configuration from the clients. Request: POST /software {"clients" : [ "192.168.2.1", "192.168.2.2" ]} Reply: 200 OK This allows to refresh the software inventory from clients.
* #915 add POST hardware command to REST API in ogAdmServerOpenGnSys Support Team2019-07-031-0/+1
| | | | | | | | | | | | | This patch implements the command "hardware" that fetches the hardware configuration from the clients. Request: POST /hardware {"clients" : [ "192.168.2.1", "192.168.2.2" ]} Reply: 200 OK This allows to refresh the hardware inventory from clients.
* #915 Add API token to tests in ogAdmServer/tests/units/*Javier Sánchez Parra2019-06-246-12/+20
| | | | Add token parameter in REST API test infrastructure.
* #915 add support for HTTP AuthorizationOpenGnSys Support Team2019-06-242-10/+13
| | | | Add APITOKEN= field to ogAdmServer.cfg to specify the REST API key.
* #915 Remove unnecessary return in ogAdmServer/tests/run-tests.pyJavier Sánchez Parra2019-06-121-4/+0
| | | | No need to explicit return call, remove it.
* #915 add test for POST /session REST APIJavier Sánchez Parra2019-05-311-0/+20
|
* #915 add test for POST /shell/output REST APIJavier Sánchez Parra2019-05-311-0/+18
|
* #915 add test for POST /shell/run REST APIJavier Sánchez Parra2019-05-311-0/+18
|
* #915 add test for POST /wol REST APIJavier Sánchez Parra2019-05-311-0/+20
|
* #915 add test for POST /clients REST APIJavier Sánchez Parra2019-05-311-0/+19
|
* #915 add test for GET /clients REST APIJavier Sánchez Parra2019-05-311-0/+18
|
* #915 add unit test infrastructure for REST APIJavier Sánchez Parra2019-05-312-0/+49
| | | | | | | | | This python script creates a database and starts ogAdmServer to run the tests. This requires root to be launched: # ./run-tests.py From the 'tests' folder.
* #915 add POST refresh command to REST API in ogAdmServerOpenGnSys Support Team2019-05-301-0/+1
| | | | | | | | | | | | | Forces client to fetch and run any pending command from the server, reload its local configuration file and re-start its selection menu. curl -X POST http://127.0.0.1:8888/refresh -d @refresh.json Request POST /refresh {"clients": [ "192.168.2.1" ] } Reply: 200 OK
* #915 add POST stop command to REST API in ogAdmServerOpenGnSys Support Team2019-05-302-0/+2
| | | | | | | | | | | | Stop the menu selection on client (through POST method): curl -X POST http://127.0.0.1:8888/stop -d @stop.json Request POST /stop {"clients": [ "192.168.2.1" ] } Reply: 200 OK
* #915 add POST reboot command to REST API in ogAdmServerOpenGnSys Support Team2019-05-302-0/+2
| | | | | | | | | | | | Reboot a client (through POST method): curl -X POST http://127.0.0.1:8888/reboot -d @reboot.json Request POST /reboot {"clients": [ "192.168.2.1" ] } Reply: 200 OK
* #915 add POST poweroff command to REST API in ogAdmServerOpenGnSys Support Team2019-05-302-0/+2
| | | | | | | | | | | | Power off a client (through POST method): curl -X POST http://127.0.0.1:8888/poweroff -d @poweroff.json Request POST /poweroff {"clients": [ "192.168.2.1" ] } Reply: 200 OK
* #915 add POST session command to REST API in ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
| | | | | | | | | | | | Start a session on client (through POST method): curl -X POST http://127.0.0.1:8888/session -d @session.json Request POST /session {"clients": [ "192.168.2.1" ] } Reply: 200 OK
* #915 add POST shell/output command to REST API in ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
| | | | | | | | | | | | | Fetching result from run command on client (through GET method): curl -X POST http://127.0.0.1:8888/shell/output -d @post_shell_output.json Request POST /shell/output {"clients": [ "192.168.2.1" ] } Reply: 200 OK {"clients": [ { "addr" : "192.168.2.1", "output" : "..." } ] }
* #915 add run command to REST API in ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
| | | | | | | | | | | | Run command on client (through POST method): curl -X POST http://127.0.0.1:8888/shell/run -d @post_run.json Request POST /shell/run {"clients": [ "192.168.2.1", "192.168.2.2" ], "run" : "ls" } Reply: 200 OK
* #915 add wol command to REST API in ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
| | | | | | | | | | Send Wake-On-Lan to clients (through POST method): Request: curl -X POST http://127.0.0.1:8888/wol { "type" : "unicast", "clients" : [ { "addr" : "192.168.2.1", "mac" : "00AABBCCDD01" } ] } Reply: 200 OK
* #915 add clients command to REST API in ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
| | | | | | | | | | | | Request for existing clients: curl -X GET http://127.0.0.1:8888/clients Request: GET /clients Reply: 200 OK {"clients": [ { "addr" : "192.168.2.1", "state" : "OPG" }, { "addr" : "192.168.2.2", "state" : "OFF" }]}
* #915 add initial REST API for ogAdmServerOpenGnSys Support Team2019-05-272-0/+2
Add REST API for ogAdmServer, this API is exposed through port 8888 on the system that runs the ogAdmServer. The body of the HTTP message is expressed in JSON format. This patch implements the command "clients" that maps to the existing legacy "Sondeo" command, that is used by the web interface to poll refresh the client state. This patch also includes an initial test infrastructure using 'curl' to send commands to the new REST API. Request: POST /clients {"clients" : [ "192.168.2.1", "192.168.2.2" ]} Reply: 200 OK This allows to refresh the status of the list of clients.