

def test_parsecmdline_find_gu_name(self):
    passwd = 'jenkins:x:1000:1000::/home/jenkins:/bin/bash'
    group = 'cloud-users:x:1000:'
    uids = {
        
    }
    gids = {
        
    }
    mngids.parse(passwd, uids)
    mngids.parse(group, gids, True)
    cmd = ['useradd', 'jenkins', '--shell', '/bin/bash', '--gid', 'cloud-users', '--comment', 'eNovance Jenkins User', '-m']
    mngids.parse_cmdline(cmd, group, gids)
    self.assertEquals(cmd[1], '--uid')
    self.assertEquals(cmd[2], '1000')
    self.assertEquals(cmd[7], '1000')
    cmd = ['useradd', '--shell', '/bin/bash', '--gid', 'cloud-users', '--comment', 'eNovance Jenkins User', '-m', 'jenkins']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--uid')
    self.assertEquals(cmd[2], '1000')
    self.assertEquals(cmd[6], '1000')
    cmd = ['useradd', '--shell', '/bin/bash', '--gid', 'cloud-users', 'jenkins', '--comment', 'eNovance Jenkins User', '-m']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--uid')
    self.assertEquals(cmd[2], '1000')
    self.assertEquals(cmd[6], '1000')
    cmd = ['groupadd', 'cloud-users']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--gid')
    self.assertEquals(cmd[2], '1000')
    cmd = ['groupadd', '--gid', '1010', 'cloud-users', '-o']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--gid')
    self.assertEquals(cmd[2], '1000')
    cmd = ['groupadd', '--gid', '1010', '-f', 'cloud-users', '-o']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--gid')
    self.assertEquals(cmd[2], '1000')
    cmd = ['useradd', '--shell', '/bin/bash', '--gid', 'cloud-users', '-f', '10', 'jenkins', '--comment', 'eNovance Jenkins User', '-m']
    mngids.parse_cmdline(cmd, uids, gids)
    self.assertEquals(cmd[1], '--uid')
    self.assertEquals(cmd[2], '1000')
    self.assertEquals(cmd[6], '1000')

dataset/ETHPy150Open redhat-cip/edeploy/build/test_mngids.py TestMngids.test_parsecmdline_find_gu_name/VarMisuse@80/153 `uids`->`group`