Changing ResourceManager naming for platform::ResourceName
[nepi.git] / examples / linux / netcat_file_transfer.py
index e2047d1..d42166e 100644 (file)
@@ -54,7 +54,7 @@ ssh_key = options.ssh_key
 ec = ExperimentController(exp_id = "nc_file_transfer")
 
 ## Register node 1
-node1 = ec.register_resource("LinuxNode")
+node1 = ec.register_resource("linux::Node")
 # Set the hostname of the first node to use for the experiment
 ec.set(node1, "hostname", hostname1)
 # username should be your SSH user 
@@ -67,7 +67,7 @@ ec.set(node1, "cleanExperiment", True)
 ec.set(node1, "cleanProcesses", True)
 
 ## Register node 2 
-node2 = ec.register_resource("LinuxNode")
+node2 = ec.register_resource("linux::Node")
 # Set the hostname of the first node to use for the experiment
 ec.set(node2, "hostname", hostname2)
 # username should be your SSH user 
@@ -88,7 +88,7 @@ local_path_to_video = os.path.join(
 command = "cat ${SHARE}/%s | pv -fbt 2> bw.txt | nc %s 1234" % ( 
         video, hostname2 )
 
-server = ec.register_resource("LinuxApplication")
+server = ec.register_resource("linux::Application")
 ec.set(server, "depends", "pv nc tcpdump")
 ec.set(server, "files", local_path_to_video)
 ec.set(server, "command", command)
@@ -100,7 +100,7 @@ ec.register_connection(server, node1)
 # if not nc in the client side close the socket suddently if runned in background
 command =  "nc -dl 1234 > %s" % video
 
-client = ec.register_resource("LinuxApplication")
+client = ec.register_resource("linux::Application")
 ec.set(client, "depends", "nc")
 ec.set(client, "command", command)
 ec.register_connection(client, node2)
@@ -108,7 +108,7 @@ ec.register_connection(client, node2)
 # Register a tcpdump in the server node to monitor the file transfer 
 command = "tcpdump -ni eth0 -w file_transfer.pcap -s0 port 1234 2>&1"
 
-capture = ec.register_resource("LinuxApplication")
+capture = ec.register_resource("linux::Application")
 ec.set(capture, "depends", "tcpdump")
 ec.set(capture, "command", command)
 ec.set(capture, "sudo", True)