Using REST to provision subscribers in scale test
Change-Id: Ia1458e083f7c8982bb358f003d1a3b5f7ae4e126
diff --git a/libraries/onos.robot b/libraries/onos.robot
index a68292d..7bd72f5 100755
--- a/libraries/onos.robot
+++ b/libraries/onos.robot
@@ -307,6 +307,14 @@
Execute ONOS CLI Command ${ONOS_SSH_IP} ${ONOS_SSH_PORT}
... volt-add-subscriber-access ${of_id} ${onu_port}
+Provision subscriber REST
+ [Documentation] Uses the rest APIs to provision a subscriber
+ [Arguments] ${onos_ip} ${onos_port} ${of_id} ${onu_port}
+ ${resp}= Post Request ONOS
+ ... /onos/olt/oltapp/${of_id}/${onu_port}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+
List Enabled UNI Ports
[Documentation] List all the UNI Ports, the only way we have is to filter out the one called NNI
... Creates a list of dictionaries
@@ -325,11 +333,13 @@
Return From Keyword ${result}
Provision all subscribers on device
- [Documentation] Calls volt-add-subscriber-access in ONOS for all the enabled UNI ports on a partivular device
- [Arguments] ${onos_ip} ${onos_port} ${of_id}
- ${unis}= List Enabled UNI Ports ${onos_ip} ${onos_port} ${of_id}
+ [Documentation] Provisions a subscriber in ONOS for all the enabled UNI ports on a particular device
+ [Arguments] ${onos_ip} ${onos_ssh_port} ${onos_rest_port} ${of_id}
+ ${unis}= List Enabled UNI Ports ${onos_ip} ${onos_ssh_port} ${of_id}
+ ${onos_auth}= Create List karaf karaf
+ Create Session ONOS http://${onos_ip}:${onos_rest_port} auth=${onos_auth}
FOR ${uni} IN @{unis}
- Provision subscriber ${onos_ip} ${onos_port} ${uni['of_id']} ${uni['port']}
+ Provision Subscriber REST ${onos_ip} ${onos_rest_port} ${uni['of_id']} ${uni['port']}
END
List OLTs