1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

workloads/openssl: save binary's hash and version

Store the hash and the version of the openssl executable used by the
workload in the result metadata.
This commit is contained in:
Sergei Trofimov 2018-05-24 16:10:05 +01:00 committed by Marc Bonnici
parent 2ff06af632
commit ec9605603e

View File

@ -55,7 +55,12 @@ class Openssl(Workload):
def initialize(self, context):
if self.use_system_binary:
try:
self.target.execute('openssl -h')
cmd = '{0} md5sum < $({0} which openssl)'
output = self.target.execute(cmd.format(self.target.busybox))
md5hash = output.split()[0]
version = self.target.execute('openssl version').strip()
context.update_metadata('hashes', 'openssl', md5hash)
context.update_metadata('versions', 'openssl', version)
except TargetError:
msg = 'Openssl does not appear to be installed on target.'
raise WorkloadError(msg)