refs #812 Adds host schema, adds subnet call to the subnet schema, deletes some output error in API Robot
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
parent
db9ce9c90e
commit
72d5240932
|
|
@ -6,6 +6,21 @@ nelmio_api_doc:
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
Host:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
hostname:
|
||||||
|
type: string
|
||||||
|
description: The hostname of the device
|
||||||
|
example: "pc11"
|
||||||
|
hw-address:
|
||||||
|
type: string
|
||||||
|
description: The hardware address (MAC)
|
||||||
|
example: "56:6f:c7:4f:00:4f"
|
||||||
|
ip-address:
|
||||||
|
type: string
|
||||||
|
description: The IP address assigned to the host
|
||||||
|
example: "192.168.5.11"
|
||||||
Subnet:
|
Subnet:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -15,18 +30,19 @@ nelmio_api_doc:
|
||||||
subnet:
|
subnet:
|
||||||
type: string
|
type: string
|
||||||
description: The name of the subnet
|
description: The name of the subnet
|
||||||
nextServer:
|
next-server:
|
||||||
type: string
|
type: string
|
||||||
description: The next server in the subnet
|
description: The next server in the subnet
|
||||||
bootFileName:
|
boot-file-name:
|
||||||
type: string
|
type: string
|
||||||
description: The boot file name for the subnet
|
description: The boot file name for the subnet
|
||||||
reservations:
|
reservations:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
$ref: '#/components/schemas/Host'
|
||||||
description: The reservations in the subnet
|
description: The reservations in the subnet
|
||||||
|
|
||||||
|
|
||||||
areas: # to filter documented areas
|
areas: # to filter documented areas
|
||||||
path_patterns:
|
path_patterns:
|
||||||
- ^/ogdhcp/ # Accepts routes under /api except /api/doc
|
- ^/ogdhcp/ # Accepts routes under /api except /api/doc
|
||||||
|
|
|
||||||
|
|
@ -306,13 +306,7 @@ public function getSubnets(): JsonResponse
|
||||||
* @OA\JsonContent(
|
* @OA\JsonContent(
|
||||||
* type="object",
|
* type="object",
|
||||||
* @OA\Property(property="success", type="string", example="Subnet added successfully"),
|
* @OA\Property(property="success", type="string", example="Subnet added successfully"),
|
||||||
* @OA\Property(property="message", type="object",
|
* @OA\Property(property="message", ref="#/components/schemas/Subnet")
|
||||||
* @OA\Property(property="subnetId", type="integer", example=2),
|
|
||||||
* @OA\Property(property="subnet", type="string", example="192.168.1.0/24"),
|
|
||||||
* @OA\Property(property="nextServer", type="string", example="192.168.1.1"),
|
|
||||||
* @OA\Property(property="bootFileName", type="string", example="pxelinux.0"),
|
|
||||||
* @OA\Property(property="reservations", type="array", @OA\Items(type="object"))
|
|
||||||
* )
|
|
||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Post a new subnet
|
||||||
... nextServer=192.168.2.1
|
... nextServer=192.168.2.1
|
||||||
... bootFileName=pxelinux.0
|
... bootFileName=pxelinux.0
|
||||||
${headers}= Create Dictionary Content-Type=application/json
|
${headers}= Create Dictionary Content-Type=application/json
|
||||||
${response}= POST ${BASE_URL}/subnets json=${new_subnet} headers=${headers} expected_status=200
|
${response}= POST ${BASE_URL}/subnets json=${new_subnet} headers=${headers}
|
||||||
Status Should Be 200 ${response}
|
Status Should Be 200 ${response}
|
||||||
${json}= Convert to Dictionary ${response.json()}
|
${json}= Convert to Dictionary ${response.json()}
|
||||||
Dictionary Should Contain Key ${json} success
|
Dictionary Should Contain Key ${json} success
|
||||||
|
|
@ -87,7 +87,7 @@ Post a new subnet with existing id
|
||||||
Status Should Be 400 ${response}
|
Status Should Be 400 ${response}
|
||||||
${json}= Convert to Dictionary ${response.json()}
|
${json}= Convert to Dictionary ${response.json()}
|
||||||
Dictionary Should Contain Key ${json} error
|
Dictionary Should Contain Key ${json} error
|
||||||
Should Contain ${response.json()["error"]} Error: La subred con el id '${valid_net_id}' ya existe.
|
Should Contain ${response.json()["error"]} La subred con el id '${valid_net_id}' ya existe.
|
||||||
|
|
||||||
Post a new subnet with existing address
|
Post a new subnet with existing address
|
||||||
[Documentation] Post a new subnet with invalid data
|
[Documentation] Post a new subnet with invalid data
|
||||||
|
|
@ -104,7 +104,7 @@ Post a new subnet with existing address
|
||||||
Status Should Be 400 ${response}
|
Status Should Be 400 ${response}
|
||||||
${json}= Convert to Dictionary ${response.json()}
|
${json}= Convert to Dictionary ${response.json()}
|
||||||
Dictionary Should Contain Key ${json} error
|
Dictionary Should Contain Key ${json} error
|
||||||
Should Contain ${response.json()['error']} Error: La subred con la dirección '192.168.1.0/24' ya existe
|
Should Contain ${response.json()['error']} La subred con la dirección '192.168.1.0/24' ya existe
|
||||||
|
|
||||||
|
|
||||||
Modify an existing subnet by id
|
Modify an existing subnet by id
|
||||||
|
|
@ -169,7 +169,7 @@ Modify subnet with invalid configuration address without netmask
|
||||||
${json}= Convert To Dictionary ${response.json()}
|
${json}= Convert To Dictionary ${response.json()}
|
||||||
|
|
||||||
# Verificar que la respuesta contiene el error esperado
|
# Verificar que la respuesta contiene el error esperado
|
||||||
Should Be Equal ${json['error']} Error: La máscara de red es requerida con el parametro 'address'
|
Should Be Equal ${json['error']} La máscara de red es requerida con el parametro 'address'
|
||||||
|
|
||||||
Modify subnet with invalid configuration netmask without addres
|
Modify subnet with invalid configuration netmask without addres
|
||||||
[Documentation] Este test verifica que la modificación falla cuando hay un error en la configuración de Kea DHCP.
|
[Documentation] Este test verifica que la modificación falla cuando hay un error en la configuración de Kea DHCP.
|
||||||
|
|
@ -185,7 +185,7 @@ Modify subnet with invalid configuration netmask without addres
|
||||||
${json}= Convert To Dictionary ${response.json()}
|
${json}= Convert To Dictionary ${response.json()}
|
||||||
|
|
||||||
# Verificar que la respuesta contiene el error esperado
|
# Verificar que la respuesta contiene el error esperado
|
||||||
Should Be Equal ${json['error']} Error: La dirección de red es requerida con el parametro 'mask'
|
Should Be Equal ${json['error']} La dirección de red es requerida con el parametro 'mask'
|
||||||
|
|
||||||
Delete subnet by id
|
Delete subnet by id
|
||||||
[Documentation] Este test verifica que la subred se elimina correctamente con el código 200.
|
[Documentation] Este test verifica que la subred se elimina correctamente con el código 200.
|
||||||
|
|
@ -209,7 +209,7 @@ Delete subnet - Error: wrong subnet Id
|
||||||
# Verificar que la respuesta contiene la clave 'error'
|
# Verificar que la respuesta contiene la clave 'error'
|
||||||
Dictionary Should Contain Key ${json} error
|
Dictionary Should Contain Key ${json} error
|
||||||
# Validar el mensaje de error
|
# Validar el mensaje de error
|
||||||
Should Be Equal ${json['error']} Error: La subred con el id '999' no existe
|
Should Be Equal ${json['error']} La subred con el id '999' no existe
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue