Update check_target_files_vintf to check the last line of stdout.

More output is now produced on stdout by checkvintf.
Update logic to compare against the last line for incompatible.

Fixes the following tests:
test_check_target_files_vintf.CheckTargetFilesVintfTest#test_CheckVintf_kernel_incompat
test_check_target_files_vintf.CheckTargetFilesVintfTest#test_CheckVintf_matrix_incompat
test_check_target_files_vintf.CheckTargetFilesVintfTest#test_CheckVintf_sku_incompat

Bug: 251221029
Test: atest releasetools_test
Change-Id: I592acf9a3868e2a60e203b2201e7fadcbb0e7f04
This commit is contained in:
Rob Seymour
2022-10-05 19:52:54 +00:00
parent 529b58c8e8
commit dc4e0f2ee0

View File

@@ -142,9 +142,10 @@ def CheckVintfFromExtractedTargetFiles(input_tmp, info_dict=None):
command = common_command + sku_args
proc = common.Run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
last_out_line = out.split()[-1] if out != "" else out
if proc.returncode == 0:
logger.info("Command `%s` returns 'compatible'", ' '.join(command))
elif out.strip() == "INCOMPATIBLE":
elif last_out_line.strip() == "INCOMPATIBLE":
logger.info("Command `%s` returns 'incompatible'", ' '.join(command))
success = False
else: