Example #1
0
 def testFindFirstRoleWithGroup(self):
     echo = "role1-group-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0, res.count(echo) == 1)
Example #2
0
 def testFindUserRoleNoCommandInConfiguration(self):
     echo = "role1-user-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code != 0, res.count(echo) == 0)
Example #3
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)
Example #4
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)
Example #5
0
 def testFindFirstRoleWithUser(self):
     echo = "role1-user-cmd"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code == 0,
                                 res.count("r0le1") == 1)
Example #6
0
 def testFindRoleWithUserWrongCommand(self):
     echo = "wrong-command"
     res, code = utils.sr_echo_cmd(echo)
     utils.multipleAssertCommand(res, code, code != 0, res.count(echo) == 0)
Example #7
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)