mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add test to check if os parameter matches filename (#12442)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
os: arubaos-CX
|
||||
os: arubaos-cx
|
||||
text: 'ArubaOS-CX'
|
||||
type: network
|
||||
icon: aruba
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
os: eatonups
|
||||
os: eatonupsm2
|
||||
text: 'Eaton UPS'
|
||||
group: ups
|
||||
type: power
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
os: bladeshelterpdu
|
||||
os: ts-bspdu
|
||||
text: 'BladeShelter PDU by PowerTek'
|
||||
type: power
|
||||
icon: bladeshelterpdu
|
||||
|
||||
@@ -53,6 +53,20 @@ class YamlSchemaTest extends TestCase
|
||||
$this->validateYamlFilesAgainstSchema('/includes/definitions', '/misc/os_schema.json');
|
||||
}
|
||||
|
||||
/**
|
||||
* @group os
|
||||
*/
|
||||
public function testOSMatchFilename()
|
||||
{
|
||||
foreach ($this->listFiles('/includes/definitions/*.yaml') as $filename => $file) {
|
||||
$this->assertEquals(
|
||||
Yaml::parseFile($file)['os'],
|
||||
substr($filename, 0, -5),
|
||||
"Parameter 'os' doesn't match the filename $filename"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @group os
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user