aboutsummaryrefslogtreecommitdiff
path: root/examples/triangle.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/triangle.py')
-rw-r--r--examples/triangle.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/triangle.py b/examples/triangle.py
new file mode 100644
index 0000000..6be58a5
--- /dev/null
+++ b/examples/triangle.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env/python
+
+from rumba.model import *
+
+# import testbed plugins
+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
+import rumba.prototypes.rlite as rl
+import rumba.prototypes.irati as irati
+
+shim500 = ShimEthDIF("shim500", link_speed=30))
+shim400 = ShimEthDIF("shim400", link_speed=20))
+shim300 = ShimEthDIF("shim300", link_speed=10))
+
+n1 = NormalDIF("n1")
+
+a = Node("a",
+ difs=[300, 500, n1],
+ dif_registrations={n1: [300, 500]})
+
+b = Node("b",
+ difs=[300, 400, n1],
+ dif_registrations={n1: [300, 400]})
+
+c = Node("c",
+ difs=[400, 500, n1],
+ dif_registrations={n1: [400, 500]})
+
+tb = qemu.Testbed(exp_name = "triangle",
+ bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage",
+ initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio")
+
+exp = rl.Experiment(tb, nodes = [a, b, c, d])
+
+print(exp)
+
+exp.run()