test_watchdog.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:landscape-client 作者: CanonicalLtd 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号