MT#5887 copy the original config.yml file and restore it after the tests.

mr3.3.1
Victor Seva 12 years ago
parent 4347a909dd
commit a17d3c9ef4

@ -19,6 +19,7 @@
# Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
#
use File::Spec;
use File::Copy;
use Tie::File;
use strict;
use warnings;
@ -59,8 +60,6 @@ else
$base_dir = '/usr/share/kamailio-config-tests';
}
$yaml = YAML::Tiny->read($file) or die "File $file could not be read";
my ($action, $domain) = @ARGV;
$action = 'off' unless defined($action);
@ -68,13 +67,7 @@ $domain = 'spce.test' unless defined($domain);
if (lc($action) eq "off")
{
$yaml->[0]->{kamailio}{lb}{debug} = 'no';
$yaml->[0]->{kamailio}{lb}{use_dns_cache} = 'on';
$yaml->[0]->{kamailio}{proxy}{debug} = 'no';
$yaml->[0]->{kamailio}{proxy}{presence}{enable} = 'no';
$yaml->[0]->{sems}{debug} = 'no';
$yaml->[0]->{checktools}{sip_check_enable} = 1;
move($file.".orig", $file);
tie @array, 'Tie::File', '/etc/hosts' or die ('Can set test domain on /etc/hosts');
for (@array)
{
@ -94,6 +87,8 @@ if (lc($action) eq "off")
}
else
{
copy($file, $file.".orig") or die "Copy failed: $!";
$yaml = YAML::Tiny->read($file) or die "File $file could not be read";
$yaml->[0]->{kamailio}{lb}{debug} = 'yes';
$yaml->[0]->{kamailio}{lb}{use_dns_cache} = 'off';
$yaml->[0]->{kamailio}{proxy}{debug} = 'yes';

Loading…
Cancel
Save