From 9bf140762ec676d1270443f5030bae04b3650e44 Mon Sep 17 00:00:00 2001 From: "priya.ramasubbu" Date: Wed, 21 Oct 2015 21:16:48 +0530 Subject: [PATCH] Vtn Manager Pathpolicy test in csit * Refactor Verify flows for the pathpolicy * Address review comments add as a dependent patch Change-Id: I3886402f8f0ba140d6db31fae37eefa46b144f9d Signed-off-by: priya.ramasubbu --- csit/libraries/VtnMaKeywords.robot | 36 +++++++++---------- .../010__vtn_manager_pathpolicy.robot | 4 +-- .../010__vtn_manager_pathpolicy.robot | 4 +-- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index af73b55ced..43581dfcbf 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -31,6 +31,9 @@ ${pathpolicy_topo_10} sudo mn --controller=remote,ip=${CONTROLLER} --custom t ${policy_id} 1 @{PATHPOLICY_ATTR} "id":"1" "type":"OF" "name":"s4-eth2" ${custom} ${CURDIR}/${CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH} +${in_port} 1 +${out_before_pathpolicy} output:2 +${out_after_pathpolicy} output:3 *** Keywords *** Start SuiteVtnMa @@ -135,25 +138,13 @@ Get a pathpolicy : FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR} \ should Contain ${resp.content} ${pathpolicyElement} -Verify flowEntryBeforePathPolicy - [Arguments] ${OF_VERSION} - [Documentation] Checking Flows on switch S1 and switch S3 before applying path policy - ${DUMPFLOWS}= Set Variable If "${OF_VERSION}"=="OF10" ${DUMPFLOWS_OF10} ${DUMPFLOWS_OF13} - write ${DUMPFLOWS} - ${result} Read Until mininet> - @{list_to_verify} Create List in_port=1 actions=output:2 actions=output:3 - : FOR ${flowverifyElement} IN @{list_to_verify} - \ should Contain ${result} ${flowverifyElement} - -Verify flowEntryAfterPathPolicy - [Arguments] ${OF_VERSION} +Verify flowEntryPathPolicy + [Arguments] ${of_version} ${port} ${output} [Documentation] Checking Flows on switch S1 and switch S3 after applying path policy - ${DUMPFLOWS}= Set Variable If "${OF_VERSION}"=="OF10" ${DUMPFLOWS_OF10} ${DUMPFLOWS_OF13} + ${DUMPFLOWS}= Set Variable If "${of_version}"=="OF10" ${DUMPFLOWS_OF10} ${DUMPFLOWS_OF13} write ${DUMPFLOWS} ${result} Read Until mininet> - @{list_to_verify} Create List in_port=1 actions=output:3 in_port=2 - : FOR ${flowverifyElement} IN @{list_to_verify} - \ should Contain ${result} ${flowverifyElement} + Should Contain ${result} in_port=${port} actions=${output} Start PathSuiteVtnMaTest [Documentation] Start VTN Manager Test Suite and Mininet @@ -267,26 +258,31 @@ Remove a portmap Verify FlowMacAddress [Arguments] ${host1} ${host2} ${OF_VERSION} - Run Keyword If '${OF_VERSION}' == 'OF10' VerifyFlowsOnOpenFlow ${host1} ${host2} ${DUMPFLOWS_OF10} + [Documentation] Verify the source and destination mac address. + Run Keyword If '${OF_VERSION}' == 'OF10' Verify Flows On OpenFlow ${host1} ${host2} ${DUMPFLOWS_OF10} ... ELSE VerifyFlowsOnOpenFlow ${host1} ${host2} ${DUMPFLOWS_OF13} -VerifyFlowsOnOpenFlow +Verify Flows On OpenFlow [Arguments] ${host1} ${host2} ${DUMPFLOWS} + [Documentation] Verify the mac addresses on the specified open flow. ${booleanValue}= Run Keyword And Return Status Verify macaddress ${host1} ${host2} ${DUMPFLOWS} Should Be Equal As Strings ${booleanValue} True Verify RemovedFlowMacAddress [Arguments] ${host1} ${host2} ${OF_VERSION} - Run Keyword If '${OF_VERSION}' == 'OF10' VerifyRemovedFlowsOnOpenFlow ${host1} ${host2} ${DUMPFLOWS_OF10} + [Documentation] Verify the removed source and destination mac address. + Run Keyword If '${OF_VERSION}' == 'OF10' Verify Removed Flows On OpenFlow ${host1} ${host2} ${DUMPFLOWS_OF10} ... ELSE VerifyRemovedFlowsOnOpenFlow ${host1} ${host2} ${DUMPFLOWS_OF13} -VerifyRemovedFlowsOnOpenFlow +Verify Removed Flows On OpenFlow [Arguments] ${host1} ${host2} ${DUMPFLOWS} + [Documentation] Verify the removed mac addresses on the specified open flow. ${booleanValue}= Run Keyword And Return Status Verify macaddress ${host1} ${host2} ${DUMPFLOWS} Should Not Be Equal As Strings ${booleanValue} True Verify macaddress [Arguments] ${host1} ${host2} ${DUMPFLOWS} + [Documentation] Verify the source and destination mac address after ping in the dumpflows write ${host1} ifconfig -a | grep HWaddr ${sourcemacaddr} Read Until mininet> ${macaddress}= Split String ${sourcemacaddr} ${SPACE} diff --git a/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_pathpolicy.robot b/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_pathpolicy.robot index 0783df386d..84db8c34b5 100644 --- a/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_pathpolicy.robot +++ b/csit/suites/vtn/VTN_Mgr_OF10/010__vtn_manager_pathpolicy.robot @@ -62,7 +62,7 @@ Ping h1 to h2 before path policy Verify flowEntryBeforePathPolicy [Documentation] Checking Flows on switch s1 and s3 [Tags] exclude - Verify flowEntryBeforePathPolicy OF10 + Verify flowEntryPathPolicy OF10 ${in_port} ${out_before_pathpolicy} Add a flowcondition flowcond_path [Documentation] Create a flowcondition flowcond_path @@ -97,7 +97,7 @@ Ping h1 to h2 after path policy Verify flowEntryAfterPathPolicy [Documentation] Checking Flows on switch s1 and s3 [Tags] exclude - Verify flowEntryAfterPathPolicy OF10 + Verify flowEntryPathPolicy OF10 ${in_port} ${out_after_pathpolicy} Delete a pathmap [Documentation] Delete a pathmap diff --git a/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_pathpolicy.robot b/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_pathpolicy.robot index f22ca8f568..addeff891d 100644 --- a/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_pathpolicy.robot +++ b/csit/suites/vtn/VTN_Mgr_OF13/010__vtn_manager_pathpolicy.robot @@ -62,7 +62,7 @@ Ping h1 to h2 before path policy Verify flowEntryBeforePathPolicy [Documentation] Checking Flows on switch s1 and s3 [Tags] exclude - Verify flowEntryBeforePathPolicy OF13 + Verify flowEntryPathPolicy OF13 ${in_port} ${out_before_pathpolicy} Add a flowcondition flowcond_path [Documentation] Create a flowcondition flowcond_path @@ -97,7 +97,7 @@ Ping h1 to h2 after path policy Verify flowEntryAfterPathPolicy [Documentation] Checking Flows on switch s1 and s3 [Tags] exclude - Verify flowEntryAfterPathPolicy OF13 + Verify flowEntryPathPolicy OF13 ${in_port} ${out_after_pathpolicy} Delete a pathmap [Documentation] Delete a pathmap -- 2.36.6