{"action":"created","comment":{"url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/comments/46832879","id":46832879,"diff_hunk":"@@ -0,0 +1,124 @@\n+# Copyright 2014 iNuron NV\n+#\n+# Licensed under the Open vStorage Modified Apache License (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.openvstorage.org/license\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+from ci.tests.general.general import test_config\n+from ci.tests.general.connection import Connection\n+from ci.tests.vpool import vpool_test\n+from ci.tests.mgmtcenter import mgmt_center_test\n+from ci.tests.general import general\n+from ci import autotests\n+import time\n+\n+testsToRun = general.get_tests_to_run(autotests.get_test_level())\n+\n+VPOOL_NAME = test_config.get('vpool', 'vpool_name')\n+TEMPLATE_SERVERS = ['http://sso-qpackages-loch.cloudfounders.com/templates/openvstorage', 'http://172.20.3.8/templates/openvstorage']\n+\n+\n+template_source_folder = '/fio_debian/'\n+template_image = 'debian.qcow2'\n+template_target_folder = '/var/tmp/templates/'\n+\n+NUMBER_OF_DISKS = 10\n+GRID_IP = test_config.get('main', 'grid_ip')\n+\n+\n+def download_template(server_location):\n+    general.execute_command('wget -P {0} {1}{2}{3}'.format(template_target_folder, server_location, template_source_folder, template_image))\n+    general.execute_command('chown root {0}{1}'.format(template_target_folder, template_image))\n+\n+\n+def get_template_location_by_ip(ip):\n+    if ip.split('.')[0] == '172' and ip.split('.')[1] == '20':\n+        return TEMPLATE_SERVERS[1]\n+    else:\n+        return TEMPLATE_SERVERS[0]\n+\n+\n+def check_template_exists():\n+    out, err = general.execute_command('[ -d {0} ] && echo \"Dir exists\" || echo \"Dir does not exists\"'.format(template_target_folder))\n+    if 'not' not in out:\n+        general.execute_command('rm -rf {0}'.format(template_target_folder))\n+        general.execute_command('mkdir {0}'.format(template_target_folder))\n+    download_template(get_template_location_by_ip(GRID_IP))\n+\n+\n+def setup():\n+    check_template_exists()\n+    vpool_test.setup()\n+    mgmt_center_test.setup()\n+    vpool_test.add_vpool()\n+\n+\n+def teardown():\n+    api = Connection.get_connection()\n+    vpool_list = api.get_component_by_name('vpools', VPOOL_NAME)[0]\n+    assert len(vpool_list), \"No vpool found where one was expected\"\n+    vpool = vpool_list[0]\n+    if vpool:\n+        _, __ = general.execute_command(\"rm -rf /mnt/{0}/*.raw\".format(VPOOL_NAME))\n+        general.api_remove_vpool(VPOOL_NAME)\n+    vpool_test.teardown()\n+    # @todo change mgmgt teardown to delete recently added hmc\n+    mgmt_center_test.teardown()\n+\n+\n+def create_raw_vdisk_from_template(template_folder, image_name, vpool_name, disk_name):\n+    _, __ = general.execute_command('qemu-img convert -O raw {0}{1} /mnt/{2}/{3}.raw'.format(template_folder, image_name, vpool_name, disk_name))","path":"ci/tests/vmachine/vmachine_test.py","position":78,"original_position":78,"commit_id":"e5389ed8c6edfe329eb892a9532b78062e3488f9","original_commit_id":"e5389ed8c6edfe329eb892a9532b78062e3488f9","user":{"login":"pploegaert","id":8393135,"avatar_url":"https://avatars.githubusercontent.com/u/8393135?v=3","gravatar_id":"","url":"https://api.github.com/users/pploegaert","html_url":"https://github.com/pploegaert","followers_url":"https://api.github.com/users/pploegaert/followers","following_url":"https://api.github.com/users/pploegaert/following{/other_user}","gists_url":"https://api.github.com/users/pploegaert/gists{/gist_id}","starred_url":"https://api.github.com/users/pploegaert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pploegaert/subscriptions","organizations_url":"https://api.github.com/users/pploegaert/orgs","repos_url":"https://api.github.com/users/pploegaert/repos","events_url":"https://api.github.com/users/pploegaert/events{/privacy}","received_events_url":"https://api.github.com/users/pploegaert/received_events","type":"User","site_admin":false},"body":"I would like to have the output of these command logged to /var/log/ovs/autotests/vmachine.log\r\ne.g. https://github.com/openvstorage/integrationtests/blob/master/ci/tests/backend/alba.py\r\nfrom ci.tests.general.logHandler import LogHandler\r\n\r\nlogger = LogHandler.get('vmachine', name='fio')\r\nlogger.logger.propagate = False\r\n","created_at":"2015-12-07T15:29:04Z","updated_at":"2015-12-07T15:29:04Z","html_url":"https://github.com/openvstorage/integrationtests/pull/102#discussion_r46832879","pull_request_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/comments/46832879"},"html":{"href":"https://github.com/openvstorage/integrationtests/pull/102#discussion_r46832879"},"pull_request":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102","id":52851606,"html_url":"https://github.com/openvstorage/integrationtests/pull/102","diff_url":"https://github.com/openvstorage/integrationtests/pull/102.diff","patch_url":"https://github.com/openvstorage/integrationtests/pull/102.patch","issue_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/102","number":102,"state":"open","locked":false,"title":"Ovs 3695 fio vms","user":{"login":"mnuca","id":13517221,"avatar_url":"https://avatars.githubusercontent.com/u/13517221?v=3","gravatar_id":"","url":"https://api.github.com/users/mnuca","html_url":"https://github.com/mnuca","followers_url":"https://api.github.com/users/mnuca/followers","following_url":"https://api.github.com/users/mnuca/following{/other_user}","gists_url":"https://api.github.com/users/mnuca/gists{/gist_id}","starred_url":"https://api.github.com/users/mnuca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnuca/subscriptions","organizations_url":"https://api.github.com/users/mnuca/orgs","repos_url":"https://api.github.com/users/mnuca/repos","events_url":"https://api.github.com/users/mnuca/events{/privacy}","received_events_url":"https://api.github.com/users/mnuca/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-07T14:36:37Z","updated_at":"2015-12-07T15:29:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12272d792aca65c2b429c14bd2525ed84e2cb639","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102/commits","review_comments_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102/comments","review_comment_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/102/comments","statuses_url":"https://api.github.com/repos/openvstorage/integrationtests/statuses/e5389ed8c6edfe329eb892a9532b78062e3488f9","head":{"label":"openvstorage:OVS-3695-fio-vms","ref":"OVS-3695-fio-vms","sha":"e5389ed8c6edfe329eb892a9532b78062e3488f9","user":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":39761416,"name":"integrationtests","full_name":"openvstorage/integrationtests","owner":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvstorage/integrationtests","description":null,"fork":false,"url":"https://api.github.com/repos/openvstorage/integrationtests","forks_url":"https://api.github.com/repos/openvstorage/integrationtests/forks","keys_url":"https://api.github.com/repos/openvstorage/integrationtests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvstorage/integrationtests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvstorage/integrationtests/teams","hooks_url":"https://api.github.com/repos/openvstorage/integrationtests/hooks","issue_events_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/events{/number}","events_url":"https://api.github.com/repos/openvstorage/integrationtests/events","assignees_url":"https://api.github.com/repos/openvstorage/integrationtests/assignees{/user}","branches_url":"https://api.github.com/repos/openvstorage/integrationtests/branches{/branch}","tags_url":"https://api.github.com/repos/openvstorage/integrationtests/tags","blobs_url":"https://api.github.com/repos/openvstorage/integrationtests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvstorage/integrationtests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvstorage/integrationtests/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvstorage/integrationtests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvstorage/integrationtests/statuses/{sha}","languages_url":"https://api.github.com/repos/openvstorage/integrationtests/languages","stargazers_url":"https://api.github.com/repos/openvstorage/integrationtests/stargazers","contributors_url":"https://api.github.com/repos/openvstorage/integrationtests/contributors","subscribers_url":"https://api.github.com/repos/openvstorage/integrationtests/subscribers","subscription_url":"https://api.github.com/repos/openvstorage/integrationtests/subscription","commits_url":"https://api.github.com/repos/openvstorage/integrationtests/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvstorage/integrationtests/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvstorage/integrationtests/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvstorage/integrationtests/contents/{+path}","compare_url":"https://api.github.com/repos/openvstorage/integrationtests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvstorage/integrationtests/merges","archive_url":"https://api.github.com/repos/openvstorage/integrationtests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvstorage/integrationtests/downloads","issues_url":"https://api.github.com/repos/openvstorage/integrationtests/issues{/number}","pulls_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls{/number}","milestones_url":"https://api.github.com/repos/openvstorage/integrationtests/milestones{/number}","notifications_url":"https://api.github.com/repos/openvstorage/integrationtests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvstorage/integrationtests/labels{/name}","releases_url":"https://api.github.com/repos/openvstorage/integrationtests/releases{/id}","created_at":"2015-07-27T07:37:21Z","updated_at":"2015-07-27T07:37:25Z","pushed_at":"2015-12-07T15:06:42Z","git_url":"git://github.com/openvstorage/integrationtests.git","ssh_url":"git@github.com:openvstorage/integrationtests.git","clone_url":"https://github.com/openvstorage/integrationtests.git","svn_url":"https://github.com/openvstorage/integrationtests","homepage":null,"size":608,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"openvstorage:master","ref":"master","sha":"3c08b5651a232aa19701d3d531af003d7427bac1","user":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":39761416,"name":"integrationtests","full_name":"openvstorage/integrationtests","owner":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvstorage/integrationtests","description":null,"fork":false,"url":"https://api.github.com/repos/openvstorage/integrationtests","forks_url":"https://api.github.com/repos/openvstorage/integrationtests/forks","keys_url":"https://api.github.com/repos/openvstorage/integrationtests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvstorage/integrationtests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvstorage/integrationtests/teams","hooks_url":"https://api.github.com/repos/openvstorage/integrationtests/hooks","issue_events_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/events{/number}","events_url":"https://api.github.com/repos/openvstorage/integrationtests/events","assignees_url":"https://api.github.com/repos/openvstorage/integrationtests/assignees{/user}","branches_url":"https://api.github.com/repos/openvstorage/integrationtests/branches{/branch}","tags_url":"https://api.github.com/repos/openvstorage/integrationtests/tags","blobs_url":"https://api.github.com/repos/openvstorage/integrationtests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvstorage/integrationtests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvstorage/integrationtests/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvstorage/integrationtests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvstorage/integrationtests/statuses/{sha}","languages_url":"https://api.github.com/repos/openvstorage/integrationtests/languages","stargazers_url":"https://api.github.com/repos/openvstorage/integrationtests/stargazers","contributors_url":"https://api.github.com/repos/openvstorage/integrationtests/contributors","subscribers_url":"https://api.github.com/repos/openvstorage/integrationtests/subscribers","subscription_url":"https://api.github.com/repos/openvstorage/integrationtests/subscription","commits_url":"https://api.github.com/repos/openvstorage/integrationtests/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvstorage/integrationtests/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvstorage/integrationtests/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvstorage/integrationtests/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvstorage/integrationtests/contents/{+path}","compare_url":"https://api.github.com/repos/openvstorage/integrationtests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvstorage/integrationtests/merges","archive_url":"https://api.github.com/repos/openvstorage/integrationtests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvstorage/integrationtests/downloads","issues_url":"https://api.github.com/repos/openvstorage/integrationtests/issues{/number}","pulls_url":"https://api.github.com/repos/openvstorage/integrationtests/pulls{/number}","milestones_url":"https://api.github.com/repos/openvstorage/integrationtests/milestones{/number}","notifications_url":"https://api.github.com/repos/openvstorage/integrationtests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvstorage/integrationtests/labels{/name}","releases_url":"https://api.github.com/repos/openvstorage/integrationtests/releases{/id}","created_at":"2015-07-27T07:37:21Z","updated_at":"2015-07-27T07:37:25Z","pushed_at":"2015-12-07T15:06:42Z","git_url":"git://github.com/openvstorage/integrationtests.git","ssh_url":"git@github.com:openvstorage/integrationtests.git","clone_url":"https://github.com/openvstorage/integrationtests.git","svn_url":"https://github.com/openvstorage/integrationtests","homepage":null,"size":608,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102"},"html":{"href":"https://github.com/openvstorage/integrationtests/pull/102"},"issue":{"href":"https://api.github.com/repos/openvstorage/integrationtests/issues/102"},"comments":{"href":"https://api.github.com/repos/openvstorage/integrationtests/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openvstorage/integrationtests/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/openvstorage/integrationtests/statuses/e5389ed8c6edfe329eb892a9532b78062e3488f9"}}}}