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
2f7e9da5ab
#915 Add POST "run/schedule" command to REST API in ogAdmServer
...
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.
2019-10-25 14:12:09 +02:00
Javier Sánchez Parra
90672e4a25
#915 Add test for POST /image/restore/incremental command
...
This test covers correction of the command.
2019-10-11 11:57:08 +02:00
Roberto Hueso Gómez
45f414e32c
#915 Add test for POST "image/create/incremental" command
...
This test covers correction of the command.
2019-10-11 11:57:08 +02:00
Javier Sánchez Parra
17eeac1284
#915 Add test for POST /image/restore/basic command
...
This test covers correction of the command.
2019-10-09 15:27:59 +02:00
Javier Sánchez Parra
74061887ee
#915 Add test for POST /image/create/basic command
...
This test covers correction of the command.
2019-10-08 14:01:14 +02:00
Roberto Hueso Gómez
ad4d4bdbbe
Add test for POST /image/create command
...
This test covers correction of the command.
2019-10-07 11:15:28 +02:00
OpenGnSys Support Team
e5cfdd6406
#915 : adapt test to use id and profile fields
...
Update restore_image.json to use id and profile fields.
2019-10-01 12:59:50 +02:00
Roberto Hueso Gómez
1dde02e1ab
#915 : Add POST /image/restore command to REST API in ogAdmServer
...
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
2019-10-01 12:56:10 +02:00
Roberto Hueso Gómez
1a8ada191f
#915 : Add POST /image/create command to REST API in ogAdmServer
...
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
2019-10-01 12:56:10 +02: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
882fec820e
#915 check ogAdmServer binary existence when running pythong tests
...
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 :-)
2019-08-28 17:54:57 +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
OpenGnSys Support Team
b4a9fddf30
#915 add POST software command to REST API in ogAdmServer
...
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.
2019-07-03 02:56:07 +02:00
OpenGnSys Support Team
6b30dbc65c
#915 add POST hardware command to REST API in ogAdmServer
...
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.
2019-07-03 02:56:07 +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
OpenGnSys Support Team
fd305405b7
#915 add support for HTTP Authorization
...
Add APITOKEN= field to ogAdmServer.cfg to specify the REST API key.
2019-06-24 13:42:25 +02:00
Javier Sánchez Parra
e45455ec82
#915 Remove unnecessary return in ogAdmServer/tests/run-tests.py
...
No need to explicit return call, remove it.
2019-06-12 11:02:47 +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
Javier Sánchez Parra
727a109f7d
#915 add unit test infrastructure for REST API
...
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.
2019-05-31 11:35:42 +02:00
OpenGnSys Support Team
17f55b41c3
#915 add POST refresh command to REST API in ogAdmServer
...
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
2019-05-30 15:32:24 +02:00