From 84374b4b4e41c4bb7896092c10098b5e6b5f68c1 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 11 Sep 2019 17:59:23 +0200 Subject: explicitly collect binary versions There is no generic way to retrieve the version of a binary. Not everyone followes GNU cli guidelines and supports "--version". The larson benchmark for example reads input from stdin when started with "larson --version" blocking the Benchmark.prepare() call. --- src/benchmarks/mysql.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/benchmarks/mysql.py') diff --git a/src/benchmarks/mysql.py b/src/benchmarks/mysql.py index a47873b..e71038f 100644 --- a/src/benchmarks/mysql.py +++ b/src/benchmarks/mysql.py @@ -28,6 +28,7 @@ import sys import numpy as np from src.benchmark import Benchmark +import src.facter from src.util import print_status, print_debug, print_info2 TESTDIR = os.path.join(os.getcwd(), "mysql_test") @@ -72,6 +73,10 @@ class BenchmarkMYSQL(Benchmark): def prepare(self): super().prepare() + # save mysqld and sysbench versions + for exe in self.requirements: + self.results["facts"]["versions"][exe] = src.facter.exe_version(exe, "--version") + # Setup Test Environment if not os.path.exists("mysql_test"): print_status("Prepare mysqld directory and database") -- cgit v1.2.3