From 1ab559ab4458fb4d0cc3be323d0f0fe5a622dc52 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Sun, 19 Mar 2017 17:07:49 +0100 Subject: testbeds: placeholder for QEMU testbed --- examples/example.py | 1 + examples/two-layers.py | 12 +++++++----- rumba/model.py | 2 +- rumba/testbeds/qemu.py | 30 ++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 rumba/testbeds/qemu.py diff --git a/examples/example.py b/examples/example.py index 2222ee0..e173ef0 100755 --- a/examples/example.py +++ b/examples/example.py @@ -8,6 +8,7 @@ from rumba.model import * import rumba.testbeds.emulab as emulab import rumba.testbeds.jfed as jfed import rumba.testbeds.faketestbed as fake +import rumba.testbeds.qemu as qemu # import prototype plugins import rumba.prototypes.ouroboros as our diff --git a/examples/two-layers.py b/examples/two-layers.py index 3fba54e..7b5c868 100755 --- a/examples/two-layers.py +++ b/examples/two-layers.py @@ -8,6 +8,7 @@ from rumba.model import * import rumba.testbeds.emulab as emulab import rumba.testbeds.jfed as jfed import rumba.testbeds.faketestbed as fake +import rumba.testbeds.qemu as qemu # import prototype plugins import rumba.prototypes.ouroboros as our @@ -17,14 +18,15 @@ import rumba.prototypes.irati as irati n1 = NormalDIF("n1") n2 = NormalDIF("n2") n3 = NormalDIF("n3") +n4 = NormalDIF("n4") e1 = ShimEthDIF("e1") e2 = ShimEthDIF("e2") e3 = ShimEthDIF("e3") a = Node("a", - difs = [n3, n1, e1], - dif_registrations = {n3: [n1], n1 : [e1]}, + difs = [n3, n4, n1, e1], + dif_registrations = {n4: [n1], n3: [n1], n1 : [e1]}, registrations = {"rinaperf.server" : [n3]}, bindings = {"rinaperf.server" : "/usr/bin/rinaperf"}) @@ -33,14 +35,14 @@ b = Node("b", dif_registrations = {n1 : [e1, e2]}) c = Node("c", - difs = [n3, n1, n2, e2, e3], - dif_registrations = {n3: [n1, n2], n1 : [e2], n2: [e3]}) + difs = [n3, n4, n1, n2, e2, e3], + dif_registrations = {n4: [n1], n3: [n1, n2], n1 : [e2], n2: [e3]}) d = Node("d", difs = [n3, n2, e3], dif_registrations = {n3: [n2], n2 : [e3]}) -tb = fake.Testbed(exp_name = "twolayers", +tb = qemu.Testbed(exp_name = "twolayers", username = "vmaffio", proj_name = "cert.pem", password = "") diff --git a/rumba/model.py b/rumba/model.py index ddfc959..a043384 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -514,7 +514,7 @@ class Experiment: print("IPCP for node %s: %s" % (node.name, node.ipcps)) - # Examine the nodes and DIFs, compute the registration nd enrollment + # Examine the nodes and DIFs, compute the registration and enrollment # order, the list of IPCPs to create, registrations, ... def generate(self): self.compute_dif_ordering() diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py new file mode 100644 index 0000000..4e767e3 --- /dev/null +++ b/rumba/testbeds/qemu.py @@ -0,0 +1,30 @@ +# +# QEMU testbed for Rumba +# +# Vincenzo Maffione +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA + +import rumba.model as mod + +# Fake testbed, useful for testing +class Testbed(mod.Testbed): + def __init__(self, exp_name, username, proj_name = "ARCFIRE", + password = ""): + mod.Testbed.__init__(self, exp_name, username, password, proj_name) + + def create_experiment(self, nodes, links): + print("[QEMU testbed] experiment swapped in") -- cgit v1.2.3