- : FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1
- \ ${cmd} = Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file}
- \ ${output} = Get Karaf Log Lines From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${cmd}
- \ ${exlist} = Get and Verify Exceptions ${output}
- \ Write Exceptions Map To File ${SUITE_NAME}.${TEST_NAME} /tmp/odl${i}_exceptions.txt
- \ ${listlength} = BuiltIn.Get Length ${exlist}
- \ BuiltIn.Run Keyword If ${listlength} != 0 BuiltIn.Fail New exceptions found: ${listlength}
+ Return From Keyword If '${IS_KARAF_APPL}' == 'False' Not A Karaf App
+ FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1
+ ${cmd} = Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file}
+ ${output} = Get Karaf Log Lines From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${cmd}
+ ${exlist} ${matchlist} = Verify Exceptions ${output}
+ Write Exceptions Map To File ${SUITE_NAME}.${TEST_NAME} /tmp/odl${i}_exceptions.txt
+ ${listlength} = BuiltIn.Get Length ${exlist}
+ BuiltIn.Run Keyword If "${fail}"=="True" and ${listlength} != 0 Log And Fail Exceptions ${exlist} ${listlength}
+ ... ELSE Collections.Log List ${matchlist}
+ END
+
+Log And Fail Exceptions
+ [Arguments] ${exlist} ${listlength}
+ [Documentation] Print the list of failed exceptions and fail the test
+ Return From Keyword If '${IS_KARAF_APPL}' == 'False' Not A Karaf App
+ Collections.Log List ${exlist}
+ ${exstr} = BuiltIn.Catenate ${exlist}
+ BuiltIn.Fail New exceptions found: ${listlength}\n${exstr}