From 6818af98498a890bcca9cbc8034aaa1a733e6230 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Sat, 8 Apr 2017 12:36:51 +0200 Subject: testbeds: qemu: modify constructor arguments vm_img_folder --> bzimage, initramfs --- examples/example.py | 10 +++++----- examples/two-layers.py | 6 ++++-- rumba/prototypes/rlite.py | 2 ++ rumba/testbeds/qemu.py | 13 ++++++++----- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/examples/example.py b/examples/example.py index e173ef0..0d8fcd9 100755 --- a/examples/example.py +++ b/examples/example.py @@ -30,12 +30,12 @@ b = Node("b", difs = [e1, n1], dif_registrations = {n1 : [e1]}) -tb = jfed.Testbed(exp_name = "letest", - username = "sander", - cert_file = "cert.pem", - jfed_jar = "jfed_cli/experimenter-cli.jar") +tb = qemu.Testbed(exp_name = "example1", + username = "vmaffione", + bzimage = '/home/vmaffione/git/rlite/demo/buildroot/bzImage', + initramfs = '/home/vmaffione/git/rlite/demo/buildroot/rootfs.cpio') -exp = irati.Experiment(tb, nodes = [a, b]) +exp = rl.Experiment(tb, nodes = [a, b]) print(exp) diff --git a/examples/two-layers.py b/examples/two-layers.py index 29faebe..687c99f 100755 --- a/examples/two-layers.py +++ b/examples/two-layers.py @@ -43,9 +43,11 @@ d = Node("d", dif_registrations = {n3: [n2], n2 : [e3]}) tb = qemu.Testbed(exp_name = "twolayers", - username = "vmaffio") + username = "vmaffione", + bzimage = '/home/vmaffione/git/rlite/demo/buildroot/bzImage', + initramfs = '/home/vmaffione/git/rlite/demo/buildroot/rootfs.cpio') -exp = irati.Experiment(tb, nodes = [a, b, c, d]) +exp = rl.Experiment(tb, nodes = [a, b, c, d]) print(exp) diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py index 8cb45ec..f4ff825 100644 --- a/rumba/prototypes/rlite.py +++ b/rumba/prototypes/rlite.py @@ -20,6 +20,7 @@ import rumba.ssh_support as ssh import rumba.model as mod +import time # An experiment over the RLITE implementation class Experiment(mod.Experiment): @@ -46,4 +47,5 @@ class Experiment(mod.Experiment): print("[RLITE experiment] start") print("Setting up rlite on the nodes...") self.setup() + time.sleep(20) print("[RLITE experiment] end") diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index 8079f28..82ad873 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -27,12 +27,13 @@ import rumba.model as mod class Testbed(mod.Testbed): - def __init__(self, exp_name, username, vm_img_folder, proj_name="ARCFIRE", password="", + def __init__(self, exp_name, username, bzimage, initramfs, proj_name="ARCFIRE", password="", use_vhost=True, qemu_out_folder=""): mod.Testbed.__init__(self, exp_name, username, password, proj_name) self.vms = {} self.shims = [] - self.vm_img_path = vm_img_folder + self.bzimage = bzimage + self.initramfs = initramfs self.vhost = use_vhost self.qemu_folder = qemu_out_folder self.boot_processes = [] @@ -173,7 +174,9 @@ class Testbed(mod.Testbed): vm['id'] = vmid vars_dict = {'fwdp': fwdp, 'id': vmid, 'mac': mac, - 'vmimgpath': self.vm_img_path, 'fwdc': fwdc, + 'bzimage': self.bzimage, + 'initramfs': self.initramfs, + 'fwdc': fwdc, 'memory': vm_memory, 'frontend': vm_frontend, 'vmname': name} @@ -182,9 +185,9 @@ class Testbed(mod.Testbed): command = 'qemu-system-x86_64 ' # TODO manage non default images - command += ('-kernel %(vmimgpath)s/bzImage ' + command += ('-kernel %(bzimage)s ' '-append "console=ttyS0" ' - '-initrd %(vmimgpath)s/rootfs.cpio ' + '-initrd %(initramfs)s ' % vars_dict) command += ('-nographic ' '-display none ' -- cgit v1.2.3