Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f15ada5 authored by Tao Bao's avatar Tao Bao
Browse files

releasetools: Capture stderr output when calling delta_generator.

Prior to this CL, the call to delta_generator in
check_ota_package_signature.VerifyAbOtaPayload() didn't redirect stderr.
The logs (mostly INFO) on successful verification added noise to the
normal output, which also upset the unittest result parser.

This CL captures stderr outputs from delta_generator, and will only dump
them on error.

Bug: 72884343
Test: `python -m unittest -v test_ota_from_target_files > /dev/null`
      gives clean output.
Test: Inject error into delta_generator. The call to
      check_ota_package_signature correctly dumps both of stdout and
      stderr outputs.
Change-Id: I014a4b21bf758dcf0a4b9963259d6019851935ee
parent fe34c5b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ def VerifyAbOtaPayload(cert, package):
  cmd = ['delta_generator',
         '--in_file=' + payload_file,
         '--public_key=' + pubkey]
  proc = common.Run(cmd, stdout=subprocess.PIPE)
  proc = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  stdoutdata, _ = proc.communicate()
  assert proc.returncode == 0, \
      'Failed to verify payload with delta_generator: %s\n%s' % (package,