reactivate installation test for all plugins
This commit is contained in:
parent
c4fe1a7cd9
commit
a10fb8848f
|
@ -67,7 +67,7 @@ def refresh_packet_manager(archi):
|
|||
return output_status
|
||||
|
||||
def install_plugin(plugin, archi):
|
||||
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
||||
with open('/var/log/installation-' + plugin + '.log', "a") as outfile:
|
||||
if archi == "deb":
|
||||
outfile.write("apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb\n")
|
||||
output_status = (subprocess.run(
|
||||
|
@ -84,7 +84,7 @@ def install_plugin(plugin, archi):
|
|||
|
||||
|
||||
def remove_plugin(plugin, archi):
|
||||
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
||||
with open('/var/log/uninstallation-' + plugin + '.log', "a") as outfile:
|
||||
if archi == "deb":
|
||||
outfile.write("apt-get -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' autoremove -y " + plugin.lower() + "\n")
|
||||
output_status = (subprocess.run(
|
||||
|
@ -134,23 +134,19 @@ if __name__ == '__main__':
|
|||
for plugin in sys.argv:
|
||||
print("plugin : ", plugin)
|
||||
folders_list = get_tests_folders(plugin)
|
||||
if len(folders_list) == 0:
|
||||
print(f"we don't test {plugin} as it don't have any robots tests.")
|
||||
continue
|
||||
|
||||
nb_plugins += 1
|
||||
tmp = install_plugin(plugin, archi)
|
||||
if tmp > 0:
|
||||
list_plugin_error.append(plugin)
|
||||
error_install += tmp
|
||||
error_install += 1
|
||||
tmp = test_plugin(plugin)
|
||||
if tmp > 0:
|
||||
list_plugin_error.append(plugin)
|
||||
error_tests += tmp
|
||||
error_tests += 1
|
||||
tmp = remove_plugin(plugin, archi)
|
||||
if tmp > 0:
|
||||
list_plugin_error.append(plugin)
|
||||
error_purge += tmp
|
||||
error_purge += 1
|
||||
|
||||
print(f"{nb_plugins} plugins tested.\n there was {error_install} installation error, {error_tests} test "
|
||||
f"errors, and {error_purge} removal error list of error : {list_plugin_error}",)
|
||||
|
|
|
@ -26,17 +26,17 @@ use centreon::plugins::perfdata;
|
|||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = {};
|
||||
my $self = {};
|
||||
bless $self, $class;
|
||||
|
||||
$self->{perfdata} = centreon::plugins::perfdata->new(output => $options{output});
|
||||
|
||||
|
||||
%{$self->{option_results}} = ();
|
||||
@{$self->{option_extras}} = @{$options{options}->{extra_arguments}};
|
||||
$self->{output} = $options{output};
|
||||
@{$self->{option_extras}} = @{$options{options}->{extra_arguments}};
|
||||
$self->{output} = $options{output};
|
||||
$self->{output}->use_new_perfdata(value => 1)
|
||||
if (defined($options{force_new_perfdata}) && $options{force_new_perfdata} == 1);
|
||||
$self->{mode} = $options{mode};
|
||||
$self->{mode} = $options{mode};
|
||||
$self->{version} = '1.0';
|
||||
|
||||
return $self;
|
||||
|
@ -62,7 +62,7 @@ sub init {
|
|||
|
||||
sub version {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
|
||||
$self->{output}->add_option_msg(short_msg => "Mode Version: " . $self->{version});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue