def METHOD_NAME(self, binary, runas, scheduser, msg, setup_sched=False):
    """
    Test if running `binary` as `runas` with
    PBS_DAEMON_SERVICE_USER set as `scheduser`
    Check to see `msg` is in stderr
    If `msg` is None, make sure command passed
    """
    if scheduser:
        self.du.set_pbs_config(
            self.server.hostname,
            confs={'PBS_DAEMON_SERVICE_USER': str(scheduser)}
        )
    else:
        self.du.unset_pbs_config(
            self.server.hostname,
            confs='PBS_DAEMON_SERVICE_USER'
        )
    self.server.restart()
    pbs_conf = self.du.parse_pbs_config(self.server.shortname)
    if setup_sched:
        sched_logs = os.path.join(pbs_conf['PBS_HOME'], 'sched_logs')
        sched_priv = os.path.join(pbs_conf['PBS_HOME'], 'sched_priv')
        self.du.chown(path=sched_logs, uid=scheduser,
                      recursive=True, sudo=True, level=logging.INFO)
        self.du.chown(path=sched_priv, uid=scheduser,
                      recursive=True, sudo=True, level=logging.INFO)
    binpath = os.path.join(pbs_conf['PBS_EXEC'], 'sbin', binary)
    ret = self.du.run_cmd(self.server.shortname,
                          cmd=[binpath], runas=runas)
    if msg:
        self.assertEquals(ret['rc'], 1)
        self.assertIn(msg, '\n'.join(ret['err']))
    else:
        self.assertEquals(ret['rc'], 0)
        self.assertFalse(ret['err'])