Skip to content

Commit

Permalink
patch topotest invalid frr user
Browse files Browse the repository at this point in the history
  • Loading branch information
pguibert6WIND committed Dec 21, 2023
1 parent 4610415 commit 3748502
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/topotests/lib/topotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ def config_host(self, **params):
self.routertype = params.get("routertype")

# Set ownership of config files
self.cmd("chown {0}:{0}vty /etc/{0}".format(self.routertype))
self.cmd("chown root:root /etc/{0}".format(self.routertype))

def terminate(self):
# Stop running FRR daemons
Expand Down Expand Up @@ -1645,7 +1645,7 @@ def loadConf(self, daemon, source=None, param=None):
self.cmd_raises("rm -f " + conf_file)
self.cmd_raises("touch " + conf_file)
self.cmd_raises(
"chown {0}:{0} {1}".format(self.routertype, conf_file)
"chown root:root {0}".format(conf_file)
)
self.cmd_raises("chmod 664 {}".format(conf_file))
elif source:
Expand All @@ -1660,15 +1660,15 @@ def loadConf(self, daemon, source=None, param=None):
)
self.cmd_raises("cp {} {}".format(source, conf_file_mgmt))
self.cmd_raises(
"chown {0}:{0} {1}".format(self.routertype, conf_file_mgmt)
"chown root:root {0}".format(conf_file_mgmt)
)
self.cmd_raises("chmod 664 {}".format(conf_file_mgmt))

logger.debug(
"copying '%s' as '%s' on '%s'", source, conf_file, self.name
)
self.cmd_raises("cp {} {}".format(source, conf_file))
self.cmd_raises("chown {0}:{0} {1}".format(self.routertype, conf_file))
self.cmd_raises("chown root:root {0}".format(conf_file))
self.cmd_raises("chmod 664 {}".format(conf_file))

if (daemon == "snmpd") and (self.routertype == "frr"):
Expand Down Expand Up @@ -1714,8 +1714,8 @@ def startRouter(self, tgen=None):
)

self.cmd(
"chown %s:%svty /etc/%s/vtysh.conf"
% (self.routertype, self.routertype, self.routertype)
"chown root:root /etc/%s/vtysh.conf"
% (self.routertype)
)
# TODO remove the following lines after all tests are migrated to Topogen.
# Try to find relevant old logfiles in /tmp and delete them
Expand Down Expand Up @@ -1828,7 +1828,7 @@ def startRouterDaemons(self, daemons=None, tgen=None):

# Starts actual daemons without init (ie restart)
# cd to per node directory
self.cmd("install -m 775 -o frr -g frr -d {}/{}".format(self.logdir, self.name))
self.cmd("install -m 775 -o root -g root -d {}/{}".format(self.logdir, self.name))
self.set_cwd("{}/{}".format(self.logdir, self.name))
self.cmd("umask 000")

Expand Down Expand Up @@ -2237,7 +2237,7 @@ def emacs_gdb_ready():
)

# Update the permissions on the log files
self.cmd("chown frr:frr -R {}/{}".format(self.logdir, self.name))
self.cmd("chown root:root -R {}/{}".format(self.logdir, self.name))
self.cmd("chmod ug+rwX,o+r -R {}/{}".format(self.logdir, self.name))

if "frr" in logd_options:
Expand Down

0 comments on commit 3748502

Please sign in to comment.