#
#
# content ccncat
-# PL host Linux host
+# Linux host Linux host
# 0 ------- Internet ------ 0
#
from nepi.execution.ec import ExperimentController, ECState
-from nepi.execution.resource import ResourceState, ResourceAction, \
- populate_factory
+from nepi.execution.resource import ResourceState, ResourceAction
from nepi.resources.linux.node import OSType
from optparse import OptionParser, SUPPRESS_HELP
+import getpass
import os
import time
build = (
# Evaluate if ccnx binaries are already installed
" ( "
- " test -f ${EXP_HOME}/ccnx/bin/ccnd"
+ " test -f ${BIN}/ccnx-0.7.1/bin/ccnd"
" ) || ( "
# If not, untar and build
" ( "
- " mkdir -p ${SOURCES}/ccnx && "
- " tar xf ${SOURCES}/ccnx-0.7.1.tar.gz --strip-components=1 -C ${SOURCES}/ccnx "
+ " mkdir -p ${SRC}/ccnx-0.7.1 && "
+ " tar xf ${SRC}/ccnx-0.7.1.tar.gz --strip-components=1 -C ${SRC}/ccnx-0.7.1 "
" ) && "
- "cd ${SOURCES}/ccnx && "
+ "cd ${SRC}/ccnx-0.7.1 && "
# Just execute and silence warnings...
"( ./configure && make ) "
" )")
install = (
# Evaluate if ccnx binaries are already installed
" ( "
- " test -f ${EXP_HOME}/ccnx/bin/ccnd"
+ " test -f ${BIN}/ccnx-0.7.1/bin/ccnd"
" ) || ( "
- " mkdir -p ${EXP_HOME}/ccnx/bin && "
- " cp -r ${SOURCES}/ccnx ${EXP_HOME}"
+ " mkdir -p ${BIN}/ccnx-0.7.1/bin && "
+ " cp -r ${SRC}/ccnx-0.7.1/bin ${BIN}/ccnx-0.7.1"
" )"
)
- env = "PATH=$PATH:${EXP_HOME}/ccnx/bin"
+ env = "PATH=$PATH:${BIN}/ccnx-0.7.1/bin"
# BASH command -> ' ccndstart ; ccndc add ccnx:/ udp host ; ccnr '
command = "ccndstart && "
return app
def add_publish(ec, movie):
- env = "PATH=$PATH:${EXP_HOME}/ccnx/bin"
+ env = "PATH=$PATH:${BIN}/ccnx-0.7.1/bin"
command = "ccnseqwriter -r ccnx:/VIDEO"
app = ec.register_resource("LinuxApplication")
return app
def add_stream(ec):
- env = "PATH=$PATH:${EXP_HOME}/ccnx/bin"
+ env = "PATH=$PATH:${BIN}/ccnx-0.7.1/bin"
command = "sudo -S dbus-uuidgen --ensure ; ( ccncat ccnx:/VIDEO | vlc - ) "
app = ec.register_resource("LinuxApplication")
# the host can be accessed through SSH without prompting
# for a password. The host must allow X forwarding using SSH.
linux_host = 'roseval.pl.sophia.inria.fr'
-
+ linux_user = getpass.getuser()
+
usage = "usage: %prog -p <pl-host> -s <pl-slice> -l <linux-host> -u <linux-user> -m <movie> -e <exp-id> -i <ssh_key>"
parser = OptionParser(usage=usage)
help="Hostname of second Linux host (non PlanetLab)",
default = linux_host, type="str")
parser.add_option("-u", "--linux-user", dest="linux_user",
- help="User for extra Linux host (non PlanetLab)", default = linux_host,
- type="str")
+ help="User for extra Linux host (non PlanetLab)",
+ default = linux_user, type="str")
parser.add_option("-m", "--movie", dest="movie",
help="Stream movie", type="str")
parser.add_option("-e", "--exp-id", dest="exp_id",
( pl_host, pl_user, linux_host, linux_user, movie, exp_id, pl_ssh_key
) = get_options()
- # Search for available RMs
- populate_factory()
-
# Create the ExperimentController instance
ec = ExperimentController(exp_id = exp_id)