aboutsummaryrefslogtreecommitdiff
path: root/rumba/testbeds/qemu.py
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-04-15 10:06:55 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-04-15 10:06:55 +0200
commit1d3022acb3fa3067f2027ae1a2c61aa99790c024 (patch)
tree306392d72db6ad85051ae531baa05fa3bc45e927 /rumba/testbeds/qemu.py
parentfc1252893bed0dc92220bc223aa9e7c5a77675b9 (diff)
downloadrumba-1d3022acb3fa3067f2027ae1a2c61aa99790c024.tar.gz
rumba-1d3022acb3fa3067f2027ae1a2c61aa99790c024.zip
qemu: minor fixes to print() statements
Diffstat (limited to 'rumba/testbeds/qemu.py')
-rw-r--r--rumba/testbeds/qemu.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py
index 174b860..d998625 100644
--- a/rumba/testbeds/qemu.py
+++ b/rumba/testbeds/qemu.py
@@ -62,7 +62,7 @@ class Testbed(mod.Testbed):
for command in commands:
if not error_queue.empty() and not ignore_errors:
break
- print('DEBUG: executing >> %s' % command)
+ print('qemu: executing >> %s' % command)
try:
subprocess.check_call(command.split())
except subprocess.CalledProcessError as e:
@@ -88,7 +88,7 @@ class Testbed(mod.Testbed):
port_id = port['port_id']
vm_id = self.vms[node_name]['id']
mac = '00:0a:0a:0a:%02x:%02x' % (vm_id, port_id)
- print('DEBUG: recovering ifname for port: '
+ print('qemu: recovering ifname for port: '
+ port['tap_id'] + '.')
output = ssh_support.execute_command(
self,
@@ -117,13 +117,12 @@ class Testbed(mod.Testbed):
except subprocess.CalledProcessError:
raise Exception('Not authenticated')
- print("[QEMU testbed] swapping in")
+ print("qemu: swapping in")
# Building bridges and taps
shim_processes = []
r_queue = multiprocessing.Queue()
e_queue = multiprocessing.Queue()
- print(experiment.dif_ordering)
for shim in experiment.dif_ordering:
if not isinstance(shim, mod.ShimEthDIF):
# Nothing to do here
@@ -196,14 +195,14 @@ class Testbed(mod.Testbed):
# Check for errors
if not e_queue.empty():
error_str = str(e_queue.get())
- print('Testbed instantiation failed: %s' % error_str)
+ print('qemu: Testbed instantiation failed: %s' % error_str)
raise Exception('Failure: %s' % error_str)
try:
# Check for results
result = r_queue.get(timeout=1)
if result == "Command chain ran correctly.":
over_processes += 1
- print('DEBUG: %s of %s processes completed.'
+ print('qemu: %s of %s processes completed.'
% (over_processes, total_processes))
except:
max_waiting_time -= 1
@@ -278,7 +277,7 @@ class Testbed(mod.Testbed):
booting_budget -= 1
if booting_budget <= 0:
- print('Sleeping %s secs waiting '
+ print('qemu: Sleeping %s secs waiting '
'for the VMs to boot' % boot_backoff)
time.sleep(boot_backoff)
@@ -286,7 +285,7 @@ class Testbed(mod.Testbed):
with open('%s/qemu_out_%s' % (self.qemu_logs_dir, vmid), 'w')\
as out_file:
- print('DEBUG: executing >> %s' % command)
+ print('qemu: executing >> %s' % command)
self.boot_processes.append(subprocess.Popen(command.split(),
stdout=out_file))
@@ -296,11 +295,11 @@ class Testbed(mod.Testbed):
if booting_budget < boot_backoff:
tsleep = boot_backoff * (boot_batch_size - booting_budget) / \
boot_batch_size
- print('Sleeping %s secs waiting for the last VMs to boot' % tsleep)
+ print('qemu: Sleeping %s secs waiting for the last VMs to boot' % tsleep)
time.sleep(tsleep)
# TODO: to be removed, we should loop in the ssh part
- print('Sleeping 5 seconds, just to be on the safe side')
+ print('qemu: Sleeping 5 seconds, just to be on the safe side')
time.sleep(5)
self.recover_if_names(experiment)
@@ -347,16 +346,15 @@ class Testbed(mod.Testbed):
while max_waiting_time > 0 and over_processes < total_processes:
# Check for errors
if not error_queue.empty():
- print(
- 'Failure while shutting down: %s' % str(error_queue.get())
- )
+ print('qemu:Failure while shutting down: %s'\
+ % str(error_queue.get()))
over_processes += 1
try:
# Check for results
result = results_queue.get(timeout=1)
if result == "Command chain ran correctly.":
over_processes += 1
- print('DEBUG: %s of %s tear-down port processes completed.'
+ print('qemu: %s of %s tear-down port processes completed.'
% (over_processes, total_processes))
except:
max_waiting_time -= 1
@@ -386,7 +384,7 @@ class Testbed(mod.Testbed):
while max_waiting_time > 0 and over_processes < total_processes:
# Check for errors
if not error_queue.empty():
- print('Failure while shutting down: %s'
+ print('qemu: Failure while shutting down: %s'
% str(error_queue.get()))
over_processes += 1
try:
@@ -394,7 +392,7 @@ class Testbed(mod.Testbed):
result = results_queue.get(timeout=1)
if result == "Command chain ran correctly.":
over_processes += 1
- print('DEBUG: %s of %s tear-down shim processes completed.'
+ print('qemu: %s of %s tear-down shim processes completed.'
% (over_processes, total_processes))
except:
max_waiting_time -= 1