From: Marius Gavrilescu Date: Mon, 21 Sep 2015 17:29:57 +0000 (+0300) Subject: Make t/real.t clean up after itself properly X-Git-Tag: 0.001001~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=3fe0289735ee971183763e0d36351f8c4df92f8c;p=webservice-scaleway.git Make t/real.t clean up after itself properly --- diff --git a/t/real.t b/t/real.t index 07b9d2c..29df623 100644 --- a/t/real.t +++ b/t/real.t @@ -34,7 +34,7 @@ my @vols = $sw->volumes; ok grep ({$_->name eq $vol->name} @vols), 'list_volumes'; my ($debian) = grep { $_->name =~ /debian jessie/i } $sw->images; -my $srv = $sw->create_server('mysrv', $org, $debian, {1 => {%$vol}}); +my $srv = $sw->create_server('mysrv', $org, $debian, {1 => $vol->id}); note "Created new server $srv with name ", $srv->name; is $sw->server($srv)->name, $srv->name, 'get_server'; $srv->{name} = 'testsrv'; @@ -52,8 +52,7 @@ note "This server can: ", join ' ', $sw->server_actions($srv); #$sw->update_snapshot($snp); #is $sw->snapshot($snp)->name, $snp->name, 'update_snapshot'; -sleep 20; - +@vols = map { $_->{id} } values %{$srv->volumes}; $sw->delete_server($srv); $sw->delete_ip($ip); -$sw->delete_volume($vol); +$sw->delete_volume($_) for @vols;