rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
for cmd in regexes_commands: FunctionnalTest(cmd).Run() | ScenarioTest(regexes_commands).Run() | def test_regexes(): """ Try funky strings to make regexes fail (they should not).""" # TODO: test regexes directly from defs in licorn.core.... test_message('''starting regexes tests.''') regexes_commands = [] # groups related regexes_commands.extend([ ADD + [ 'group', "--name='_- -_'"], CHECK + [ 'group', "--name='_- -_'"], ADD + [ 'group', "--name=';-)'"], ADD + [ 'group', "--name='^_^'"], ADD + [ 'group', "--name='le copain des groupes'"], CHECK + [ 'group', '-v', "--name='le copain des groupes'"], ADD + [ 'group', "--name='héhéhé'"], ADD + [ 'group', "--name='%(\`ls -la /etc/passwd\`)'"], ADD + [ 'group', "--name='echo print coucou | python | nothing'"], ADD + [ 'group', "--name='**/*-'"], CHECK + [ 'group', '-v', "--name='**/*-'"] ]) # users related regexes_commands.extend([ ADD + [ 'user', "--login='_- -_'"], ADD + [ 'user', "--login=';-)'"], ADD + [ 'user', "--login='^_^'"], ADD + [ 'user', "--login='le copain des utilisateurs'"], ADD + [ 'user', "--login='héhéhé'"], ADD + [ 'user', "--login='%(\`ls -la /etc/passwd\`)'"], ADD + [ 'user', "--login='echo print coucou | python'"], ADD + [ 'user', "--login='**/*-'"] ]) for cmd in regexes_commands: FunctionnalTest(cmd).Run() # TODO: profiles ? test_message('''regexes tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
['group', '--name=test_users_A'], ['group', '--name=test_users_B'], ['group', '--name=groupeA'], ['group', '--name=B-Group_Test'], ['group', '--name=groupe_a_skel'] | ['group', 'test_users_A'], ['group', 'test_users_B'], ['group', 'groupeA'], ['group', 'B-Group_Test'], ['group', 'groupe_a_skel'], ['group', 'ACL_tests'], ['group', 'MOD_tests'], ['group', 'SYSTEM-test'], ['group', 'SKEL-tests'] | def clean_system(): """ Remove all stuff to make the system clean, testsuite-wise.""" test_message('''cleaning system from previous runs.''') # delete them first in case of a previous failed testsuite run. # don't check exit codes or such, this will be done later. for argument in ( ['user', 'toto'], ['user', 'tutu'], ['user', 'tata'], ['user', '--login=utilisager.normal'], ['user', '--login=test.responsibilly'], ['user', '--login=utilicateur.accentue'], ['profile', '--group=utilisagers', '--del-users', '--no-archive'], ['profile', '--group=responsibilisateurs', '--del-users', '--no-archive'], ['group', '--name=test_users_A'], ['group', '--name=test_users_B'], ['group', '--name=groupeA'], ['group', '--name=B-Group_Test'], ['group', '--name=groupe_a_skel'] ): execute(DELETE + argument) os.system('rm -rf %s/* %s/*' % (configuration.home_backup_dir, configuration.home_archive_dir)) test_message('''system cleaned from previous testsuite runs.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(DELETE + argument) os.system('rm -rf %s/* %s/*' % (configuration.home_backup_dir, | execute(DEL + argument) os.system('sudo rm -rf %s/* %s/*' % (configuration.home_backup_dir, | def clean_system(): """ Remove all stuff to make the system clean, testsuite-wise.""" test_message('''cleaning system from previous runs.''') # delete them first in case of a previous failed testsuite run. # don't check exit codes or such, this will be done later. for argument in ( ['user', 'toto'], ['user', 'tutu'], ['user', 'tata'], ['user', '--login=utilisager.normal'], ['user', '--login=test.responsibilly'], ['user', '--login=utilicateur.accentue'], ['profile', '--group=utilisagers', '--del-users', '--no-archive'], ['profile', '--group=responsibilisateurs', '--del-users', '--no-archive'], ['group', '--name=test_users_A'], ['group', '--name=test_users_B'], ['group', '--name=groupeA'], ['group', '--name=B-Group_Test'], ['group', '--name=groupe_a_skel'] ): execute(DELETE + argument) os.system('rm -rf %s/* %s/*' % (configuration.home_backup_dir, configuration.home_archive_dir)) test_message('''system cleaned from previous testsuite runs.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(['cp', '-f', '/etc/' + file, | execute([ 'sudo', 'cp', '-f', '/etc/%s' % file, | def make_backups(mode): """Make backup of important system files before messing them up ;-) """ # this is mandatory, else there could be some inconsistencies following # backend (de)activation, and backup comparison could fail (false-negative) # because of this. execute(['chk', 'config', '-avvb']) if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): execute(['cp', '-f', '/etc/' + file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.1.ldif']) else: logging.error('backup mode not understood.') test_message('''made backups of system config files.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(['slapcat', '-l', '/tmp/backup.1.ldif']) | execute(['sudo', 'slapcat', '-l', '/tmp/backup.1.ldif']) | def make_backups(mode): """Make backup of important system files before messing them up ;-) """ # this is mandatory, else there could be some inconsistencies following # backend (de)activation, and backup comparison could fail (false-negative) # because of this. execute(['chk', 'config', '-avvb']) if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): execute(['cp', '-f', '/etc/' + file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.1.ldif']) else: logging.error('backup mode not understood.') test_message('''made backups of system config files.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(['/usr/bin/colordiff', '/etc/%s' % file, | log_and_exec(['sudo', '/usr/bin/colordiff', '/etc/%s' % file, | def compare_delete_backups(mode): test_message('''comparing backups of system files after tests for side-effects alterations.''') if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): log_and_exec(['/usr/bin/colordiff', '/etc/%s' % file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) else: logging.error('backup mode not understood.') test_message('''system config files backup comparison finished successfully.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(['rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) | execute(['sudo', 'rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) | def compare_delete_backups(mode): test_message('''comparing backups of system files after tests for side-effects alterations.''') if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): log_and_exec(['/usr/bin/colordiff', '/etc/%s' % file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) else: logging.error('backup mode not understood.') test_message('''system config files backup comparison finished successfully.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(['slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], | execute(['sudo', 'slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['sudo', '/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], | def compare_delete_backups(mode): test_message('''comparing backups of system files after tests for side-effects alterations.''') if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): log_and_exec(['/usr/bin/colordiff', '/etc/%s' % file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) else: logging.error('backup mode not understood.') test_message('''system config files backup comparison finished successfully.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
execute(['rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) | execute(['sudo', 'rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) | def compare_delete_backups(mode): test_message('''comparing backups of system files after tests for side-effects alterations.''') if mode == 'unix': for file in system_files: if os.path.exists('/etc/%s' % file): log_and_exec(['/usr/bin/colordiff', '/etc/%s' % file, '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/%s.bak.%s' % (file.replace('/', '_'), bkp_ext)]) elif mode == 'ldap': execute(['slapcat', '-l', '/tmp/backup.2.ldif']) log_and_exec(['/usr/bin/colordiff', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif'], False, comment="should not display any diff (system has been cleaned).", verb = True) execute(['rm', '/tmp/backup.1.ldif', '/tmp/backup.2.ldif']) else: logging.error('backup mode not understood.') test_message('''system config files backup comparison finished successfully.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
test_message('''starting groups related tests.''') group_name = 'groupeA' def gen_chk_acls_cmds(group): return [ 'getfacl', '-R', '%s/%s/%s' % ( | gname = 'groupeA' def chk_acls_cmds(group, subdir=None): return [ 'sudo', 'getfacl', '-R', '%s/%s/%s%s' % ( | def test_groups(context): """Test ADD/MOD/DEL on groups in various ways.""" test_message('''starting groups related tests.''') group_name = 'groupeA' def gen_chk_acls_cmds(group): return [ 'getfacl', '-R', '%s/%s/%s' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group) ] FunctionnalTest( ADD + [ 'group', '--name=%s' % group_name ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context+'+already').Run() # re-run the ADD command and verify it fails. FunctionnalTest( ADD + [ 'group', '--name=%s' % group_name ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run(inverse_test=True) # completeny remove the shared group dir and verify CHK repairs it. remove_group_cmds = [ "rm", "-rf", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] # idem with public_html shared subdir. remove_group_html_cmds = [ "rm", "-rf", "%s/%s/%s/public_html" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] # remove the posix ACLs and let CHK correct everything (after having # declared an error first with --auto-no). remove_group_acls_cmds = [ "setfacl", "-R", "-b", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] # idem for public_html subdir. remove_group_html_acls_cmds = [ "setfacl", "-R", "-b", "%s/%s/%s/public_html" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] bad_chown_group_cmds = ['chown', 'bin:daemon', '%s/%s/%s/public_html' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), '>/dev/null', '2>&1'] for pre_cmd in (remove_group_cmds, remove_group_html_cmds, remove_group_acls_cmds, remove_group_html_acls_cmds, bad_chown_group_cmds): for subopt in ('--auto-no', '--auto-yes', '-b'): FunctionnalTest( CHECK + [ 'group', '--name=%s' % group_name, subopt], pre_cmds = [ remove_group_acls_cmds], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run(options = [['-v'], ['-ve'], ['-vv'], ['-vve']]) # should fail FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--skel=/etc/doesntexist" ],context=context).Run() # delete it from the system, not to pollute FunctionnalTest(DELETE + [ 'group', '--name', group_name, '--del-users', '--no-archive'], context=context).Run() group_name = 'B-Group_Test' FunctionnalTest(ADD + [ 'group', "--name=%s" % group_name, "--system" ], context=context).Run() # should produce nothing FunctionnalTest(CHECK + [ "group", "-v", "--name=%s" % group_name], context=context).Run() FunctionnalTest(DELETE + ["group", "--name", group_name], context=context).Run() # FIXME: verify /etc/group /etc/licorn/groups /home/groupes/... # should fail because group is not present anymore. FunctionnalTest(CHECK + [ "group", "-v", "--name=%s" % group_name ], context=context).Run() group_name = "groupe_a_skel" FunctionnalTest(ADD + [ "group", "--name=%s" % group_name, '''--description="Le groupe C s'il vous plaît..."''' ], context=context).Run() # should display a message saying that the group is already not permissive... FunctionnalTest(MODIFY + [ "group", '--name=%s' % group_name, '--not-permissive' ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run() # should change ACLs. FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--permissive" ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run() # another message saying that the group is already permissive. FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--permissive" ], context=context+'+already').Run() # NOT YET #log_and_exec(ADD + " group --name=groupeE --gid=1520") # RENAME IS NOT SUPPORTED YET !! #log_and_exec(MODIFY + " group --name=TestGroup_A --rename=leTestGroup_A/etc/power") # FIXME: get members of group for later verifications... FunctionnalTest(DELETE + ["group", "--name", group_name, '--del-users', '--no-archive'], context=context).Run() # FIXME: verify deletion of groups + deletion of users... # already deleted, should fail... FunctionnalTest(DELETE + ["group", "--name", group_name], context=context+'+already').Run() # FIXME: get members. #log_and_exec(DELETE + " group --name=groupeD --del-users") # FIXME: idem last group, verify users account were archived, shared dir ws archived. #os.system("rm -rf %s >/dev/null 2>&1" % ("/home/" + configuration.groups.names['plural'] + "/groupeD") ) FunctionnalTest(ADD + ["group", "--name=%s" % group_name, "--skel=/etc/skel", "--description='Vive les skel'"], context=context).Run() FunctionnalTest(DELETE + ["group", "--name", group_name], context=context).Run() # FIXME: verify /etc/group /etc/licorn/groups /home/groupes/... test_message('''groups related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
group) ] FunctionnalTest( ADD + [ 'group', '--name=%s' % group_name ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context+'+already').Run() FunctionnalTest( ADD + [ 'group', '--name=%s' % group_name ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run(inverse_test=True) | group, '/%s' % subdir if subdir else '') ] ScenarioTest([ ADD + [ 'group', '--name=%s' % gname, '-v' ], chk_acls_cmds(gname), ADD + [ 'group', gname ], ADD + [ 'group', gname, '-v' ], DEL + [ 'group', gname ], DEL + [ 'group', gname ], ], context=context, descr='''create group, verify ACL, ''' '''try to create again in short mode, ''' '''remove various components then check, ''' '''then delete group and try to re-delete.''' ).Run() gname = 'ACL_tests' | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
remove_group_cmds = [ "rm", "-rf", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] | remove_group_cmds = [ 'sudo', "rm", "-vrf", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ] | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
remove_group_html_cmds = [ "rm", "-rf", | remove_group_html_cmds = [ 'sudo', "rm", "-vrf", | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] | configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ] | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
remove_group_acls_cmds = [ "setfacl", "-R", "-b", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] | remove_group_acls_cmds = [ 'sudo', "setfacl", "-R", "-b", "%s/%s/%s" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ] | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), ">/dev/null", "2>&1" ] bad_chown_group_cmds = ['chown', 'bin:daemon', '%s/%s/%s/public_html' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group_name), '>/dev/null', '2>&1'] for pre_cmd in (remove_group_cmds, remove_group_html_cmds, remove_group_acls_cmds, remove_group_html_acls_cmds, bad_chown_group_cmds): for subopt in ('--auto-no', '--auto-yes', '-b'): FunctionnalTest( CHECK + [ 'group', '--name=%s' % group_name, subopt], pre_cmds = [ remove_group_acls_cmds], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run(options = [['-v'], ['-ve'], ['-vv'], ['-vve']]) FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--skel=/etc/doesntexist" ],context=context).Run() FunctionnalTest(DELETE + [ 'group', '--name', group_name, '--del-users', '--no-archive'], context=context).Run() group_name = 'B-Group_Test' FunctionnalTest(ADD + [ 'group', "--name=%s" % group_name, "--system" ], | configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ] bad_chown_group_cmds = ['chown', 'bin:daemon', '--changes', '%s/%s/%s/public_html' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ] for break_acl_pre_cmd, chk_acl_cmd in ( (remove_group_cmds, chk_acls_cmds(gname)), (remove_group_html_cmds, chk_acls_cmds(gname, 'public_html')), (remove_group_acls_cmds, chk_acls_cmds(gname)), (remove_group_html_acls_cmds, chk_acls_cmds(gname, 'public_html')), (bad_chown_group_cmds, chk_acls_cmds(gname))): for subopt_l1 in ('--auto-no', '--auto-yes', '-b'): for subopt_l2 in ('-v', '-ve', '-vv', '-vve'): ScenarioTest([ ADD + [ 'group', gname, '-v' ], break_acl_pre_cmd, CHK + [ 'group', gname, subopt_l1, subopt_l2 ], chk_acl_cmd, DEL + [ 'group', gname, '-v', '--no-archive' ] ], descr='''Various ACLs tests on groups, ''' '''with various and combined options''', context=context).Run() gname = 'MOD_tests' ScenarioTest([ ADD + [ 'group', gname, '-v' ], MOD + [ "group", "--name=%s" % gname, "--skel=/etc/doesntexist" ], MOD + [ "group", '--name=%s' % gname, '--not-permissive' ], chk_acls_cmds(gname), MOD + [ "group", "--name=%s" % gname, "--permissive" ], chk_acls_cmds(gname), MOD + [ "group", "--name=%s" % gname, "--permissive" ], DEL + [ 'group', gname, '-v' ] ], descr='''modify with a non-existing profile, re-make not-permissive, ''' '''make permissive.''', | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(CHECK + [ "group", "-v", "--name=%s" % group_name], | gname = 'SYSTEM-test' ScenarioTest([ ADD + [ 'group', "--name=%s" % gname, "--system" ], GET + [ 'groups' ], CHK + [ "group", "-v", "--name=%s" % gname ], DEL + ["group", "--name", gname], GET + [ 'groups' ], CHK + [ "group", "-v", "--name=%s" % gname ] ], descr='''add --system, check, delete and recheck.''', | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(DELETE + ["group", "--name", group_name], | ScenarioTest([ ADD + [ 'group', gname, '--gid=1520' ], GET + [ 'groups', '-la' ], DEL + ["group", gname ], GET + [ 'groups', '-la' ], ADD + [ 'group', gname, '--gid=15200', '--system' ], GET + [ 'groups', '-la' ], DEL + ["group", gname ], GET + [ 'groups', '-la' ], ADD + [ 'group', gname, '--gid=199', '--system' ], GET + [ 'groups', '-la' ], DEL + ["group", gname ], GET + [ 'groups', '-la' ] ], context=context, descr='''ADD and DEL groups with fixed GIDs (ONE should fail).''').Run() gname = 'SKEL-tests' ScenarioTest([ ADD + ["group", "--name=%s" % gname, "--skel=/etc/skel", "--description='Vive les skel'"], GET + [ 'groups', '-la' ], DEL + ["group", gname ], GET + [ 'groups', '-la' ] ], descr='ADD group with specified skel and descr', | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
FunctionnalTest(CHECK + [ "group", "-v", "--name=%s" % group_name ], context=context).Run() group_name = "groupe_a_skel" FunctionnalTest(ADD + [ "group", "--name=%s" % group_name, '''--description="Le groupe C s'il vous plaît..."''' ], context=context).Run() FunctionnalTest(MODIFY + [ "group", '--name=%s' % group_name, '--not-permissive' ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run() FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--permissive" ], chk_cmds = [ gen_chk_acls_cmds(group_name) ], context=context).Run() FunctionnalTest(MODIFY + [ "group", "--name=%s" % group_name, "--permissive" ], context=context+'+already').Run() | gname = 'ARCHIVES-test' ScenarioTest([ ADD + [ 'group', gname, '-v' ], [ 'sudo', 'touch', "%s/%s/%s/test.txt" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ], [ 'sudo', 'mkdir', "%s/%s/%s/testdir" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ], [ 'sudo', 'touch', "%s/%s/%s/testdir/testfile" % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], gname) ], CHK + [ "group", "-vb", gname ], DEL + [ 'group', gname ], [ 'sudo', 'find', configuration.home_archive_dir ], [ 'sudo', 'getfacl', '-R', configuration.home_archive_dir ], [ 'sudo', 'rm', '-rf', '%s/*' % configuration.home_archive_dir ] ], context=context, descr='''verify the --archive option of DEL group and check on ''' '''shared dir contents.''' ).Run() | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
FunctionnalTest(DELETE + ["group", "--name", group_name, '--del-users', '--no-archive'], context=context).Run() | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
|
FunctionnalTest(DELETE + ["group", "--name", group_name], context=context+'+already').Run() | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
|
FunctionnalTest(ADD + ["group", "--name=%s" % group_name, "--skel=/etc/skel", "--description='Vive les skel'"], context=context).Run() FunctionnalTest(DELETE + ["group", "--name", group_name], context=context).Run() | def gen_chk_acls_cmds(group): | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
|
def test_users(): | def test_users(context): | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
os.system(GETENT + " groups") os.system(GETENT + " profiles") | os.system(GET + " groups") os.system(GET + " profiles") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") | log_and_exec(MOD + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MOD + " user --login=utilisager.normal -v --add-groups test_users_B") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " group -v --name test_users_B") | log_and_exec(CHK + " group -v --name test_users_B") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " group -v --name test_users_A") | log_and_exec(CHK + " group -v --name test_users_A") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", | log_and_exec(CHK + " group -vv --name test_users_A --extended --auto-no", | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") | log_and_exec(CHK + " group -vv --name test_users_A --extended --auto-yes") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", | log_and_exec(CHK + " user -v --name utilisager.normal --auto-no", | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") | log_and_exec(CHK + " user -v --name utilisager.normal --auto-yes") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") | log_and_exec(CHK + " user -v --name utilisager.normal --auto-yes") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(CHECK + " group -vv --name test_users_B --extended") | log_and_exec(CHK + " group -vv --name test_users_B --extended") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") | log_and_exec(MOD + " user --login=utilisager.normal --del-groups test_users_A") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", | log_and_exec(MOD + " user --login=utilisager.normal --del-groups test_users_A", | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") | log_and_exec(MOD + " profile --group utilisagers --add-groups cdrom") log_and_exec(MOD + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MOD + " profile --group utilisagers --apply-groups") log_and_exec(MOD + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MOD + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MOD + " profile --group responsibilisateurs --apply-groups") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", | log_and_exec(DEL + " user --login utilicateur.accentue") log_and_exec(DEL + " user --login utilisateur.accentuen2", | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, | log_and_exec(DEL + " profile -vvv --group utilisagers --del-users --no-archive") log_and_exec(DEL + " profile --group responsibilisateurs", True, 12, | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") | log_and_exec(DEL + " group --name=test_users_A --del-users --no-archive") log_and_exec(DEL + " user --login test.responsibilly") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") | log_and_exec(DEL + " profile --group responsibilisateurs") log_and_exec(DEL + " group --name=test_users_B -vv") | def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
def test_users(): """Test ADD/MOD/DEL on user accounts in various ways.""" test_message('''starting users related tests.''') log_and_exec(ADD + " group --name test_users_A --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " group --name test_users_B --description 'groupe créé pour la suite de tests sur les utilisateurs, vous pouvez effacer'") os.system(GETENT + " groups") os.system(GETENT + " profiles") log_and_exec(ADD + " user --firstname Utiliçateur --lastname Accentué") log_and_exec(ADD + " user --gecos 'Utilisateur Accentué n°2'", True, 12, comment = "can't build a login from only a GECOS field.") log_and_exec(ADD + " user --login utilisager.normal --profile utilisagers") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_A") log_and_exec(MODIFY + " user --login=utilisager.normal -v --add-groups test_users_B") # should produce nothing, because nothing is wrong. log_and_exec(CHECK + " group -v --name test_users_B") os.system("rm ~utilisager.normal/test_users_A") # all must be OK, extended checks are not enabled, the program will not "see" the missing link. log_and_exec(CHECK + " group -v --name test_users_A") # the link to group_A isn't here ! log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-no", True, 7, comment = "a user lacks a symlink.") log_and_exec(CHECK + " group -vv --name test_users_A --extended --auto-yes") # the same check, but checking from users.py #os.system("rm ~utilisager.normal/test_users_A") #log_and_exec(CHECK + " user --name utilisager.normal") # not yet implemented #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-no", True, 7, comment="user lacks symlink") #log_and_exec(CHECK + " user --name utilisager.normal --extended --auto-yes") # checking for Maildir repair capacity... if configuration.users.mailbox_type == configuration.MAIL_TYPE_HOME_MAILDIR: os.system("rm -rf ~utilisager.normal/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-no", True, 7, comment="user lacks ~/" + configuration.users.mailbox) log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("touch ~utilisager.normal/.dmrc ; chmod 666 ~utilisager.normal/.dmrc") log_and_exec(CHECK + " user -v --name utilisager.normal --auto-yes") os.system("mv -f ~utilisager.normal/test_users_B ~utilisager.normal/mon_groupe_B_préféré") # all must be ok, the link is just renamed... log_and_exec(CHECK + " group -vv --name test_users_B --extended") # FIXME: verify the user can create things in shared group dirs. log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A") # should fail log_and_exec(MODIFY + " user --login=utilisager.normal --del-groups test_users_A", comment = "already not a member.") log_and_exec(ADD + " user --login test.responsibilly --profile responsibilisateurs") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom") log_and_exec(MODIFY + " profile --group utilisagers --add-groups cdrom,test_users_B") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups") log_and_exec(MODIFY + " profile --group responsibilisateurs --add-groups plugdev,audio,test_users_A") log_and_exec(MODIFY + " profile --group responsibilisateurs --del-groups audio") log_and_exec(MODIFY + " profile --group responsibilisateurs --apply-groups") # clean the system log_and_exec(DELETE + " user --login utilicateur.accentue") log_and_exec(DELETE + " user --login utilisateur.accentuen2", True, 5, comment = "this user has *NOT* been created previously.") log_and_exec(DELETE + " profile -vvv --group utilisagers --del-users --no-archive") #os.system(GETENT + " users") log_and_exec(DELETE + " profile --group responsibilisateurs", True, 12, comment = "there are still some users in the pri group of this profile.") log_and_exec(DELETE + " group --name=test_users_A --del-users --no-archive") log_and_exec(DELETE + " user --login test.responsibilly") # this should work now that the last user has been deleted log_and_exec(DELETE + " profile --group responsibilisateurs") log_and_exec(DELETE + " group --name=test_users_B -vv") # already deleted before #log_and_exec(DELETE + " user --login utilisager.normal") #log_and_exec(DELETE + " user --login test.responsibilly") test_message('''users related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def test_imports(): | def test_imports(context): | def test_imports(): """Test massive user accounts imports.""" os.system(DELETE + " profile --group utilisagers --del-users --no-archive") os.system(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv", True, 12, comment = "You should specify a profile") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0 --confirm-import") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0 --confirm-import") # activer les 2 lignes suivantes pour importer 860 utilisateurs de Latresne... log_and_exec(ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers --confirm-import") os.system("sleep 5") log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") log_and_exec(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
os.system(DELETE + " profile --group utilisagers --del-users --no-archive") os.system(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") | os.system(DEL + " profile --group utilisagers --del-users --no-archive") os.system(DEL + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GET + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DEL + " group --name % --no-archive") | def test_imports(): """Test massive user accounts imports.""" os.system(DELETE + " profile --group utilisagers --del-users --no-archive") os.system(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv", True, 12, comment = "You should specify a profile") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0 --confirm-import") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0 --confirm-import") # activer les 2 lignes suivantes pour importer 860 utilisateurs de Latresne... log_and_exec(ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers --confirm-import") os.system("sleep 5") log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") log_and_exec(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") log_and_exec(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") def test_profiles(): | log_and_exec(DEL + " profile --group utilisagers --del-users --no-archive") log_and_exec(DEL + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GET + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DEL + " group --name % --no-archive") def test_profiles(context): | def test_imports(): """Test massive user accounts imports.""" os.system(DELETE + " profile --group utilisagers --del-users --no-archive") os.system(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv", True, 12, comment = "You should specify a profile") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers") log_and_exec(ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users.csv --profile utilisagers --lastname-column 1 --firstname-column 0 --confirm-import") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs") log_and_exec(ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_resps.csv --profile responsibilisateurs --lastname-column 1 --firstname-column 0 --confirm-import") # activer les 2 lignes suivantes pour importer 860 utilisateurs de Latresne... log_and_exec(ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers") log_and_exec("time " + ADD + " users --filename ./testsuite/tests_users2.csv --profile utilisagers --confirm-import") os.system("sleep 5") log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") log_and_exec(DELETE + " profile --group responsibilisateurs --del-users --no-archive") log_and_exec(GETENT + " groups --empty | cut -d\":\" -f 1 | xargs -I% " + DELETE + " group --name % --no-archive") | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec(MODIFY + " profile --group utilisagers --apply-groups --to-groups utilisagers") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups --to-members") log_and_exec(MODIFY + " profile --group utilisagers --apply-skel --to-users toto --auto-no") log_and_exec(MODIFY + " profile --group utilisagers --apply-skel --to-users toto --batch") log_and_exec(MODIFY + " profile --group utilisagers --apply-group --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-all") log_and_exec(DELETE + " profile --group responsibilisateurs --no-archive") log_and_exec(DELETE + " user toto --no-archive") log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") | log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-groups utilisagers") log_and_exec(MOD + " profile --group utilisagers --apply-groups --to-members") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --auto-no") log_and_exec(MOD + " profile --group utilisagers --apply-skel --to-users toto --batch") log_and_exec(MOD + " profile --group utilisagers --apply-group --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MOD + " profile --group utilisagers --apply-all --to-all") log_and_exec(DEL + " profile --group responsibilisateurs --no-archive") log_and_exec(DEL + " user toto --no-archive") log_and_exec(DEL + " profile --group utilisagers --del-users --no-archive") | def test_profiles(): """Test the applying feature of profiles.""" test_message('''starting profiles related tests.''') log_and_exec(ADD + " profile --name Utilisagers --group utilisagers --comment 'profil normal créé pour la suite de tests utilisateurs'") log_and_exec(ADD + " profile --name Responsibilisateurs --group responsibilisateurs --groups cdrom,lpadmin,plugdev,audio,video,scanner,fuse --comment 'profil power user créé pour la suite de tests utilisateurs.'") log_and_exec(ADD + " user toto --profile utilisagers") log_and_exec(ADD + " user tutu --profile utilisagers") log_and_exec(ADD + " user tata --profile utilisagers") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups --to-groups utilisagers") log_and_exec(MODIFY + " profile --group utilisagers --apply-groups --to-members") log_and_exec(MODIFY + " profile --group utilisagers --apply-skel --to-users toto --auto-no") log_and_exec(MODIFY + " profile --group utilisagers --apply-skel --to-users toto --batch") log_and_exec(MODIFY + " profile --group utilisagers --apply-group --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-users toto") log_and_exec(MODIFY + " profile --group utilisagers --apply-all --to-all") log_and_exec(DELETE + " profile --group responsibilisateurs --no-archive") log_and_exec(DELETE + " user toto --no-archive") log_and_exec(DELETE + " profile --group utilisagers --del-users --no-archive") test_message('''profiles related tests finished.''') | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive | log_and_exec $MOD profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DEL profile --name=profileB --del-users --no-archive log_and_exec $DEL profile --name=profileeD log_and_exec $MOD profile --name=profileeC --not-permissive | def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist | log_and_exec $MOD profile --name=theprofile --skel=/etc/doesntexist | def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
||
test_message('testing Unix backend.') if execute(['mod', 'config', '-B', 'ldap'])[1] == 0: make_backups('unix') FunctionnalTest(GETENT + ['config'], context='unix').Run( options=[['backends']]) test_get('unix') test_groups('unix') compare_delete_backups('unix') clean_system() test_message('testing LDAP backend.') if execute(['mod', 'config', '-b', 'ldap'])[1] == 0: make_backups('ldap') FunctionnalTest(GETENT + ['config'], context='ldap').Run( options=[['backends']]) test_get('ldap') test_groups('ldap') compare_delete_backups('ldap') clean_system() | save_state(1, state_type='context') for ctxnum, ctx, activate_cmd in ( (1, 'unix', ['sudo', 'mod', 'config', '-B', 'ldap']), (2, 'ldap', ['sudo', 'mod', 'config', '-b', 'ldap']) ): if execute(activate_cmd)[1] == 0: start_ctx = get_state('context') if ctxnum < start_ctx: logging.notice('Skipping context %s' % stylize(ST_NAME, ctx)) continue test_message('testing %s context.' % ctx) make_backups(ctx) ScenarioTest.reinit() test_get(ctx) test_groups(ctx) compare_delete_backups(ctx) clean_system() save_state(ctxnum + 1, state_type='context') | def to_be_implemented(): """ TO BE DONE ! # # Profiles # # doit planter pour le groupe log_and_exec $ADD profile --name=profileA --group=a # doit planter pour le groupe kjsdqsdf log_and_exec $ADD profile --name=profileB --group=b --comment="le profil b" --shell=/bin/bash --quota=26 --groups=cdrom,kjsdqsdf,audio --skeldir=/etc/skel && exit 1 # doit planter pour le skel pas un répertoire, pour le groupe jfgdghf log_and_exec $MODIFY profile --name=profileA --rename=theprofile --rename-primary-group=theprofile --comment=modify --shell=/bin/sh --skel=/etc/power --quota=10 --add-groups=cdrom,remote,qsdfgkh --del-groups=cdrom,jfgdghf log_and_exec $DELETE profile --name=profileB --del-users --no-archive log_and_exec $DELETE profile --name=profileeD log_and_exec $MODIFY profile --name=profileeC --not-permissive log_and_exec $ADD profile --name=theprofile log_and_exec $MODIFY profile --name=theprofile --skel=/etc/doesntexist } """ pass | 07cb13c975b820cb15074a8378ec89357e5846f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/07cb13c975b820cb15074a8378ec89357e5846f4/core.py |
invalid_dir_regex_text = r'^((\/|\*\/)|[^%s]*\/?\.\.\/)' % separator | invalid_dir_regex_text = r'^((~.\*|\$HOME.\*|\/|\*\/)|[^%s]*\/?\.\.\/)' % separator | def find_prefered_backend(self): """ iterate through active backends and find the prefered one. We use a copy, in case there is no prefered yet: LMC.backends will change and this would crash the for_loop. | 9fbe6af9e9c1f58a9ba839b23336aedc23bb7df8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/9fbe6af9e9c1f58a9ba839b23336aedc23bb7df8/classes.py |
if rule_text[0] == '~' or rule_text[:5] == '$HOME': | if rule_text == '~' or rule_text == '$HOME': | def generate_name(self, file_name, rule_text, system_wide, controller): """ for a system configuration file named /etc/licorn/check.d/users.dropbox.conf, return "dropbox" | 9fbe6af9e9c1f58a9ba839b23336aedc23bb7df8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/9fbe6af9e9c1f58a9ba839b23336aedc23bb7df8/classes.py |
def LockAccount(self, login, lock = True): """(Un)Lock a user account.""" if login is None: raise exceptions.BadArgumentError(logging.SYSU_SPECIFY_LOGIN) | 05aac7f26031f789e50be55c81dcd4cb23f7d8e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/05aac7f26031f789e50be55c81dcd4cb23f7d8e2/users.py |
||
UsersController.users[uid]['userPassword'] = '!' + \ UsersController.users[uid]['userPassword'] logging.info('Locked user account %s.' % \ styles.stylize(styles.ST_LOGIN, login)) else: UsersController.users[uid]['userPassword'] = \ UsersController.users[uid]['userPassword'][1:] logging.info('Unlocked user account %s.' % \ styles.stylize(styles.ST_LOGIN, login)) | if UsersController.users[uid]['locked']: logging.info('account %s already locked.' % styles.stylize(styles.ST_NAME, login)) else: UsersController.users[uid]['userPassword'] = '!' + \ UsersController.users[uid]['userPassword'] logging.info('Locked user account %s.' % \ styles.stylize(styles.ST_LOGIN, login)) else: if UsersController.users[uid]['locked']: UsersController.users[uid]['userPassword'] = \ UsersController.users[uid]['userPassword'][1:] logging.info('Unlocked user account %s.' % \ styles.stylize(styles.ST_LOGIN, login)) else: logging.info('account %s already unlocked.' % styles.stylize(styles.ST_NAME, login)) | def LockAccount(self, login, lock = True): """(Un)Lock a user account.""" if login is None: raise exceptions.BadArgumentError(logging.SYSU_SPECIFY_LOGIN) | 05aac7f26031f789e50be55c81dcd4cb23f7d8e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/05aac7f26031f789e50be55c81dcd4cb23f7d8e2/users.py |
def LockAccount(self, login, lock = True): """(Un)Lock a user account.""" if login is None: raise exceptions.BadArgumentError(logging.SYSU_SPECIFY_LOGIN) | 05aac7f26031f789e50be55c81dcd4cb23f7d8e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/05aac7f26031f789e50be55c81dcd4cb23f7d8e2/users.py |
||
('gecos', decodestring), | ('gecos', gecos_decode), | def account_lock(value, tmp_entry=temp_user_dict): try: # get around an error where password is not base64 encoded. password = decodestring(value.split('}',1)[1]) except Exception: password = value | 612e9eb2908557a6396597e951c2d666006dd93c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/612e9eb2908557a6396597e951c2d666006dd93c/ldap_backend.py |
'''shared dir contents.''' | '''shared dir contents, ensure | def chk_acls_cmds(group, subdir=None): return [ 'sudo', 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group, '/%s' % subdir if subdir else '') ] | a13fb091747f8353a62f0498ac613b3ca142d8ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a13fb091747f8353a62f0498ac613b3ca142d8ce/core.py |
action="store", type="string", dest="name", default = None, | action="store", type="string", dest="name", default=None, | def common_filter_group(app, parser, tool, mode): """Build Filter OptionGroup for all get variants.""" big_help_string = ( """ WARNING: filters are only partially cumulative. Order """ """of operations: %s %s """ """takes precedence on other inclusive filters (if it is """ """present, any other inclusive filter is purely discarded). In this """ """case, %s is equal to all %s. %s if %s is not used, other """ """inclusive filters are union'ed to construct the %s of """ """%s. %s Then all exclusive filters are union'ed in turn too, to """ """construct an %s of %s. %s The %s is """ """substracted from the %s, and the result is used in the """ """calling CLI tool to operate onto.""" % ( stylize(ST_LIST_L1, '(1)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(2)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(3)'), stylize(ST_DEFAULT, 'exclude_list'), mode, stylize(ST_LIST_L1, '(4)'), stylize(ST_DEFAULT, 'exclude_list'), stylize(ST_DEFAULT, 'include_list') ) ) filtergroup = OptionGroup(parser, stylize(ST_OPTION, "Filter options"), """Filter %s.%s""" % (mode, big_help_string if mode != 'configuration' else '') ) if tool in ('get', 'mod', 'del') : if mode in ( 'users', 'groups', 'profiles', 'privileges', 'machines'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""Also select system data. I.e. """ """output system %s too.""" % mode) filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if tool is 'get': if mode in ('daemon_status', 'users', 'groups', 'machines'): filtergroup.add_option('-l', '--long', '--full', action="store_true", dest="long", default=False, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if mode == 'daemon_status': filtergroup.add_option('--detail', '--details', '-p', '--precision', '--precisions', '--pinpoint', action="store", dest="precision", default=None, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if tool is 'chk': if mode in ( 'users', 'groups', 'configuration', 'profiles'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""%s""" """ %s: this can be a very long operation""" """%s""" % ( """Check *all* %s on the system.""" % stylize(ST_MODE, mode) \ if mode != 'configuration' \ else 'Check every bit of the configuration.', stylize(ST_IMPORTANT, "WARNING"), """, depending of the current number of %s.""" % mode if mode != 'configuration' else '')) if mode in ('users', 'groups', 'profiles'): filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if mode is 'users': filtergroup.add_option('--login', '--logins', '--username', '--usernames', '--name', '--names', action="store", type="string", dest="login", default=None, help="""Specify user(s) by their login (separated by commas """ """without spaces).""") filtergroup.add_option('--uid', '--uids', action="store", type="string", dest="uid", default=None, help="""Specify user(s) by their UID (separated by commas """ """without spaces).""") if mode is 'users' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-user', '--exclude-user', '--not-users', '--exclude-users', '--not-login', '--exclude-login', '--not-logins', '--exclude-logins', '--not-username', '--exclude-username', '--not-usernames', '--exclude-usernames', action="store", type="string", dest="exclude_login", default=None, help='''Specify user(s) to exclude from current operation, by ''' '''their *login* (separated by commas without spaces).''') filtergroup.add_option('--not-uid', '--exclude-uid', '--not-uids', '--exclude-uids', action="store", type="string", dest="exclude_uid", default=None, help='''Specify user(s) to exclude from current operation by ''' '''their UID (separated by commas without spaces).''') if mode is 'groups': filtergroup.add_option('--name', '--names', '--group', '--groups', '--group-name', '--group-names', action="store", type="string", dest="name", default=None, help="""Specify group(s) by their name (separated by commas """ """without spaces).""") filtergroup.add_option('--gid', '--gids', action="store", type="string", dest="gid", default=None, help="""Specify group(s) by their GID (separated by commas """ """without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--system', '--system-groups', '--sys', action="store_true", dest="system", default = False, help="Only select system groups.") filtergroup.add_option('--privileged', '--priv', '--privs', '--pri', '--privileged-groups', action="store_true", dest="privileged", default = False, help="Only select privileged groups.") filtergroup.add_option('--responsibles', '--rsp', '--responsible-groups', action="store_true", dest="responsibles", default = False, help="Only select responsibles groups.") filtergroup.add_option('--guests', '--gst', '--guest-groups', action="store_true", dest="guests", default = False, help="Only select guests groups.") filtergroup.add_option('--empty', '--empty-groups', action="store_true", dest="empty", default = False, help="Only select empty groups.") if mode is 'groups' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-group', '--exclude-group', '--not-groups', '--exclude-groups', '--not-groupname', '--exclude-groupname', '--not-groupnames', '--exclude-groupnames', action="store", type="string", dest="exclude_group", default=None, help='''Specify group(s) to exclude from current operation, by ''' '''their *name* (separated by commas without spaces).''') filtergroup.add_option('--not-gid', '--exclude-gid', '--not-gids', '--exclude-gids', action="store", type="string", dest="exclude_gid", default=None, help='''Specify group(s) to exclude from current operation by ''' '''their *GID* (separated by commas without spaces).''') if mode is 'profiles': filtergroup.add_option('--profile', '--profiles', '--profile-name', '--profile-names', '--name', '--names', action="store", type="string", dest="name", default = None, help="""Specify profile by its common name (separated by commas """ """without spaces, when possible. If name contains spaces, """ """use --group instead). %s.""" % stylize(ST_IMPORTANT, "one of --name or --group is required")) filtergroup.add_option('--group', '--groups', '--profile-group', '--profile-groups', action="store", type="string", dest="group", default = None, help="""specify profile by its primary group (separated by """ """commas without spaces).""") if mode is 'machines': filtergroup.add_option('--hostname', '--hostnames', '--name', '--names', '--client-name', '--client-names', action="store", type="string", dest="hostname", default = None, help="""Specify machine(s) by their hostname (separated by """ """commas without spaces).""") filtergroup.add_option('--mid', '--mids', '--ip', '--ips', '--ip-address', '--ip-addresses', action="store", type="string", dest="mid", default = None, help="""Specify machine(s) by their IP address (separated by """ """commas without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--asleep', '--asleep-machines', action="store_true", dest="asleep", default = False, help="Only select asleep machines.") filtergroup.add_option('--idle', '--idle-machines', action="store_true", dest="idle", default = False, help="Only select idle machines.") filtergroup.add_option('--active', '--active-machines', action="store_true", dest="active", default = False, help="Only select active machines.") return filtergroup | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="group", default = None, | action="store", type="string", dest="group", default=None, | def common_filter_group(app, parser, tool, mode): """Build Filter OptionGroup for all get variants.""" big_help_string = ( """ WARNING: filters are only partially cumulative. Order """ """of operations: %s %s """ """takes precedence on other inclusive filters (if it is """ """present, any other inclusive filter is purely discarded). In this """ """case, %s is equal to all %s. %s if %s is not used, other """ """inclusive filters are union'ed to construct the %s of """ """%s. %s Then all exclusive filters are union'ed in turn too, to """ """construct an %s of %s. %s The %s is """ """substracted from the %s, and the result is used in the """ """calling CLI tool to operate onto.""" % ( stylize(ST_LIST_L1, '(1)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(2)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(3)'), stylize(ST_DEFAULT, 'exclude_list'), mode, stylize(ST_LIST_L1, '(4)'), stylize(ST_DEFAULT, 'exclude_list'), stylize(ST_DEFAULT, 'include_list') ) ) filtergroup = OptionGroup(parser, stylize(ST_OPTION, "Filter options"), """Filter %s.%s""" % (mode, big_help_string if mode != 'configuration' else '') ) if tool in ('get', 'mod', 'del') : if mode in ( 'users', 'groups', 'profiles', 'privileges', 'machines'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""Also select system data. I.e. """ """output system %s too.""" % mode) filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if tool is 'get': if mode in ('daemon_status', 'users', 'groups', 'machines'): filtergroup.add_option('-l', '--long', '--full', action="store_true", dest="long", default=False, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if mode == 'daemon_status': filtergroup.add_option('--detail', '--details', '-p', '--precision', '--precisions', '--pinpoint', action="store", dest="precision", default=None, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if tool is 'chk': if mode in ( 'users', 'groups', 'configuration', 'profiles'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""%s""" """ %s: this can be a very long operation""" """%s""" % ( """Check *all* %s on the system.""" % stylize(ST_MODE, mode) \ if mode != 'configuration' \ else 'Check every bit of the configuration.', stylize(ST_IMPORTANT, "WARNING"), """, depending of the current number of %s.""" % mode if mode != 'configuration' else '')) if mode in ('users', 'groups', 'profiles'): filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if mode is 'users': filtergroup.add_option('--login', '--logins', '--username', '--usernames', '--name', '--names', action="store", type="string", dest="login", default=None, help="""Specify user(s) by their login (separated by commas """ """without spaces).""") filtergroup.add_option('--uid', '--uids', action="store", type="string", dest="uid", default=None, help="""Specify user(s) by their UID (separated by commas """ """without spaces).""") if mode is 'users' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-user', '--exclude-user', '--not-users', '--exclude-users', '--not-login', '--exclude-login', '--not-logins', '--exclude-logins', '--not-username', '--exclude-username', '--not-usernames', '--exclude-usernames', action="store", type="string", dest="exclude_login", default=None, help='''Specify user(s) to exclude from current operation, by ''' '''their *login* (separated by commas without spaces).''') filtergroup.add_option('--not-uid', '--exclude-uid', '--not-uids', '--exclude-uids', action="store", type="string", dest="exclude_uid", default=None, help='''Specify user(s) to exclude from current operation by ''' '''their UID (separated by commas without spaces).''') if mode is 'groups': filtergroup.add_option('--name', '--names', '--group', '--groups', '--group-name', '--group-names', action="store", type="string", dest="name", default=None, help="""Specify group(s) by their name (separated by commas """ """without spaces).""") filtergroup.add_option('--gid', '--gids', action="store", type="string", dest="gid", default=None, help="""Specify group(s) by their GID (separated by commas """ """without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--system', '--system-groups', '--sys', action="store_true", dest="system", default = False, help="Only select system groups.") filtergroup.add_option('--privileged', '--priv', '--privs', '--pri', '--privileged-groups', action="store_true", dest="privileged", default = False, help="Only select privileged groups.") filtergroup.add_option('--responsibles', '--rsp', '--responsible-groups', action="store_true", dest="responsibles", default = False, help="Only select responsibles groups.") filtergroup.add_option('--guests', '--gst', '--guest-groups', action="store_true", dest="guests", default = False, help="Only select guests groups.") filtergroup.add_option('--empty', '--empty-groups', action="store_true", dest="empty", default = False, help="Only select empty groups.") if mode is 'groups' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-group', '--exclude-group', '--not-groups', '--exclude-groups', '--not-groupname', '--exclude-groupname', '--not-groupnames', '--exclude-groupnames', action="store", type="string", dest="exclude_group", default=None, help='''Specify group(s) to exclude from current operation, by ''' '''their *name* (separated by commas without spaces).''') filtergroup.add_option('--not-gid', '--exclude-gid', '--not-gids', '--exclude-gids', action="store", type="string", dest="exclude_gid", default=None, help='''Specify group(s) to exclude from current operation by ''' '''their *GID* (separated by commas without spaces).''') if mode is 'profiles': filtergroup.add_option('--profile', '--profiles', '--profile-name', '--profile-names', '--name', '--names', action="store", type="string", dest="name", default = None, help="""Specify profile by its common name (separated by commas """ """without spaces, when possible. If name contains spaces, """ """use --group instead). %s.""" % stylize(ST_IMPORTANT, "one of --name or --group is required")) filtergroup.add_option('--group', '--groups', '--profile-group', '--profile-groups', action="store", type="string", dest="group", default = None, help="""specify profile by its primary group (separated by """ """commas without spaces).""") if mode is 'machines': filtergroup.add_option('--hostname', '--hostnames', '--name', '--names', '--client-name', '--client-names', action="store", type="string", dest="hostname", default = None, help="""Specify machine(s) by their hostname (separated by """ """commas without spaces).""") filtergroup.add_option('--mid', '--mids', '--ip', '--ips', '--ip-address', '--ip-addresses', action="store", type="string", dest="mid", default = None, help="""Specify machine(s) by their IP address (separated by """ """commas without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--asleep', '--asleep-machines', action="store_true", dest="asleep", default = False, help="Only select asleep machines.") filtergroup.add_option('--idle', '--idle-machines', action="store_true", dest="idle", default = False, help="Only select idle machines.") filtergroup.add_option('--active', '--active-machines', action="store_true", dest="active", default = False, help="Only select active machines.") return filtergroup | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="hostname", default = None, | action="store", type="string", dest="hostname", default=None, | def common_filter_group(app, parser, tool, mode): """Build Filter OptionGroup for all get variants.""" big_help_string = ( """ WARNING: filters are only partially cumulative. Order """ """of operations: %s %s """ """takes precedence on other inclusive filters (if it is """ """present, any other inclusive filter is purely discarded). In this """ """case, %s is equal to all %s. %s if %s is not used, other """ """inclusive filters are union'ed to construct the %s of """ """%s. %s Then all exclusive filters are union'ed in turn too, to """ """construct an %s of %s. %s The %s is """ """substracted from the %s, and the result is used in the """ """calling CLI tool to operate onto.""" % ( stylize(ST_LIST_L1, '(1)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(2)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(3)'), stylize(ST_DEFAULT, 'exclude_list'), mode, stylize(ST_LIST_L1, '(4)'), stylize(ST_DEFAULT, 'exclude_list'), stylize(ST_DEFAULT, 'include_list') ) ) filtergroup = OptionGroup(parser, stylize(ST_OPTION, "Filter options"), """Filter %s.%s""" % (mode, big_help_string if mode != 'configuration' else '') ) if tool in ('get', 'mod', 'del') : if mode in ( 'users', 'groups', 'profiles', 'privileges', 'machines'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""Also select system data. I.e. """ """output system %s too.""" % mode) filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if tool is 'get': if mode in ('daemon_status', 'users', 'groups', 'machines'): filtergroup.add_option('-l', '--long', '--full', action="store_true", dest="long", default=False, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if mode == 'daemon_status': filtergroup.add_option('--detail', '--details', '-p', '--precision', '--precisions', '--pinpoint', action="store", dest="precision", default=None, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if tool is 'chk': if mode in ( 'users', 'groups', 'configuration', 'profiles'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""%s""" """ %s: this can be a very long operation""" """%s""" % ( """Check *all* %s on the system.""" % stylize(ST_MODE, mode) \ if mode != 'configuration' \ else 'Check every bit of the configuration.', stylize(ST_IMPORTANT, "WARNING"), """, depending of the current number of %s.""" % mode if mode != 'configuration' else '')) if mode in ('users', 'groups', 'profiles'): filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if mode is 'users': filtergroup.add_option('--login', '--logins', '--username', '--usernames', '--name', '--names', action="store", type="string", dest="login", default=None, help="""Specify user(s) by their login (separated by commas """ """without spaces).""") filtergroup.add_option('--uid', '--uids', action="store", type="string", dest="uid", default=None, help="""Specify user(s) by their UID (separated by commas """ """without spaces).""") if mode is 'users' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-user', '--exclude-user', '--not-users', '--exclude-users', '--not-login', '--exclude-login', '--not-logins', '--exclude-logins', '--not-username', '--exclude-username', '--not-usernames', '--exclude-usernames', action="store", type="string", dest="exclude_login", default=None, help='''Specify user(s) to exclude from current operation, by ''' '''their *login* (separated by commas without spaces).''') filtergroup.add_option('--not-uid', '--exclude-uid', '--not-uids', '--exclude-uids', action="store", type="string", dest="exclude_uid", default=None, help='''Specify user(s) to exclude from current operation by ''' '''their UID (separated by commas without spaces).''') if mode is 'groups': filtergroup.add_option('--name', '--names', '--group', '--groups', '--group-name', '--group-names', action="store", type="string", dest="name", default=None, help="""Specify group(s) by their name (separated by commas """ """without spaces).""") filtergroup.add_option('--gid', '--gids', action="store", type="string", dest="gid", default=None, help="""Specify group(s) by their GID (separated by commas """ """without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--system', '--system-groups', '--sys', action="store_true", dest="system", default = False, help="Only select system groups.") filtergroup.add_option('--privileged', '--priv', '--privs', '--pri', '--privileged-groups', action="store_true", dest="privileged", default = False, help="Only select privileged groups.") filtergroup.add_option('--responsibles', '--rsp', '--responsible-groups', action="store_true", dest="responsibles", default = False, help="Only select responsibles groups.") filtergroup.add_option('--guests', '--gst', '--guest-groups', action="store_true", dest="guests", default = False, help="Only select guests groups.") filtergroup.add_option('--empty', '--empty-groups', action="store_true", dest="empty", default = False, help="Only select empty groups.") if mode is 'groups' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-group', '--exclude-group', '--not-groups', '--exclude-groups', '--not-groupname', '--exclude-groupname', '--not-groupnames', '--exclude-groupnames', action="store", type="string", dest="exclude_group", default=None, help='''Specify group(s) to exclude from current operation, by ''' '''their *name* (separated by commas without spaces).''') filtergroup.add_option('--not-gid', '--exclude-gid', '--not-gids', '--exclude-gids', action="store", type="string", dest="exclude_gid", default=None, help='''Specify group(s) to exclude from current operation by ''' '''their *GID* (separated by commas without spaces).''') if mode is 'profiles': filtergroup.add_option('--profile', '--profiles', '--profile-name', '--profile-names', '--name', '--names', action="store", type="string", dest="name", default = None, help="""Specify profile by its common name (separated by commas """ """without spaces, when possible. If name contains spaces, """ """use --group instead). %s.""" % stylize(ST_IMPORTANT, "one of --name or --group is required")) filtergroup.add_option('--group', '--groups', '--profile-group', '--profile-groups', action="store", type="string", dest="group", default = None, help="""specify profile by its primary group (separated by """ """commas without spaces).""") if mode is 'machines': filtergroup.add_option('--hostname', '--hostnames', '--name', '--names', '--client-name', '--client-names', action="store", type="string", dest="hostname", default = None, help="""Specify machine(s) by their hostname (separated by """ """commas without spaces).""") filtergroup.add_option('--mid', '--mids', '--ip', '--ips', '--ip-address', '--ip-addresses', action="store", type="string", dest="mid", default = None, help="""Specify machine(s) by their IP address (separated by """ """commas without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--asleep', '--asleep-machines', action="store_true", dest="asleep", default = False, help="Only select asleep machines.") filtergroup.add_option('--idle', '--idle-machines', action="store_true", dest="idle", default = False, help="Only select idle machines.") filtergroup.add_option('--active', '--active-machines', action="store_true", dest="active", default = False, help="Only select active machines.") return filtergroup | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="mid", default = None, | action="store", type="string", dest="mid", default=None, | def common_filter_group(app, parser, tool, mode): """Build Filter OptionGroup for all get variants.""" big_help_string = ( """ WARNING: filters are only partially cumulative. Order """ """of operations: %s %s """ """takes precedence on other inclusive filters (if it is """ """present, any other inclusive filter is purely discarded). In this """ """case, %s is equal to all %s. %s if %s is not used, other """ """inclusive filters are union'ed to construct the %s of """ """%s. %s Then all exclusive filters are union'ed in turn too, to """ """construct an %s of %s. %s The %s is """ """substracted from the %s, and the result is used in the """ """calling CLI tool to operate onto.""" % ( stylize(ST_LIST_L1, '(1)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(2)'), stylize(ST_NOTICE, '--all'), stylize(ST_DEFAULT, 'include_list'), mode, stylize(ST_LIST_L1, '(3)'), stylize(ST_DEFAULT, 'exclude_list'), mode, stylize(ST_LIST_L1, '(4)'), stylize(ST_DEFAULT, 'exclude_list'), stylize(ST_DEFAULT, 'include_list') ) ) filtergroup = OptionGroup(parser, stylize(ST_OPTION, "Filter options"), """Filter %s.%s""" % (mode, big_help_string if mode != 'configuration' else '') ) if tool in ('get', 'mod', 'del') : if mode in ( 'users', 'groups', 'profiles', 'privileges', 'machines'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""Also select system data. I.e. """ """output system %s too.""" % mode) filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if tool is 'get': if mode in ('daemon_status', 'users', 'groups', 'machines'): filtergroup.add_option('-l', '--long', '--full', action="store_true", dest="long", default=False, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if mode == 'daemon_status': filtergroup.add_option('--detail', '--details', '-p', '--precision', '--precisions', '--pinpoint', action="store", dest="precision", default=None, help='''long output (all info, attributes, etc). ''' '''NOT enabled by default.''') if tool is 'chk': if mode in ( 'users', 'groups', 'configuration', 'profiles'): filtergroup.add_option('-a', '--all', action="store_true", dest="all", default=False, help="""%s""" """ %s: this can be a very long operation""" """%s""" % ( """Check *all* %s on the system.""" % stylize(ST_MODE, mode) \ if mode != 'configuration' \ else 'Check every bit of the configuration.', stylize(ST_IMPORTANT, "WARNING"), """, depending of the current number of %s.""" % mode if mode != 'configuration' else '')) if mode in ('users', 'groups', 'profiles'): filtergroup.add_option('-X', '--not', '--exclude', action="store", dest="exclude", default=None, help='''exclude %s from the selection. Can be IDs or %s ''' '''names. Separated by commas without spaces.''' % (mode, mode[:-1])) if mode is 'users': filtergroup.add_option('--login', '--logins', '--username', '--usernames', '--name', '--names', action="store", type="string", dest="login", default=None, help="""Specify user(s) by their login (separated by commas """ """without spaces).""") filtergroup.add_option('--uid', '--uids', action="store", type="string", dest="uid", default=None, help="""Specify user(s) by their UID (separated by commas """ """without spaces).""") if mode is 'users' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-user', '--exclude-user', '--not-users', '--exclude-users', '--not-login', '--exclude-login', '--not-logins', '--exclude-logins', '--not-username', '--exclude-username', '--not-usernames', '--exclude-usernames', action="store", type="string", dest="exclude_login", default=None, help='''Specify user(s) to exclude from current operation, by ''' '''their *login* (separated by commas without spaces).''') filtergroup.add_option('--not-uid', '--exclude-uid', '--not-uids', '--exclude-uids', action="store", type="string", dest="exclude_uid", default=None, help='''Specify user(s) to exclude from current operation by ''' '''their UID (separated by commas without spaces).''') if mode is 'groups': filtergroup.add_option('--name', '--names', '--group', '--groups', '--group-name', '--group-names', action="store", type="string", dest="name", default=None, help="""Specify group(s) by their name (separated by commas """ """without spaces).""") filtergroup.add_option('--gid', '--gids', action="store", type="string", dest="gid", default=None, help="""Specify group(s) by their GID (separated by commas """ """without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--system', '--system-groups', '--sys', action="store_true", dest="system", default = False, help="Only select system groups.") filtergroup.add_option('--privileged', '--priv', '--privs', '--pri', '--privileged-groups', action="store_true", dest="privileged", default = False, help="Only select privileged groups.") filtergroup.add_option('--responsibles', '--rsp', '--responsible-groups', action="store_true", dest="responsibles", default = False, help="Only select responsibles groups.") filtergroup.add_option('--guests', '--gst', '--guest-groups', action="store_true", dest="guests", default = False, help="Only select guests groups.") filtergroup.add_option('--empty', '--empty-groups', action="store_true", dest="empty", default = False, help="Only select empty groups.") if mode is 'groups' or (tool is 'mod' and mode is 'profiles'): filtergroup.add_option('--not-group', '--exclude-group', '--not-groups', '--exclude-groups', '--not-groupname', '--exclude-groupname', '--not-groupnames', '--exclude-groupnames', action="store", type="string", dest="exclude_group", default=None, help='''Specify group(s) to exclude from current operation, by ''' '''their *name* (separated by commas without spaces).''') filtergroup.add_option('--not-gid', '--exclude-gid', '--not-gids', '--exclude-gids', action="store", type="string", dest="exclude_gid", default=None, help='''Specify group(s) to exclude from current operation by ''' '''their *GID* (separated by commas without spaces).''') if mode is 'profiles': filtergroup.add_option('--profile', '--profiles', '--profile-name', '--profile-names', '--name', '--names', action="store", type="string", dest="name", default = None, help="""Specify profile by its common name (separated by commas """ """without spaces, when possible. If name contains spaces, """ """use --group instead). %s.""" % stylize(ST_IMPORTANT, "one of --name or --group is required")) filtergroup.add_option('--group', '--groups', '--profile-group', '--profile-groups', action="store", type="string", dest="group", default = None, help="""specify profile by its primary group (separated by """ """commas without spaces).""") if mode is 'machines': filtergroup.add_option('--hostname', '--hostnames', '--name', '--names', '--client-name', '--client-names', action="store", type="string", dest="hostname", default = None, help="""Specify machine(s) by their hostname (separated by """ """commas without spaces).""") filtergroup.add_option('--mid', '--mids', '--ip', '--ips', '--ip-address', '--ip-addresses', action="store", type="string", dest="mid", default = None, help="""Specify machine(s) by their IP address (separated by """ """commas without spaces).""") if tool in ('get', 'mod', 'del', 'chk'): filtergroup.add_option('--asleep', '--asleep-machines', action="store_true", dest="asleep", default = False, help="Only select asleep machines.") filtergroup.add_option('--idle', '--idle-machines', action="store_true", dest="idle", default = False, help="Only select idle machines.") filtergroup.add_option('--active', '--active-machines', action="store_true", dest="active", default = False, help="Only select active machines.") return filtergroup | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
%s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( | %s user [-s|--system] [-p|--password "<password>"] [-g|--gid=<primary_gid>] [-r|--profile=<profile>] [-K|--skel=<skel>] [-e|--gecos=<given name>] [-H|--home=<home_dir>] […]""" % ( | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="login", default = None, | action="store", type="string", dest="login", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="gecos", default = None, | action="store", type="string", dest="gecos", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="password", default = None, | action="store", type="string", dest="password", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
'--primary-gid', action="store", type="string", dest="primary_gid", default = None, | '--primary-gid', '--group', action="store", type="string", dest="primary_gid", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
'--add-to-groups', | '--add-to-groups', '--aux-groups', '--secondary-groups', '--groups', | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="profile", default = None, | action="store", type="string", dest="profile", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="int", dest="uid", default = None, | action="store", type="int", dest="uid", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="home", default = None, | action="store", type="string", dest="home", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="shell", default = None, | action="store", type="string", dest="shell", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="skel", default = None, | action="store", type="string", dest="skel", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="firstname", default = None, | action="store", type="string", dest="firstname", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="lastname", default = None, | action="store", type="string", dest="lastname", default=None, | def add_user_parse_arguments(app, configuration): """Integrated help and options / arguments for « add user ».""" usage_text = """ %s user [--login] <login> %s user --firstname <firstname> --lastname <lastname> [--system] [--password "<password>"] [--gid=<primary_gid>] [--profile=<profile>] [--skel=<skel>] [--gecos=<given name>] [--home=<home_dir>] […]""" % ( stylize(ST_APPNAME, "%prog"), stylize(ST_APPNAME, "%prog")) parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_user')) user = OptionGroup(parser, stylize(ST_OPTION, "Add user options ")) user.add_option('-l', "--login", "--name", action="store", type="string", dest="login", default = None, help="""Specify user's login (%s).""" % stylize( ST_IMPORTANT, "one of login or firstname+lastname arguments is required")) user.add_option('-e', "--gecos", action="store", type="string", dest="gecos", default = None, help="""Specify user's GECOS field. If given, GECOS takes precedence """ """on --firstname and --lastname, which will be silently """ """discarded. Default: autogenerated from firstname & lastname """ """if given, else from login.""") user.add_option('-p', "--password", action="store", type="string", dest="password", default = None, help="""Specify user's password (else will be autogenerated, %d """ """chars long).""" % configuration.users.min_passwd_size) user.add_option('-g', '--in-group', '--primary-group', '--gid', '--primary-gid', action="store", type="string", dest="primary_gid", default = None, help="""Specify user's future primary group (at your preference as """ """a group name or a GID). This parameter is overriden by the """ """profile argument if you specify both. Default: %s.""" % configuration.users.default_gid) user.add_option('-G', '--in-groups', '--auxilliary-groups', '--add-to-groups', action="store", type="string", dest="in_groups", default=None, help='''Specify future user's auxilliary groups (at your preference ''' '''as groupnames or GIDs, which can be mixed, and separated by ''' '''commas without spaces). These supplemental groups are added ''' '''to the list of groups defined by the profile, if you specify ''' '''both. Default: None.''') user.add_option('-s', "--system", action="store_true", dest="system", default = False, help="Create a system account instead of a standard user (root only).") user.add_option('-r', "--profile", action="store", type="string", dest="profile", default = None, help="""Profile which will be applied to the user. Default: None, """ """overrides primary group / GID.""") user.add_option('-u', "--uid", '--desired-uid', action="store", type="int", dest="uid", default = None, help="""manually specify an UID for the new user. This UID must be """ """free and inside the range %s - %s for a standard user, and """ """outside the range for a system account, else it will be """ """rejected and the user account won't be created. Default: """ """next free UID in the selected range.""" % ( stylize(ST_DEFAULT, configuration.users.uid_min), stylize(ST_DEFAULT, configuration.users.uid_max))) user.add_option('-H', "--home", action="store", type="string", dest="home", default = None, help="""Specify the user's home directory. Only valid for a system """ """account, else discarded because standard accounts have a """ """fixed home dir %s/<login>""" % configuration.users.base_path) user.add_option("-S", "--shell", action="store", type="string", dest="shell", default = None, help="""Specify user's shell, from the ones given by command """ """`get config shells`. Default: %s""" % configuration.users.default_shell) user.add_option('-K', "--skel", action="store", type="string", dest="skel", default = None, help="""Specify a particular skeleton to apply to home dir after """ """creation, instead of the profile or the primary-group """ """implicit skel. Default: the profile skel if profile given, """ """else %s.""" % configuration.users.default_skel) user.add_option("--firstname", action="store", type="string", dest="firstname", default = None, help="""Specify user's first name (required if --lastname is given,""" """overriden by GECOS).""") user.add_option("--lastname", action="store", type="string", dest="lastname", default = None, help="""Specify user's last name (required if --firstname is given, """ """overriden by GECOS).""") user.add_option("--no-create-home", action="store_true", dest="no_create_home", default = False, help="") user.add_option("--disabled-password", action="store_true", dest="disabled_password", default = False, help="") user.add_option("--disabled-login", action="store_true", dest="disabled_login", default = False, help="") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="name", default = None, | action="store", type="string", dest="name", default=None, | def add_profile_parse_arguments(app, configuration): """Integrated help and options / arguments for « add profile ».""" usage_text = "\n\t%s profile [--name=]<name> [-g|--group=<groupName>] [--description=<descr>]\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--shell=<shell>] [--quota=<quota>] [--skel=<nom_squelette>]\n" \ + "\t\t[-a|--[add-]groups=<groupe1>[[,groupe2][,…]] [--force-existing]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_profile')) profile = OptionGroup(parser, stylize(ST_OPTION, "Add profile options ")) profile.add_option("--name", '--profile-name', '--profile', action="store", type="string", dest="name", default = None, help="The profile's name (ie: «Administrator», «Power user», «Webmaster», «Guest»). It should be a singular word and %s." % stylize(ST_IMPORTANT, "it is required")) profile.add_option('-g', "--group", '--profile-group', action="store", type="string", dest="group", default = None, help="Group name identifying the profile on the system (ie: «administrators», «power-users», «webmasters», «guests»). It should be a plural world and will become a system group. %s." % stylize(ST_IMPORTANT, "It is required")) profile.add_option("--description", action="store", type="string", dest="description", default = '', help="Description of the profile (free text).") profile.add_option("--shell", action="store", type="string", dest="shell", default = configuration.users.default_shell, help="Default shell for this profile (defaults to %s)." % stylize(ST_DEFAULT, configuration.users.default_shell)) profile.add_option("--quota", action="store", type="int", dest="quota", default = 1024, help="User data quota in Mb (soft quota, defaults to %s)." % stylize(ST_DEFAULT, "1024")) profile.add_option('-a', "--groups", "--add-groups", action="store", type="string", dest="groups", default = [], help="Groups users of this profile will become members of. Separated by commas without spaces.") profile.add_option("--skel", action="store", type="string", dest="skeldir", default = configuration.users.default_skel, help="skeleton dir for this profile (must be an absolute path, defaults to %s)." % stylize(ST_DEFAULT, configuration.users.default_skel)) profile.add_option("--force-existing", '--use-existing', action="store_true", dest="force_existing", default = False, help="Confirm the use of a previously created system group for the profile. %s, but in some cases (where the group is created by another package or script) this is OK." % stylize(ST_IMPORTANT, "This is risky")) parser.add_option_group(profile) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="group", default = None, | action="store", type="string", dest="group", default=None, | def add_profile_parse_arguments(app, configuration): """Integrated help and options / arguments for « add profile ».""" usage_text = "\n\t%s profile [--name=]<name> [-g|--group=<groupName>] [--description=<descr>]\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--shell=<shell>] [--quota=<quota>] [--skel=<nom_squelette>]\n" \ + "\t\t[-a|--[add-]groups=<groupe1>[[,groupe2][,…]] [--force-existing]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_profile')) profile = OptionGroup(parser, stylize(ST_OPTION, "Add profile options ")) profile.add_option("--name", '--profile-name', '--profile', action="store", type="string", dest="name", default = None, help="The profile's name (ie: «Administrator», «Power user», «Webmaster», «Guest»). It should be a singular word and %s." % stylize(ST_IMPORTANT, "it is required")) profile.add_option('-g', "--group", '--profile-group', action="store", type="string", dest="group", default = None, help="Group name identifying the profile on the system (ie: «administrators», «power-users», «webmasters», «guests»). It should be a plural world and will become a system group. %s." % stylize(ST_IMPORTANT, "It is required")) profile.add_option("--description", action="store", type="string", dest="description", default = '', help="Description of the profile (free text).") profile.add_option("--shell", action="store", type="string", dest="shell", default = configuration.users.default_shell, help="Default shell for this profile (defaults to %s)." % stylize(ST_DEFAULT, configuration.users.default_shell)) profile.add_option("--quota", action="store", type="int", dest="quota", default = 1024, help="User data quota in Mb (soft quota, defaults to %s)." % stylize(ST_DEFAULT, "1024")) profile.add_option('-a', "--groups", "--add-groups", action="store", type="string", dest="groups", default = [], help="Groups users of this profile will become members of. Separated by commas without spaces.") profile.add_option("--skel", action="store", type="string", dest="skeldir", default = configuration.users.default_skel, help="skeleton dir for this profile (must be an absolute path, defaults to %s)." % stylize(ST_DEFAULT, configuration.users.default_skel)) profile.add_option("--force-existing", '--use-existing', action="store_true", dest="force_existing", default = False, help="Confirm the use of a previously created system group for the profile. %s, but in some cases (where the group is created by another package or script) this is OK." % stylize(ST_IMPORTANT, "This is risky")) parser.add_option_group(profile) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="name", default = None, | action="store", type="string", dest="name", default=None, | def add_keyword_parse_arguments(app, configuration): """Integrated help and options / arguments for « add keyword ».""" usage_text = "\n\t%s kw|tag|keyword|keywords --name=<keyword> [--parent=<parent_keyword> --description=<description>]\n" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_keyword')) keyword = OptionGroup(parser, stylize(ST_OPTION, "Add keyword options ")) keyword.add_option("--name", action="store", type="string", dest="name", default = None, help="The keyword's name. It should be a singular word and %s." % stylize(ST_IMPORTANT, "it is required")) keyword.add_option("--parent", action="store", type="string", dest="parent", default = "", help="Keyword's parent name.") keyword.add_option("--description", action="store", type="string", dest="description", default = "", help="Description of the keyword (free text).") parser.add_option_group(keyword) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="privileges_to_add", default = None, | action="store", type="string", dest="privileges_to_add", default=None, | def add_privilege_parse_arguments(app, configuration): """Integrated help and options / arguments for « add keyword ».""" usage_text = "\n\t%s priv|privs|privilege|privileges [--name|--names=]privilege1[[,privilege2],…]\n" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_privilege')) priv = OptionGroup(parser, stylize(ST_OPTION, "Add privilege options ")) priv.add_option("--name", "--names", action="store", type="string", dest="privileges_to_add", default = None, help="The privilege's name(s). %s and can be a single word or multiple ones, separated by commas." % stylize(ST_IMPORTANT, "it is required")) parser.add_option_group(priv) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="filename", default = None, | action="store", type="string", dest="filename", default=None, | def addimport_parse_arguments(app, configuration): """Integrated help and options / arguments for « import users ».""" usage_text = "\n\t%s users --filename=<fichier> --profile=<profil>\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--lastname-column=<COL>] [--firstname-column=<COL>]\n" \ + "\t\t[--group-column=<COL>] [--login-column=<COL>] [--password-column=<COL>]\n" \ + "\t\t[--separator=<SEP>] [--confirm-import] [--no-sync]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_import')) addimport = OptionGroup(parser, stylize(ST_OPTION, "Import users and groups options ")) addimport.add_option("--filename", action="store", type="string", dest="filename", default = None, help="name of the file you want to import accounts from (must point to a valid CSV file and %s)." % stylize(ST_IMPORTANT, "is required")) addimport.add_option("--profile", action="store", type="string", dest="profile", default = None, help="profile the accounts will be affected upon creation (%s)." % stylize(ST_IMPORTANT, "required")) addimport.add_option("--lastname-column", action="store", type="int", dest="lastname_col", default = 0, help="lastname column number (default is %s)." % stylize(ST_DEFAULT, "0")) addimport.add_option("--firstname-column", action="store", type="int", dest="firstname_col", default = 1, help="firstname column number (default is %s)." % stylize(ST_DEFAULT, "1")) addimport.add_option("--group-column", action="store", type="int", dest="group_col", default = 2, help="%s column number (default is %s)." % (stylize(ST_SPECIAL, configuration.groups.names.plural), stylize(ST_DEFAULT, "2"))) addimport.add_option("--login-column", action="store", type="int", dest="login_col", default = None, help="%s column number (default is %s: login will be guessed from firstname and lastname)." \ % (stylize(ST_SPECIAL, "login"), stylize(ST_DEFAULT, "None"))) addimport.add_option("--password-column", action="store", type="int", dest="password_col", default = None, help="%s column number (default is %s: password will be randomly generated and %d chars long)." \ % (stylize(ST_SPECIAL, "passwd"), stylize(ST_DEFAULT, "None"), configuration.users.min_passwd_size)) addimport.add_option("--separator", action="store", type="string", dest="separator", default = ";", help="separator for the CSV fields (default is %s by sniffing in the file)." % stylize(ST_DEFAULT, "determined automatically")) addimport.add_option("--confirm-import", action="store_true", dest="confirm_import", default = False, help="Really do the import. %s on the system, only give you an example of what will be done, which is useful to verify your file has been correctly parsed (fields order, separator…)." % stylize(ST_IMPORTANT, "Without this flag the program will do nothing")) addimport.add_option("--no-sync", action="store_true", dest="no_sync", default = False, help="Commit changes only after all modifications.") parser.add_option_group(addimport) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="profile", default = None, | action="store", type="string", dest="profile", default=None, | def addimport_parse_arguments(app, configuration): """Integrated help and options / arguments for « import users ».""" usage_text = "\n\t%s users --filename=<fichier> --profile=<profil>\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--lastname-column=<COL>] [--firstname-column=<COL>]\n" \ + "\t\t[--group-column=<COL>] [--login-column=<COL>] [--password-column=<COL>]\n" \ + "\t\t[--separator=<SEP>] [--confirm-import] [--no-sync]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_import')) addimport = OptionGroup(parser, stylize(ST_OPTION, "Import users and groups options ")) addimport.add_option("--filename", action="store", type="string", dest="filename", default = None, help="name of the file you want to import accounts from (must point to a valid CSV file and %s)." % stylize(ST_IMPORTANT, "is required")) addimport.add_option("--profile", action="store", type="string", dest="profile", default = None, help="profile the accounts will be affected upon creation (%s)." % stylize(ST_IMPORTANT, "required")) addimport.add_option("--lastname-column", action="store", type="int", dest="lastname_col", default = 0, help="lastname column number (default is %s)." % stylize(ST_DEFAULT, "0")) addimport.add_option("--firstname-column", action="store", type="int", dest="firstname_col", default = 1, help="firstname column number (default is %s)." % stylize(ST_DEFAULT, "1")) addimport.add_option("--group-column", action="store", type="int", dest="group_col", default = 2, help="%s column number (default is %s)." % (stylize(ST_SPECIAL, configuration.groups.names.plural), stylize(ST_DEFAULT, "2"))) addimport.add_option("--login-column", action="store", type="int", dest="login_col", default = None, help="%s column number (default is %s: login will be guessed from firstname and lastname)." \ % (stylize(ST_SPECIAL, "login"), stylize(ST_DEFAULT, "None"))) addimport.add_option("--password-column", action="store", type="int", dest="password_col", default = None, help="%s column number (default is %s: password will be randomly generated and %d chars long)." \ % (stylize(ST_SPECIAL, "passwd"), stylize(ST_DEFAULT, "None"), configuration.users.min_passwd_size)) addimport.add_option("--separator", action="store", type="string", dest="separator", default = ";", help="separator for the CSV fields (default is %s by sniffing in the file)." % stylize(ST_DEFAULT, "determined automatically")) addimport.add_option("--confirm-import", action="store_true", dest="confirm_import", default = False, help="Really do the import. %s on the system, only give you an example of what will be done, which is useful to verify your file has been correctly parsed (fields order, separator…)." % stylize(ST_IMPORTANT, "Without this flag the program will do nothing")) addimport.add_option("--no-sync", action="store_true", dest="no_sync", default = False, help="Commit changes only after all modifications.") parser.add_option_group(addimport) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="int", dest="login_col", default = None, | action="store", type="int", dest="login_col", default=None, | def addimport_parse_arguments(app, configuration): """Integrated help and options / arguments for « import users ».""" usage_text = "\n\t%s users --filename=<fichier> --profile=<profil>\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--lastname-column=<COL>] [--firstname-column=<COL>]\n" \ + "\t\t[--group-column=<COL>] [--login-column=<COL>] [--password-column=<COL>]\n" \ + "\t\t[--separator=<SEP>] [--confirm-import] [--no-sync]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_import')) addimport = OptionGroup(parser, stylize(ST_OPTION, "Import users and groups options ")) addimport.add_option("--filename", action="store", type="string", dest="filename", default = None, help="name of the file you want to import accounts from (must point to a valid CSV file and %s)." % stylize(ST_IMPORTANT, "is required")) addimport.add_option("--profile", action="store", type="string", dest="profile", default = None, help="profile the accounts will be affected upon creation (%s)." % stylize(ST_IMPORTANT, "required")) addimport.add_option("--lastname-column", action="store", type="int", dest="lastname_col", default = 0, help="lastname column number (default is %s)." % stylize(ST_DEFAULT, "0")) addimport.add_option("--firstname-column", action="store", type="int", dest="firstname_col", default = 1, help="firstname column number (default is %s)." % stylize(ST_DEFAULT, "1")) addimport.add_option("--group-column", action="store", type="int", dest="group_col", default = 2, help="%s column number (default is %s)." % (stylize(ST_SPECIAL, configuration.groups.names.plural), stylize(ST_DEFAULT, "2"))) addimport.add_option("--login-column", action="store", type="int", dest="login_col", default = None, help="%s column number (default is %s: login will be guessed from firstname and lastname)." \ % (stylize(ST_SPECIAL, "login"), stylize(ST_DEFAULT, "None"))) addimport.add_option("--password-column", action="store", type="int", dest="password_col", default = None, help="%s column number (default is %s: password will be randomly generated and %d chars long)." \ % (stylize(ST_SPECIAL, "passwd"), stylize(ST_DEFAULT, "None"), configuration.users.min_passwd_size)) addimport.add_option("--separator", action="store", type="string", dest="separator", default = ";", help="separator for the CSV fields (default is %s by sniffing in the file)." % stylize(ST_DEFAULT, "determined automatically")) addimport.add_option("--confirm-import", action="store_true", dest="confirm_import", default = False, help="Really do the import. %s on the system, only give you an example of what will be done, which is useful to verify your file has been correctly parsed (fields order, separator…)." % stylize(ST_IMPORTANT, "Without this flag the program will do nothing")) addimport.add_option("--no-sync", action="store_true", dest="no_sync", default = False, help="Commit changes only after all modifications.") parser.add_option_group(addimport) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="int", dest="password_col", default = None, | action="store", type="int", dest="password_col", default=None, | def addimport_parse_arguments(app, configuration): """Integrated help and options / arguments for « import users ».""" usage_text = "\n\t%s users --filename=<fichier> --profile=<profil>\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--lastname-column=<COL>] [--firstname-column=<COL>]\n" \ + "\t\t[--group-column=<COL>] [--login-column=<COL>] [--password-column=<COL>]\n" \ + "\t\t[--separator=<SEP>] [--confirm-import] [--no-sync]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'add_import')) addimport = OptionGroup(parser, stylize(ST_OPTION, "Import users and groups options ")) addimport.add_option("--filename", action="store", type="string", dest="filename", default = None, help="name of the file you want to import accounts from (must point to a valid CSV file and %s)." % stylize(ST_IMPORTANT, "is required")) addimport.add_option("--profile", action="store", type="string", dest="profile", default = None, help="profile the accounts will be affected upon creation (%s)." % stylize(ST_IMPORTANT, "required")) addimport.add_option("--lastname-column", action="store", type="int", dest="lastname_col", default = 0, help="lastname column number (default is %s)." % stylize(ST_DEFAULT, "0")) addimport.add_option("--firstname-column", action="store", type="int", dest="firstname_col", default = 1, help="firstname column number (default is %s)." % stylize(ST_DEFAULT, "1")) addimport.add_option("--group-column", action="store", type="int", dest="group_col", default = 2, help="%s column number (default is %s)." % (stylize(ST_SPECIAL, configuration.groups.names.plural), stylize(ST_DEFAULT, "2"))) addimport.add_option("--login-column", action="store", type="int", dest="login_col", default = None, help="%s column number (default is %s: login will be guessed from firstname and lastname)." \ % (stylize(ST_SPECIAL, "login"), stylize(ST_DEFAULT, "None"))) addimport.add_option("--password-column", action="store", type="int", dest="password_col", default = None, help="%s column number (default is %s: password will be randomly generated and %d chars long)." \ % (stylize(ST_SPECIAL, "passwd"), stylize(ST_DEFAULT, "None"), configuration.users.min_passwd_size)) addimport.add_option("--separator", action="store", type="string", dest="separator", default = ";", help="separator for the CSV fields (default is %s by sniffing in the file)." % stylize(ST_DEFAULT, "determined automatically")) addimport.add_option("--confirm-import", action="store_true", dest="confirm_import", default = False, help="Really do the import. %s on the system, only give you an example of what will be done, which is useful to verify your file has been correctly parsed (fields order, separator…)." % stylize(ST_IMPORTANT, "Without this flag the program will do nothing")) addimport.add_option("--no-sync", action="store_true", dest="no_sync", default = False, help="Commit changes only after all modifications.") parser.add_option_group(addimport) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="name", default = None, | action="store", type="string", dest="name", default=None, | def del_keyword_parse_arguments(app, configuration): """Integrated help and options / arguments for « delete keyword ».""" usage_text = "\n\t%s keyword --name=<nom>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'del_keyword')) keyword = OptionGroup(parser, stylize(ST_OPTION, "Delete keyword options ")) keyword.add_option("--name", action="store", type="string", dest="name", default = None, help="specify the keyword to delete.") keyword.add_option("--del-children", action="store_true", dest="del_children", default = False, help="delete the parent and his children.") parser.add_option_group(keyword) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="privileges_to_remove", default = None, | action="store", type="string", dest="privileges_to_remove", default=None, | def del_privilege_parse_arguments(app, configuration): """Integrated help and options / arguments for « add keyword ».""" usage_text = "\n\t%s priv|privs|privilege|privileges [--name|--names=]privilege1[[,privilege2],…]\n" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'del_privilege')) parser.add_option_group(common_filter_group(app, parser, 'del', 'privileges')) priv = OptionGroup(parser, stylize(ST_OPTION, "Delete privilege options ")) priv.add_option("--name", "--names", action="store", type="string", dest="privileges_to_remove", default = None, help="The privilege's name(s). %s and can be a single word or multiple ones, separated by commas." % stylize(ST_IMPORTANT, "it is required")) parser.add_option_group(priv) return check_opts_and_args(parser.parse_args()) | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="filename", default = None, | action="store", type="string", dest="filename", default=None, | def delimport_parse_arguments(app, configuration): usage_text = "\n\t%s --filename=<fichier> [--no-archive]" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'del_import')) delimport = OptionGroup(parser, stylize(ST_OPTION, "Un-import users and groups options ")) delimport.add_option("--filename", action="store", type="string", dest="filename", default = None, help="") delimport.add_option("--no-archive", action="store_true", dest="no_archive", default = False, help="don't make a backup of user's home when deleting them.") parser.add_option_group(delimport) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
dest="newpassword", default = None, | dest="newpassword", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
dest="newgecos", default = None, | dest="newgecos", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
dest="newshell", default = None, | dest="newshell", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store_true", dest="lock", default = None, | action="store_true", dest="lock", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store_false", dest="lock", default = None, | action="store_false", dest="lock", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
dest="groups_to_add", default = None, | dest="groups_to_add", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
dest="groups_to_del", default = None, | dest="groups_to_del", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="apply_skel", default = None, | action="store", type="string", dest="apply_skel", default=None, | def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args() | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
action="store", type="string", dest="newname", default = None, | action="store", type="string", dest="newname", default=None, | def mod_group_parse_arguments(app, configuration): usage_text = "\n\t%s group --name=<nom_actuel> [--rename=<nouveau_nom>]\n" % stylize(ST_APPNAME, "%prog") \ + "\t\t[--add-users=<user1[[,user2][,…]]>] [--del-users=<user1[[,user2][,…]]>]\n" \ + "\t\t[--add-resps=<user1[[,user2][,…]]>] [--delete-resps=<user1[[,user2][,…]]>]\n" \ + "\t\t[--add-guests=<user1[[,user2][,…]]>] [--delete-guests=<user1[[,user2][,…]]>]\n" \ + "\t\t[--permissive|--not-permissive] [--skel=<new skel>] [--description=<new description>]" parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_group')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'groups')) group = OptionGroup(parser, stylize(ST_OPTION, "Modify group options")) group.add_option("--rename", action="store", type="string", dest="newname", default = None, help="specify group's new name (not yet implemented).") group.add_option("--skel", action="store", type="string", dest="newskel", default = None, help="specify group's new skel dir.") group.add_option("--description", action="store", type="string", dest="newdescription", default = None, help="specify new group's description") group.add_option("-p", "--permissive", "--set-permissive", action="store_true", dest="permissive", default = None, help="set the shared directory of the group permissive.") group.add_option("-P", "--not-permissive", "--set-not-permissive", action="store_false", dest="permissive", default = None, help="set the shared directory of the group not permissive.") group.add_option("--add-users", action="store", type="string", dest="users_to_add", default = [], help="Add users to the group. The users are separated by commas without spaces.") group.add_option("--del-users", action="store", type="string", dest="users_to_del", default = [], help="Delete users from the group. The users are separated by commas without spaces.") group.add_option("--add-resps", action="store", type="string", dest="resps_to_add", default = [], help="Add responsibles to the group. The responsibles are separated by commas without spaces.") group.add_option("--del-resps", action="store", type="string", dest="resps_to_del", default = [], help="Delete responsibles from the group. The responsibles are separated by commas without spaces.") group.add_option("--add-guests", action="store", type="string", dest="guests_to_add", default = [], help="Add guests to the group. The guests are separated by commas without spaces.") group.add_option("--del-guests", action="store", type="string", dest="guests_to_del", default = [], help="Delete guests from the group. The guests are separated by commas without spaces.") group.add_option("--add-granted-profiles", action="store", type="string", dest="granted_profiles_to_add", default = None, help="Add the profiles which the users can access to the group's shared directory. The profiles are separated by commas without spaces.") group.add_option("--del-granted-profiles", action="store", type="string", dest="granted_profiles_to_del", default = None, help="Delete the profiles which the users can access to the group's shared directory. The profiles are separated by commas without spaces.") parser.add_option_group(group) return check_opts_and_args(parser.parse_args()) | 461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.