From 7a9acc9beeaf662e00f986a2b1239b34d540b1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 18 Nov 2015 14:51:35 +0100 Subject: [PATCH 1/9] Sharing etag propagation tests Only for users, includes resharing and upload to several places --- lib/oc-tests/test_sharePropagation.py | 256 ++++++++++++ lib/oc-tests/test_sharePropagationInside.py | 409 ++++++++++++++++++++ 2 files changed, 665 insertions(+) create mode 100644 lib/oc-tests/test_sharePropagation.py create mode 100644 lib/oc-tests/test_sharePropagationInside.py diff --git a/lib/oc-tests/test_sharePropagation.py b/lib/oc-tests/test_sharePropagation.py new file mode 100644 index 0000000..73d5ce4 --- /dev/null +++ b/lib/oc-tests/test_sharePropagation.py @@ -0,0 +1,256 @@ +__doc__ = """ +Test share etag propagation + ++-------------+-------------------------+-------------------------+----------------------+ +| step number | owner | R2 R3 | R4 | ++-------------+-------------------------+-------------------------+----------------------+ +| 2 | create working dir | create working dir | create working dir | +| | share folder with R2 R3 | | | ++-------------+-------------------------+-------------------------+----------------------+ +| 3 | sync | | | ++-------------+-------------------------+-------------------------+----------------------+ +| 4 | verify propagation | verify propagation | | ++-------------+-------------------------+-------------------------+----------------------+ +| 5 | | upload in shared dir | | ++-------------+-------------------------+-------------------------+----------------------+ +| 6 | verify propagation | verify propagation | | ++-------------+-------------------------+-------------------------+----------------------+ +| 7 | unshare folder | | | ++-------------+-------------------------+-------------------------+----------------------+ +| 8 | verify propagation | verify propagation | | ++-------------+-------------------------+-------------------------+----------------------+ +| 9 | share folder with R2 R3 | | | ++-------------+-------------------------+-------------------------+----------------------+ +| 10 | | R2 reshare with R4 | | ++-------------+-------------------------+-------------------------+----------------------+ +| 11 | verify propagation | verify propagation | verify propagation | ++-------------+-------------------------+-------------------------+----------------------+ +| 12 | | R2 upload in shared dir | | ++-------------+-------------------------+-------------------------+----------------------+ +| 13 | verify propagation | verify propagation | verify propagation | ++-------------+-------------------------+-------------------------+----------------------+ +| 14 | | | upload in shared dir | ++-------------+-------------------------+-------------------------+----------------------+ +| 15 | verify propagation | verify propagation | verify propagation | ++-------------+-------------------------+-------------------------+----------------------+ +| 16 | | R2 unshares folder | | ++-------------+-------------------------+-------------------------+----------------------+ +| 17 | verify etag is the same | verify propagation | verify propagation | ++-------------+-------------------------+-------------------------+----------------------+ +""" + +from smashbox.utilities import * +import itertools +import os.path +import re + +def parse_worker_number(worker_name): + match = re.search(r'(\d+)$', worker_name) + if match is not None: + return int(match.group()) + else: + return None + +@add_worker +def setup(step): + + step(1, 'create test users') + reset_owncloud_account(num_test_users=5) + check_users(5) + + reset_rundir() + reset_server_log_file() + + step(18, 'Validate server log file is clean') + + d = make_workdir() + scrape_log_file(d) + +@add_worker +def owner(step): + + user = '%s%i' % (config.oc_account_name, 1) + + step (2, 'Create workdir') + d = make_workdir() + + mkdir(os.path.join(d, 'test')) + mkdir(os.path.join(d, 'test', 'sub')) + run_ocsync(d, user_num=1) + + client = get_oc_api() + client.login(user, config.oc_account_password) + # make sure folder is shared + user2 = '%s%i' % (config.oc_account_name, 2) + share1_data = client.share_file_with_user('/test', user2, perms=31) + fatal_check(share1_data, 'failed sharing a file with %s' % (user2,)) + + user3 = '%s%i' % (config.oc_account_name, 3) + share2_data = client.share_file_with_user('/test', user3, perms=31) + fatal_check(share2_data, 'failed sharing a file with %s' % (user3,)) + + root_etag = client.file_info('/').get_etag() + test_etag = client.file_info('/test').get_etag() + test_sub_etag = client.file_info('/test/sub').get_etag() + + step(3, 'Upload file') + createfile(os.path.join(d, 'test', 'test.txt'), '1', count=1000, bs=10) + run_ocsync(d, user_num=1) + + step(4, 'Verify etag propagation') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(6, 'verify another etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(7, 'unshare') + client.delete_share(share1_data.share_id) + client.delete_share(share2_data.share_id) + + step(8, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + + step(9, 'share again the files') + share1_data = client.share_file_with_user('/test', user2, perms=31) + fatal_check(share1_data, 'failed sharing a file with %s' % (user2,)) + share2_data = client.share_file_with_user('/test', user3, perms=31) + fatal_check(share2_data, 'failed sharing a file with %s' % (user3,)) + + step(11, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + + step(13, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + + step(15, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + + step(17, 'verify etag is the same') + root_etag8 = client.file_info('/').get_etag() + # It shoudn't be propagated here in this case + error_check(root_etag7 == root_etag8, + 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) + +def recipients(step): + + usernum = parse_worker_number(reflection.getProcessName()) + user = '%s%i' % (config.oc_account_name, usernum) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + root_etag = client.file_info('/').get_etag() + + step(4, 'verify etag propagation') + run_ocsync(d, user_num=usernum) + + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(5, 'upload to shared folder') + createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) + run_ocsync(d, user_num=usernum) + + step(6, 'verify another etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(8, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + + step(10, 'reshare file') + if usernum is 2: + user4 = '%s%i' % (config.oc_account_name, 4) + share_data = client.share_file_with_user('/test', user4, perms=31) + + step(11, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + + step(12, 'recipient 2 upload a file') + if usernum is 2: + createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) + run_ocsync(d, user_num=usernum) + + step(13, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + + step(15, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + + step(16, 'unshare file') + if usernum is 2: + client.delete_share(share_data.share_id) + + step(17, 'verify etag propagation') + root_etag8 = client.file_info('/').get_etag() + error_check(root_etag7 != root_etag8, + 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) + +@add_worker +def recipient_4(step): + usernum = parse_worker_number(reflection.getProcessName()) + user = '%s%i' % (config.oc_account_name, usernum) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + root_etag = client.file_info('/').get_etag() + + step(11, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + error_check(root_etag != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag5)) + + step(13, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + + step(14, 'upload file') + run_ocsync(d, user_num=usernum) + createfile(os.path.join(d, 'test', 'test4.txt'), '4', count=1000, bs=10) + run_ocsync(d, user_num=usernum) + + step(15, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + + step(17, 'verify etag propagation') + root_etag8 = client.file_info('/').get_etag() + error_check(root_etag7 != root_etag8, + 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) + +for i in range(2,4): + add_worker(recipients, name='recipient_%s' % (i,)) + diff --git a/lib/oc-tests/test_sharePropagationInside.py b/lib/oc-tests/test_sharePropagationInside.py new file mode 100644 index 0000000..020f730 --- /dev/null +++ b/lib/oc-tests/test_sharePropagationInside.py @@ -0,0 +1,409 @@ +__doc__ = """ ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| step | owner | R1 | R2 | R3 | R4 | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 2 | create dir | create dir | create dir | create dir | create dir | +| | share /test | | | | | +| | -> R1 R2 | | | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 3 | | | reshare /test | | | +| | | | -> R3 | | | +| | | | reshare /test/sub | | | +| | | | -> R4 | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 4 | get etags | get etags | get etags | get etags | get etags | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 5 | upload to | | | | | +| | -> /test | | | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 6 | propagation | propagation | propagation | propagation | NOT propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 7 | | | upload to | | | +| | | | -> /test | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 8 | propagation | propagation | propagation | propagation | NOT propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 9 | upload to | | | | | +| | -> /test/sub | | | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 10 | propagation | propagation | propagation | propagation | propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 11 | | upload to | | | | +| | | -> /test/sub | | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 12 | propagation | propagation | propagation | propagation | propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 13 | | | | | upload to /sub | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 14 | propagation | propagation | propagation | propagation | propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 15 | | | unshare | | | +| | | | -> /test/sub | | | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +| 16 | NOT propagation | propagation | propagation | propagation | propagation | ++-------+-----------------+----------------+-------------------+-------------+-----------------+ +""" +from smashbox.utilities import * +import itertools +import os.path +import re + +def parse_worker_number(worker_name): + match = re.search(r'(\d+)$', worker_name) + if match is not None: + return int(match.group()) + else: + return None + +@add_worker +def setup(step): + + step(1, 'create test users') + reset_owncloud_account(num_test_users=5) + check_users(5) + + reset_rundir() + reset_server_log_file() + + step(17, 'Validate server log file is clean') + + d = make_workdir() + scrape_log_file(d) + +@add_worker +def owner(step): + user = '%s%i' % (config.oc_account_name, 1) + + step (2, 'Create workdir') + d = make_workdir() + + mkdir(os.path.join(d, 'test')) + mkdir(os.path.join(d, 'test', 'sub')) + run_ocsync(d, user_num=1) + + client = get_oc_api() + client.login(user, config.oc_account_password) + # make sure folder is shared + user2 = '%s%i' % (config.oc_account_name, 2) + share1_data = client.share_file_with_user('/test', user2, perms=31) + fatal_check(share1_data, 'failed sharing a file with %s' % (user2,)) + + user3 = '%s%i' % (config.oc_account_name, 3) + share1_data = client.share_file_with_user('/test', user3, perms=31) + fatal_check(share1_data, 'failed sharing a file with %s' % (user3,)) + + step(4, 'get base etags to compare') + root_etag = client.file_info('/').get_etag() + test_etag = client.file_info('/test').get_etag() + + step(5, 'Upload to /test') + createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) + run_ocsync(d, user_num=1) + + step(6, 'verify etag propagation') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(8, 'verify etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(9, 'Upload to /test/sub') + createfile(os.path.join(d, 'test', 'sub', 'test4.txt'), '4', count=1000, bs=10) + run_ocsync(d, user_num=1) + + step(10, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + test_etag2 = client.file_info('/test').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + error_check(test_etag != test_etag2, + 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) + + step(12, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + test_etag3 = client.file_info('/test').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + error_check(test_etag2 != test_etag3, + 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) + + step(14, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + test_etag4 = client.file_info('/test').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + error_check(test_etag3 != test_etag4, + 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) + + step(16, 'verify etag is NOT propagated') + root_etag7 = client.file_info('/').get_etag() + test_etag5 = client.file_info('/test').get_etag() + error_check(root_etag6 == root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + error_check(test_etag4 == test_etag5, + 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) + +def recipient1(step): + + user = '%s%i' % (config.oc_account_name, 2) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + + step(4, 'get base etags to compare') + root_etag = client.file_info('/').get_etag() + test_etag = client.file_info('/test').get_etag() + + step(6, 'verify etag propagation') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(8, 'verify etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(10, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + test_etag2 = client.file_info('/test').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + error_check(test_etag != test_etag2, + 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) + + step(11, 'Upload to /test/sub') + run_ocsync(d, user_num=2) + createfile(os.path.join(d, 'test', 'test5.txt'), '5', count=1000, bs=10) + run_ocsync(d, user_num=2) + + step(12, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + test_etag3 = client.file_info('/test').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + error_check(test_etag2 != test_etag3, + 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) + + step(14, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + test_etag4 = client.file_info('/test').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + error_check(test_etag3 != test_etag4, + 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) + + step(16, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + test_etag5 = client.file_info('/test').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + error_check(test_etag4 != test_etag5, + 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) + +def recipient2(step): + + user = '%s%i' % (config.oc_account_name, 3) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + root_etag = client.file_info('/').get_etag() + + user4 = '%s%i' % (config.oc_account_name, 4) + user5 = '%s%i' % (config.oc_account_name, 5) + + step(3, 'Reshare /test folder with %s and /test/sub with %s' % (user4, user5)) + + share1_data = client.share_file_with_user('/test', user4, perms=31) + fatal_check(share1_data, 'failed sharing a file with %s' % (user4,)) + share2_data = client.share_file_with_user('/test/sub', user5, perms=31) + fatal_check(share2_data, 'failed sharing a file with %s' % (user5,)) + + step(4, 'get base etags to compare') + root_etag = client.file_info('/').get_etag() + test_etag = client.file_info('/test').get_etag() + + step(6, 'verify etag propagation') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(7, 'Upload to /test') + run_ocsync(d, user_num=3) + createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) + run_ocsync(d, user_num=3) + + step(8, 'verify etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(10, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + test_etag2 = client.file_info('/test').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + error_check(test_etag != test_etag2, + 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) + + step(12, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + test_etag3 = client.file_info('/test').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + error_check(test_etag2 != test_etag3, + 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) + + step(14, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + test_etag4 = client.file_info('/test').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + error_check(test_etag3 != test_etag4, + 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) + + step(15, 'Unshare reshared /test/sub') + client.delete_share(share_data2.share_id) + + step(16, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + test_etag5 = client.file_info('/test').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + error_check(test_etag4 != test_etag5, + 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) + +def recipient3(step): + + user = '%s%i' % (config.oc_account_name, 4) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + + step(4, 'get base etags to compare') + root_etag = client.file_info('/').get_etag() + test_etag = client.file_info('/test').get_etag() + + step(6, 'verify etag propagation') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag != root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(8, 'verify etag propagation') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 != root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(10, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + test_etag2 = client.file_info('/test').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + error_check(test_etag != test_etag2, + 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) + + step(12, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + test_etag3 = client.file_info('/test').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + error_check(test_etag2 != test_etag3, + 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) + + step(14, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + test_etag4 = client.file_info('/test').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + error_check(test_etag3 != test_etag4, + 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) + + step(16, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + test_etag5 = client.file_info('/test').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + error_check(test_etag4 != test_etag5, + 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) + +def recipient4(step): + + user = '%s%i' % (config.oc_account_name, 5) + + step (2, 'Create workdir') + + d = make_workdir() + run_ocsync(d, user_num=usernum) + + client = get_oc_api() + client.login(user, config.oc_account_password) + + step(4, 'get base etags to compare') + root_etag = client.file_info('/').get_etag() + sub_etag = client.file_info('/sub').get_etag() + + step(6, 'verify etag is NOT propagated') + root_etag2 = client.file_info('/').get_etag() + error_check(root_etag == root_etag2, + 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) + + step(8, 'verify etag is NOT propagated') + root_etag3 = client.file_info('/').get_etag() + error_check(root_etag2 == root_etag3, + 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) + + step(10, 'verify etag propagation') + root_etag4 = client.file_info('/').get_etag() + sub_etag2 = client.file_info('/sub').get_etag() + error_check(root_etag3 != root_etag4, + 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) + error_check(sub_etag != sub_etag2, + 'etag for /test previous [%s] new [%s]' % (sub_etag, sub_etag2)) + + step(12, 'verify etag propagation') + root_etag5 = client.file_info('/').get_etag() + sub_etag3 = client.file_info('/sub').get_etag() + error_check(root_etag4 != root_etag5, + 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) + error_check(sub_etag2 != sub_etag3, + 'etag for /test previous [%s] new [%s]' % (sub_etag2, sub_etag3)) + + step(13, 'Upload to /sub') + run_ocsync(d, user_num=5) + createfile(os.path.join(d, 'sub', 'test6.txt'), '6', count=1000, bs=10) + run_ocsync(d, user_num=5) + + step(14, 'verify etag propagation') + root_etag6 = client.file_info('/').get_etag() + sub_etag4 = client.file_info('/sub').get_etag() + error_check(root_etag5 != root_etag6, + 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) + error_check(sub_etag3 != sub_etag4, + 'etag for /test previous [%s] new [%s]' % (sub_etag3, sub_etag4)) + + step(16, 'verify etag propagation') + root_etag7 = client.file_info('/').get_etag() + sub_etag5 = client.file_info('/sub').get_etag() + error_check(root_etag6 != root_etag7, + 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) + error_check(sub_etag4 != sub_etag5, + 'etag for /test previous [%s] new [%s]' % (sub_etag4, sub_etag5)) + From fb87c92ceb3638d6070615b3f94019c3159e83ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 18 Nov 2015 18:05:12 +0100 Subject: [PATCH 2/9] Fix unshare test to check it doesn't change the etag, improve errors --- lib/oc-tests/test_sharePropagation.py | 45 ++++---- lib/oc-tests/test_sharePropagationInside.py | 119 +++++++++----------- 2 files changed, 78 insertions(+), 86 deletions(-) diff --git a/lib/oc-tests/test_sharePropagation.py b/lib/oc-tests/test_sharePropagation.py index 73d5ce4..182ea14 100644 --- a/lib/oc-tests/test_sharePropagation.py +++ b/lib/oc-tests/test_sharePropagation.py @@ -17,13 +17,13 @@ +-------------+-------------------------+-------------------------+----------------------+ | 7 | unshare folder | | | +-------------+-------------------------+-------------------------+----------------------+ -| 8 | verify propagation | verify propagation | | +| 8 | verify etag is the same | verify propagation | | +-------------+-------------------------+-------------------------+----------------------+ | 9 | share folder with R2 R3 | | | +-------------+-------------------------+-------------------------+----------------------+ | 10 | | R2 reshare with R4 | | +-------------+-------------------------+-------------------------+----------------------+ -| 11 | verify propagation | verify propagation | verify propagation | +| 11 | verify etag is the same | verify propagation | verify propagation | +-------------+-------------------------+-------------------------+----------------------+ | 12 | | R2 upload in shared dir | | +-------------+-------------------------+-------------------------+----------------------+ @@ -35,7 +35,7 @@ +-------------+-------------------------+-------------------------+----------------------+ | 16 | | R2 unshares folder | | +-------------+-------------------------+-------------------------+----------------------+ -| 17 | verify etag is the same | verify propagation | verify propagation | +| 17 | verify etag is the same | verify etag is the same | verify propagation | +-------------+-------------------------+-------------------------+----------------------+ """ @@ -90,8 +90,6 @@ def owner(step): fatal_check(share2_data, 'failed sharing a file with %s' % (user3,)) root_etag = client.file_info('/').get_etag() - test_etag = client.file_info('/test').get_etag() - test_sub_etag = client.file_info('/test/sub').get_etag() step(3, 'Upload file') createfile(os.path.join(d, 'test', 'test.txt'), '1', count=1000, bs=10) @@ -99,12 +97,12 @@ def owner(step): step(4, 'Verify etag propagation') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads /test/test.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(6, 'verify another etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipients upload to /test/test2.txt' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(7, 'unshare') @@ -113,7 +111,7 @@ def owner(step): step(8, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 == root_etag4, 'owner unshares ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) step(9, 'share again the files') @@ -124,23 +122,23 @@ def owner(step): step(11, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 == root_etag5, 'recipient 2 reshares /test to recipient 4 ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) step(13, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) step(15, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 4 uploads /test/test4.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) step(17, 'verify etag is the same') root_etag8 = client.file_info('/').get_etag() # It shoudn't be propagated here in this case - error_check(root_etag7 == root_etag8, + error_check(root_etag7 == root_etag8, 'recipient 2 unshares the reshare ' 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) def recipients(step): @@ -161,7 +159,7 @@ def recipients(step): run_ocsync(d, user_num=usernum) root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads /test/test.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(5, 'upload to shared folder') @@ -170,12 +168,12 @@ def recipients(step): step(6, 'verify another etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipients upload to /test/test2.txt' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(8, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner unshares ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) step(10, 'reshare file') @@ -185,7 +183,7 @@ def recipients(step): step(11, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 2 reshares /test to recipient 4 ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) step(12, 'recipient 2 upload a file') @@ -195,12 +193,12 @@ def recipients(step): step(13, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) step(15, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 4 uploads /test/test4.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) step(16, 'unshare file') @@ -209,7 +207,8 @@ def recipients(step): step(17, 'verify etag propagation') root_etag8 = client.file_info('/').get_etag() - error_check(root_etag7 != root_etag8, + # recipients 2 and 3 aren't affected by the unshare + error_check(root_etag7 == root_etag8, 'recipient 2 unshares the reshare ' 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) @add_worker @@ -228,12 +227,12 @@ def recipient_4(step): step(11, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() - error_check(root_etag != root_etag5, + error_check(root_etag != root_etag5, 'recipient 2 reshares /test to recipient 4 ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag5)) step(13, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) step(14, 'upload file') @@ -243,12 +242,12 @@ def recipient_4(step): step(15, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 4 uploads /test/test4.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) step(17, 'verify etag propagation') root_etag8 = client.file_info('/').get_etag() - error_check(root_etag7 != root_etag8, + error_check(root_etag7 != root_etag8, 'recipient 2 unshares the reshare ' 'etag for / previous [%s] new [%s]' % (root_etag7, root_etag8)) for i in range(2,4): diff --git a/lib/oc-tests/test_sharePropagationInside.py b/lib/oc-tests/test_sharePropagationInside.py index 020f730..2576874 100644 --- a/lib/oc-tests/test_sharePropagationInside.py +++ b/lib/oc-tests/test_sharePropagationInside.py @@ -40,7 +40,7 @@ | 15 | | | unshare | | | | | | | -> /test/sub | | | +-------+-----------------+----------------+-------------------+-------------+-----------------+ -| 16 | NOT propagation | propagation | propagation | propagation | propagation | +| 16 | NOT propagation | propagation | NOT propagation | propagation | propagation | +-------+-----------------+----------------+-------------------+-------------+-----------------+ """ from smashbox.utilities import * @@ -48,13 +48,6 @@ import os.path import re -def parse_worker_number(worker_name): - match = re.search(r'(\d+)$', worker_name) - if match is not None: - return int(match.group()) - else: - return None - @add_worker def setup(step): @@ -102,12 +95,12 @@ def owner(step): step(6, 'verify etag propagation') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(8, 'verify etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipient2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(9, 'Upload to /test/sub') @@ -117,33 +110,33 @@ def owner(step): step(10, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() test_etag2 = client.file_info('/test').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) - error_check(test_etag != test_etag2, + error_check(test_etag != test_etag2, 'owner uploads to /test/sub/test4.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() test_etag3 = client.file_info('/test').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) - error_check(test_etag2 != test_etag3, + error_check(test_etag2 != test_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) step(14, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() test_etag4 = client.file_info('/test').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) - error_check(test_etag3 != test_etag4, + error_check(test_etag3 != test_etag4, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) step(16, 'verify etag is NOT propagated') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 == root_etag7, + error_check(root_etag6 == root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 == test_etag5, + error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) def recipient1(step): @@ -153,7 +146,7 @@ def recipient1(step): step (2, 'Create workdir') d = make_workdir() - run_ocsync(d, user_num=usernum) + run_ocsync(d, user_num=2) client = get_oc_api() client.login(user, config.oc_account_password) @@ -164,20 +157,20 @@ def recipient1(step): step(6, 'verify etag propagation') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(8, 'verify etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipient2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(10, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() test_etag2 = client.file_info('/test').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) - error_check(test_etag != test_etag2, + error_check(test_etag != test_etag2, 'owner uploads to /test/sub/test4.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) step(11, 'Upload to /test/sub') @@ -188,25 +181,25 @@ def recipient1(step): step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() test_etag3 = client.file_info('/test').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) - error_check(test_etag2 != test_etag3, + error_check(test_etag2 != test_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) step(14, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() test_etag4 = client.file_info('/test').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) - error_check(test_etag3 != test_etag4, + error_check(test_etag3 != test_etag4, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 != test_etag5, + error_check(test_etag4 != test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) def recipient2(step): @@ -216,7 +209,7 @@ def recipient2(step): step (2, 'Create workdir') d = make_workdir() - run_ocsync(d, user_num=usernum) + run_ocsync(d, user_num=3) client = get_oc_api() client.login(user, config.oc_account_password) @@ -238,7 +231,7 @@ def recipient2(step): step(6, 'verify etag propagation') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(7, 'Upload to /test') @@ -248,31 +241,31 @@ def recipient2(step): step(8, 'verify etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipient2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(10, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() test_etag2 = client.file_info('/test').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) - error_check(test_etag != test_etag2, + error_check(test_etag != test_etag2, 'owner uploads to /test/sub/test4.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() test_etag3 = client.file_info('/test').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) - error_check(test_etag2 != test_etag3, + error_check(test_etag2 != test_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) step(14, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() test_etag4 = client.file_info('/test').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) - error_check(test_etag3 != test_etag4, + error_check(test_etag3 != test_etag4, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) step(15, 'Unshare reshared /test/sub') @@ -281,9 +274,9 @@ def recipient2(step): step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 == root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 != test_etag5, + error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) def recipient3(step): @@ -293,7 +286,7 @@ def recipient3(step): step (2, 'Create workdir') d = make_workdir() - run_ocsync(d, user_num=usernum) + run_ocsync(d, user_num=4) client = get_oc_api() client.login(user, config.oc_account_password) @@ -304,44 +297,44 @@ def recipient3(step): step(6, 'verify etag propagation') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag != root_etag2, + error_check(root_etag != root_etag2, 'owner uploads to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(8, 'verify etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, + error_check(root_etag2 != root_etag3, 'recipient2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(10, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() test_etag2 = client.file_info('/test').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) - error_check(test_etag != test_etag2, + error_check(test_etag != test_etag2, 'owner uploads to /test/sub/test4.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag, test_etag2)) step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() test_etag3 = client.file_info('/test').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) - error_check(test_etag2 != test_etag3, + error_check(test_etag2 != test_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for /test previous [%s] new [%s]' % (test_etag2, test_etag3)) step(14, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() test_etag4 = client.file_info('/test').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) - error_check(test_etag3 != test_etag4, + error_check(test_etag3 != test_etag4, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 != test_etag5, + error_check(test_etag4 != test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) def recipient4(step): @@ -351,7 +344,7 @@ def recipient4(step): step (2, 'Create workdir') d = make_workdir() - run_ocsync(d, user_num=usernum) + run_ocsync(d, user_num=5) client = get_oc_api() client.login(user, config.oc_account_password) @@ -362,28 +355,28 @@ def recipient4(step): step(6, 'verify etag is NOT propagated') root_etag2 = client.file_info('/').get_etag() - error_check(root_etag == root_etag2, + error_check(root_etag == root_etag2, 'owner uploads to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(8, 'verify etag is NOT propagated') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 == root_etag3, + error_check(root_etag2 == root_etag3, 'recipient2 uploads to /test/test3.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(10, 'verify etag propagation') root_etag4 = client.file_info('/').get_etag() sub_etag2 = client.file_info('/sub').get_etag() - error_check(root_etag3 != root_etag4, + error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) - error_check(sub_etag != sub_etag2, + error_check(sub_etag != sub_etag2, 'owner uploads to /test/sub/test4.txt ' 'etag for /test previous [%s] new [%s]' % (sub_etag, sub_etag2)) step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() sub_etag3 = client.file_info('/sub').get_etag() - error_check(root_etag4 != root_etag5, + error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) - error_check(sub_etag2 != sub_etag3, + error_check(sub_etag2 != sub_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for /test previous [%s] new [%s]' % (sub_etag2, sub_etag3)) step(13, 'Upload to /sub') @@ -394,16 +387,16 @@ def recipient4(step): step(14, 'verify etag propagation') root_etag6 = client.file_info('/').get_etag() sub_etag4 = client.file_info('/sub').get_etag() - error_check(root_etag5 != root_etag6, + error_check(root_etag5 != root_etag6, 'recipient 4 uploads to /sub/test6.txt through reshare ' 'etag for / previous [%s] new [%s]' % (root_etag5, root_etag6)) - error_check(sub_etag3 != sub_etag4, - 'etag for /test previous [%s] new [%s]' % (sub_etag3, sub_etag4)) + error_check(sub_etag3 != sub_etag4, 'recipient 4 uploads to /sub/test6.txt through reshare ' + 'etag for /sub previous [%s] new [%s]' % (sub_etag3, sub_etag4)) step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() sub_etag5 = client.file_info('/sub').get_etag() - error_check(root_etag6 != root_etag7, + error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(sub_etag4 != sub_etag5, + error_check(sub_etag4 != sub_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (sub_etag4, sub_etag5)) From 9c0b3d6bdf8ab908908eebfe72d2419df3c1a24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 18 Nov 2015 18:55:13 +0100 Subject: [PATCH 3/9] Add missing workers and fix unshare propagation tests --- lib/oc-tests/test_sharePropagationInside.py | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/oc-tests/test_sharePropagationInside.py b/lib/oc-tests/test_sharePropagationInside.py index 2576874..72063b9 100644 --- a/lib/oc-tests/test_sharePropagationInside.py +++ b/lib/oc-tests/test_sharePropagationInside.py @@ -40,7 +40,8 @@ | 15 | | | unshare | | | | | | | -> /test/sub | | | +-------+-----------------+----------------+-------------------+-------------+-----------------+ -| 16 | NOT propagation | propagation | NOT propagation | propagation | propagation | +| 16 | NOT propagation | NOT | NOT propagation | NOT | propagation | +| | | propagation | | propagation | | +-------+-----------------+----------------+-------------------+-------------+-----------------+ """ from smashbox.utilities import * @@ -139,6 +140,7 @@ def owner(step): error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) +@add_worker def recipient1(step): user = '%s%i' % (config.oc_account_name, 2) @@ -197,11 +199,13 @@ def recipient1(step): step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' + # not affected by the unshare + error_check(root_etag6 == root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 != test_etag5, 'recipient 2 unshares reshare ' + error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) +@add_worker def recipient2(step): user = '%s%i' % (config.oc_account_name, 3) @@ -269,7 +273,7 @@ def recipient2(step): 'etag for /test previous [%s] new [%s]' % (test_etag3, test_etag4)) step(15, 'Unshare reshared /test/sub') - client.delete_share(share_data2.share_id) + client.delete_share(share2_data.share_id) step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() @@ -279,6 +283,7 @@ def recipient2(step): error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) +@add_worker def recipient3(step): user = '%s%i' % (config.oc_account_name, 4) @@ -332,11 +337,12 @@ def recipient3(step): step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() test_etag5 = client.file_info('/test').get_etag() - error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' + error_check(root_etag6 == root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(test_etag4 != test_etag5, 'recipient 2 unshares reshare ' + error_check(test_etag4 == test_etag5, 'recipient 2 unshares reshare ' 'etag for /test previous [%s] new [%s]' % (test_etag4, test_etag5)) +@add_worker def recipient4(step): user = '%s%i' % (config.oc_account_name, 5) @@ -369,7 +375,7 @@ def recipient4(step): error_check(root_etag3 != root_etag4, 'owner uploads to /test/sub/test4.txt ' 'etag for / previous [%s] new [%s]' % (root_etag3, root_etag4)) error_check(sub_etag != sub_etag2, 'owner uploads to /test/sub/test4.txt ' - 'etag for /test previous [%s] new [%s]' % (sub_etag, sub_etag2)) + 'etag for /sub previous [%s] new [%s]' % (sub_etag, sub_etag2)) step(12, 'verify etag propagation') root_etag5 = client.file_info('/').get_etag() @@ -377,7 +383,7 @@ def recipient4(step): error_check(root_etag4 != root_etag5, 'recipient 1 uploads to /test/sub/test5.txt ' 'etag for / previous [%s] new [%s]' % (root_etag4, root_etag5)) error_check(sub_etag2 != sub_etag3, 'recipient 1 uploads to /test/sub/test5.txt ' - 'etag for /test previous [%s] new [%s]' % (sub_etag2, sub_etag3)) + 'etag for /sub previous [%s] new [%s]' % (sub_etag2, sub_etag3)) step(13, 'Upload to /sub') run_ocsync(d, user_num=5) @@ -394,9 +400,7 @@ def recipient4(step): step(16, 'verify etag propagation') root_etag7 = client.file_info('/').get_etag() - sub_etag5 = client.file_info('/sub').get_etag() error_check(root_etag6 != root_etag7, 'recipient 2 unshares reshare ' 'etag for / previous [%s] new [%s]' % (root_etag6, root_etag7)) - error_check(sub_etag4 != sub_etag5, 'recipient 2 unshares reshare ' - 'etag for /test previous [%s] new [%s]' % (sub_etag4, sub_etag5)) + # /sub folder should be deleted at this point, so no checking From 0318c96472b1c9780731f6a9373971fec04824cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Fri, 20 Nov 2015 15:28:28 +0100 Subject: [PATCH 4/9] Move tests to owncloud, add sleep before uploads and fix issue --- lib/{oc-tests => owncloud}/test_sharePropagation.py | 7 +++++++ .../test_sharePropagationInside.py | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) rename lib/{oc-tests => owncloud}/test_sharePropagation.py (98%) rename lib/{oc-tests => owncloud}/test_sharePropagationInside.py (98%) diff --git a/lib/oc-tests/test_sharePropagation.py b/lib/owncloud/test_sharePropagation.py similarity index 98% rename from lib/oc-tests/test_sharePropagation.py rename to lib/owncloud/test_sharePropagation.py index 182ea14..9558e41 100644 --- a/lib/oc-tests/test_sharePropagation.py +++ b/lib/owncloud/test_sharePropagation.py @@ -37,12 +37,15 @@ +-------------+-------------------------+-------------------------+----------------------+ | 17 | verify etag is the same | verify etag is the same | verify propagation | +-------------+-------------------------+-------------------------+----------------------+ + +Remove the sleep(x) once https://github.com/owncloud/client/issues/4160 has a resolution """ from smashbox.utilities import * import itertools import os.path import re +import time def parse_worker_number(worker_name): match = re.search(r'(\d+)$', worker_name) @@ -93,6 +96,7 @@ def owner(step): step(3, 'Upload file') createfile(os.path.join(d, 'test', 'test.txt'), '1', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=1) step(4, 'Verify etag propagation') @@ -164,6 +168,7 @@ def recipients(step): step(5, 'upload to shared folder') createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=usernum) step(6, 'verify another etag propagation') @@ -189,6 +194,7 @@ def recipients(step): step(12, 'recipient 2 upload a file') if usernum is 2: createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=usernum) step(13, 'verify etag propagation') @@ -238,6 +244,7 @@ def recipient_4(step): step(14, 'upload file') run_ocsync(d, user_num=usernum) createfile(os.path.join(d, 'test', 'test4.txt'), '4', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=usernum) step(15, 'verify etag propagation') diff --git a/lib/oc-tests/test_sharePropagationInside.py b/lib/owncloud/test_sharePropagationInside.py similarity index 98% rename from lib/oc-tests/test_sharePropagationInside.py rename to lib/owncloud/test_sharePropagationInside.py index 72063b9..578fcc0 100644 --- a/lib/oc-tests/test_sharePropagationInside.py +++ b/lib/owncloud/test_sharePropagationInside.py @@ -43,11 +43,14 @@ | 16 | NOT propagation | NOT | NOT propagation | NOT | propagation | | | | propagation | | propagation | | +-------+-----------------+----------------+-------------------+-------------+-----------------+ + +Remove the sleep(x) once https://github.com/owncloud/client/issues/4160 has a resolution """ from smashbox.utilities import * import itertools import os.path import re +import time @add_worker def setup(step): @@ -106,6 +109,7 @@ def owner(step): step(9, 'Upload to /test/sub') createfile(os.path.join(d, 'test', 'sub', 'test4.txt'), '4', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=1) step(10, 'verify etag propagation') @@ -177,7 +181,8 @@ def recipient1(step): step(11, 'Upload to /test/sub') run_ocsync(d, user_num=2) - createfile(os.path.join(d, 'test', 'test5.txt'), '5', count=1000, bs=10) + createfile(os.path.join(d, 'test', 'sub', 'test5.txt'), '5', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=2) step(12, 'verify etag propagation') @@ -241,6 +246,7 @@ def recipient2(step): step(7, 'Upload to /test') run_ocsync(d, user_num=3) createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=3) step(8, 'verify etag propagation') @@ -388,6 +394,7 @@ def recipient4(step): step(13, 'Upload to /sub') run_ocsync(d, user_num=5) createfile(os.path.join(d, 'sub', 'test6.txt'), '6', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=5) step(14, 'verify etag propagation') From 9094cbf02c747ee2e171e5db60ac1167d229e708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Mon, 23 Nov 2015 14:35:51 +0100 Subject: [PATCH 5/9] Fix locking issue (only upload one file instead of two) --- lib/owncloud/test_sharePropagation.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/owncloud/test_sharePropagation.py b/lib/owncloud/test_sharePropagation.py index 9558e41..e39be3e 100644 --- a/lib/owncloud/test_sharePropagation.py +++ b/lib/owncloud/test_sharePropagation.py @@ -106,7 +106,7 @@ def owner(step): step(6, 'verify another etag propagation') root_etag3 = client.file_info('/').get_etag() - error_check(root_etag2 != root_etag3, 'recipients upload to /test/test2.txt' + error_check(root_etag2 != root_etag3, 'recipients upload to /test/test2.txt ' 'etag for / previous [%s] new [%s]' % (root_etag2, root_etag3)) step(7, 'unshare') @@ -167,9 +167,10 @@ def recipients(step): 'etag for / previous [%s] new [%s]' % (root_etag, root_etag2)) step(5, 'upload to shared folder') - createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) - time.sleep(3) - run_ocsync(d, user_num=usernum) + if usernum is 2: + createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) + time.sleep(3) + run_ocsync(d, user_num=usernum) step(6, 'verify another etag propagation') root_etag3 = client.file_info('/').get_etag() From e06bf838bf6fd4a4348942ebae2f7ffe8f37d428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Mon, 23 Nov 2015 14:39:58 +0100 Subject: [PATCH 6/9] Fix missing sleep --- lib/owncloud/test_sharePropagationInside.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/owncloud/test_sharePropagationInside.py b/lib/owncloud/test_sharePropagationInside.py index 578fcc0..dc1184e 100644 --- a/lib/owncloud/test_sharePropagationInside.py +++ b/lib/owncloud/test_sharePropagationInside.py @@ -95,6 +95,7 @@ def owner(step): step(5, 'Upload to /test') createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) + time.sleep(3) run_ocsync(d, user_num=1) step(6, 'verify etag propagation') From 787926d3ede80795f19cfe40f4228238ca0b845e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Tue, 24 Nov 2015 10:47:36 +0100 Subject: [PATCH 7/9] Remove extra user and remove sleeps --- lib/owncloud/test_sharePropagation.py | 9 ++------- lib/owncloud/test_sharePropagationInside.py | 6 ------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/owncloud/test_sharePropagation.py b/lib/owncloud/test_sharePropagation.py index e39be3e..abbcc6a 100644 --- a/lib/owncloud/test_sharePropagation.py +++ b/lib/owncloud/test_sharePropagation.py @@ -45,7 +45,6 @@ import itertools import os.path import re -import time def parse_worker_number(worker_name): match = re.search(r'(\d+)$', worker_name) @@ -58,8 +57,8 @@ def parse_worker_number(worker_name): def setup(step): step(1, 'create test users') - reset_owncloud_account(num_test_users=5) - check_users(5) + reset_owncloud_account(num_test_users=4) + check_users(4) reset_rundir() reset_server_log_file() @@ -96,7 +95,6 @@ def owner(step): step(3, 'Upload file') createfile(os.path.join(d, 'test', 'test.txt'), '1', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=1) step(4, 'Verify etag propagation') @@ -169,7 +167,6 @@ def recipients(step): step(5, 'upload to shared folder') if usernum is 2: createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=usernum) step(6, 'verify another etag propagation') @@ -195,7 +192,6 @@ def recipients(step): step(12, 'recipient 2 upload a file') if usernum is 2: createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=usernum) step(13, 'verify etag propagation') @@ -245,7 +241,6 @@ def recipient_4(step): step(14, 'upload file') run_ocsync(d, user_num=usernum) createfile(os.path.join(d, 'test', 'test4.txt'), '4', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=usernum) step(15, 'verify etag propagation') diff --git a/lib/owncloud/test_sharePropagationInside.py b/lib/owncloud/test_sharePropagationInside.py index dc1184e..63b7959 100644 --- a/lib/owncloud/test_sharePropagationInside.py +++ b/lib/owncloud/test_sharePropagationInside.py @@ -50,7 +50,6 @@ import itertools import os.path import re -import time @add_worker def setup(step): @@ -95,7 +94,6 @@ def owner(step): step(5, 'Upload to /test') createfile(os.path.join(d, 'test', 'test2.txt'), '2', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=1) step(6, 'verify etag propagation') @@ -110,7 +108,6 @@ def owner(step): step(9, 'Upload to /test/sub') createfile(os.path.join(d, 'test', 'sub', 'test4.txt'), '4', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=1) step(10, 'verify etag propagation') @@ -183,7 +180,6 @@ def recipient1(step): step(11, 'Upload to /test/sub') run_ocsync(d, user_num=2) createfile(os.path.join(d, 'test', 'sub', 'test5.txt'), '5', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=2) step(12, 'verify etag propagation') @@ -247,7 +243,6 @@ def recipient2(step): step(7, 'Upload to /test') run_ocsync(d, user_num=3) createfile(os.path.join(d, 'test', 'test3.txt'), '3', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=3) step(8, 'verify etag propagation') @@ -395,7 +390,6 @@ def recipient4(step): step(13, 'Upload to /sub') run_ocsync(d, user_num=5) createfile(os.path.join(d, 'sub', 'test6.txt'), '6', count=1000, bs=10) - time.sleep(3) run_ocsync(d, user_num=5) step(14, 'verify etag propagation') From 0319dcfc16e422fa35a5878bcf8706b59e272a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Tue, 24 Nov 2015 11:14:32 +0100 Subject: [PATCH 8/9] Remove messages that are no longer needed --- lib/owncloud/test_sharePropagation.py | 2 -- lib/owncloud/test_sharePropagationInside.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/owncloud/test_sharePropagation.py b/lib/owncloud/test_sharePropagation.py index abbcc6a..460532e 100644 --- a/lib/owncloud/test_sharePropagation.py +++ b/lib/owncloud/test_sharePropagation.py @@ -37,8 +37,6 @@ +-------------+-------------------------+-------------------------+----------------------+ | 17 | verify etag is the same | verify etag is the same | verify propagation | +-------------+-------------------------+-------------------------+----------------------+ - -Remove the sleep(x) once https://github.com/owncloud/client/issues/4160 has a resolution """ from smashbox.utilities import * diff --git a/lib/owncloud/test_sharePropagationInside.py b/lib/owncloud/test_sharePropagationInside.py index 63b7959..4526fcf 100644 --- a/lib/owncloud/test_sharePropagationInside.py +++ b/lib/owncloud/test_sharePropagationInside.py @@ -43,8 +43,6 @@ | 16 | NOT propagation | NOT | NOT propagation | NOT | propagation | | | | propagation | | propagation | | +-------+-----------------+----------------+-------------------+-------------+-----------------+ - -Remove the sleep(x) once https://github.com/owncloud/client/issues/4160 has a resolution """ from smashbox.utilities import * import itertools From 79006cbc977c3232d3ea117055c9dd2f7fabdcb8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 25 Nov 2015 09:11:59 +0100 Subject: [PATCH 9/9] Make the tests as light weight as possible --- lib/owncloud/test_sharePropagation.py | 17 +++++++++-------- lib/owncloud/test_sharePropagationInside.py | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/owncloud/test_sharePropagation.py b/lib/owncloud/test_sharePropagation.py index 460532e..3f5e6b8 100644 --- a/lib/owncloud/test_sharePropagation.py +++ b/lib/owncloud/test_sharePropagation.py @@ -55,16 +55,18 @@ def parse_worker_number(worker_name): def setup(step): step(1, 'create test users') - reset_owncloud_account(num_test_users=4) - check_users(4) - reset_rundir() - reset_server_log_file() + num_users = 4 - step(18, 'Validate server log file is clean') + # Create additional accounts + if config.oc_number_test_users < num_users: + for i in range(config.oc_number_test_users + 1, num_users + 1): + username = "%s%i" % (config.oc_account_name, i) + delete_owncloud_account(username) + create_owncloud_account(username, config.oc_account_password) + login_owncloud_account(username, config.oc_account_password) - d = make_workdir() - scrape_log_file(d) + check_users(num_users) @add_worker def owner(step): @@ -74,7 +76,6 @@ def owner(step): step (2, 'Create workdir') d = make_workdir() - mkdir(os.path.join(d, 'test')) mkdir(os.path.join(d, 'test', 'sub')) run_ocsync(d, user_num=1) diff --git a/lib/owncloud/test_sharePropagationInside.py b/lib/owncloud/test_sharePropagationInside.py index 4526fcf..0983eb8 100644 --- a/lib/owncloud/test_sharePropagationInside.py +++ b/lib/owncloud/test_sharePropagationInside.py @@ -53,16 +53,18 @@ def setup(step): step(1, 'create test users') - reset_owncloud_account(num_test_users=5) - check_users(5) - reset_rundir() - reset_server_log_file() + num_users = 5 - step(17, 'Validate server log file is clean') + # Create additional accounts + if config.oc_number_test_users < num_users: + for i in range(config.oc_number_test_users + 1, num_users + 1): + username = "%s%i" % (config.oc_account_name, i) + delete_owncloud_account(username) + create_owncloud_account(username, config.oc_account_password) + login_owncloud_account(username, config.oc_account_password) - d = make_workdir() - scrape_log_file(d) + check_users(num_users) @add_worker def owner(step): @@ -71,7 +73,6 @@ def owner(step): step (2, 'Create workdir') d = make_workdir() - mkdir(os.path.join(d, 'test')) mkdir(os.path.join(d, 'test', 'sub')) run_ocsync(d, user_num=1)