Just testing first case
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
d5258e733a
commit
3ea2296444
|
|
@ -19,63 +19,67 @@ Get Status of the DHCP server
|
||||||
# Convertir la respuesta a JSON usando ${response.json()}
|
# Convertir la respuesta a JSON usando ${response.json()}
|
||||||
${json}= Set Variable ${response.json()}
|
${json}= Set Variable ${response.json()}
|
||||||
# Validar el estado de los servicios
|
# Validar el estado de los servicios
|
||||||
Should Be Equal ${json["services_status"]["tftpboot"]} active
|
Should Contain ${response.json()} success
|
||||||
Should Be Equal ${json["services_status"]["nginx"]} active
|
Should Contain ${response.json()} message
|
||||||
|
Should Contain ${response.json()['message']} disk_usage
|
||||||
|
Should Contain ${response.json()['message']} subnets
|
||||||
|
Should Contain ${response.json()['message']['disk_usage']} total
|
||||||
|
|
||||||
Get all subnets
|
|
||||||
[Documentation] Get all subnets
|
|
||||||
[Tags] subnets
|
|
||||||
${response}= GET ${BASE_URL}/subnets
|
|
||||||
Status Should Be 200
|
|
||||||
# Convertir la respuesta a JSON usando ${response.json()}
|
|
||||||
${json}= Set Variable ${response.json()}
|
|
||||||
# Obtener la longitud del arreglo JSON
|
|
||||||
${num_elements}= Get Length ${json}
|
|
||||||
# Validar el número de elementos
|
|
||||||
Should Be Equal As Numbers ${num_elements} 1
|
|
||||||
|
|
||||||
Post a new subnet
|
# Get all subnets
|
||||||
[Documentation] Post a new subnet
|
# [Documentation] Get all subnets
|
||||||
[Tags] subnets
|
# [Tags] subnets
|
||||||
${headers}= Create Dictionary Content-Type=application/json
|
# ${response}= GET ${BASE_URL}/subnets
|
||||||
${response}= POST ${BASE_URL}/subnets json=${new_subnet} headers=${headers}
|
# Status Should Be 200
|
||||||
Status Should Be 200
|
# # Convertir la respuesta a JSON usando ${response.json()}
|
||||||
${json}= Set Variable ${response.json()}
|
# ${json}= Set Variable ${response.json()}
|
||||||
Should Be Equal ${json["status"]} success
|
# # Obtener la longitud del arreglo JSON
|
||||||
Should Be Equal ${json["message"]} Subred creada correctamente
|
# ${num_elements}= Get Length ${json}
|
||||||
Should Be Equal ${json["subnetId"]} 2
|
# # Validar el número de elementos
|
||||||
|
# Should Be Equal As Numbers ${num_elements} 1
|
||||||
|
|
||||||
Modify a new subnet by id
|
# Post a new subnet
|
||||||
[Documentation] Modify a subnet by id
|
# [Documentation] Post a new subnet
|
||||||
[Tags] subnets
|
# [Tags] subnets
|
||||||
|
# ${headers}= Create Dictionary Content-Type=application/json
|
||||||
|
# ${response}= POST ${BASE_URL}/subnets json=${new_subnet} headers=${headers}
|
||||||
|
# Status Should Be 200
|
||||||
|
# ${json}= Set Variable ${response.json()}
|
||||||
|
# Should Be Equal ${json["status"]} success
|
||||||
|
# Should Be Equal ${json["message"]} Subred creada correctamente
|
||||||
|
# Should Be Equal ${json["subnetId"]} 2
|
||||||
|
|
||||||
|
# Modify a new subnet by id
|
||||||
|
# [Documentation] Modify a subnet by id
|
||||||
|
# [Tags] subnets
|
||||||
|
|
||||||
# Modificar la subred con id=2
|
# # Modificar la subred con id=2
|
||||||
${response}= PUT ${BASE_URL}/subnets/2 json=${modified_subnet} headers=${headers}
|
# ${response}= PUT ${BASE_URL}/subnets/2 json=${modified_subnet} headers=${headers}
|
||||||
Status Should Be 200
|
# Status Should Be 200
|
||||||
|
|
||||||
# Verificar la respuesta del PUT
|
# # Verificar la respuesta del PUT
|
||||||
${json}= Set Variable ${response.json()}
|
# ${json}= Set Variable ${response.json()}
|
||||||
Should Be Equal ${json["status"]} success
|
# Should Be Equal ${json["status"]} success
|
||||||
Should Be Equal ${json["message"]} Subred modificada correctamente
|
# Should Be Equal ${json["message"]} Subred modificada correctamente
|
||||||
Should Be Equal ${json["subnetId"]} 2
|
# Should Be Equal ${json["subnetId"]} 2
|
||||||
|
|
||||||
# Obtener todas las subredes y verificar si la subred fue modificada
|
# # Obtener todas las subredes y verificar si la subred fue modificada
|
||||||
${response_all}= GET ${BASE_URL}/subnets
|
# ${response_all}= GET ${BASE_URL}/subnets
|
||||||
Status Should Be 200
|
# Status Should Be 200
|
||||||
${json_all}= Set Variable ${response_all.json()}
|
# ${json_all}= Set Variable ${response_all.json()}
|
||||||
|
|
||||||
# Iterar sobre todas las subredes para encontrar la subred con id=2 y verificar su máscara
|
# # Iterar sobre todas las subredes para encontrar la subred con id=2 y verificar su máscara
|
||||||
FOR ${subnet} IN @{json_all}
|
# FOR ${subnet} IN @{json_all}
|
||||||
Run Keyword If '${subnet["id"]}' == '2' Should Be Equal ${subnet["mask"]} 255.255.192.0
|
# Run Keyword If '${subnet["id"]}' == '2' Should Be Equal ${subnet["mask"]} 255.255.192.0
|
||||||
END
|
# END
|
||||||
|
|
||||||
Delete a new subnet by id
|
# Delete a new subnet by id
|
||||||
[Documentation] Delete a subnet by id
|
# [Documentation] Delete a subnet by id
|
||||||
[Tags] subnets
|
# [Tags] subnets
|
||||||
${response}= DELETE ${BASE_URL}/subnets/2 headers=${headers}
|
# ${response}= DELETE ${BASE_URL}/subnets/2 headers=${headers}
|
||||||
Status Should Be 200
|
# Status Should Be 200
|
||||||
${json}= Set Variable ${response.json()}
|
# ${json}= Set Variable ${response.json()}
|
||||||
Should Be Equal ${json["status"]} success
|
# Should Be Equal ${json["status"]} success
|
||||||
Should Be Equal ${json["message"]} Subred eliminada correctamente
|
# Should Be Equal ${json["message"]} Subred eliminada correctamente
|
||||||
Should Be Equal ${json["subnetId"]} 2
|
# Should Be Equal ${json["subnetId"]} 2
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue