Isabel Arrans
b11608152e
#915 restore more tests
2020-10-24 12:53:11 +02:00
Diego Crespo Quinta
45711db04f
#915 Fix expected returned codes in GET /session and GET /software tests
...
Fix incorrect status code.
2020-10-22 22:37:36 +02:00
Diego Crespo Quinta
1d451acff5
#915 Fix several test errors
...
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.
2020-10-22 18:58:56 +02:00
Roberto Hueso Gómez
abd2b913d8
#915 Test malformed payload for POST commands
...
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.
2019-11-14 14:51:13 +01:00
Roberto Hueso Gómez
1cdbc5facf
#915 Test malformed payload for POST /shell/run
...
This test covers requests that do not contain 1 of the parameters in their
payloads.
2019-11-13 14:16:02 +01:00
Roberto Hueso Gómez
682d3b6b17
#915 Test malformed payload for POST /wol
...
This test covers requests that do not contain 1 of the parameters in their
payloads.
2019-11-13 14:16:01 +01:00
Roberto Hueso Gómez
4d98bdf5f6
#915 Test malformed payload for POST /clients
...
This test covers requests that do not contain 1 of the parameters in their
payloads.
2019-11-13 14:15:58 +01:00
Roberto Hueso Gómez
65cc7c17e2
#915 Extend REST API POST no payload tests to all remaining tests.
...
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
2019-11-13 14:15:56 +01:00
Roberto Hueso Gómez
6c91d147c1
#915 Rename POST /image/setup for /setup in REST API
...
This patch renames the setup command to avoid semantic confusion.
2019-11-13 14:15:43 +01:00
Roberto Hueso Gómez
ee2e16ac96
#915 Adapt POST /shell/run test to the 'echo' parameter
2019-11-12 21:37:11 +01:00
Roberto Hueso Gómez
64b470514b
#915 Fix ogAdmServer POST /software test parameters
...
This patch adds missing parameters to the test JSON.
2019-11-06 11:16:22 +01:00
Roberto Hueso Gómez
2bc2490d00
#915 Add test for POST /run/schedule REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
1f55beb8f5
#915 Add test for POST /image/restore/incremental REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
20f935bb65
#915 Add test for POST /image/restore/basic REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
b5722de3fb
#915 Add test for POST /image/create/incremental REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
713070ab10
#915 Add test for POST /image/create/basic REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
1436d44cc6
#915 Add test for POST /image/setup REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
ba3b1ad543
#915 Add test for POST /image/restore REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
b4d2890460
#915 Add test for POST /image/create REST API
...
This test covers 3 scenarios:
1. Correct usage.
2. Incorrect usage, without payload.
3. Incorrect usage, use this command with GET.
2019-10-31 13:18:48 +01:00
Roberto Hueso Gómez
c1c89e196c
#915 : Return 400 status code in POST methods when no payload is attached
...
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.
2019-09-19 16:06:03 +02:00
Roberto Hueso Gómez
55edb404b7
#915 : Fix incorrect method and code in invalid GET requests
...
Some tests should perform GET requests however they incorrectly use POST.
Return codes for these tests have also been fixed.
2019-09-18 17:40:41 +02:00
Roberto Hueso Gómez
72b6c26a49
#915 : Remove duplicated test
...
This test is already performed in test_0001_get_clients.py
2019-09-18 17:40:41 +02:00
Roberto Hueso Gómez
741524f59b
#915 : more descriptive function name in test
...
This test sends a POST with no body, which is illegal, use a function
name that describes this.
2019-09-18 17:40:41 +02:00
Javier Sánchez Parra
46d791ae44
#915 add test for too large HTTP request fields
...
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.
2019-09-10 11:10:34 +02:00
Javier Sánchez Parra
784495f5d5
#915 adds test for too large HTTP request
...
This test checks for too large HTTP requests, for example:
POST /clients
with a body of 4096 bytes.
2019-09-04 20:13:11 +02:00
Javier Sánchez Parra
e397e7930f
#915 add missing brackets to WOL API test json
...
Without the brackets the call works (200 response) but the ogAdmServer
does not send the WOL packets.
2019-08-28 17:53:19 +02:00
Javier Sánchez Parra
8903c6819e
#915 adds tests for a non existent method
...
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.
2019-07-15 09:53:40 +02:00
Javier Sánchez Parra
9c7954b4cc
#915 adds test for POST /software REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:51:22 +02:00
Javier Sánchez Parra
022774b255
#915 adds test for POST /hardware REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:51:03 +02:00
Javier Sánchez Parra
e46b09ba2c
#915 adds test for POST /refresh REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:50:43 +02:00
Javier Sánchez Parra
84c4544f61
#915 adds test for POST /stop REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:50:21 +02:00
Javier Sánchez Parra
5ea87f3c92
#915 adds test for POST /reboot REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:49:51 +02:00
Javier Sánchez Parra
a914462bbf
#915 adds test for POST /poweroff REST API
...
This test covers two two scenarios:
1. Correct usage.
2. Incorrect usage, use this command with GET (this returns http 405).
2019-07-15 09:49:04 +02:00
Javier Sánchez Parra
a887c7b4c8
#915 tests correct command, /session
...
This should test /shell/run instead of /session
2019-07-15 09:47:38 +02:00
Javier Sánchez Parra
880cc90c14
#915 Improve test output using unittest discover
...
* Call the tests with python module unittest. In particular, the
discover function.
* Rename tests files to meet the default requirements of discover
function.
2019-07-05 17:41:26 +02:00
Javier Sánchez Parra
eae2385f67
#915 Add API token to tests in ogAdmServer/tests/units/*
...
Add token parameter in REST API test infrastructure.
2019-06-24 13:50:43 +02:00
Javier Sánchez Parra
b35438d27e
#915 add test for POST /session REST API
2019-05-31 11:39:43 +02:00
Javier Sánchez Parra
496f5ebb49
#915 add test for POST /shell/output REST API
2019-05-31 11:39:29 +02:00
Javier Sánchez Parra
5312e73c91
#915 add test for POST /shell/run REST API
2019-05-31 11:39:06 +02:00
Javier Sánchez Parra
556aa6b858
#915 add test for POST /wol REST API
2019-05-31 11:39:01 +02:00
Javier Sánchez Parra
c39b1f324e
#915 add test for POST /clients REST API
2019-05-31 11:38:57 +02:00
Javier Sánchez Parra
1af2f4b55e
#915 add test for GET /clients REST API
2019-05-31 11:38:52 +02:00