from nepi.execution.attribute import Attribute, Flags, Types
from nepi.execution.resource import clsinit_copy, ResourceState, \
- reschedule_delay
-from nepi.execution.resource import clsinit_copy
+ reschedule_delay
from nepi.resources.linux.application import LinuxApplication
from nepi.util.timefuncs import tnow
"Runs in server mode. ",
type = Types.Bool,
default = False,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
p = Attribute("p",
"Port to listen to in server mode, or to connect to in client mode. "
"Defaults to 5678. ",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
a = Attribute("a",
"Client option. Perform UDP Round Trip Time (latency) ",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
A = Attribute("A",
"Client option. "
"Message size for UDP RTT test. "
"UDP RTT (latency) test with specified message size.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
b = Attribute("b",
"Client option. "
"Client UDP buffer size in bytes. Using system default "
"value if not defined.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
B = Attribute("B",
"Client option. "
"Server UDP buffer size in bytes. The same as cleint's by default.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
c = Attribute("c",
"Client option. "
"CPU log option. Tracing system info during the test. "
"Only available when output is defined. ",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
d = Attribute("d",
"Client option. "
"Data size of each read/write in bytes. The same as packet size "
"by default.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
e = Attribute("e",
"Client option. "
"Exponential test (data size of each sending increasing from 1 "
"byte to packet size). ",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
g = Attribute("g",
"Client option. "
"UDP traffic generator (Keep sending data to a host). "
"Work without server's support.",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
target = Attribute("target",
"Client option. "
"Hostname or IP address of UDP server. Must be specified.",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
i = Attribute("i",
"Client option. "
"Bidirectional UDP throuhgput test. Default is unidirection "
"stream test. ",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
l = Attribute("l",
"Client option. "
"UDP datagram (packet) size in bytes ( < udp-buffer-szie ). "
"1460 by default.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
m = Attribute("m",
"Client option. "
"Total message size in bytes. 1048576 by default.",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
o = Attribute("o",
"Client option. "
"Output file name. ",
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
P = Attribute("P",
"Client option. "
"Write the plot file for gnuplot. Only enable when the output "
"is specified. ",
type = Types.Bool,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
q = Attribute("q",
"Client option. "
"is specified. ",
type = Types.Enumerate,
allowed = ["1", "2", "3", "4", "5", "6"],
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
r = Attribute("r",
"Client option. "
"Repetition of tests. 10 by default. ",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
t = Attribute("t",
"Client option. "
"Test time constraint in seconds. 5 by default. ",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
T = Attribute("T",
"Client option. "
"Throughput constraint for UDP generator or throughput "
"test. Unlimited by default. ",
type = Types.Integer,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
continuous = 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,
- flags = Flags.ExecReadOnly)
+ flags = Flags.Design)
cls._register_attribute(s)
cls._register_attribute(p)
super(LinuxUdpTest, self).__init__(ec, guid)
self._home = "udptest-%s" % self.guid
- def deploy(self):
+ def do_deploy(self):
if not self.get("command"):
self.set("command", self._start_command)
if not self.get("depends"):
self.set("depends", self._depends)
- super(LinuxUdpTest, self).deploy()
+ super(LinuxUdpTest, self).do_deploy()
def upload_start_command(self):
-
super(LinuxUdpTest, self).upload_start_command()
if self.get("s") == True:
# finished to continue )
self._run_in_background()
- def start(self):
+ def do_start(self):
if self.get("s") == True:
# Server is already running
if self.state == ResourceState.READY:
else:
msg = " Failed to execute command '%s'" % command
self.error(msg, out, err)
- self.fail()
+ raise RuntimeError, err
else:
- super(LinuxUdpTest, self).start()
+ super(LinuxUdpTest, self).do_start()
@property
def _start_command(self):