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()}
|
||||
${json}= Set Variable ${response.json()}
|
||||
# Validar el estado de los servicios
|
||||
Should Be Equal ${json["services_status"]["tftpboot"]} active
|
||||
Should Be Equal ${json["services_status"]["nginx"]} active
|
||||
Should Contain ${response.json()} success
|
||||
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
|
||||
[Documentation] Post a new subnet
|
||||
[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
|
||||
# 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
|
||||
|
||||
Modify a new subnet by id
|
||||
[Documentation] Modify a subnet by id
|
||||
[Tags] subnets
|
||||
# Post a new subnet
|
||||
# [Documentation] Post a new subnet
|
||||
# [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
|
||||
${response}= PUT ${BASE_URL}/subnets/2 json=${modified_subnet} headers=${headers}
|
||||
Status Should Be 200
|
||||
# # Modificar la subred con id=2
|
||||
# ${response}= PUT ${BASE_URL}/subnets/2 json=${modified_subnet} headers=${headers}
|
||||
# Status Should Be 200
|
||||
|
||||
# Verificar la respuesta del PUT
|
||||
${json}= Set Variable ${response.json()}
|
||||
Should Be Equal ${json["status"]} success
|
||||
Should Be Equal ${json["message"]} Subred modificada correctamente
|
||||
Should Be Equal ${json["subnetId"]} 2
|
||||
# # Verificar la respuesta del PUT
|
||||
# ${json}= Set Variable ${response.json()}
|
||||
# Should Be Equal ${json["status"]} success
|
||||
# Should Be Equal ${json["message"]} Subred modificada correctamente
|
||||
# Should Be Equal ${json["subnetId"]} 2
|
||||
|
||||
# Obtener todas las subredes y verificar si la subred fue modificada
|
||||
${response_all}= GET ${BASE_URL}/subnets
|
||||
Status Should Be 200
|
||||
${json_all}= Set Variable ${response_all.json()}
|
||||
# # Obtener todas las subredes y verificar si la subred fue modificada
|
||||
# ${response_all}= GET ${BASE_URL}/subnets
|
||||
# Status Should Be 200
|
||||
# ${json_all}= Set Variable ${response_all.json()}
|
||||
|
||||
# Iterar sobre todas las subredes para encontrar la subred con id=2 y verificar su máscara
|
||||
FOR ${subnet} IN @{json_all}
|
||||
Run Keyword If '${subnet["id"]}' == '2' Should Be Equal ${subnet["mask"]} 255.255.192.0
|
||||
END
|
||||
# # Iterar sobre todas las subredes para encontrar la subred con id=2 y verificar su máscara
|
||||
# FOR ${subnet} IN @{json_all}
|
||||
# Run Keyword If '${subnet["id"]}' == '2' Should Be Equal ${subnet["mask"]} 255.255.192.0
|
||||
# END
|
||||
|
||||
Delete a new subnet by id
|
||||
[Documentation] Delete a subnet by id
|
||||
[Tags] subnets
|
||||
${response}= DELETE ${BASE_URL}/subnets/2 headers=${headers}
|
||||
Status Should Be 200
|
||||
${json}= Set Variable ${response.json()}
|
||||
Should Be Equal ${json["status"]} success
|
||||
Should Be Equal ${json["message"]} Subred eliminada correctamente
|
||||
Should Be Equal ${json["subnetId"]} 2
|
||||
# Delete a new subnet by id
|
||||
# [Documentation] Delete a subnet by id
|
||||
# [Tags] subnets
|
||||
# ${response}= DELETE ${BASE_URL}/subnets/2 headers=${headers}
|
||||
# Status Should Be 200
|
||||
# ${json}= Set Variable ${response.json()}
|
||||
# Should Be Equal ${json["status"]} success
|
||||
# Should Be Equal ${json["message"]} Subred eliminada correctamente
|
||||
# Should Be Equal ${json["subnetId"]} 2
|
||||
|
||||
|
|
Loading…
Reference in New Issue