except RuntimeError, e:
if self.check_bad_host(e.args[0], e.args[1]):
self.node.blacklist()
- raise RuntimeError, "Failed install build sources on node %s: %s %s. command %s" % (
+ raise RuntimeError, "Failed install build sources on node %s: %s %s. COMMAND %s" % (
self.node.hostname, e.args[0], e.args[1], command)
def set_master(self, master):
# Attributes
self.ccnLocalPort = None
self.ccnRoutes = None
- self.ccnxVersion = "ccnx-0.6.0"
+ self.ccnxVersion = "0.7.1"
- #self.ccnx_0_5_1_sources = "http://www.ccnx.org/releases/ccnx-0.5.1.tar.gz"
- self.ccnx_0_5_1_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.5.1.tar.gz"
- #self.ccnx_0_6_0_sources = "http://www.ccnx.org/releases/ccnx-0.6.0.tar.gz"
- self.ccnx_0_6_0_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.6.0.tar.gz"
- #self.buildDepends = 'make gcc development-tools openssl-devel expat-devel libpcap-devel libxml2-devel'
+ #self.ccnx_0_6_0_sources = "http://yans.pl.sophia.inria.fr/libs/ccnx-0.6.0.tar.gz"
+ self.ccnx_sources = "http://www.ccnx.org/releases/ccnx-%s.tar.gz"
self.buildDepends = 'make gcc openssl-devel expat-devel libpcap-devel libxml2-devel'
- self.ccnx_0_5_1_build = (
+ self.ccnx_build = (
" ( "
" cd .. && "
- " test -d ccnx-0.5.1-src/build/bin "
+ " test -d ccnx-src/build/bin "
" ) || ( "
# Not working, rebuild
"("
- " mkdir -p ccnx-0.5.1-src && "
- " wget -q -c -O ccnx-0.5.1-src.tar.gz %(ccnx_source_url)s &&"
- " tar xf ccnx-0.5.1-src.tar.gz --strip-components=1 -C ccnx-0.5.1-src "
+ " mkdir -p ccnx-src && "
+ " wget -q -c -O ccnx-src.tar.gz %(ccnx_source_url)s &&"
+ " tar xf ccnx-src.tar.gz --strip-components=1 -C ccnx-src "
") && "
- "cd ccnx-0.5.1-src && "
- "mkdir -p build/include &&"
- "mkdir -p build/lib &&"
- "mkdir -p build/bin &&"
- "I=$PWD/build && "
- "INSTALL_BASE=$I ./configure &&"
- "make && make install"
- " )") % dict(
- ccnx_source_url = server.shell_escape(self.ccnx_0_5_1_sources),
- )
-
- self.ccnx_0_5_1_install = (
- " ( "
- " test -d ${BUILD}/ccnx-0.5.1-src/build/bin && "
- " cp -r ${BUILD}/ccnx-0.5.1-src/build/bin ${SOURCES}"
- " )"
- )
-
- self.ccnx_0_6_0_build = (
- " ( "
- " cd .. && "
- " test -d ccnx-0.6.0-src/build/bin "
- " ) || ( "
- # Not working, rebuild
- "("
- " mkdir -p ccnx-0.6.0-src && "
- " wget -q -c -O ccnx-0.6.0-src.tar.gz %(ccnx_source_url)s &&"
- " tar xf ccnx-0.6.0-src.tar.gz --strip-components=1 -C ccnx-0.6.0-src "
- ") && "
- "cd ccnx-0.6.0-src && "
+ "cd ccnx-src && "
"./configure && make"
" )") % dict(
- ccnx_source_url = server.shell_escape(self.ccnx_0_6_0_sources),
+ ccnx_source_url = server.shell_escape(self.ccnx_sources % self.ccnxVersion),
)
- self.ccnx_0_6_0_install = (
+ self.ccnx_install = (
" ( "
- " test -d ${BUILD}/ccnx-0.6.0-src/bin && "
- " cp -r ${BUILD}/ccnx-0.6.0-src/bin ${SOURCES}"
+ " test -d ${BUILD}/ccnx-src/bin && "
+ " cp -r ${BUILD}/ccnx-src/bin ${SOURCES}"
" )"
)
def setup(self):
# setting ccn sources
if not self.build:
- if self.ccnxVersion == 'ccnx-0.6.0':
- self.build = self.ccnx_0_6_0_build
- elif self.ccnxVersion == 'ccnx-0.5.1':
- self.build = self.ccnx_0_5_1_build
+ self.build = self.ccnx_build
if not self.install:
- if self.ccnxVersion == 'ccnx-0.6.0':
- self.install = self.ccnx_0_6_0_install
- elif self.ccnxVersion == 'ccnx-0.5.1':
- self.install = self.ccnx_0_5_1_install
+ self.install = self.ccnx_install
super(CCNxDaemon, self).setup()
timeout = None,
retry = 0,
err_on_timeout = True,
- connect_timeout = 60,
+ connect_timeout = 90,
persistent = True,
hostip = None):
"""
Executes a remote commands, returns ((stdout,stderr),process)
"""
- if TRACE:
- print "ssh", host, command
-
+
tmp_known_hosts = None
args = ['ssh', '-C',
# Don't bother with localhost. Makes test easier
'-o', 'NoHostAuthenticationForLocalhost=yes',
- # XXX: Security vulnerability
- #'-o', 'StrictHostKeyChecking=no',
'-o', 'ConnectTimeout=%d' % (int(connect_timeout),),
'-o', 'ConnectionAttempts=3',
'-o', 'ServerAliveInterval=30',
args.extend([
'-o', 'ControlMaster=auto',
'-o', 'ControlPath=/tmp/nepi_ssh-%r@%h:%p',
- '-o', 'ControlPersist=60' ])
+ '-o', 'ControlPersist=90' ])
if agent:
args.append('-A')
if port:
server_key, host, port, args)
args.append(command)
-
for x in xrange(retry or 3):
# connects to the remote host and starts a remote connection
proc = subprocess.Popen(args,
try:
out, err = _communicate(proc, stdin, timeout, err_on_timeout)
+ if TRACE:
+ print "COMMAND host %s, command %s, out %s, error %s" % (host, " ".join(args), out, err)
+
if proc.poll():
- if TRACE:
- print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
if err.strip().startswith('ssh: ') or err.strip().startswith('mux_client_hello_exchange: '):
# SSH error, can safely retry
continue
break
except RuntimeError,e:
if TRACE:
- print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
- print " timedout -> ", e.args
+ print "EXCEPTION host %s, command %s, out %s, error %s, exception TIMEOUT -> %s" % (
+ host, " ".join(args), out, err, e.args)
+
if retry <= 0:
raise
retry -= 1
- if TRACE:
- print " -> ", out, err
-
return ((out, err), proc)
def popen_scp(source, dest,
args = ['ssh', '-l', user, '-C',
# Don't bother with localhost. Makes test easier
'-o', 'NoHostAuthenticationForLocalhost=yes',
- # XXX: Security vulnerability
- #'-o', 'StrictHostKeyChecking=no',
- '-o', 'ConnectTimeout=60',
+ '-o', 'ConnectTimeout=90',
'-o', 'ConnectionAttempts=3',
'-o', 'ServerAliveInterval=30',
'-o', 'TCPKeepAlive=yes',
args = ['scp', '-q', '-p', '-C',
# Don't bother with localhost. Makes test easier
'-o', 'NoHostAuthenticationForLocalhost=yes',
- # XXX: Security vulnerability
- #'-o', 'StrictHostKeyChecking=no',
- '-o', 'ConnectTimeout=60',
+ '-o', 'ConnectTimeout=90',
'-o', 'ConnectionAttempts=3',
'-o', 'ServerAliveInterval=30',
'-o', 'TCPKeepAlive=yes' ]