From 6619c9053c3c179d9dde9dfc9db054f6489bf31f Mon Sep 17 00:00:00 2001 From: Sam Hague Date: Wed, 8 Nov 2017 11:25:25 -0500 Subject: [PATCH 1/1] Reduce logging in SG suite Change-Id: I54d4f3382f2360cb7e7f96bb231f8c84a43a0b13 Signed-off-by: Sam Hague --- .../Neutron_Security_Group.robot | 60 ++----------------- 1 file changed, 5 insertions(+), 55 deletions(-) diff --git a/csit/suites/openstack/NeutronSecurityGrp/Neutron_Security_Group.robot b/csit/suites/openstack/NeutronSecurityGrp/Neutron_Security_Group.robot index a61171cf5b..5808de77b5 100644 --- a/csit/suites/openstack/NeutronSecurityGrp/Neutron_Security_Group.robot +++ b/csit/suites/openstack/NeutronSecurityGrp/Neutron_Security_Group.robot @@ -45,78 +45,51 @@ ${INVALID_PORT_RANGE_MIN} Invalid value for port TC01_Update Security Group description and Name [Documentation] This test case validates the security group creation with optional parameter description, Update Security Group description and name [Tags] Regression - Log "Creating security Group and verification" Create Security Group and Validate ${SGP_SSH[0]} - Log "Creating security Rule and verification" Create Security Rule and Validate ${SGP_SSH[0]} direction=${ADD_PARAMS[0]} ethertype=${ADD_PARAMS[1]} port_range_max=${ADD_PARAMS[3]} port_range_min=${ADD_PARAMS[2]} protocol=${ADD_PARAMS[4]} - Log "Fetching the flows from DPN1 and DPN2" Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} - Log "Creating neutron setup as network subnet port" Neutron Setup Creation ${NETWORK[0]} ${SUBNET[0]} ${IP_SUBNET[0]} ${PORT[0]} ${PORT[1]} ${SECURITY_GROUPS} ... ${SGP_ID} - Log "Security group verification on Neutron port" Security group verification on Neutron port ${PORT[0]} ${SGP_ID} Security group verification on Neutron port ${PORT[1]} ${SGP_ID} - Log "Update Security Group Description and Verification" Update Security Group Description and Verification ${SGP_ID} ${DESCRIPTION} ${VERIFY_DESCRIPTION} - Log "Update Security Group Name and Verification" Update Security Group Name and Verification ${SGP_ID} ${NAME_UPDATE} ${VERIFY_NAME} TC02_Create Security Rule with port_range_min > port_range_max [Documentation] This test case validates the security group and rule creation with optional parameters Create Security Rule with port_range_min greater than port_range_max [Tags] Regression - Log "Creating security Group and verification" Create Security Group and Validate ${SGP_SSH[1]} - Log "Fetching the flows from DPN1 and DPN2" Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} - Log "Neutron Rule Creation With Port Range Min Grt Port Range Max and Validation" Neutron Rule Creation With Invalid Parameters ${SGP_SSH[1]} ${ADD_ARG_SSH5} ${PORT_RANGE_ERROR} TC03_Create Security Rule with port_range_min = -1 [Documentation] This test case validates the security group and rule creation with optional parameters, Create Security Rule with port_range_min = -1 [Tags] Regression - Log "Creating security Group and verification" Create Security Group and Validate ${SGP_SSH[2]} - Log "Fetching the flows from DPN1 and DPN2" Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} - Log "Neutron Rule Creation With Port Range Min Grt Port Range Max and Validation" Neutron Rule Creation With Invalid Parameters ${SGP_SSH[2]} ${ADD_ARG_SSH6} ${INVALID_PORT_RANGE_MIN} TC04_Create Security Rule with port_range_max = -1 [Documentation] This test case validates the security group and rule creation with optional parameters, Create Security Rule with port_range_max = -1 [Tags] Regression - Log "Creating security Group and verification" Create Security Group and Validate ${SGP_SSH[3]} - Log "Fetching the flows from DPN1 and DPN2" Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} - Log "Neutron Rule Creation With Port Range Min Grt Port Range Max and Validation" Neutron Rule Creation With Invalid Parameters ${SGP_SSH[3]} ${ADD_ARG_SSH7} ${INVALID_PORT_RANGE_MIN} *** Keywords *** Get Flows [Arguments] ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} [Documentation] Get the Flows from DPN1 and DPN2 - Log "Fetching the flows from DPN1" - ${resp}= Run Command On Remote System ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 - Log ${resp} - Log "Fetching the Groups from DPN1" - ${resp}= Run Command On Remote System ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 - Log ${resp} - Log "Fetching the flows from DPN2" - ${resp}= Run Command On Remote System ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 - Log ${resp} - Log "Fetching the Groups from DPN2" - ${resp}= Run Command On Remote System ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 - Log ${resp} + ${resp}= Run Command On Remote System And Log ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 + ${resp}= Run Command On Remote System And Log ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 + ${resp}= Run Command On Remote System And Log ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 + ${resp}= Run Command On Remote System And Log ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 Create Security Group and Validate [Arguments] ${SGP_SSH} [Documentation] Create Security Group and Validate - Log "Creating security Group" ${OUTPUT} ${SGP_ID} Neutron Security Group Create ${SGP_SSH} Set Global Variable ${SGP_ID} - Log ${OUTPUT} - Log ${SGP_ID} Log "Verifying the security group" ${resp} RequestsLibrary.Get Request session ${SEC_GROUP} Log ${resp.content} @@ -126,12 +99,8 @@ Create Security Group and Validate Create Security Rule and Validate [Arguments] ${SGP_SSH} &{Kwargs} [Documentation] Create Security Rule and Validate - Log "Creating the Rules for SSH groups" ${OUTPUT} ${RULE_ID} Neutron Security Group Rule Create ${SGP_SSH} - Log ${OUTPUT} - Log ${RULE_ID} Set Global Variable ${RULE_ID} - Log "Verifying the security Rule" ${resp} RequestsLibrary.Get Request session ${SEC_RULE} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} ${RESP_CODE} @@ -141,49 +110,33 @@ Neutron Setup Creation [Arguments] ${NETWORK} ${SUBNET} ${IP_SUBNET} ${PORT1} ${PORT2} ${SECURITY_GROUPS} ... ${SGP_ID} [Documentation] Neutron Setup Creation - Log "Creating networks" ${net_id} Create Network ${NETWORK} - Log ${net_id} Set Global Variable ${net_id} - Log "Creating subnets" ${subnet_id} Create SubNet ${NETWORK} ${SUBNET} ${IP_SUBNET} - Log ${subnet_id} Set Global Variable ${subnet_id} ${ADD_ARGMS}= Set Variable ${SECURITY_GROUPS} ${SGP_ID} ${port_id} Create Neutron Port With Additional Params ${NETWORK} ${PORT1} ${ADD_ARGMS} - Log ${port_id} - Log "Creating ports" ${port_id} Create Neutron Port With Additional Params ${NETWORK} ${PORT2} ${ADD_ARGMS} - Log ${port_id} Security group verification on Neutron port [Arguments] ${PORT} ${SGP_ID} [Documentation] Security group verification on Neutron port - Log "security group verification" ${PORT_SHOW} Neutron Port Show ${PORT} - Log ${PORT_SHOW} Should Contain ${PORT_SHOW} ${SGP_ID} Update Security Group Description and Verification [Arguments] ${SGP_ID} ${DESCRIPTION} ${VERIFY_DESCRIPTION} [Documentation] Update Security Group Description and Verification - Log "Update Security Group Description" ${output} Neutron Security Group Update ${SGP_ID} ${DESCRIPTION} - Log "Verification of Description" ${output} Neutron Security Group Show ${SGP_ID} - Log ${output} Should Contain ${output} ${VERIFY_DESCRIPTION} Update Security Group Name and Verification [Arguments] ${SGP_ID} ${NAME_UPDATE} ${VERIFY_NAME} [Documentation] Update Security Group Name and Verification - Log "Update Security Group Name" ${output} Neutron Security Group Update ${SGP_ID} ${NAME_UPDATE} - Log "Verification of Updated Name" ${output} Neutron Security Group Show ${SGP_ID} - Log ${output} Should Contain ${output} ${VERIFY_NAME} - Log "Verification of Updated Name via Rest" ${resp} RequestsLibrary.Get Request session ${SEC_GROUP} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} ${RESP_CODE} @@ -192,11 +145,8 @@ Update Security Group Name and Verification Neutron Rule Creation With Invalid Parameters [Arguments] ${SecurityGroupName} ${additional_args} ${EXPECTED_ERROR} [Documentation] Neutron Rule Creation With Null Protocol - ${cmd}= Set Variable neutron security-group-rule-create ${SecurityGroupName} ${additional_args} - Log ${cmd} - ${rc} ${output}= Run And Return Rc And Output ${cmd} + ${rc} ${output}= Run And Return Rc And Output neutron security-group-rule-create ${SecurityGroupName} ${additional_args} Log ${output} - Log ${rc} Should Contain ${output} ${EXPECTED_ERROR} Close Connection [Return] ${output} -- 2.36.6