{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/smashbox/pulls/comments/27493471","id":27493471,"diff_hunk":"@@ -0,0 +1,203 @@\n+\n+__doc__ = \"\"\"\n+\n+Test basic file sharing between users.  \n+\n++-----------+----------------------+------------------+----------------------------+\n+|  Step     |  user1               |  user2           |  Sharee Two                |\n+|  Number   |                      |                  |                            |\n++===========+======================+==================+============================|\n+|  2        | create work dir      | create work dir  |  create work dir           |\n++-----------+----------------------+------------------+----------------------------+\n+|  3        | Create test folder   |                  |                            |\n+|           |                      |                  |                            |\n+|           |                      |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  4        | Share test with      |                  |                            |\n+|           | user2                |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  5        |                      | Syncs and        |                            |\n+|           |                      | validates files  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  6        |                      | Create folder    |                            |\n+|           |                      | sub              |                            |\n+|           |                      |                  |                            |\n+|           |                      | Create several   |                            |\n+|           |                      | files            |                            |\n+|           |                      |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  7        |                      | Shares sub by    |                            |\n+|           |                      | link             |                            |\n+|           |                      |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  8        |                      | Move sub into    |                            |\n+|           |                      | test             |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  9        | Syncs and validates  |                  |                            |\n+|           |                      |                  |                            | \n+|           |                      |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  10       |                      |                  |      Check shared link     |\n+|           |                      |                  |                            |\n++-----------+----------------------+------------------+----------------------------+\n+|  11       | Final step           | Final step       |        Final Step          |\n++-----------+----------------------+------------------+----------------------------+\n+\n+\n+Data Providers:\n+\n+  test_sharePermissions:      Permissions to be applied to the share\n+\n+\"\"\"\n+\n+from smashbox.utilities import *\n+import glob\n+import time\n+\n+OCS_PERMISSION_READ = 1\n+OCS_PERMISSION_UPDATE = 2\n+OCS_PERMISSION_CREATE = 4\n+OCS_PERMISSION_DELETE = 8\n+OCS_PERMISSION_SHARE = 16\n+OCS_PERMISSION_ALL = 31\n+\n+nfiles = 20\n+\n+TEST_FILES = ['TEST_FILE_USER_SHARED_%02d.dat'%i for i in range(nfiles)]\n+\n+\n+filesizeKB = int(config.get('share_filesizeKB',10))\n+sharePermissions = config.get('test_sharePermissions', OCS_PERMISSION_ALL)\n+\n+testsets = [\n+    { \n+        'test_sharePermissions':OCS_PERMISSION_ALL\n+    },\n+    { \n+        'test_sharePermissions':OCS_PERMISSION_READ | OCS_PERMISSION_UPDATE\n+    },\n+    { \n+        'test_sharePermissions':OCS_PERMISSION_READ | OCS_PERMISSION_SHARE\n+    }\n+]\n+\n+@add_worker\n+def setup(step):\n+\n+    step (1, 'create test users')\n+    reset_owncloud_account(num_test_users=config.oc_number_test_users)\n+    check_users(config.oc_number_test_users)\n+\n+    reset_rundir()\n+\n+@add_worker\n+def user1_worker(step):\n+\n+    step (2, 'Create workdir')\n+    d = make_workdir()\n+\n+    step (3, 'Create initial test files and directories')\n+\n+    test_folder = mkdir(os.path.join(d,'test'))\n+\n+    shared = reflection.getSharedObject()\n+    #shared['md5_sharer'] = md5sum(os.path.join(d,'test'))\n+    #logger.info('md5_sharer: %s',shared['md5_sharer'])\n+\n+    list_files(d)\n+    list_files(os.path.join(d,'test'))\n+    run_ocsync(d,user_num=1)\n+    list_files(d)\n+\n+    step (4,'user1 shares files')\n+\n+    user1 = \"%s%i\"%(config.oc_account_name, 1)\n+    user2 = \"%s%i\"%(config.oc_account_name, 2)\n+\n+    kwargs = {'perms': sharePermissions}\n+\n+    shared['TEST_FOLDER_USER_SHARE'] = share_file_with_user('test', user1, user2, **kwargs)\n+\n+\n+    step (11, 'user1 final step')\n+\n+@add_worker\n+def user2_worker(step):\n+\n+    step (2, 'user2 creates workdir')\n+    d = make_workdir()\n+\n+    step (5, 'user2 syncs and validate files exist')\n+\n+    run_ocsync(d,user_num=2)\n+    list_files(d)\n+\n+    # for i in range(nfiles):\n+    #     sharedFile = os.path.join(os.path.join(d,test_folder),TEST_FILES[i])\n+    #     logger.info ('Checking that %s is present in local directory for user2', sharedFile)\n+    #     error_check(os.path.exists(sharedFile), \"File %s should exist\" %sharedFile)\n+\n+ \n+\n+    step (6, 'user2 creates folder sub and uploads test files into it')\n+    sub_folder = mkdir(os.path.join(d,'sub'))\n+\n+    for i in range(nfiles):\n+        createfile(os.path.join(sub_folder,TEST_FILES[i]),'0',count=1000,bs=filesizeKB)\n+\n+    shared = reflection.getSharedObject()\n+    #shared['md5_sharer'] = md5sum(os.path.join(d,'sub'))\n+    #logger.info('md5_sharer: %s',shared['md5_sharer'])\n+\n+    list_files(d)\n+    run_ocsync(d,user_num=2)\n+    list_files(d)\n+\n+    step (7, 'user2 shares sub folder by link')\n+\n+    user2 = \"%s%i\"%(config.oc_account_name, 2)\n+    #SHARING NOT SURE ABOUT THE WAY TO CALL THIS INSTRUCTION","path":"lib/oc-tests/test_moveSharedFilesAround.py","position":159,"original_position":159,"commit_id":"00d156d6fe50547a9cda250bbce5a155d129141e","original_commit_id":"00d156d6fe50547a9cda250bbce5a155d129141e","user":{"login":"jnfrmarks","id":8480343,"avatar_url":"https://avatars.githubusercontent.com/u/8480343?v=3","gravatar_id":"","url":"https://api.github.com/users/jnfrmarks","html_url":"https://github.com/jnfrmarks","followers_url":"https://api.github.com/users/jnfrmarks/followers","following_url":"https://api.github.com/users/jnfrmarks/following{/other_user}","gists_url":"https://api.github.com/users/jnfrmarks/gists{/gist_id}","starred_url":"https://api.github.com/users/jnfrmarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnfrmarks/subscriptions","organizations_url":"https://api.github.com/users/jnfrmarks/orgs","repos_url":"https://api.github.com/users/jnfrmarks/repos","events_url":"https://api.github.com/users/jnfrmarks/events{/privacy}","received_events_url":"https://api.github.com/users/jnfrmarks/received_events","type":"User","site_admin":false},"body":"Not sure what you mean with this comment - ","created_at":"2015-03-31T16:02:31Z","updated_at":"2015-03-31T16:02:31Z","html_url":"https://github.com/owncloud/smashbox/pull/48#discussion_r27493471","pull_request_url":"https://api.github.com/repos/owncloud/smashbox/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/comments/27493471"},"html":{"href":"https://github.com/owncloud/smashbox/pull/48#discussion_r27493471"},"pull_request":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/smashbox/pulls/48","id":31929763,"html_url":"https://github.com/owncloud/smashbox/pull/48","diff_url":"https://github.com/owncloud/smashbox/pull/48.diff","patch_url":"https://github.com/owncloud/smashbox/pull/48.patch","issue_url":"https://api.github.com/repos/owncloud/smashbox/issues/48","number":48,"state":"open","locked":false,"title":"added downloading function to utilities","user":{"login":"SergioBertolinSG","id":9048796,"avatar_url":"https://avatars.githubusercontent.com/u/9048796?v=3","gravatar_id":"","url":"https://api.github.com/users/SergioBertolinSG","html_url":"https://github.com/SergioBertolinSG","followers_url":"https://api.github.com/users/SergioBertolinSG/followers","following_url":"https://api.github.com/users/SergioBertolinSG/following{/other_user}","gists_url":"https://api.github.com/users/SergioBertolinSG/gists{/gist_id}","starred_url":"https://api.github.com/users/SergioBertolinSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergioBertolinSG/subscriptions","organizations_url":"https://api.github.com/users/SergioBertolinSG/orgs","repos_url":"https://api.github.com/users/SergioBertolinSG/repos","events_url":"https://api.github.com/users/SergioBertolinSG/events{/privacy}","received_events_url":"https://api.github.com/users/SergioBertolinSG/received_events","type":"User","site_admin":false},"body":"Please review and merge @PVince81 @jvillafanez @jnfrmarks ","created_at":"2015-03-25T14:55:49Z","updated_at":"2015-03-31T16:02:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44edab0a00514e8643bb1273bc8665a213ff3487","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/owncloud/smashbox/pulls/48/commits","review_comments_url":"https://api.github.com/repos/owncloud/smashbox/pulls/48/comments","review_comment_url":"https://api.github.com/repos/owncloud/smashbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/smashbox/issues/48/comments","statuses_url":"https://api.github.com/repos/owncloud/smashbox/statuses/00d156d6fe50547a9cda250bbce5a155d129141e","head":{"label":"owncloud:download_file","ref":"download_file","sha":"00d156d6fe50547a9cda250bbce5a155d129141e","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":29028070,"name":"smashbox","full_name":"owncloud/smashbox","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/smashbox","description":"main test suite","fork":true,"url":"https://api.github.com/repos/owncloud/smashbox","forks_url":"https://api.github.com/repos/owncloud/smashbox/forks","keys_url":"https://api.github.com/repos/owncloud/smashbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/smashbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/smashbox/teams","hooks_url":"https://api.github.com/repos/owncloud/smashbox/hooks","issue_events_url":"https://api.github.com/repos/owncloud/smashbox/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/smashbox/events","assignees_url":"https://api.github.com/repos/owncloud/smashbox/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/smashbox/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/smashbox/tags","blobs_url":"https://api.github.com/repos/owncloud/smashbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/smashbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/smashbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/smashbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/smashbox/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/smashbox/languages","stargazers_url":"https://api.github.com/repos/owncloud/smashbox/stargazers","contributors_url":"https://api.github.com/repos/owncloud/smashbox/contributors","subscribers_url":"https://api.github.com/repos/owncloud/smashbox/subscribers","subscription_url":"https://api.github.com/repos/owncloud/smashbox/subscription","commits_url":"https://api.github.com/repos/owncloud/smashbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/smashbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/smashbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/smashbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/smashbox/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/smashbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/smashbox/merges","archive_url":"https://api.github.com/repos/owncloud/smashbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/smashbox/downloads","issues_url":"https://api.github.com/repos/owncloud/smashbox/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/smashbox/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/smashbox/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/smashbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/smashbox/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/smashbox/releases{/id}","created_at":"2015-01-09T17:50:29Z","updated_at":"2015-03-31T15:21:16Z","pushed_at":"2015-03-31T15:21:19Z","git_url":"git://github.com/owncloud/smashbox.git","ssh_url":"git@github.com:owncloud/smashbox.git","clone_url":"https://github.com/owncloud/smashbox.git","svn_url":"https://github.com/owncloud/smashbox","homepage":null,"size":881,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":32,"forks":1,"open_issues":32,"watchers":1,"default_branch":"master"}},"base":{"label":"owncloud:develop","ref":"develop","sha":"bb0f48ae6b124a35b00eaa5beef9a00f5c3fd42f","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":29028070,"name":"smashbox","full_name":"owncloud/smashbox","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/smashbox","description":"main test suite","fork":true,"url":"https://api.github.com/repos/owncloud/smashbox","forks_url":"https://api.github.com/repos/owncloud/smashbox/forks","keys_url":"https://api.github.com/repos/owncloud/smashbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/smashbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/smashbox/teams","hooks_url":"https://api.github.com/repos/owncloud/smashbox/hooks","issue_events_url":"https://api.github.com/repos/owncloud/smashbox/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/smashbox/events","assignees_url":"https://api.github.com/repos/owncloud/smashbox/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/smashbox/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/smashbox/tags","blobs_url":"https://api.github.com/repos/owncloud/smashbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/smashbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/smashbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/smashbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/smashbox/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/smashbox/languages","stargazers_url":"https://api.github.com/repos/owncloud/smashbox/stargazers","contributors_url":"https://api.github.com/repos/owncloud/smashbox/contributors","subscribers_url":"https://api.github.com/repos/owncloud/smashbox/subscribers","subscription_url":"https://api.github.com/repos/owncloud/smashbox/subscription","commits_url":"https://api.github.com/repos/owncloud/smashbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/smashbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/smashbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/smashbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/smashbox/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/smashbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/smashbox/merges","archive_url":"https://api.github.com/repos/owncloud/smashbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/smashbox/downloads","issues_url":"https://api.github.com/repos/owncloud/smashbox/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/smashbox/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/smashbox/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/smashbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/smashbox/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/smashbox/releases{/id}","created_at":"2015-01-09T17:50:29Z","updated_at":"2015-03-31T15:21:16Z","pushed_at":"2015-03-31T15:21:19Z","git_url":"git://github.com/owncloud/smashbox.git","ssh_url":"git@github.com:owncloud/smashbox.git","clone_url":"https://github.com/owncloud/smashbox.git","svn_url":"https://github.com/owncloud/smashbox","homepage":null,"size":881,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":32,"forks":1,"open_issues":32,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/48"},"html":{"href":"https://github.com/owncloud/smashbox/pull/48"},"issue":{"href":"https://api.github.com/repos/owncloud/smashbox/issues/48"},"comments":{"href":"https://api.github.com/repos/owncloud/smashbox/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/smashbox/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/smashbox/statuses/00d156d6fe50547a9cda250bbce5a155d129141e"}}}}