def test_spawn_process_same_uid(self, getuid, getgid):
"""
If the daemon is specified to run as root, and the watchdog is running
as root, no uid or gid switching will occur.
"""
self._write_script("#!/bin/sh")
reactor = mock.Mock()
daemon = self.get_daemon(reactor=reactor, username="root")
daemon.BIN_DIR = self.config.bindir
daemon.start()
reactor.spawnProcess.assert_called_with(
mock.ANY, mock.ANY, args=mock.ANY, env=mock.ANY, uid=None,
gid=None)
评论列表
文章目录