Revision 0d761a49
[#1571] Ajout du champ Vigilo Template
Change-Id: Ib31d45245cbbbeb845df30f013bec479878ee627
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2321
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
Tested-by: Francois POIROTTE <francois.poirotte@c-s.fr>
Vigilo/VigiloTestSoftware.php | ||
---|---|---|
24 | 24 |
|
25 | 25 |
public function addRelevantTestWith($softwareName) |
26 | 26 |
{ |
27 |
if (strstr($softwareName, "vigilo-test")) |
|
27 |
if (strstr($softwareName, "vigilo-test"))
|
|
28 | 28 |
{ |
29 | 29 |
$functionArray=array("addCustomTest", array($softwareName)); |
30 | 30 |
} |
31 | 31 |
else |
32 | 32 |
{ |
33 |
if (!array_key_exists($softwareName, $this->softwareBase)) |
|
34 |
{ |
|
33 |
if (!array_key_exists($softwareName, $this->softwareBase)) { |
|
35 | 34 |
return; |
36 | 35 |
} |
37 | 36 |
$functionArray=$this->softwareBase[$softwareName]; |
... | ... | |
42 | 41 |
protected function addCustomTest($softwareName) |
43 | 42 |
{ |
44 | 43 |
$software_name = str_replace('vigilo-test-', '', $softwareName); |
45 |
$explode_software_name = explode('-', $software_name, 2);
|
|
44 |
$explode_software_name = explode('-', $software_name, 2);
|
|
46 | 45 |
$args=array(); |
47 | 46 |
switch(strtolower($explode_software_name[0])) |
48 | 47 |
{ |
49 |
case "process": |
|
48 |
case "process":
|
|
50 | 49 |
$args[]=new VigiloArg('processname', $explode_software_name[1]); |
51 | 50 |
$explode_software_name[0] = "Process"; |
52 | 51 |
break; |
53 |
case "service": |
|
52 |
case "service":
|
|
54 | 53 |
$args[]=new VigiloArg('svcname', $explode_software_name[1]); |
55 | 54 |
$explode_software_name[0] = "Service"; |
56 | 55 |
break; |
57 |
case "tcp": |
|
58 |
$args[]=new VigiloArg('port', $explode_software_name[1]); |
|
56 |
case "tcp":
|
|
57 |
$args[]=new VigiloArg('port', $explode_software_name[1]);
|
|
59 | 58 |
$explode_software_name[0] = "TCP"; |
60 | 59 |
break; |
61 | 60 |
default: return; |
62 | 61 |
} |
63 | 62 |
|
64 |
return new VigiloTest($explode_software_name[0], $args); |
|
63 |
return new VigiloTest($explode_software_name[0], $args);
|
|
65 | 64 |
} |
66 | 65 |
|
67 | 66 |
protected function addNTPTest() |
Also available in: Unified diff