if key in ['ipv4-destination', 'ipv4-source', 'ipv6-destination', 'ipv6-source', 'ipv6-nd-target']:
nvalue = _allign_address(value)
m_dict[key] = nvalue
- elif key in ['tunnel-mask','type','metadata-mask']:
+ elif key in ['tunnel-mask','type','metadata-mask','out_port','out_group']:
nvalue = _convert_numbers(value)
m_dict[key] = nvalue
else:
--- /dev/null
+*** Settings ***
+Documentation Test suite for Routed RPC.
+Library Collections
+Library ../../../../libraries/RequestsLibrary.py
+Library ../../../../libraries/Common.py
+Library ../../../../libraries/CrudLibrary.py
+Library ../../../../libraries/SettingsLibrary.py
+Library ../../../../libraries/UtilLibrary.py
+Variables ../../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT} /restconf/config/
+
+
+*** Test Cases ***
+Add cars and get cars from Leader
+ [Documentation] Add 100 cars and get added cars from Leader
+ ${resp} AddCar ${LEADER} ${PORT} ${100}
+ ${resp} Getcars ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer1
+
+Add persons and get persons from Leader
+ [Documentation] Add 100 persons and get persons
+ [Documentation] Note: There should be one person added first to enable rpc
+ ${resp} AddPerson ${LEADER} ${PORT} ${0}
+ ${resp} AddPerson ${LEADER} ${PORT} ${100}
+ ${resp} GetPersons ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user5
+ SLEEP 10
+
+Add car-person mapping and get car-person mapping from Follower1
+ [Documentation] Add car-person and get car-person from Leader
+ [Documentation] Note: This is done to enable working of rpc
+ ${resp} AddCarPerson ${FOLLOWER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user0
+ SLEEP 5
+
+Purchase 100 cars using Follower1
+ [Documentation] Purchase 100 cars using Follower1
+ ${resp} BuyCar ${FOLLOWER1} ${PORT} ${100}
+ ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Get Cars from Leader
+ [Documentation] Get 100 using Leader
+ ${resp} Getcars ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer99
+
+Get persons from Leader
+ [Documentation] Get 101 Persons from Leader
+ ${resp} GetPersons ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
+
+Get car-person mappings using Leader
+ [Documentation] Get 101 car-person mappings using Leader to see 100 entry
+ ${resp} GetCarPersonMappings ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
--- /dev/null
+*** Settings ***
+Documentation Test suite for Routed RPC.
+Library Collections
+Library ../../../../libraries/RequestsLibrary.py
+Library ../../../../libraries/Common.py
+Library ../../../../libraries/CrudLibrary.py
+Library ../../../../libraries/SettingsLibrary.py
+Library ../../../../libraries/UtilLibrary.py
+Library ../../../../libraries/ClusterStateLibrary.py
+Variables ../../../../variables/Variables.py
+
+*** Variables ***
+${REST_CONTEXT} /restconf/config/
+
+*** Test Cases ***
+Add cars and get cars from Leader
+ [Documentation] Add 100 cars and get added cars from Leader
+ ${resp} AddCar ${LEADER} ${PORT} ${100}
+ ${resp} Getcars ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer1
+
+Add persons and get persons from Leader
+ [Documentation] Add 100 persons and get persons
+ [Documentation] Note: There should be one person added first to enable rpc
+ ${resp} AddPerson ${LEADER} ${PORT} ${0}
+ ${resp} AddPerson ${LEADER} ${PORT} ${100}
+ ${resp} GetPersons ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user5
+
+Add car-person mapping and get car-person mapping from Follower1
+ [Documentation] Add car-person and get car-person from Follower1
+ [Documentation] Note: This is done to enable working of rpc
+ ${resp} AddCarPerson ${FOLLOWER1} ${PORT} ${0}
+ ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user0
+
+Purchase 100 cars using Follower
+ [Documentation] Purchase 100 cars using Follower
+ SLEEP 10
+ ${resp} BuyCar ${FOLLOWER1} ${PORT} ${100}
+ ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Get Cars from Leader
+ [Documentation] Get 100 using Leader
+ ${resp} Getcars ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer9
+
+Get persons from Leader
+ [Documentation] Get 11 Persons from Leader
+ ${resp} GetPersons ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
+
+Get car-person mappings using Leader
+ [Documentation] Get car-person mappings using Leader to see 100 entry
+ ${resp} GetCarPersonMappings ${LEADER} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
+
+Stop Leader
+ [Documentation] Stop Leader controller
+ ${resp} Stopcontroller ${LEADER} root Ecp123 /opt/clustering/dist
+ SLEEP 30
+ ${resp} Killcontroller ${LEADER} root Ecp123 /opt/clustering/dist
+
+
+Add cars and get cars from Follower1
+ [Documentation] Add 100 cars and get added cars from Follower
+ ${resp} AddCar ${FOLLOWER1} ${PORT} ${100}
+ ${resp} Getcars ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer1
+
+Add persons and get persons from Follower1
+ [Documentation] Add 100 persons and get persons
+ [Documentation] Note: There should be one person added first to enable rpc
+ ${resp} AddPerson ${FOLLOWER1} ${PORT} ${0}
+ ${resp} AddPerson ${FOLLOWER1} ${PORT} ${100}
+ ${resp} GetPersons ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user5
+ SLEEP 10
+
+Purchase 100 cars using Follower2
+ [Documentation] Purchase 100 cars using Follower2
+ ${resp} BuyCar ${FOLLOWER2} ${PORT} ${100}
+ SLEEP 10
+ ${resp} GetCarPersonMappings ${FOLLOWER2} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Get Cars from Follower1
+ [Documentation] Get 100 using Follower1
+ ${resp} Getcars ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} manufacturer9
+
+Get persons from Follower1
+ [Documentation] Get 11 Persons from Follower1
+ ${resp} GetPersons ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
+
+Get car-person mappings using Follower1
+ [Documentation] Get car-person mappings using Follower1 to see 100 entry
+ ${resp} GetCarPersonMappings ${FOLLOWER1} ${PORT} ${0}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${resp.content} user100
+
+Start Leader
+ [Documentation] Start Leader controller
+ ${resp} Startcontroller ${LEADER} root Ecp123 /opt/clustering/dist
+ SLEEP 20
+
<id>234</id>
<cookie_mask>10</cookie_mask>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>338</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>
<table_id>2</table_id>
<id>339</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>
<table_id>2</table_id>
<id>340</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>
<table_id>2</table_id>
<id>341</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<tunnel>
<tunnel-mask>0xf7d120c</tunnel-mask>
<table_id>2</table_id>
<id>342</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>
<table_id>2</table_id>
<id>343</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>344</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>
<table_id>2</table_id>
<id>152</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>154</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>155</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>156</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>157</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>158</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>160</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>161</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>162</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>163</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>164</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>165</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>166</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>167</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<in-port>202</in-port>
<in-phy-port>10122</in-phy-port>
<table_id>2</table_id>
<id>168</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<metadata>
<metadata-mask>0x46645a66</metadata-mask>
<table_id>2</table_id>
<id>169</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>170</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<ethernet-match>
<ethernet-type>
<table_id>2</table_id>
<id>171</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<tunnel>
<tunnel-mask>0xf7d120c</tunnel-mask>
<table_id>2</table_id>
<id>172</id>
<cookie_mask>10</cookie_mask>
- <out_port>10</out_port>
+ <out_port>0xffffffff</out_port>
<installHw>false</installHw>
- <out_group>2</out_group>
+ <out_group>0xffffffff</out_group>
<match>
<vlan-match>
<vlan-id>