Skip to content

Commit

Permalink
adapt tests to the change
Browse files Browse the repository at this point in the history
API changed a little bit, and some minor expected results too
  • Loading branch information
guillomovitch committed Jun 1, 2012
1 parent f8c979c commit b3a55a2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
14 changes: 11 additions & 3 deletions t/inventory/generic/dmidecode/battery.t
Expand Up @@ -13,13 +13,19 @@ my %tests = (
NAME => 'EV06047',
SERIAL => undef,
MANUFACTURER => 'LGC-LGC',
CHEMISTRY => 'Lithium Ion'
CHEMISTRY => 'Lithium Ion',
VOLTAGE => 10800,
CAPACITY => 4400,
DATE => undef
},
'linux-2.6' => {
NAME => 'DELL C129563',
MANUFACTURER => 'Samsung SDI',
SERIAL => undef,
CHEMISTRY => undef
CHEMISTRY => undef,
VOLTAGE => 11100,
CAPACITY => 48000,
DATE => undef
},
'openbsd-3.7' => undef,
'openbsd-3.8' => undef,
Expand All @@ -32,7 +38,9 @@ my %tests = (
SERIAL => '2000417915',
DATE => '09/19/2002',
MANUFACTURER => 'TOSHIBA',
CHEMISTRY => 'Lithium Ion'
CHEMISTRY => 'Lithium Ion',
VOLTAGE => 10800,
CAPACITY => 0
},
'windows-hyperV' => undef
);
Expand Down
14 changes: 12 additions & 2 deletions t/inventory/generic/dmidecode/memory.t
Expand Up @@ -277,6 +277,16 @@ my %tests = (
CAPTION => 'DIMM 2',
CAPACITY => '512',
MEMORYCORRECTION => 'Single-bit ECC'
},
{
NUMSLOTS => 3,
SERIALNUMBER => undef,
DESCRIPTION => 'DIMM (Single-bit ECC)',
SPEED => '400 MHz (2.5 ns)',
TYPE => 'DDR',
CAPTION => 'DIMM 3',
CAPACITY => '512',
MEMORYCORRECTION => 'Single-bit ECC'
}
],
'rhel-4.3' => [
Expand Down Expand Up @@ -1619,6 +1629,6 @@ plan tests => scalar keys %tests;

foreach my $test (keys %tests) {
my $file = "resources/generic/dmidecode/$test";
my $memories = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Memory::_getMemories(file => $file);
is_deeply($memories, $tests{$test}, $test);
my @memories = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Memory::_getMemories(file => $file);
is_deeply(\@memories, $tests{$test}, $test);
}
7 changes: 4 additions & 3 deletions t/inventory/generic/dmidecode/ports.t
Expand Up @@ -64,7 +64,8 @@ my %tests = (
CAPTION => 'Other'
}
],
'freebsd-8.1' => undef,
'freebsd-8.1' => [
],
'linux-2.6' => [
{
NAME => 'PARALLEL',
Expand Down Expand Up @@ -1305,6 +1306,6 @@ plan tests => scalar keys %tests;

foreach my $test (keys %tests) {
my $file = "resources/generic/dmidecode/$test";
my $ports = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Ports::_getPorts(file => $file);
is_deeply($ports, $tests{$test}, $test);
my @ports = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Ports::_getPorts(file => $file);
is_deeply(\@ports, $tests{$test}, $test);
}
7 changes: 4 additions & 3 deletions t/inventory/generic/dmidecode/slots.t
Expand Up @@ -668,13 +668,14 @@ my %tests = (
DESIGNATION => undef
}
],
'windows-hyperV' => undef,
'windows-hyperV' => [
]
);

plan tests => scalar keys %tests;

foreach my $test (keys %tests) {
my $file = "resources/generic/dmidecode/$test";
my $slots = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Slots::_getSlots(file => $file);
is_deeply($slots, $tests{$test}, $test);
my @slots = FusionInventory::Agent::Task::Inventory::Input::Generic::Dmidecode::Slots::_getSlots(file => $file);
is_deeply(\@slots, $tests{$test}, $test);
}

0 comments on commit b3a55a2

Please sign in to comment.