aboutsummaryrefslogtreecommitdiff
path: root/examples/mouse.py
blob: 25e248753fce911c12af1e7033b470446c674ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env python

# An example script using the rumba package

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

n01 = NormalDIF("n01")

e01 = ShimEthDIF("e01")
e02 = ShimEthDIF("e02")
e03 = ShimEthDIF("e03")
e04 = ShimEthDIF("e04")
e05 = ShimEthDIF("e05")
e06 = ShimEthDIF("e06")
e07 = ShimEthDIF("e07")
e08 = ShimEthDIF("e08")
e09 = ShimEthDIF("e09")
e10 = ShimEthDIF("e10")
e11 = ShimEthDIF("e11")
e12 = ShimEthDIF("e12")
e13 = ShimEthDIF("e13")
e14 = ShimEthDIF("e14")
e15 = ShimEthDIF("e15")
e16 = ShimEthDIF("e16")
e17 = ShimEthDIF("e17")


a = Node("a",
         difs = [n01, e01, e06, e13 ],
         dif_registrations = {n01 : [e01, e06, e13]})

b = Node("b",
         difs = [n01, e01, e02, e04],
         dif_registrations = {n01 : [e01, e02, e04]})

c = Node("c",
         difs = [n01, e02, e03],
         dif_registrations = {n01 : [e02, e03]})

d = Node("d",
         difs = [n01, e03, e04, e05],
         dif_registrations = {n01 : [e03, e04, e05]})

e = Node("e",
         difs = [n01, e05, e06, e07],
         dif_registrations = {n01 : [e05, e06, e07]})

f = Node("f",
         difs = [n01, e07, e08],
         dif_registrations = {n01 : [e07, e08]})

g = Node("g",
         difs = [n01, e08, e09, e14],
         dif_registrations = {n01 : [e08, e09, e14]})

h = Node("h",
         difs = [n01, e09, e10, e15],
         dif_registrations = {n01 : [e09, e10, e15]})

i = Node("i",
         difs = [n01, e10, e11, e16],
         dif_registrations = {n01 : [e10, e11, e16]})

j = Node("j",
         difs = [n01, e11, e12],
         dif_registrations = {n01 : [e11, e12]})

k = Node("k",
         difs = [n01, e12, e13],
         dif_registrations = {n01 : [e12, e13]})

l = Node("l",
         difs = [n01, e14, e15],
         dif_registrations = {n01 : [e14, e15]})

m = Node("m",
         difs = [n01, e16, e17],
         dif_registrations = {n01 : [e16, e17]})

n = Node("n",
         difs = [n01, e17],
         dif_registrations = {n01 : [e17]})

tb = jfed.Testbed(exp_name = "mouse2",
                  cert_file = "/home/sander/cert.pem",
                  username = "sander")

exp = rl.Experiment(tb, nodes = [a, b, c, d, e, f, g, h, i, j, k, l, m, n])

print(exp)

exp.swap_in()
exp.install_prototype()
exp.bootstrap_prototype()