Revision 0b9269d8
b/kamaki/cli/commands/pithos_cli.py | ||
---|---|---|
36 | 36 |
from kamaki.cli.errors import CLIError, raiseCLIError |
37 | 37 |
from kamaki.cli.utils import format_size, print_dict, pretty_keys, print_list |
38 | 38 |
from kamaki.cli.argument import FlagArgument, ValueArgument, IntArgument |
39 |
from . import _command_init
|
|
39 |
from kamaki.cli.commands import _command_init
|
|
40 | 40 |
#set_api_description('store', 'Pithos+ storage commands') |
41 | 41 |
API_DESCRIPTION = dict(store='Pithos+ storage commands') |
42 | 42 |
from kamaki.clients.pithos import PithosClient, ClientError |
b/kamaki/clients/tests.py | ||
---|---|---|
194 | 194 |
print('\tDelete network %s'%netid) |
195 | 195 |
self.client.delete_network(netid) |
196 | 196 |
|
197 |
def _wait_for_nic(self, netid, servid): |
|
197 |
def _wait_for_nic(self, netid, servid, in_creation=True):
|
|
198 | 198 |
c=['|','/','-','\\'] |
199 | 199 |
limit = 50 |
200 | 200 |
wait=3 |
201 | 201 |
while wait < limit: |
202 | 202 |
nics = self.client.list_server_nics(servid) |
203 | 203 |
for net in nics: |
204 |
if net['id'] == netid: |
|
204 |
found_nic = net['id'] == netid |
|
205 |
if (in_creation and found_nic) or not (in_creation or found_nic): |
|
205 | 206 |
return True |
206 |
sys.stdout.write('\twait nic %s to connect to %s: %ss '%(netid, servid, wait)) |
|
207 |
dis = '' if in_creation else 'dis' |
|
208 |
sys.stdout.write('\twait nic %s to %sconnect to %s: %ss '%(netid, dis, servid, wait)) |
|
207 | 209 |
for i in range(wait*4): |
208 | 210 |
sys.stdout.write('\b%s'%c[i%4]) |
209 | 211 |
sys.stdout.flush() |
... | ... | |
739 | 741 |
self._test_disconnect_server() |
740 | 742 |
|
741 | 743 |
def _test_disconnect_server(self): |
742 |
pass |
|
744 |
self.client.disconnect_server(self.server1['id'], self.network1['id']) |
|
745 |
self.assertTrue(self._wait_for_nic(self.network1['id'], self.server1['id'], |
|
746 |
in_creation=False)) |
|
747 |
|
|
743 | 748 |
|
744 | 749 |
@if_not_all |
745 | 750 |
def test_list_server_nics(self): |
Also available in: Unified diff