From aa738ee3553b5b023dccb241676f285ec669866c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 4 May 2020 11:10:56 +0200 Subject: [PATCH] test: force ctime to UTC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise this test fails depending on TZ of the testing system Signed-off-by: Fabian Grünbichler --- test/list_volumes_test.pm | 20 ++++++++++---------- test/run_plugin_tests.pl | 3 +++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/test/list_volumes_test.pm b/test/list_volumes_test.pm index efcb547..02edc35 100644 --- a/test/list_volumes_test.pm +++ b/test/list_volumes_test.pm @@ -130,7 +130,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585595500, + 'ctime' => 1585602700, 'format' => 'vma.gz', 'size' => DEFAULT_SIZE, 'vmid' => '16110', @@ -138,7 +138,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585595565, + 'ctime' => 1585602765, 'format' => 'vma.lzo', 'size' => DEFAULT_SIZE, 'vmid' => '16110', @@ -146,7 +146,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585595635, + 'ctime' => 1585602835, 'format' => 'vma', 'size' => DEFAULT_SIZE, 'vmid' => '16110', @@ -154,7 +154,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585595635, + 'ctime' => 1585602835, 'format' => 'vma.zst', 'size' => DEFAULT_SIZE, 'vmid' => '16110', @@ -199,7 +199,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585597170, + 'ctime' => 1585604370, 'format' => 'tar.lzo', 'size' => DEFAULT_SIZE, 'vmid' => '16112', @@ -207,7 +207,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585597770, + 'ctime' => 1585604970, 'format' => 'tar.gz', 'size' => DEFAULT_SIZE, 'vmid' => '16112', @@ -215,7 +215,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585597770, + 'ctime' => 1585604970, 'format' => 'tar.zst', 'size' => DEFAULT_SIZE, 'vmid' => '16112', @@ -223,7 +223,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1585598370, + 'ctime' => 1585605570, 'format' => 'tgz', 'size' => DEFAULT_SIZE, 'vmid' => '16112', @@ -365,7 +365,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1580756263, + 'ctime' => 1580759863, 'format' => 'tar.gz', 'size' => DEFAULT_SIZE, 'vmid' => '19253', @@ -373,7 +373,7 @@ my @tests = ( }, { 'content' => 'backup', - 'ctime' => 1548095359, + 'ctime' => 1548098959, 'format' => 'tar', 'size' => DEFAULT_SIZE, 'vmid' => '19254', diff --git a/test/run_plugin_tests.pl b/test/run_plugin_tests.pl index e29fc88..54322bb 100755 --- a/test/run_plugin_tests.pl +++ b/test/run_plugin_tests.pl @@ -3,6 +3,9 @@ use strict; use warnings; +# to ensure consistent ctime values on all systems +$ENV{TZ} = 'UTC'; + use TAP::Harness; my $harness = TAP::Harness->new( { verbosity => -1 });