OS Testing update (#7971)

* OS Testing update
Option on pre-commit.php to run tests for just one OS. Reorganize tests a bit to support this.
Improved bgp-peers capture and os module capture (initial)
Better output when phpunit tests fail

* fix a couple issues.  Better output for another

* Use the correct setup function
This commit is contained in:
Tony Murray
2017-12-28 16:12:08 -06:00
committed by GitHub
parent 12373d0f60
commit 20865b0ca4
7 changed files with 120 additions and 53 deletions

View File

@@ -32,6 +32,9 @@ use LibreNMS\Util\ModuleTestHelper;
class OSModulesTest extends DBTestCase
{
/**
* Test all modules for a particular OS
*
* @group os
* @dataProvider dumpedDataProvider
* @param string $target_os
* @param string $filename
@@ -55,13 +58,13 @@ class OSModulesTest extends DBTestCase
$this->assertEquals(
$data['discovery'],
$results[$module]['discovery'],
"OS $target_os: Discovered $module data does not match that found in $filename"
"OS $target_os: Discovered $module data does not match that found in $filename\n" . $helper->getLastDiscoveryOutput()
);
$this->assertEquals(
$data['poller'] == 'matches discovery' ? $data['discovery'] : $data['poller'],
$results[$module]['poller'],
"OS $target_os: Polled $module data does not match that found in $filename"
"OS $target_os: Polled $module data does not match that found in $filename\n" . $helper->getLastPollerOutput()
);
}
}