From 8d11d0735a33687222811b2511fb43530db42dd2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 19 Jun 2015 11:41:45 +0200 Subject: [PATCH 1/4] Correctly reset the test users --- lib/oc-tests/test_shareGroup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oc-tests/test_shareGroup.py b/lib/oc-tests/test_shareGroup.py index 19fbc9d..ecc305b 100644 --- a/lib/oc-tests/test_shareGroup.py +++ b/lib/oc-tests/test_shareGroup.py @@ -82,7 +82,7 @@ def setup(step): step (1, 'create test users') - reset_owncloud_account(config.oc_number_test_users) + reset_owncloud_account(num_test_users=config.oc_number_test_users) check_users(num_test_users=config.oc_number_test_users) reset_owncloud_group(num_groups=config.oc_number_test_groups) From 454582ebcda383b1d1dff6f53f26eabd0b499865 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 19 Jun 2015 11:43:24 +0200 Subject: [PATCH 2/4] Always reset the "test" user because it is being used by "webdav_mkcol()" --- python/smashbox/utilities/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/smashbox/utilities/__init__.py b/python/smashbox/utilities/__init__.py index fa01d72..5c4e921 100644 --- a/python/smashbox/utilities/__init__.py +++ b/python/smashbox/utilities/__init__.py @@ -37,11 +37,11 @@ def reset_owncloud_account(reset_procedure=None, num_test_users=None): logger.info('reset_owncloud_account (%s) for %d users', reset_procedure, num_test_users) if reset_procedure == 'delete': - if num_test_users is None: - delete_owncloud_account(config.oc_account_name) - create_owncloud_account(config.oc_account_name, config.oc_account_password) - login_owncloud_account(config.oc_account_name, config.oc_account_password) - else: + delete_owncloud_account(config.oc_account_name) + create_owncloud_account(config.oc_account_name, config.oc_account_password) + login_owncloud_account(config.oc_account_name, config.oc_account_password) + + if num_test_users is not None: for i in range(1, num_test_users + 1): username = "%s%i" % (config.oc_account_name, i) delete_owncloud_account(username) From 8690c32d6e59a17bdcdd9d46ccc402e6f80e3de3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 May 2015 17:35:55 +0200 Subject: [PATCH 3/4] Fix the user and group names in shareGroup.py --- lib/oc-tests/test_shareGroup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/oc-tests/test_shareGroup.py b/lib/oc-tests/test_shareGroup.py index ecc305b..0f444f8 100644 --- a/lib/oc-tests/test_shareGroup.py +++ b/lib/oc-tests/test_shareGroup.py @@ -88,7 +88,9 @@ def setup(step): reset_owncloud_group(num_groups=config.oc_number_test_groups) check_groups(config.oc_number_test_groups) - add_user_to_group('user3', 'testgroup1') + user3 = "%s%i"%(config.oc_account_name, 3) + group1 = "%s%i"%(config.oc_group_name, 1) + add_user_to_group(user3, group1) reset_rundir() @@ -258,7 +260,10 @@ def admin(step): step (14, 'Admin user removes user from group') - remove_user_from_group('user3', 'testgroup1') + + user3 = "%s%i"%(config.oc_account_name, 3) + group1 = "%s%i"%(config.oc_group_name, 1) + add_user_to_group(user3, group1) step (16, 'Admin final step') From 2acea279e7a6342943dc92734ea116db9e3da7b2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 May 2015 17:46:21 +0200 Subject: [PATCH 4/4] Remove the user when you want to remove him :see_no_evil: --- lib/oc-tests/test_shareGroup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oc-tests/test_shareGroup.py b/lib/oc-tests/test_shareGroup.py index 0f444f8..22afc84 100644 --- a/lib/oc-tests/test_shareGroup.py +++ b/lib/oc-tests/test_shareGroup.py @@ -263,7 +263,7 @@ def admin(step): user3 = "%s%i"%(config.oc_account_name, 3) group1 = "%s%i"%(config.oc_group_name, 1) - add_user_to_group(user3, group1) + remove_user_from_group(user3, group1) step (16, 'Admin final step')