refactor: pre-commit.php updates (#8679)

Disable the log for unit tests to speed things up hopefully
This commit is contained in:
Tony Murray
2018-05-09 06:53:45 -05:00
committed by Neil Lathwood
parent 5273b291bf
commit 8afafe7eb0
9 changed files with 53 additions and 61 deletions

View File

@@ -72,7 +72,11 @@ class Snmpsim
}
if (isCli() && !$this->proc->isRunning()) {
echo `tail -5 $this->log` . PHP_EOL;
// if starting failed, run snmpsim again and output to the console and validate the data
passthru($this->getCmd(false) . ' --validate-data');
echo "\nFailed to start Snmpsim. Scroll up for error.\n";
exit;
}
}
@@ -149,7 +153,9 @@ class Snmpsim
{
$cmd = "snmpsimd.py --data-dir={$this->snmprec_dir} --agent-udpv4-endpoint={$this->ip}:{$this->port}";
if ($with_log) {
if (is_null($this->log)) {
$cmd .= " --logging-method=null";
} elseif ($with_log) {
$cmd .= " --logging-method=file:{$this->log}";
}