summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* #942 Add REST API /schedule get functionRoberto Hueso Gómez2020-06-021-1/+1
|
* #942 Add support for scheduled tasks and commandsOpenGnSys Support Team2020-06-022-0/+2
| | | | | | | | | | | | | | | | | This field needs to be at least 31 bits long to store all days in a month. Other fields are also set to 32 bits because unsigned int length can change depending on the system. We also need to support the three ways that the ogAdmAgent and the WebConsole have to create an schedule. At first, we only supported the easiest method: * Hour, day, month and year -> 10:00, 28, february, 2020 This commit adds these two ways to create an schedule: * Hour, week day, month and year -> 10:00, Monday, february, 2020 * Hour, week, month and year -> 10:00, first week, february, 2020
* #942 Add /run/task to API RESTOpenGnSys Support Team2020-06-022-0/+2
| | | | | | | | | | | | | | | | | | This patch adds a new command to the REST API to run tasks. A task (tarea) is composed of procedures (procedimientos), each procedure is composed of commands (acciones) that are represented through legacy sockHidra parameters in the database. This results in iterating over the task (tareas_acciones) table in the database to fetch the list of procedures (procedimientos). Then, this iterates over the list commands that compose a procedures represented through procedimientos_acciones table. Finally, this builds and sends the sockHidra legacy message for the client. This patch includes an implementation of the Linux linked list.
* #915 Test malformed payload for POST commandsRoberto Hueso Gómez2019-11-1416-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | This patch includes tests for the remaining REST API commands: POST /shell/output POST /session POST /poweroff POST /reboot POST /stop POST /refresh POST /hardware POST /software POST /image/create POST /image/restore POST /setup POST /image/create/basic POST /image/create/incremental POST /image/restore/basic POST /image/restore/incremental POST /run/schedule This test covers requests that are missing one of the parameters in its payload.
* #915 Test malformed payload for POST /shell/runRoberto Hueso Gómez2019-11-131-0/+9
| | | | | This test covers requests that do not contain 1 of the parameters in their payloads.
* #915 Test malformed payload for POST /wolRoberto Hueso Gómez2019-11-131-0/+9
| | | | | This test covers requests that do not contain 1 of the parameters in their payloads.
* #915 Test malformed payload for POST /clientsRoberto Hueso Gómez2019-11-131-0/+4
| | | | | This test covers requests that do not contain 1 of the parameters in their payloads.
* #915 Extend REST API POST no payload tests to all remaining tests.Roberto Hueso Gómez2019-11-1311-0/+44
| | | | | | | | | | | | | | | | | This patch extends tests for requests without any payload in the following REST API POST functions: - /clients - /wol - /shell/run - /shell/output - /session - /poweroff - /reboot - /stop - /refresh - /hardware - /software
* #915 Rename POST /image/setup for /setup in REST APIRoberto Hueso Gómez2019-11-132-3/+3
| | | | This patch renames the setup command to avoid semantic confusion.
* #915 Adapt POST /shell/run test to the 'echo' parameterRoberto Hueso Gómez2019-11-121-1/+3
|
* #915 Fix ogAdmServer POST /software test parametersRoberto Hueso Gómez2019-11-061-1/+3
| | | | This patch adds missing parameters to the test JSON.
* #915 Add test for POST /run/schedule REST APIRoberto Hueso Gómez2019-10-311-0/+24
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/restore/incremental REST APIRoberto Hueso Gómez2019-10-311-0/+43
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/restore/basic REST APIRoberto Hueso Gómez2019-10-311-0/+41
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/create/incremental REST APIRoberto Hueso Gómez2019-10-311-0/+40
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/create/basic REST APIRoberto Hueso Gómez2019-10-311-0/+38
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/setup REST APIRoberto Hueso Gómez2019-10-311-0/+47
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/restore REST APIRoberto Hueso Gómez2019-10-311-0/+31
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add test for POST /image/create REST APIRoberto Hueso Gómez2019-10-311-0/+30
| | | | | | | | This test covers 3 scenarios: 1. Correct usage. 2. Incorrect usage, without payload. 3. Incorrect usage, use this command with GET.
* #915 Add POST "run/schedule" command to REST API in ogAdmServerRoberto Hueso Gómez2019-10-252-0/+2
| | | | | | | | | | | | | | | | | This patch implements the command "run/schedule" that kicks in pending commands execution. Request: POST /run/schedule { "clients": ["192.168.56.11"] } Reply: 200 OK This patch also adds a simple test to cover correction of the command.
* #915 Add test for POST /image/restore/incremental commandJavier Sánchez Parra2019-10-112-0/+2
| | | | This test covers correction of the command.
* #915 Add test for POST "image/create/incremental" commandRoberto Hueso Gómez2019-10-112-0/+2
| | | | This test covers correction of the command.
* #915 Add test for POST /image/restore/basic commandJavier Sánchez Parra2019-10-092-0/+2
| | | | This test covers correction of the command.
* #915 Add test for POST /image/create/basic commandJavier Sánchez Parra2019-10-082-0/+2
| | | | This test covers correction of the command.
* Add test for POST /image/create commandRoberto Hueso Gómez2019-10-072-0/+2
| | | | This test covers correction of the command.
* #915: adapt test to use id and profile fieldsOpenGnSys Support Team2019-10-011-1/+1
| | | | Update restore_image.json to use id and profile fields.
* #915: Add POST /image/restore command to REST API in ogAdmServerRoberto Hueso Gómez2019-10-012-0/+2
| | | | | | | | | | | This patch implements the command "image/create" that creates an image in a client. Request: POST /image/restore { "clients" : [ "192.168.56.11" ], "disk" : "1", "partition" : "1", "name" : "test", "repository" : "192.168.56.10", "type" : "UNICAST", "filesystem": "1", "image_id": "1"} Reply: 200 OK
* #915: Add POST /image/create command to REST API in ogAdmServerRoberto Hueso Gómez2019-10-012-0/+2
| | | | | | | | | | | This patch implements the command "image/create" that creates an image in a client. Request: POST /image/create { "clients" : [ "192.168.2.1" ], "disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.2" } Reply: 200 OK
* #915: Return 400 status code in POST methods when no payload is attachedRoberto Hueso Gómez2019-09-191-1/+1
| | | | | | | If no payload is attached to method that requires a payload, then the API returns a 400 status code (following RFC 7231) instead of the previous 404. test_0001_get_clients.py is also modified to fit the new status code.
* #915: Fix incorrect method and code in invalid GET requestsRoberto Hueso Gómez2019-09-184-8/+8
| | | | | Some tests should perform GET requests however they incorrectly use POST. Return codes for these tests have also been fixed.
* #915: Remove duplicated testRoberto Hueso Gómez2019-09-181-4/+0
| | | | This test is already performed in test_0001_get_clients.py
* #915: more descriptive function name in testRoberto Hueso Gómez2019-09-181-1/+1
| | | | | This test sends a POST with no body, which is illegal, use a function name that describes this.
* #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.