Commit c203689e authored by Francesc Guasch's avatar Francesc Guasch
Browse files

test(ports): improved ports exposing testing

parent dcbc1ca5
...@@ -165,8 +165,8 @@ sub create_domain { ...@@ -165,8 +165,8 @@ sub create_domain {
, id_owner => $user->id , id_owner => $user->id
, %arg_create , %arg_create
, active => 0 , active => 0
, memory => 256*1024 , memory => 1024*1024
, disk => 1 * 1024 * 1024 , disk => 1024 * 1024 * 1024
); );
}; };
is('',''.$@); is('',''.$@);
......
...@@ -521,7 +521,7 @@ sub test_restricted($vm, $restricted) { ...@@ -521,7 +521,7 @@ sub test_restricted($vm, $restricted) {
flush_rules(); flush_rules();
flush_rules_node($vm); flush_rules_node($vm);
my $domain = create_domain($vm->type, user_admin,'debian'); my $domain = create_domain($vm->type, user_admin,'debian Stretch');
my $local_ip = $vm->ip; my $local_ip = $vm->ip;
my $remote_ip = '10.0.0.6'; my $remote_ip = '10.0.0.6';
...@@ -628,7 +628,9 @@ sub test_change_expose_3($vm) { ...@@ -628,7 +628,9 @@ sub test_change_expose_3($vm) {
my $remote_ip = '1.2.3.4'; my $remote_ip = '1.2.3.4';
$domain->start(user => user_admin, remote_ip => $remote_ip); $domain->start(user => user_admin, remote_ip => $remote_ip);
_wait_ip($vm->type, $domain); _wait_ip($vm->type, $domain);
rvd_back->_process_requests_dont_fork(1);
_check_port_rules($domain, $remote_ip); _check_port_rules($domain, $remote_ip);
...@@ -646,7 +648,8 @@ sub _check_port_rules($domain, $remote_ip, $msg='') { ...@@ -646,7 +648,8 @@ sub _check_port_rules($domain, $remote_ip, $msg='') {
for my $port ( $domain->list_ports ) { for my $port ( $domain->list_ports ) {
my ($n_rule, $n_rule_drop, $n_rule_nat) my ($n_rule, $n_rule_drop, $n_rule_nat)
=_search_rules($domain, $remote_ip, $port->{internal_port}, $port->{public_port}); =_search_rules($domain, $remote_ip, $port->{internal_port}, $port->{public_port});
ok($n_rule_nat,"Expecting NAT rule ".Dumper($port)."\n$msg") or exit; ok($n_rule_nat,"Expecting NAT rule ".Dumper($port)."\n$msg")
or confess;
if ($port->{restricted}) { if ($port->{restricted}) {
ok($n_rule); ok($n_rule);
ok($n_rule_drop); ok($n_rule_drop);
...@@ -694,7 +697,7 @@ clean(); ...@@ -694,7 +697,7 @@ clean();
add_network_10(0); add_network_10(0);
test_can_expose_ports(); test_can_expose_ports();
for my $vm_name ( 'Void','KVM') { for my $vm_name ( 'KVM', 'Void' ) {
my $vm = rvd_back->search_vm($vm_name); my $vm = rvd_back->search_vm($vm_name);
next if !$vm; next if !$vm;
......
Supports Markdown
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