Add test to check if os parameter matches filename (#12442)

This commit is contained in:
Jellyfrog
2021-01-26 06:19:31 +01:00
committed by GitHub
parent ae38a45b7e
commit 4ba095853b
4 changed files with 17 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
os: arubaos-CX
os: arubaos-cx
text: 'ArubaOS-CX'
type: network
icon: aruba

View File

@@ -1,4 +1,4 @@
os: eatonups
os: eatonupsm2
text: 'Eaton UPS'
group: ups
type: power

View File

@@ -1,4 +1,4 @@
os: bladeshelterpdu
os: ts-bspdu
text: 'BladeShelter PDU by PowerTek'
type: power
icon: bladeshelterpdu

View File

@@ -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
*/