${response} = RequestsLibrary.Get_Request operational data-change-counter:data-change-counter
BuiltIn.Should_Be_Equal ${response.status_code} ${200} Got status: ${response.status_code} and message: ${response.text}
# TODO: The following line can be insecure. Should we use regexp instead?
- ${count} = BuiltIn.Evaluate ${response.text}["data-change-counter"]["count"]
+ # TODO: beware of new releases (carbon ...) and mind if more counters are used
+ ${count} = BuiltIn.Run Keyword If "${ODL_STREAM}" in ["beryllium", "stable-lithium"] BuiltIn.Evaluate ${response.text}["data-change-counter"]["count"]
+ ... ELSE BuiltIn.Evaluate ${response.text}["data-change-counter"]["counter"][0]["count"]
[Return] ${count}
Reconfigure_Topology_Name
Resolve_URI_From_Template_Folder
[Arguments] ${folder} ${mapping_as_string}
[Documentation] Read URI template from folder, strip endline, make changes according to mapping, return the result.
- ${uri_template}= OperatingSystem.Get_File ${folder}${/}config.uri
+ ${status} ${uri_template}= BuiltIn.Run_Keyword_And_Ignore_Error OperatingSystem.Get_File ${folder}${/}config.uri.${ODL_STREAM}
+ ${uri_template}= BuiltIn.Run Keyword If '${status}' != 'PASS' OperatingSystem.Get_File ${folder}${/}config.uri ELSE BuiltIn.Set Variable ${uri_template}
BuiltIn.Log ${uri_template}
${uri_part}= Strip_Endline_And_Apply_Substitutions_From_Mapping ${uri_template} ${mapping_as_string}
[Return] ${uri_part}
Resolve_Xml_Data_From_Template_Folder
[Arguments] ${folder} ${mapping_as_string}
[Documentation] Read XML data template from folder, strip endline, make changes according to mapping, return the result.
- ${data_template}= OperatingSystem.Get_File ${folder}${/}data.xml
+ ${status} ${data_template}= BuiltIn.Run_Keyword_And_Ignore_Error OperatingSystem.Get_File ${folder}${/}data.xml.${ODL_STREAM}
+ ${data_template}= BuiltIn.Run Keyword If '${status}' != 'PASS' OperatingSystem.Get_File ${folder}${/}data.xml ELSE BuiltIn.Set Variable ${data_template}
BuiltIn.Log ${data_template}
${xml_data}= Strip_Endline_And_Apply_Substitutions_From_Mapping ${data_template} ${mapping_as_string}
[Return] ${xml_data}
Resolve_Json_Data_From_Template_Folder
[Arguments] ${folder} ${mapping_as_string}
[Documentation] Read JSON data template from folder, strip endline, make changes according to mapping, return the result.
- ${data_template}= OperatingSystem.Get_File ${folder}${/}data.json
+ ${status} ${data_template}= BuiltIn.Run_Keyword_And_Ignore_Error OperatingSystem.Get_File ${folder}${/}data.json.${ODL_STREAM}
+ ${data_template}= BuiltIn.Run Keyword If '${status}' != 'PASS' OperatingSystem.Get_File ${folder}${/}data.json ELSE BuiltIn.Set Variable ${data_template}
BuiltIn.Log ${data_template}
${json_data}= Strip_Endline_And_Apply_Substitutions_From_Mapping ${data_template} ${mapping_as_string}
[Return] ${json_data}
--- /dev/null
+config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter
--- /dev/null
+config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter-singleton
<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">prefix:data-change-counter-impl</type>
- <name>data-change-counter-singleton</name>
+ <name>data-change-counter</name>
+ <counter-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">data-change-counter</counter-id>
<data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
<name>pingpong-binding-data-broker</name>
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">prefix:data-change-counter-impl</type>
+ <name>data-change-counter-singleton</name>
+ <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+ <name>pingpong-binding-data-broker</name>
+ </data-provider>
+ <topology-name xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">$TOPOLOGY_NAME</topology-name>
+</module>
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">prefix:data-change-counter-impl</type>
+ <name>data-change-counter-singleton</name>
+ <data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
+ <name>pingpong-binding-data-broker</name>
+ </data-provider>
+ <topology-name xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">$TOPOLOGY_NAME</topology-name>
+</module>
path_attributes_hex += (
next_hop_hex # IP address of the next hop (4 bytes)
)
+ path_attributes_hex += (
+ "\x40" # Flags ("Well-Known")
+ "\x05" # Type (LOCAL_PREF)
+ "\x04" # Length (4)
+ "\x00\x00\x00\x64" # (100)
+ )
if originator_id is not None:
path_attributes_hex += (
"\x80" # Flags ("Optional, non-transitive")