git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changing ResourceManager naming for platform::ResourceName
[nepi.git]
/
src
/
nepi
/
resources
/
linux
/
nping.py
diff --git
a/src/nepi/resources/linux/nping.py
b/src/nepi/resources/linux/nping.py
index
f85f583
..
f0269af
100644
(file)
--- a/
src/nepi/resources/linux/nping.py
+++ b/
src/nepi/resources/linux/nping.py
@@
-18,20
+18,15
@@
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
from nepi.execution.attribute import Attribute, Flags, Types
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
from nepi.execution.attribute import Attribute, Flags, Types
-from nepi.execution.resource import clsinit_copy
+from nepi.execution.resource import clsinit_copy
from nepi.resources.linux.application import LinuxApplication
from nepi.util.timefuncs import tnow
import os
from nepi.resources.linux.application import LinuxApplication
from nepi.util.timefuncs import tnow
import os
-nping_sources = dict({
- "i686": "http://nmap.org/dist/nping-0.6.25-1.i386.rpm",
- "amd64": "http://nmap.org/dist/nping-0.6.25-1.x86_64.rpm",
- })
-
@clsinit_copy
class LinuxNPing(LinuxApplication):
@clsinit_copy
class LinuxNPing(LinuxApplication):
- _rtype = "
Linux
NPing"
+ _rtype = "
linux::
NPing"
@classmethod
def _register_attributes(cls):
@classmethod
def _register_attributes(cls):
@@
-39,84
+34,84
@@
class LinuxNPing(LinuxApplication):
"Sets nping -c option. "
"Stop after a given number of rounds. ",
type = Types.Integer,
"Sets nping -c option. "
"Stop after a given number of rounds. ",
type = Types.Integer,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
e = Attribute("e",
"Sets nping -e option. "
"Set the network interface to be used.",
e = Attribute("e",
"Sets nping -e option. "
"Set the network interface to be used.",
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
delay = Attribute("delay",
"Sets nping --delay option. "
"Delay between probes ",
delay = Attribute("delay",
"Sets nping --delay option. "
"Delay between probes ",
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
rate = Attribute("rate",
"Sets nping --rate option. "
"Send probes at a given rate ",
rate = Attribute("rate",
"Sets nping --rate option. "
"Send probes at a given rate ",
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
ttl = Attribute("ttl",
"Sets nping --ttl option. "
"Time To Live. ",
ttl = Attribute("ttl",
"Sets nping --ttl option. "
"Time To Live. ",
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
p = Attribute("p",
"Sets nping -p option. "
"Target ports. ",
type = Types.Integer,
p = Attribute("p",
"Sets nping -p option. "
"Target ports. ",
type = Types.Integer,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
tcp = Attribute("tcp",
"Sets nping --tcp option. "
"TCP mode. ",
type = Types.Bool,
default = False,
tcp = Attribute("tcp",
"Sets nping --tcp option. "
"TCP mode. ",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
udp = Attribute("udp",
"Sets nping --udp option. "
"UDP mode. ",
type = Types.Bool,
default = False,
udp = Attribute("udp",
"Sets nping --udp option. "
"UDP mode. ",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
icmp = Attribute("icmp",
"Sets nping --icmp option. "
"ICMP mode. ",
type = Types.Bool,
default = False,
icmp = Attribute("icmp",
"Sets nping --icmp option. "
"ICMP mode. ",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
arp = Attribute("arp",
"Sets nping --arp option. "
"ARP mode. ",
type = Types.Bool,
default = False,
arp = Attribute("arp",
"Sets nping --arp option. "
"ARP mode. ",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
traceroute = Attribute("traceroute",
"Sets nping --traceroute option. "
"Traceroute mode. ",
type = Types.Bool,
default = False,
traceroute = Attribute("traceroute",
"Sets nping --traceroute option. "
"Traceroute mode. ",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
countinuous = Attribute("continuous",
"Run nping in a while loop",
type = Types.Bool,
default = False,
countinuous = Attribute("continuous",
"Run nping in a while loop",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
print_timestamp = Attribute("printTimestamp",
"Print timestamp before running nping",
type = Types.Bool,
default = False,
print_timestamp = Attribute("printTimestamp",
"Print timestamp before running nping",
type = Types.Bool,
default = False,
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
target = Attribute("target",
"nping target host (host that will be pinged)",
target = Attribute("target",
"nping target host (host that will be pinged)",
- flags = Flags.
ExecReadOnly
)
+ flags = Flags.
Design
)
cls._register_attribute(c)
cls._register_attribute(e)
cls._register_attribute(c)
cls._register_attribute(e)
@@
-138,7
+133,7
@@
class LinuxNPing(LinuxApplication):
self._home = "nping-%s" % self.guid
self._sudo_kill = True
self._home = "nping-%s" % self.guid
self._sudo_kill = True
- def deploy(self):
+ def d
o_d
eploy(self):
if not self.get("command"):
self.set("command", self._start_command)
if not self.get("command"):
self.set("command", self._start_command)
@@
-151,7
+146,7
@@
class LinuxNPing(LinuxApplication):
if not self.get("depends"):
self.set("depends", "nmap")
if not self.get("depends"):
self.set("depends", "nmap")
- super(LinuxNPing, self).deploy()
+ super(LinuxNPing, self).d
o_d
eploy()
@property
def _start_command(self):
@property
def _start_command(self):
@@
-219,7
+214,7
@@
class LinuxNPing(LinuxApplication):
" )"
" && %s && sudo alien -i nping.rpm ) " % install_alien)
" )"
" && %s && sudo alien -i nping.rpm ) " % install_alien)
- return ("( nping || %s )" % install)
+ return ("( nping
--version
|| %s )" % install)
def valid_connection(self, guid):
# TODO: Validate!
def valid_connection(self, guid):
# TODO: Validate!