You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
702 B
33 lines
702 B
package Utils::Env;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
use POSIX qw(tzset strftime);
|
|
|
|
require Exporter;
|
|
our @ISA = qw(Exporter);
|
|
our @EXPORT_OK = qw(
|
|
set_local_timezone
|
|
);
|
|
|
|
## no critic (Variables::RequireLocalizedPunctuationVars)
|
|
$ENV{RATEOMAT_BILLING_DB_HOST} = '192.168.0.29';
|
|
$ENV{RATEOMAT_PROVISIONING_DB_HOST} = '192.168.0.29';
|
|
$ENV{RATEOMAT_ACCOUNTING_DB_HOST} = '192.168.0.29';
|
|
|
|
$ENV{CATALYST_SERVER} = 'https://127.0.0.1:1443';
|
|
|
|
sub set_local_timezone {
|
|
(my $tz,$ENV{RATEOMAT_CONNECTION_TIMEZONE}) = @_;
|
|
if ($tz) {
|
|
my $old_tz = strftime("%Z", localtime());
|
|
$ENV{TZ} = $tz;
|
|
tzset;
|
|
diag("switching local timezone from $old_tz to " . strftime("%Z", localtime()));
|
|
}
|
|
}
|
|
|
|
1;
|