示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)