# Copyright (C) 2013 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
import time
def add_node(ec, host, user, ssh_key = None):
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linuxNode")
ec.set(node, "hostname", host)
ec.set(node, "username", user)
ec.set(node, "identity", ssh_key)
- ec.set(node, "cleanHome", True)
+ ec.set(node, "cleanExperiment", True)
ec.set(node, "cleanProcesses", True)
return node
def add_ccnd(ec, node):
- ccnd = ec.register_resource("LinuxCCND")
+ ccnd = ec.register_resource("linux::CCND")
ec.set(ccnd, "debug", 7)
ec.register_connection(ccnd, node)
return ccnd
def add_ccnr(ec, ccnd):
- ccnr = ec.register_resource("LinuxCCNR")
+ ccnr = ec.register_resource("linux::CCNR")
ec.register_connection(ccnr, ccnd)
return ccnr
def add_fib_entry(ec, ccnd, peer_host):
- entry = ec.register_resource("LinuxFIBEntry")
+ entry = ec.register_resource("linux::FIBEntry")
ec.set(entry, "host", peer_host)
ec.register_connection(entry, ccnd)
return entry
def add_content(ec, ccnr, content_name, content):
- co = ec.register_resource("LinuxCCNContent")
+ co = ec.register_resource("linux::CCNContent")
ec.set(co, "contentName", content_name)
ec.set(co, "content", content)
ec.register_connection(co, ccnr)
command = "ccnpeek %(content_name)s; ccncat %(content_name)s" % {
"content_name" : content_name}
- app = ec.register_resource("LinuxCCNApplication")
+ app = ec.register_resource("linux::CCNApplication")
ec.set(app, "command", command)
ec.register_connection(app, ccnd)
ring_hosts = [host1, host2, host3, host4]
ccnds = dict()
- for i in xrange(len(ring_hosts)):
+ for i in range(len(ring_hosts)):
host = ring_hosts[i]
node = add_node(ec, host, pl_user, pl_ssh_key)
ccnd = add_ccnd(ec, node)
# Register a collector to automatically collect traces
collector = add_collector(ec, "stderr")
- for ccnd in ccnds.values():
+ for ccnd in ccnds:
ec.register_connection(collector, ccnd)
# deploy all ResourceManagers