summaryrefslogtreecommitdiffstats
path: root/tests/units
Commit message (Collapse)AuthorAgeFilesLines
* #915 Add commands and procedures to procedure creationJavier Sánchez Parra2021-06-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the possibility to create a procedure with commands and other procedures integrated as steps. Note: "steps" parameter is optional and "steps" array object order defines execution order. Request: POST /procedure/add { "center": "1", "name": "procedure", "description": "My procedure", "steps": [ { "command": "wol", "params": { "type": "broadcast" } }, { "procedure": 22 }, { "command": "poweroff", "params": {} } ] } Response: 200 OK This commit also updates unit tests for /procedure/add POST method to include steps.
* #942 Add POST /procedure/add methodJavier Sánchez Parra2021-05-311-0/+39
| | | | | | | | | | | | | | | | | | | | | | This method adds a procedure associated with a center to the database. Required payload parameters are center and name, description is optional. Note: ogServer does not allow to add more than one procedure with the same name and center. Request: POST /procedure/add { "center": "1" "name": "procedure1" "description": "My procedure" } Response: 200 OK This commit also adds unit tests for /procedure/add POST method.
* #915 Add /room/add POST methodJavier Sánchez Parra2021-04-201-0/+47
| | | | | | | | | | | | | | | | | | | | | | | Adds POST method to add rooms (labs), required payload parameters are name, netmask and center; any additional attributes are optional. Required JSON: { "center": 0, "name": "classroom10", "netmask": "255.255.255.0" } Full JSON: { "center": 0, "name": "classroom11", "netmask": "255.255.255.0", "group": 0, "location": "First floor", "gateway": "192.168.56.1", "ntp": "hora.cica.es", "dns": "1.1.1.1", "remote": True } This commit also adds unit tests for /room/add POST method.
* #915 Add large HTTP response testJavier Sánchez Parra2021-04-191-0/+26
| | | | | | | | This commit adds a test for HTTP responses that are too large to fit in ogServer response buffer. It also moves the basic sql data used for the other tests to its own file, easing its reuse in several files.
* #915 Add GET /oglive/test REST API functionJavier Sánchez Parra2021-04-051-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function returns the installed and available ogLiveS in the server to be booted from. Request: GET /oglive/list NO BODY Response 200 OK { "oglive": [ { "distribution": "bionic", "kernel": "5.4.0-40-generic", "architecture": "amd64", "revision": "r20200629", "directory": "ogLive-5.4.0-r20200629", "iso": "ogLive-bionic-5.4.0-40-generic-amd64-r20200629.85eceaf.iso" }, { "distribution": "bionic", "kernel": "5.0.0-27-generic", "architecture": "amd64", "revision": "r20190830", "directory": "ogLive-5.0.0-r20190830", "iso": "ogLive-bionic-5.0.0-27-generic-amd64-r20190830.7208cc9.iso" } ], "default": 0 } This commit also adds tests for GET /oglive/test.
* #1004 Add GET /images testDiego Crespo Quinta2021-03-301-0/+25
| | | | Fix incorrect error if json is missing.
* Fix GET /hardware test urlDiego Crespo Quinta2021-03-231-2/+2
|
* #915 Fix big request testJavier Sánchez Parra2021-02-231-4/+2
| | | | | ogServer now responses with "413 Payload Too Large" when the payload is too large.
* #915 Fix test POST /wolJavier Sánchez Parra2021-02-231-2/+2
| | | | | | | Commit e4cb91b changed MAC and netmask retrieving, now ogServer take these addresses from the database instead of from the JSON. Remove MAC and netmask from the JSON body.
* #1022 increase maximum API REST request sizeOpenGnSys Support Team2021-02-041-1/+1
| | | | | Software inventory generates a request larger that 64 Kbytes. Rise the maximum API REST request size to 128 Kbytes.
* #915 add test POST /client/deleteIsabel Arrans2020-12-171-0/+25
|
* #915 Fix GET /software testDiego Crespo Quinta2020-12-151-1/+1
|
* #915 Fix test POST /client/addIsabel Arrans2020-12-151-6/+21
|
* #915 Fix GET /client/info testIsabel Arrans2020-12-151-1/+9
|
* #915 Add GET /software testDiego Crespo Quinta2020-12-122-5/+32
|
* #915 Add GET /hardware testDiego Crespo Quinta2020-12-122-3/+25
|
* #915 Test for GET /client/info and POST /client/addIsabel Arrans2020-12-112-0/+56
|
* #915 Add POST /mode testDiego Crespo Quinta2020-12-021-0/+30
|
* #915 Fix POST /setup testDiego Crespo Quinta2020-12-021-0/+1
| | | | Add new type field to json.
* #915 Test GET /scopesDiego Crespo Quinta2020-12-011-0/+25
| | | | And fix ogserver, report error if GET /scopes have a JSON body.
* #915 add GET /session testDiego Crespo Quinta2020-11-172-4/+25
|
* #915 test malformed body in GET /client/setupIsabel Arrans2020-11-101-0/+25
|
* #915 fix POST /hardware testIsabel Arrans2020-10-271-1/+1
|
* #915 restore more testsIsabel Arrans2020-10-245-51/+4
|
* #915 Fix expected returned codes in GET /session and GET /software testsDiego Crespo Quinta2020-10-222-2/+2
| | | | Fix incorrect status code.
* #915 Fix several test errorsDiego Crespo Quinta2020-10-226-153/+4
| | | | | | | | | | Test 0006: add json to GET /session and update expected return code. Test 0012: add json to GET /software and update expected return code (200), in this case json fields are integer, not string. Test 0020: remove it, /image/create/incremental does not exist anymore. Test 0021: same as before for /image/restore/basic Test 0022: same as before for /image/restore/incremental Test 0023: rename to test_0020.
* #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-131-2/+2
| | | | 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: 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 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.