Commit 06c12dad authored by Francesc Guasch's avatar Francesc Guasch
Browse files

test: improved some tests on ports and remote

parent 0eef0fda
......@@ -1324,7 +1324,7 @@ sub _clean_remote_nodes {
sub clean_remote_node {
my $node = shift;
start_node($node);
start_node($node) if !$node->is_local();
_remove_old_domains_vm($node);
wait_request(debug => 0);
_remove_old_disks($node);
......
......@@ -138,21 +138,29 @@ sub test_start_after_hibernate($domain
my $internal_net = $internal_ip;
$internal_net =~ s{(.*)\.\d+$}{$1.0/24};
$domain->start(user => user_admin, remote_ip => $remote_ip);
my ($in,$out,$err);
run3(['iptables','-t','nat','-L','PREROUTING','-n'],\($in, $out, $err));
my @out = split /\n/,$out;
run3(['iptables','-L','FORWARD','-n'],\($in, $out, $err));
@out = split /\n/,$out;
Ravada::Request->start_domain(
uid => user_admin->id
,id_domain => $domain->id
,remote_ip => $remote_ip
);
delete_request('enforce_limits');
wait_request(debug => 0);
wait_request(debug => 0, skip => 'enforce_limits');
my ($in,$out,$err);
run3(['iptables','-t','nat','-L','PREROUTING','-n'],\($in, $out, $err));
die $err if $err;
my @out = split /\n/,$out;
@out = split /\n/,$out;
is(grep(/^DNAT.*$local_ip.*dpt:$public_port to:$internal_ip:$internal_port/,@out),1);
run3(['iptables','-L','FORWARD','-n'],\($in, $out, $err));
die $err if $err;
@out = split /\n/,$out;
is(grep(m{^ACCEPT.*$internal_net\s+state NEW},@out),1) or die $out;
is(grep(m{^ACCEPT.*$internal_net\s+state NEW},@out),1) or die $domain->name."\n".$out;
run3(['iptables','-L','FORWARD','-n'],\($in, $out, $err));
die $err if $err;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment