Commit 4525c37b authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Merge branch 'master' into develop

parents e60cda1c a76f2b44
...@@ -3,7 +3,7 @@ package Ravada; ...@@ -3,7 +3,7 @@ package Ravada;
use warnings; use warnings;
use strict; use strict;
our $VERSION = '0.5.0-rc7'; our $VERSION = '0.5.0-rc8';
use Carp qw(carp croak); use Carp qw(carp croak);
use Data::Dumper; use Data::Dumper;
...@@ -2315,9 +2315,9 @@ sub _execute { ...@@ -2315,9 +2315,9 @@ sub _execute {
} }
$request->status('working','') unless $request->status() eq 'waiting'; $request->status('working','') unless $request->status() eq 'waiting';
$request->pid($$);
$request->start_time(time); $request->start_time(time);
$request->error(''); $request->error('');
$request->status('working','');
if ($dont_fork || !$CAN_FORK) { if ($dont_fork || !$CAN_FORK) {
$self->_do_execute_command($sub, $request); $self->_do_execute_command($sub, $request);
return; return;
......
...@@ -214,31 +214,6 @@ sub test_one_port($vm) { ...@@ -214,31 +214,6 @@ sub test_one_port($vm) {
ok($n_rule,"Expecting rule for -> $local_ip:$public_port") or exit; ok($n_rule,"Expecting rule for -> $local_ip:$public_port") or exit;
#####################################################################3
#
# Check rule won't disapear refreshing
my $req1 = Ravada::Request->refresh_vms();
my $req2 = Ravada::Request->refresh_machine(id_domain => $domain->id, uid => user_admin->id);
wait_request();
is($req1->status,'done');
is($req1->error,'');
is($req2->status,'done');
is($req2->error,'');
($n_rule)
= search_iptable_remote(local_ip => "$local_ip/32"
, local_port => $public_port
, table => 'nat'
, chain => 'PREROUTING'
, node => $vm
, jump => 'DNAT'
, 'to-destination' => $domain->ip.":".$internal_port
);
ok($n_rule,"Expecting rule for -> $local_ip:$public_port") or exit;
################################################################# #################################################################
# #
...@@ -522,39 +497,6 @@ sub test_clone_exports($vm) { ...@@ -522,39 +497,6 @@ sub test_clone_exports($vm) {
$base->remove(user_admin); $base->remove(user_admin);
} }
sub test_clone_exports_add_ports($vm) {
my $base = create_domain($vm, user_admin,'debian stretch');
$base->expose(port => 22, name => "ssh");
my @base_ports0 = $base->list_ports();
$base->prepare_base(user => user_admin, with_cd => 1);
my $clone = $base->clone(name => new_domain_name, user => user_admin);
$base->expose(port => 80, name => "web");
my @base_ports = $base->list_ports();
is(scalar @base_ports, scalar @base_ports0 + 1);
$clone->start(remote_ip => '10.1.1.1', user => user_admin);
my @clone_ports = $clone->list_ports();
is(scalar @clone_ports,2 );
for my $n ( 0 .. 1 ) {
is($base_ports[$n]->{internal_port}, $clone_ports[$n]->{internal_port});
isnt($base_ports[$n]->{public_port}, $clone_ports[$n]->{public_port},"Same public port in clone and base for ".$base_ports[$n]->{internal_port});
is($base_ports[$n]->{name}, $clone_ports[$n]->{name});
}
_wait_ip($vm, $clone);
wait_request( );
my @out = split /\n/, `iptables -t nat -L PREROUTING -n`;
ok(grep /dpt:\d+.*\d+:22/, @out);
ok(grep /dpt:\d+.*\d+:80/, @out);
$clone->remove(user_admin);
$base->remove(user_admin);
}
sub _wait_ip { sub _wait_ip {
my $vm_name = shift; my $vm_name = shift;
my $domain = shift or confess "Missing domain arg"; my $domain = shift or confess "Missing domain arg";
...@@ -956,7 +898,6 @@ for my $vm_name ( 'KVM', 'Void' ) { ...@@ -956,7 +898,6 @@ for my $vm_name ( 'KVM', 'Void' ) {
next if !$vm; next if !$vm;
diag("Testing $vm_name"); diag("Testing $vm_name");
test_clone_exports_add_ports($vm);
test_no_dupe($vm); test_no_dupe($vm);
...@@ -979,7 +920,6 @@ for my $vm_name ( 'KVM', 'Void' ) { ...@@ -979,7 +920,6 @@ for my $vm_name ( 'KVM', 'Void' ) {
test_clone_exports($vm); test_clone_exports($vm);
test_clone_exports_add_ports($vm);
} }
flush_rules(); flush_rules();
......
...@@ -96,10 +96,4 @@ ...@@ -96,10 +96,4 @@
</div> </div>
% } % }
<div ng-show="message.length" class="alert alert-light border-primary text-primary mt-4">
<div ng-repeat="text in message">
{{text}}
</div>
</div>
</div> </div>
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