Skip to content

Commit

Permalink
test: Add test for Bitdefender AV inventory support on linux after PR #…
Browse files Browse the repository at this point in the history
…472

Updated Changes
  • Loading branch information
g-bougard committed Sep 7, 2023
1 parent beba686 commit 621c3b6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ inventory:
* Fix Microsoft Defender Antivirus support on MacOSX
* fix #458: Add Microsoft Defender Antivirus support on Linux, thanks to @j-ldes
* Refactoring & enhanced Aix bios inventory to use lsconf as fallback
* PR #472: Add BitDefender Antivirus support on Linux, thanks to @ticgal

netdiscovery/netinventory:
* Enhanced Aruba IAP models support
Expand Down
40 changes: 40 additions & 0 deletions t/tasks/inventory/linux/antivirus/bitdefender.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/perl

use strict;
use warnings;
use lib 't/lib';

use Test::Deep;
use Test::Exception;
use Test::More;
use Test::NoWarnings;

use GLPI::Test::Inventory;
use GLPI::Agent::Task::Inventory::Linux::AntiVirus::Bitdefender;

my %av_tests = (
'bduitool-7.0.3.2239' => {
COMPANY => "Bitdefender",
NAME => "Bitdefender Endpoint Security Tools (BEST) for Linux",
ENABLED => 1,
UPTODATE => 1,
VERSION => "7.0.3.2239",
BASE_VERSION => "7.95171",
BASE_CREATION => "2023-08-24",
},
);

plan tests =>
(2 * scalar keys %av_tests) +
1;

my $inventory = GLPI::Test::Inventory->new();

foreach my $test (keys %av_tests) {
my $file = "resources/linux/antivirus/$test";
my $antivirus = GLPI::Agent::Task::Inventory::Linux::AntiVirus::Bitdefender::_getBitdefenderInfo(file => $file);
cmp_deeply($antivirus, $av_tests{$test}, "$test: parsing");
lives_ok {
$inventory->addEntry(section => 'ANTIVIRUS', entry => $antivirus);
} "$test: registering";
}

0 comments on commit 621c3b6

Please sign in to comment.