Depending on the active XML library the output of empty NETCONF data
can be either
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"/>
or
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"></data>
Support both options to make the test results more stable.
Change-Id: I65fe5c428a4d8da14ddc6bce2f411e02692c2659
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
- Check_Config_Data <data xmlns\="${ODL_NETCONF_NAMESPACE}"/>
+ ${escaped} = BuiltIn.Regexp_Escape ${ODL_NETCONF_NAMESPACE}
+ Check_Config_Data <data xmlns\="${escaped}"(\/>|><\/data>) ${True}
Invoke_Yang1.1_Action_Via_Xml_Post
[Documentation] Send a sample test data label into the device and check that the request went OK.
Invoke_Yang1.1_Action_Via_Xml_Post
[Documentation] Send a sample test data label into the device and check that the request went OK.
RETURN ${data}
Check_Config_Data
RETURN ${data}
Check_Config_Data
- [Arguments] ${expected} ${contains}=False
+ [Arguments] ${expected} ${regex}=False ${contains}=False
${data} = Get_Config_Data
${data} = Get_Config_Data
+ IF ${regex}
+ BuiltIn.Should Match Regexp ${data} ${expected}
+ ELSE IF ${contains}
+ BuiltIn.Should_Contain ${data} ${expected}
+ ELSE
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
- IF ${contains} BuiltIn.Should_Contain ${data} ${expected}
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
- Check_Config_Data <data xmlns\="${ODL_NETCONF_NAMESPACE}"/>
+ ${escaped}= BuiltIn.Regexp_Escape ${ODL_NETCONF_NAMESPACE}
+ Check_Config_Data <data xmlns\="${escaped}"(\/>|><\/data>) ${True}
Create_Device_Data_Label_Via_Xml
[Documentation] Send a sample test data label into the device and check that the request went OK.
Create_Device_Data_Label_Via_Xml
[Documentation] Send a sample test data label into the device and check that the request went OK.
Check_Device_Data_Is_Deleted
[Documentation] Get the device data and make sure it is empty again.
Check_Device_Data_Is_Deleted
[Documentation] Get the device data and make sure it is empty again.
- Check_Config_Data <data xmlns\="${ODL_NETCONF_NAMESPACE}"/>
+ ${escaped}= BuiltIn.Regexp_Escape ${ODL_NETCONF_NAMESPACE}
+ Check_Config_Data <data xmlns\="${escaped}"(\/>|><\/data>) ${True}
Deconfigure_Device_From_Netconf
[Documentation] Make request to deconfigure the testtool device on Netconf connector.
Deconfigure_Device_From_Netconf
[Documentation] Make request to deconfigure the testtool device on Netconf connector.
RETURN ${data}
Check_Config_Data
RETURN ${data}
Check_Config_Data
- [Arguments] ${expected} ${contains}=False
+ [Arguments] ${expected} ${regex}=False ${contains}=False
+ IF ${regex}
+ BuiltIn.Should Match Regexp ${data} ${expected}
+ ELSE IF ${contains}
+ BuiltIn.Should_Contain ${data} ${expected}
+ ELSE
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
- IF ${contains} BuiltIn.Should_Contain ${data} ${expected}
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
Check_Device_Data_Is_Empty
[Documentation] Get the device data and make sure it is empty.
- Check_Config_Data <data xmlns\="${ODL_NETCONF_NAMESPACE}"/>
+ ${escaped}= BuiltIn.Regexp_Escape ${ODL_NETCONF_NAMESPACE}
+ Check_Config_Data <data xmlns\="${escaped}"(\/>|><\/data>) ${True}
Create_Device_Data_Label_Via_Xml
[Documentation] Send a sample test data label into the device and check that the request went OK.
Create_Device_Data_Label_Via_Xml
[Documentation] Send a sample test data label into the device and check that the request went OK.
Check_Device_Data_Is_Deleted
[Documentation] Get the device data and make sure it is empty again.
Check_Device_Data_Is_Deleted
[Documentation] Get the device data and make sure it is empty again.
- Check_Config_Data <data xmlns\="${ODL_NETCONF_NAMESPACE}"/>
+ ${escaped}= BuiltIn.Regexp_Escape ${ODL_NETCONF_NAMESPACE}
+ Check_Config_Data <data xmlns\="${escaped}"(\/>|><\/data>) ${True}
Deconfigure_Device_From_Netconf
[Documentation] Make request to deconfigure the testtool device on Netconf connector.
Deconfigure_Device_From_Netconf
[Documentation] Make request to deconfigure the testtool device on Netconf connector.
RETURN ${data}
Check_Config_Data
RETURN ${data}
Check_Config_Data
- [Arguments] ${expected} ${contains}=False
+ [Arguments] ${expected} ${regex}=False ${contains}=False
+ IF ${regex}
+ BuiltIn.Should Match Regexp ${data} ${expected}
+ ELSE IF ${contains}
+ BuiltIn.Should_Contain ${data} ${expected}
+ ELSE
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
BuiltIn.Should_Be_Equal_As_Strings ${data} ${expected}
END
- IF ${contains} BuiltIn.Should_Contain ${data} ${expected}
Count_Netconf_Connectors
${count}= NetconfKeywords.Count_Netconf_Connectors_For_Device ${device_name}
Count_Netconf_Connectors
${count}= NetconfKeywords.Count_Netconf_Connectors_For_Device ${device_name}