save-test-data.php: Print a message when we encounter a bad module name (#8274)

* Print a message when we encounter a bad module name (likely a typo)

* Raise exception for invalid module name and handle it.
This commit is contained in:
Tony Murray
2018-02-25 20:03:18 -06:00
committed by GitHub
parent 6dcdd89dd7
commit b2ce9b173b
5 changed files with 75 additions and 28 deletions

View File

@@ -27,6 +27,7 @@ namespace LibreNMS\Tests;
use LibreNMS\Config;
use LibreNMS\Exceptions\FileNotFoundException;
use LibreNMS\Exceptions\InvalidModuleException;
use LibreNMS\Util\ModuleTestHelper;
class OSModulesTest extends DBTestCase
@@ -54,6 +55,8 @@ class OSModulesTest extends DBTestCase
$results = $helper->generateTestData($snmpsim, true);
} catch (FileNotFoundException $e) {
$this->fail($e->getMessage());
} catch (InvalidModuleException $e) {
$this->fail($e->getMessage());
}
if (is_null($results)) {