Skip to content

Commit

Permalink
test: Use a fixed localTimeOffset for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed May 2, 2024
1 parent 60bcb46 commit f58d560
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion t/tasks/inventory/macos/softwares.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ my %tests = (
'sample6' => [ 362, 0 ],
);

# Use a fixed local timezone offset
my $localTimeOffset = 7200;

plan tests => 3 * scalar (keys %tests)
+ 7;

Expand All @@ -40,7 +43,11 @@ foreach my $test (sort keys %tests) {
$format = "xml";
}
my $dump = $file.".results.txt";
my $softwares = GLPI::Agent::Task::Inventory::MacOS::Softwares::_getSoftwaresList(file => $file, format => $format);
my $softwares = GLPI::Agent::Task::Inventory::MacOS::Softwares::_getSoftwaresList(
file => $file,
format => $format,
localTimeOffset => $localTimeOffset
);
# Dump found result when still not integrated in test file
my ($count, $update) = ref($tests{$test}) eq 'ARRAY' ? @{$tests{$test}} : (0, 1);
unless ($count && !$update && -e $dump) {
Expand Down

0 comments on commit f58d560

Please sign in to comment.