[VOL-5536] fix vgc pipeline issues
Change-Id: I6a50276a598cb5d51d54ef499ada170a9a0fc438
Signed-off-by: Abhay Kumar <abhay.kumar@radisys.com>
diff --git a/libraries/utils_vgc.robot b/libraries/utils_vgc.robot
index 5c1e181..b6ae874 100755
--- a/libraries/utils_vgc.robot
+++ b/libraries/utils_vgc.robot
@@ -78,9 +78,15 @@
${num_all_onus}= Get Length ${hosts.src}
${num_all_onus}= Convert to String ${num_all_onus}
#send sadis file to vgc
+ ${oltconfig_file}= Get Variable Value ${oltconfig.file}
+ ${oltconfig1_file}= Get Variable Value ${oltconfig1.file}
${sadis_file}= Get Variable Value ${sadis.file}
Log To Console \nSadis File:${sadis_file}
- Run Keyword Unless '${sadis_file}' == '${None}' Send File To VGC ${sadis_file} # apps/
+ Log To Console \noltconfig File:${oltconfig_file}
+ Log To Console \noltconfig File:${oltconfig1_file}
+ Run Keyword Unless '${oltconfig_file}' == '${None}' Send File To VGC ${oltconfig_file} olt/BBSIM_OLT_10
+ Run Keyword Unless '${oltconfig1_file}' == '${None}' Send File To VGC ${oltconfig1_file} olt/BBSIM_OLT_11
+ Run Keyword Unless '${sadis_file}' == '${None}' Send File To VGC ${sadis_file} network-configurations #apps/
Set Suite Variable ${num_all_onus}
Set Suite Variable ${num_olts}
Set Suite Variable ${list_olts}
diff --git a/libraries/vgc.robot b/libraries/vgc.robot
index b1bee31..8f116b3 100755
--- a/libraries/vgc.robot
+++ b/libraries/vgc.robot
@@ -64,6 +64,18 @@
Should Be True ${matched} No match for ${serial_number} found
[Return] ${of_id}
+Verify meters response
+ [Arguments] ${meter_json_resp} ${us_cir} ${us_cbs}
+ ${meter_json_Length} Get Length ${meter_json_resp['bands']}
+ FOR ${I} IN RANGE 0 ${meter_json_Length}
+ ${burst_size}= Get From Dictionary ${meter_json_resp['bands'][${I}]} burstSize
+ ${rate}= Get From Dictionary ${meter_json_resp['bands'][${I}]} rate
+ Log ${rate}
+ Log ${burst_size}
+ ${matched}= Evaluate '${rate}' == '${us_cir}' and '${burst_size}' == '${us_cbs}'
+ Exit For Loop If ${matched}
+ END
+ [Return] ${matched}
Validate Deleted Device Cleanup In VGC
@@ -447,13 +459,13 @@
Send File To VGC
[Documentation] Send the content of the file to VGC to selected section of configuration
... using Post Request
- [Arguments] ${CONFIG_FILE} #${section}=${EMPTY}
+ [Arguments] ${CONFIG_FILE} ${dest} #${section}=${EMPTY}
${Headers}= Create Dictionary Content-Type application/json
${File_Data}= OperatingSystem.Get File ${CONFIG_FILE}
Log ${Headers}
Log ${File_Data}
${resp}= Post Request VGC
- ... network-configurations headers=${Headers} data=${File_Data}
+ ... ${dest} headers=${Headers} data=${File_Data}
Should Be Equal As Strings ${resp.status_code} 200
Verify No Pending Flows For ONU
@@ -698,74 +710,46 @@
Log ${meters}
${meter_length} Get Length ${meters}
FOR ${i} IN RANGE ${meter_length}
- ${id}= Get From Dictionary ${meters[${i}]} id
- Run Keyword If '${id}' == '2' Set Suite Variable ${meter_json_resp} ${meters[${i}]}
- END
- ${meter_json_Length} Get Length ${meter_json_resp['bands']}
- FOR ${I} IN RANGE 0 ${meter_json_Length}
- ${burst_size}= Get From Dictionary ${meter_json_resp['bands'][${I}]} burstSize
- ${rate}= Get From Dictionary ${meter_json_resp['bands'][${I}]} rate
- Log ${rate}
- Log ${burst_size}
- # for cir & cbs
- ${matched}= Set Variable If '${rate}' == '${us_cir}' and '${burst_size}' == '${us_cbs}' True False
- ${res1}= Evaluate '${rate}' == '${us_cir}' and '${burst_size}' == '${us_cbs}'
- Exit For Loop If ${matched}
+ ${matched}= Verify meters response ${meters[${i}]} ${us_cir} ${us_cbs}
+ Exit For Loop If ${matched}
END
Should Be True ${matched}
#for pir & pbs
- FOR ${I} IN RANGE 0 3
- ${burst_size}= Get From Dictionary ${meter_json_resp['bands'][${I}]} burstSize
- ${rate}= Get From Dictionary ${meter_json_resp['bands'][${I}]} rate
- ${matched}= Set Variable If '${rate}' == '${us_pir}' and '${burst_size}' == '${us_pbs}' True False
- ${res2}= Evaluate '${rate}' == '${us_pir}' and '${burst_size}' == '${us_pbs}'
- Exit For Loop If ${matched}
+ FOR ${i} IN RANGE ${meter_length}
+ ${matched}= Verify meters response ${meters[${i}]} ${us_pir} ${us_pbs}
+ Exit For Loop If ${matched}
END
Should Be True ${matched}
#for gir
- Run Keyword if ${us_gir} != 0 Validate Guarenteed Information Rate For FTTB ${us_gir} ${meter_json_resp}
- # Get downstream bandwidth profile details
+ FOR ${i} IN RANGE ${meter_length}
+ ${matched}= Run Keyword if ${us_gir} != 0 Validate Guarenteed Information Rate For FTTB ${us_gir} ${meters[${i}]}
+ Exit For Loop If ${matched}
+ END
+ Should Be True ${matched}
${ds_cir} ${ds_cbs} ${ds_pir} ${ds_pbs} ${ds_gir} Get Bandwidth Profile Details Ietf Rest
... ${ds_bw_profile}
${meter}= Get Request VGC meters
${meter_json_resp}= To Json ${meter.content}
Log ${meter_json_resp}
- Log ${rate}
- Log ${burst_size}
- ${meters}= Get From Dictionary ${meter_json_resp} meters
- Log ${meter_json_resp}
- Log ${meters}
- FOR ${i} IN RANGE 2
- ${id}= Get From Dictionary ${meters[${i}]} id
- Run Keyword If '${id}' == '2' Set Suite Variable ${meter_json_resp} ${meters[${i}]}
- END
- FOR ${I} IN RANGE 0 3
- ${burst_size}= Get From Dictionary ${meter_json_resp['bands'][${I}]} burstSize
- ${rate}= Get From Dictionary ${meter_json_resp['bands'][${I}]} rate
- Log ${rate}
- Log ${burst_size}
- # for cir & cbs
- ${matched}= Set Variable If '${rate}' == '${ds_cir}' and '${burst_size}' == '${ds_cbs}' True False
- ${res1}= Evaluate '${rate}' == '${ds_cir}' and '${burst_size}' == '${ds_cbs}'
- Exit For Loop If ${matched}
+ ${meters}= Get From Dictionary ${meter_json_resp} meters
+ Log ${meter_json_resp}
+ Log ${meters}
+ FOR ${i} IN RANGE ${meter_length}
+ ${matched}= Verify meters response ${meters[${i}]} ${ds_cir} ${ds_cbs}
+ Exit For Loop If ${matched}
END
Should Be True ${matched}
-
# for cir & cbs
- FOR ${I} IN RANGE 0 3
- ${burst_size}= Get From Dictionary ${meter_json_resp['bands'][${I}]} burstSize
- ${rate}= Get From Dictionary ${meter_json_resp['bands'][${I}]} rate
- Log ${rate}
- Log ${burst_size}
- ${matched}= Set Variable If '${rate}' == '${ds_cir}' and '${burst_size}' == '${ds_cbs}' True False
- ${res1}= Evaluate '${rate}' == '${ds_pir}' and '${burst_size}' == '${ds_pbs}'
- Exit For Loop If ${matched}
- END
- Should Be True ${matched}
- #for pir & pbs
- #for gir
- Run Keyword If ${ds_gir} != 0
- ... Validate Guarenteed Information Rate For FTTB ${ds_gir} ${meter_json_resp}
+ FOR ${i} IN RANGE ${meter_length}
+ ${matched}= Verify meters response ${meters[${i}]} ${ds_pir} ${ds_pbs}
+ Exit For Loop If ${matched}
+ END
+ Should Be True ${matched}
+ FOR ${i} IN RANGE ${meter_length}
+ ${matched}= Run Keyword if ${us_gir} != 0 Validate Guarenteed Information Rate For FTTB ${ds_gir} ${meters[${i}]}
+ Exit For Loop If ${matched}
+ END
+ Should Be True ${matched}
Validate Guarenteed Information Rate
[Documentation] Validate gir for both upstream and downstream meters
@@ -781,8 +765,9 @@
[Arguments] ${gir} ${meter_json_resp}
${burst_size}= Get From Dictionary ${meter_json_resp['bands'][2]} burstSize
${rate}= Get From Dictionary ${meter_json_resp['bands'][2]} rate
- ${matched}= Set Variable If '${rate}' == '${gir}' and '${burst_size}' == '0' True False
- Should Be True ${matched}
+# ${matched}= Set Variable If '${rate}' == '${gir}' and '${burst_size}' == '0' True False
+ ${matched}= Evaluate ${rate} == ${gir} and ${burst_size} == 0
+# Should Be True ${matched}
[Return] ${matched}
Get Bandwidth Profile Details Ietf Rest