6 from irods.test
import session
8 from irods.test
import settings
10 test_user_list = [
'alice',
'bobby',
'otherrods',
'zonehopper',
'admin']
11 test_resc_list = [
'AnotherResc',
'TestResc',
'pt',
'leaf']
15 admin_name = irods_config.client_environment[
'irods_user_name']
16 zone_name = irods_config.client_environment[
'irods_zone_name']
17 env_dict = lib.make_environment_dict(admin_name, settings.ICAT_HOSTNAME, zone_name, use_ssl=settings.USE_SSL)
18 sess = session.IrodsSession(env_dict, settings.PREEXISTING_ADMIN_PASSWORD,
False)
21 sess.run_icommand(
'irmtrash -M')
24 for user_name
in test_user_list:
26 sess.run_icommand(
'ichmod -rM own {admin_name} /{zone_name}/home/{user_name}'.format(**locals()))
29 out, _, _ = sess.run_icommand(
'ils /{zone_name}/home/{user_name}'.format(**locals()))
32 for entry
in entries[1:]:
34 if entry.startswith(
'/'):
35 sess.run_icommand(
'irm -rf {entry}'.format(**locals()))
38 sess.run_icommand(
'irm -f /{zone_name}/home/{user_name}/{entry}'.format(**locals()))
41 sess.run_icommand(
'iadmin rmuser {user_name}'.format(**locals()))
44 sess.run_icommand(
'iadmin rmchildfromresc pt leaf')
47 for resource
in test_resc_list:
48 sess.run_icommand(
'iadmin rmresc {resource}'.format(**locals()))
51 shutil.rmtree(
'/tmp/federation_test_stuff', ignore_errors=
True)