def testFindFirstRoleWithGroup(self):
     echo = "role1-group-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0, res.count(echo) == 1)
 def testFindUserRoleNoCommandInConfiguration(self):
     echo = "role1-user-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code != 0, res.count(echo) == 0)
 def testFindRoleWithGroupWrongCommand(self):
     echo = "role2-gfoo-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code != 0, res.count(echo) == 0)
 def testFindRoleWithGroupWithCommandArrayConfiguration(self):
     echo = "role3-group-cmd2"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0, res.count(echo) == 1)
 def testFindFirstRoleWithUser(self):
     echo = "role1-user-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0,
                                 res.count("r0le1") == 1)
 def testFindRoleWithUserWrongCommand(self):
     echo = "wrong-command"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code != 0, res.count(echo) == 0)
 def testFindRoleWithUserInCommandArrayConfig(self):
     echo = "role3-user-cmd2"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0, res.count(echo) == 1)