# Get all running configs in parallel
procs = {}
for rname in router_list:
- logger.info("Fetching running config for router %s", rname)
+ logger.debug("Fetching running config for router %s", rname)
procs[rname] = router_list[rname].popen(
["/usr/bin/env", "vtysh", "-c", "show running-config no-header"],
stdin=None,
#
procs = {}
for rname in router_list:
- logger.info("Fetching running config for router %s", rname)
+ logger.debug("Fetching running config for router %s", rname)
procs[rname] = router_list[rname].popen(
["/usr/bin/env", "vtysh", "-c", "show running-config no-header"],
stdin=None,
#
procs = {}
for rname in router_list:
- logger.info(
+ logger.debug(
"Generating delta for router %s to new configuration (gen %d)", rname, gen
)
procs[rname] = tgen.net.popen(
#
procs = {}
for rname in router_list:
- logger.info("Applying delta config on router %s", rname)
+ logger.debug("Applying delta config on router %s", rname)
procs[rname] = router_list[rname].popen(
["/usr/bin/env", "vtysh", "-f", delta_fmt.format(rname, gen)],
output, _ = p.communicate()
vtysh_command = "vtysh -f {}".format(delta_fmt.format(rname, gen))
if not p.returncode:
- router_list[rname].logger.info(
+ router_list[rname].logger.debug(
'\nvtysh config apply => "{}"\nvtysh output <= "{}"'.format(
vtysh_command, output
)
if show_router_config:
procs = {}
for rname in router_list:
- logger.info("Fetching running config for router %s", rname)
+ logger.debug("Fetching running config for router %s", rname)
procs[rname] = router_list[rname].popen(
["/usr/bin/env", "vtysh", "-c", "show running-config no-header"],
stdin=None,
output,
)
else:
- logger.info(
+ logger.debug(
"Configuration on router %s after reset:\n%s", rname, output
)
frr_cfg_bkup = frr_cfg_bkup_fmt.format(rname)
with open(frr_cfg_file, "r+") as cfg:
data = cfg.read()
- logger.info(
+ logger.debug(
"Applying following configuration on router %s (gen: %d):\n%s",
rname,
gen,
frr_cfg_file = frr_cfg_file_fmt.format(rname)
vtysh_command = "vtysh -f " + frr_cfg_file
if not p.returncode:
- router_list[rname].logger.info(
+ router_list[rname].logger.debug(
'\nvtysh config apply => "{}"\nvtysh output <= "{}"'.format(
vtysh_command, output
)
output,
)
else:
- logger.info("New configuration for router %s:\n%s", rname, output)
+ logger.debug("New configuration for router %s:\n%s", rname, output)
logger.debug("Exiting API: load_config_to_routers")
return not errors
bundle_procs[rname] = tgen.net[rname].popen(gen_sup_cmd, stdin=None)
for rname, rnode in router_list.items():
- logger.info("Waiting on support bundle for %s", rname)
+ logger.debug("Waiting on support bundle for %s", rname)
output, error = bundle_procs[rname].communicate()
if output:
- logger.info(
+ logger.debug(
"Output from collecting support bundle for %s:\n%s", rname, output
)
if error:
cmd = "ip link add link {} name {} type vlan id {}".format(
interface, vlan_intf, vlan
)
- logger.info("[DUT: %s]: Running command: %s", dut, cmd)
+ logger.debug("[DUT: %s]: Running command: %s", dut, cmd)
result = rnode.run(cmd)
- logger.info("result %s", result)
+ logger.debug("result %s", result)
# Bringing interface up
cmd = "ip link set {} up".format(vlan_intf)
- logger.info("[DUT: %s]: Running command: %s", dut, cmd)
+ logger.debug("[DUT: %s]: Running command: %s", dut, cmd)
result = rnode.run(cmd)
- logger.info("result %s", result)
+ logger.debug("result %s", result)
# Assigning IP address
ifaddr = ipaddress.ip_interface(
cmd = "ip -{0} a flush {1} scope global && ip a add {2} dev {1} && ip l set {1} up".format(
ifaddr.version, vlan_intf, ifaddr
)
- logger.info("[DUT: %s]: Running command: %s", dut, cmd)
+ logger.debug("[DUT: %s]: Running command: %s", dut, cmd)
result = rnode.run(cmd)
- logger.info("result %s", result)
+ logger.debug("result %s", result)
def tcpdump_capture_start(
vrf["name"], vrf["id"]
)
- logger.info("[DUT: %s]: Running kernel cmd [%s]", c_router, cmd)
+ logger.debug(
+ "[DUT: %s]: Running kernel cmd [%s]", c_router, cmd
+ )
rnode.run(cmd)
# Kernel cmd - Bring down VRF
cmd = "ip link set dev {} down".format(name)
- logger.info("[DUT: %s]: Running kernel cmd [%s]", c_router, cmd)
+ logger.debug(
+ "[DUT: %s]: Running kernel cmd [%s]", c_router, cmd
+ )
rnode.run(cmd)
else:
cmd = "ip link add {} type vrf table {}".format(
name, table_id
)
- logger.info(
+ logger.debug(
"[DUT: %s]: Running kernel cmd " "[%s]", c_router, cmd
)
rnode.run(cmd)
# Kernel cmd - Bring up VRF
cmd = "ip link set dev {} up".format(name)
- logger.info(
+ logger.debug(
"[DUT: %s]: Running kernel " "cmd [%s]", c_router, cmd
)
rnode.run(cmd)
interface_name, _vrf
)
- logger.info(
+ logger.debug(
"[DUT: %s]: Running" " kernel cmd [%s]",
c_router,
cmd,
cmd = "ip -{0} a flush {1} scope global && ip a add {2} dev {1} && ip l set {1} up".format(
ifaddr.version, name, ifaddr
)
- logger.info("[DUT: %s]: Running command: %s", dut, cmd)
+ logger.debug("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
if vrf:
action = "down"
cmd = "{} {} {}".format(cmd, intf_name, action)
- logger.info("[DUT: %s]: Running command: %s", dut, cmd)
+ logger.debug("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
)
if initial_wait > 0:
- logger.info("Waiting for [%s]s as initial delay", initial_wait)
+ logger.debug("Waiting for [%s]s as initial delay", initial_wait)
sleep(initial_wait)
invert_logic = not _expected
return saved_failure
if saved_failure:
- logger.info(
+ logger.debug(
"RETRY DIAG: [failure] Sleeping %ds until next retry with %.1f retry time left - too see if timeout was too short",
retry_sleep,
seconds_left,
)
else:
- logger.info(
+ logger.debug(
"Sleeping %ds until next retry with %.1f retry time left",
retry_sleep,
seconds_left,
def set_error(self, message, code=None):
"Sets an error message and signal other tests to skip."
- logger.info(message)
+ logger.info("setting error msg: %s", message)
# If no code is defined use a sequential number
if code is None:
all routers.
"""
daemonstr = self.RD.get(daemon)
- self.logger.info('loading "{}" configuration: {}'.format(daemonstr, source))
+ self.logger.debug('loading "{}" configuration: {}'.format(daemonstr, source))
self.net.loadConf(daemonstr, source, param)
def check_router_running(self):
vtysh_command = 'vtysh {} -c "{}" 2>/dev/null'.format(dparam, command)
- self.logger.info('vtysh command => "{}"'.format(command))
+ self.logger.debug('vtysh command => "{}"'.format(command))
output = self.run(vtysh_command)
dbgout = output.strip()
if dbgout:
if "\n" in dbgout:
dbgout = dbgout.replace("\n", "\n\t")
- self.logger.info("vtysh result:\n\t{}".format(dbgout))
+ self.logger.debug("vtysh result:\n\t{}".format(dbgout))
else:
- self.logger.info('vtysh result: "{}"'.format(dbgout))
+ self.logger.debug('vtysh result: "{}"'.format(dbgout))
if isjson is False:
return output
dbgcmds = commands if is_string(commands) else "\n".join(commands)
dbgcmds = "\t" + dbgcmds.replace("\n", "\n\t")
- self.logger.info("vtysh command => FILE:\n{}".format(dbgcmds))
+ self.logger.debug("vtysh command => FILE:\n{}".format(dbgcmds))
res = self.run(vtysh_command)
os.unlink(fname)
if dbgres:
if "\n" in dbgres:
dbgres = dbgres.replace("\n", "\n\t")
- self.logger.info("vtysh result:\n\t{}".format(dbgres))
+ self.logger.debug("vtysh result:\n\t{}".format(dbgres))
else:
- self.logger.info('vtysh result: "{}"'.format(dbgres))
+ self.logger.debug('vtysh result: "{}"'.format(dbgres))
return res
def report_memory_leaks(self, testname):
count, wait
)
- logger.info(
+ logger.debug(
"'{}' polling started (interval {} secs, maximum {} tries)".format(
func_name, wait, count
)
continue
end_time = time.time()
- logger.info(
+ logger.debug(
"'{}' succeeded after {:.2f} seconds".format(
func_name, end_time - start_time
)
count, wait
)
- logger.info(
+ logger.debug(
"'{}' polling started (interval {} secs, maximum wait {} secs)".format(
func_name, wait, int(wait * count)
)
continue
end_time = time.time()
- logger.info(
+ logger.debug(
"'{}' succeeded after {:.2f} seconds".format(
func_name, end_time - start_time
)
valstr = " ".join([str(x) for x in min_value])
else:
valstr = str(min_value)
- logger.info("Increasing sysctl %s from %s to %s", variable, cur_val, valstr)
+ logger.debug("Increasing sysctl %s from %s to %s", variable, cur_val, valstr)
commander.cmd_raises('sysctl -w {}="{}"\n'.format(variable, valstr))
valstr = " ".join([str(x) for x in value])
else:
valstr = str(value)
- logger.info("Changing sysctl %s from %s to %s", variable, cur_val, valstr)
+ logger.debug("Changing sysctl %s from %s to %s", variable, cur_val, valstr)
commander.cmd_raises('sysctl -w {}="{}"\n'.format(variable, valstr))
soft, hard = cval
if soft < min_value:
nval = (min_value, hard if min_value < hard else min_value)
- logger.info("Increasing rlimit %s from %s to %s", rname, cval, nval)
+ logger.debug("Increasing rlimit %s from %s to %s", rname, cval, nval)
resource.setrlimit(rname, nval)
except subprocess.CalledProcessError as error:
logger.warning(
logger.info("%s: stopping %s", self.name, ", ".join([x[0] for x in running]))
for name, pid in running:
- logger.info("{}: sending SIGTERM to {}".format(self.name, name))
+ logger.debug("{}: sending SIGTERM to {}".format(self.name, name))
try:
os.kill(pid, signal.SIGTERM)
except OSError as err:
- logger.info(
+ logger.debug(
"%s: could not kill %s (%s): %s", self.name, name, pid, str(err)
)
router_relative = os.path.join(script_dir, self.name, tail)
if self.path_exists(router_relative):
source = router_relative
- self.logger.info(
+ self.logger.debug(
"using router relative configuration: {}".format(source)
)
# Auto-Started staticd has no config, so it will read from zebra config
else:
- logger.info("No daemon {} known".format(daemon))
+ logger.warning("No daemon {} known".format(daemon))
# print "Daemons after:", self.daemons
def runInWindow(self, cmd, title=None):
else "",
)
else:
- logger.info("%s: %s %s started", self, self.routertype, daemon)
+ logger.debug("%s: %s %s started", self, self.routertype, daemon)
# Start mgmtd first
if "mgmtd" in daemons_list:
daemonpidfile = d.rstrip()
daemonpid = self.cmd("cat %s" % daemonpidfile).rstrip()
if daemonpid.isdigit() and pid_exists(int(daemonpid)):
- logger.info(
+ logger.debug(
"{}: killing {}".format(
self.name,
os.path.basename(daemonpidfile.rsplit(".", 1)[0]),
log = self.getStdErr(daemon)
if "memstats" in log:
# Found memory leak
- logger.info(
+ logger.warning(
"\nRouter {} {} StdErr Log:\n{}".format(self.name, daemon, log)
)
if not leakfound: