{"action":"created","comment":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/230672037","pull_request_review_id":171456821,"id":230672037,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDY3MjAzNw==","diff_hunk":"@@ -0,0 +1,71 @@\n+import re\n+import time\n+import logging\n+\n+from avocado.utils import process\n+\n+from virttest import error_context\n+from virttest.compat_52lts import decode_to_text\n+\n+\n+@error_context.context_aware\n+def run(test, params, env):\n+    \"\"\"\n+    Check if guest hang/stall if host clock is set back\n+\n+    1) sync host system time with ntp server\n+    2) boot guest with \"-rtc base=utc, clock=host, driftfix=slew\"\n+    3) set host system time back\n+    4) reboot guest and do some operation.\n+\n+    :param test: QEMU test object.\n+    :param params: Dictionary with test parameters.\n+    :param env: Dictionary with the test environment.\n+    \"\"\"\n+    clock_sync_command = params[\"clock_sync_command\"]\n+    error_context.context(\"Sync host system time with ntpserver\", logging.info)\n+    process.system(clock_sync_command, shell=True)\n+\n+    vm = env.get_vm(params[\"main_vm\"])\n+    session = vm.wait_for_login()\n+\n+    seconds_to_back = params[\"seconds_to_back\"]\n+    set_host_time_back_cmd = params[\"set_host_time_back_cmd\"]\n+    time_difference = int(params[\"time_difference\"])\n+    epoch_time_cmd = params[\"epoch_time_cmd\"]\n+    tolerance = float(params[\"tolerance\"])\n+\n+    error_context.context(\"Check time difference between host and guest\", logging.info)\n+    guest_timestr_ = session.cmd_output(epoch_time_cmd, timeout=120)\n+    host_timestr_ = decode_to_text(process.system_output(epoch_time_cmd, shell=True))\n+    host_epoch_time_, guest_epoch_time_ = map(lambda x: re.findall(r\"epoch:\\s+(\\d+)\", x)[0],\n+                                              [host_timestr_, guest_timestr_])\n+    real_difference_ = abs(int(host_epoch_time_) - int(guest_epoch_time_))\n+    if real_difference_ > tolerance:\n+        test.error(\"Unexpected timedrift between host and guest, host time: %s,\"\n+                   \"guest time: %s\" % (host_epoch_time_, guest_epoch_time_))\n+\n+    error_context.context(\"Set host system time back %s s\" % seconds_to_back)\n+    process.system_output(set_host_time_back_cmd)\n+    time.sleep(10)\n+\n+    try:\n+        vm.reboot()\n+        session = vm.wait_for_login()\n+\n+        error_context.context(\"Check time difference between host and guest\", logging.info)\n+        try:\n+            guest_timestr = session.cmd_output(epoch_time_cmd, timeout=120)\n+        except Exception:\n+            test.error(\"Guest error after set host system time back\")","path":"qemu/tests/timerdevice_host_time_back.py","position":60,"original_position":60,"commit_id":"2cadf522bb0f7ee67ca32e0345cfe28d72a990d4","original_commit_id":"2cadf522bb0f7ee67ca32e0345cfe28d72a990d4","user":{"login":"vivianQizhu","id":15028109,"node_id":"MDQ6VXNlcjE1MDI4MTA5","avatar_url":"https://avatars3.githubusercontent.com/u/15028109?v=4","gravatar_id":"","url":"https://api.github.com/users/vivianQizhu","html_url":"https://github.com/vivianQizhu","followers_url":"https://api.github.com/users/vivianQizhu/followers","following_url":"https://api.github.com/users/vivianQizhu/following{/other_user}","gists_url":"https://api.github.com/users/vivianQizhu/gists{/gist_id}","starred_url":"https://api.github.com/users/vivianQizhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivianQizhu/subscriptions","organizations_url":"https://api.github.com/users/vivianQizhu/orgs","repos_url":"https://api.github.com/users/vivianQizhu/repos","events_url":"https://api.github.com/users/vivianQizhu/events{/privacy}","received_events_url":"https://api.github.com/users/vivianQizhu/received_events","type":"User","site_admin":false},"body":"Close session","created_at":"2018-11-05T09:02:34Z","updated_at":"2018-11-05T09:03:07Z","html_url":"https://github.com/autotest/tp-qemu/pull/1240#discussion_r230672037","pull_request_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments/230672037"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/1240#discussion_r230672037"},"pull_request":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240"}}},"pull_request":{"url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240","id":171592169,"node_id":"MDExOlB1bGxSZXF1ZXN0MTcxNTkyMTY5","html_url":"https://github.com/autotest/tp-qemu/pull/1240","diff_url":"https://github.com/autotest/tp-qemu/pull/1240.diff","patch_url":"https://github.com/autotest/tp-qemu/pull/1240.patch","issue_url":"https://api.github.com/repos/autotest/tp-qemu/issues/1240","number":1240,"state":"open","locked":false,"title":"timerdevice: add cases","user":{"login":"sitoliu","id":27192648,"node_id":"MDQ6VXNlcjI3MTkyNjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/27192648?v=4","gravatar_id":"","url":"https://api.github.com/users/sitoliu","html_url":"https://github.com/sitoliu","followers_url":"https://api.github.com/users/sitoliu/followers","following_url":"https://api.github.com/users/sitoliu/following{/other_user}","gists_url":"https://api.github.com/users/sitoliu/gists{/gist_id}","starred_url":"https://api.github.com/users/sitoliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sitoliu/subscriptions","organizations_url":"https://api.github.com/users/sitoliu/orgs","repos_url":"https://api.github.com/users/sitoliu/repos","events_url":"https://api.github.com/users/sitoliu/events{/privacy}","received_events_url":"https://api.github.com/users/sitoliu/received_events","type":"User","site_admin":false},"body":"1. measure time jump on guest\r\n2. check time offset after hotplug vcpu\r\n3. verify time after set host clock back\r\n4. check time offset by qom-get\r\n\r\nID: 1549432, 1549433, 1549434, 1549435\r\nSigned-off-by: Sitong Liu <siliu@redhat.com>","created_at":"2018-02-27T08:24:38Z","updated_at":"2018-11-05T09:03:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45b793396ec2828f77ed52dce68f9597f11c0c42","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240/commits","review_comments_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240/comments","review_comment_url":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/autotest/tp-qemu/issues/1240/comments","statuses_url":"https://api.github.com/repos/autotest/tp-qemu/statuses/2cadf522bb0f7ee67ca32e0345cfe28d72a990d4","head":{"label":"sitoliu:timerdevice_feat","ref":"timerdevice_feat","sha":"2cadf522bb0f7ee67ca32e0345cfe28d72a990d4","user":{"login":"sitoliu","id":27192648,"node_id":"MDQ6VXNlcjI3MTkyNjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/27192648?v=4","gravatar_id":"","url":"https://api.github.com/users/sitoliu","html_url":"https://github.com/sitoliu","followers_url":"https://api.github.com/users/sitoliu/followers","following_url":"https://api.github.com/users/sitoliu/following{/other_user}","gists_url":"https://api.github.com/users/sitoliu/gists{/gist_id}","starred_url":"https://api.github.com/users/sitoliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sitoliu/subscriptions","organizations_url":"https://api.github.com/users/sitoliu/orgs","repos_url":"https://api.github.com/users/sitoliu/repos","events_url":"https://api.github.com/users/sitoliu/events{/privacy}","received_events_url":"https://api.github.com/users/sitoliu/received_events","type":"User","site_admin":false},"repo":{"id":89558382,"node_id":"MDEwOlJlcG9zaXRvcnk4OTU1ODM4Mg==","name":"tp-qemu","full_name":"sitoliu/tp-qemu","private":false,"owner":{"login":"sitoliu","id":27192648,"node_id":"MDQ6VXNlcjI3MTkyNjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/27192648?v=4","gravatar_id":"","url":"https://api.github.com/users/sitoliu","html_url":"https://github.com/sitoliu","followers_url":"https://api.github.com/users/sitoliu/followers","following_url":"https://api.github.com/users/sitoliu/following{/other_user}","gists_url":"https://api.github.com/users/sitoliu/gists{/gist_id}","starred_url":"https://api.github.com/users/sitoliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sitoliu/subscriptions","organizations_url":"https://api.github.com/users/sitoliu/orgs","repos_url":"https://api.github.com/users/sitoliu/repos","events_url":"https://api.github.com/users/sitoliu/events{/privacy}","received_events_url":"https://api.github.com/users/sitoliu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sitoliu/tp-qemu","description":"Virt Test Provider for qemu and other related virtualization backends","fork":true,"url":"https://api.github.com/repos/sitoliu/tp-qemu","forks_url":"https://api.github.com/repos/sitoliu/tp-qemu/forks","keys_url":"https://api.github.com/repos/sitoliu/tp-qemu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sitoliu/tp-qemu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sitoliu/tp-qemu/teams","hooks_url":"https://api.github.com/repos/sitoliu/tp-qemu/hooks","issue_events_url":"https://api.github.com/repos/sitoliu/tp-qemu/issues/events{/number}","events_url":"https://api.github.com/repos/sitoliu/tp-qemu/events","assignees_url":"https://api.github.com/repos/sitoliu/tp-qemu/assignees{/user}","branches_url":"https://api.github.com/repos/sitoliu/tp-qemu/branches{/branch}","tags_url":"https://api.github.com/repos/sitoliu/tp-qemu/tags","blobs_url":"https://api.github.com/repos/sitoliu/tp-qemu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sitoliu/tp-qemu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sitoliu/tp-qemu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sitoliu/tp-qemu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sitoliu/tp-qemu/statuses/{sha}","languages_url":"https://api.github.com/repos/sitoliu/tp-qemu/languages","stargazers_url":"https://api.github.com/repos/sitoliu/tp-qemu/stargazers","contributors_url":"https://api.github.com/repos/sitoliu/tp-qemu/contributors","subscribers_url":"https://api.github.com/repos/sitoliu/tp-qemu/subscribers","subscription_url":"https://api.github.com/repos/sitoliu/tp-qemu/subscription","commits_url":"https://api.github.com/repos/sitoliu/tp-qemu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sitoliu/tp-qemu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sitoliu/tp-qemu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sitoliu/tp-qemu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sitoliu/tp-qemu/contents/{+path}","compare_url":"https://api.github.com/repos/sitoliu/tp-qemu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sitoliu/tp-qemu/merges","archive_url":"https://api.github.com/repos/sitoliu/tp-qemu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sitoliu/tp-qemu/downloads","issues_url":"https://api.github.com/repos/sitoliu/tp-qemu/issues{/number}","pulls_url":"https://api.github.com/repos/sitoliu/tp-qemu/pulls{/number}","milestones_url":"https://api.github.com/repos/sitoliu/tp-qemu/milestones{/number}","notifications_url":"https://api.github.com/repos/sitoliu/tp-qemu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sitoliu/tp-qemu/labels{/name}","releases_url":"https://api.github.com/repos/sitoliu/tp-qemu/releases{/id}","deployments_url":"https://api.github.com/repos/sitoliu/tp-qemu/deployments","created_at":"2017-04-27T05:16:33Z","updated_at":"2018-11-05T03:09:33Z","pushed_at":"2018-11-05T08:17:31Z","git_url":"git://github.com/sitoliu/tp-qemu.git","ssh_url":"git@github.com:sitoliu/tp-qemu.git","clone_url":"https://github.com/sitoliu/tp-qemu.git","svn_url":"https://github.com/sitoliu/tp-qemu","homepage":null,"size":34356,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"autotest:master","ref":"master","sha":"5377834e87b0bf2ff8e6a48775698f18f6d5919d","user":{"login":"autotest","id":472856,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Mjg1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/472856?v=4","gravatar_id":"","url":"https://api.github.com/users/autotest","html_url":"https://github.com/autotest","followers_url":"https://api.github.com/users/autotest/followers","following_url":"https://api.github.com/users/autotest/following{/other_user}","gists_url":"https://api.github.com/users/autotest/gists{/gist_id}","starred_url":"https://api.github.com/users/autotest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autotest/subscriptions","organizations_url":"https://api.github.com/users/autotest/orgs","repos_url":"https://api.github.com/users/autotest/repos","events_url":"https://api.github.com/users/autotest/events{/privacy}","received_events_url":"https://api.github.com/users/autotest/received_events","type":"Organization","site_admin":false},"repo":{"id":16180304,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE4MDMwNA==","name":"tp-qemu","full_name":"autotest/tp-qemu","private":false,"owner":{"login":"autotest","id":472856,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Mjg1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/472856?v=4","gravatar_id":"","url":"https://api.github.com/users/autotest","html_url":"https://github.com/autotest","followers_url":"https://api.github.com/users/autotest/followers","following_url":"https://api.github.com/users/autotest/following{/other_user}","gists_url":"https://api.github.com/users/autotest/gists{/gist_id}","starred_url":"https://api.github.com/users/autotest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autotest/subscriptions","organizations_url":"https://api.github.com/users/autotest/orgs","repos_url":"https://api.github.com/users/autotest/repos","events_url":"https://api.github.com/users/autotest/events{/privacy}","received_events_url":"https://api.github.com/users/autotest/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/autotest/tp-qemu","description":"Virt Test Provider for qemu and other related virtualization backends","fork":false,"url":"https://api.github.com/repos/autotest/tp-qemu","forks_url":"https://api.github.com/repos/autotest/tp-qemu/forks","keys_url":"https://api.github.com/repos/autotest/tp-qemu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autotest/tp-qemu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autotest/tp-qemu/teams","hooks_url":"https://api.github.com/repos/autotest/tp-qemu/hooks","issue_events_url":"https://api.github.com/repos/autotest/tp-qemu/issues/events{/number}","events_url":"https://api.github.com/repos/autotest/tp-qemu/events","assignees_url":"https://api.github.com/repos/autotest/tp-qemu/assignees{/user}","branches_url":"https://api.github.com/repos/autotest/tp-qemu/branches{/branch}","tags_url":"https://api.github.com/repos/autotest/tp-qemu/tags","blobs_url":"https://api.github.com/repos/autotest/tp-qemu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autotest/tp-qemu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autotest/tp-qemu/git/refs{/sha}","trees_url":"https://api.github.com/repos/autotest/tp-qemu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autotest/tp-qemu/statuses/{sha}","languages_url":"https://api.github.com/repos/autotest/tp-qemu/languages","stargazers_url":"https://api.github.com/repos/autotest/tp-qemu/stargazers","contributors_url":"https://api.github.com/repos/autotest/tp-qemu/contributors","subscribers_url":"https://api.github.com/repos/autotest/tp-qemu/subscribers","subscription_url":"https://api.github.com/repos/autotest/tp-qemu/subscription","commits_url":"https://api.github.com/repos/autotest/tp-qemu/commits{/sha}","git_commits_url":"https://api.github.com/repos/autotest/tp-qemu/git/commits{/sha}","comments_url":"https://api.github.com/repos/autotest/tp-qemu/comments{/number}","issue_comment_url":"https://api.github.com/repos/autotest/tp-qemu/issues/comments{/number}","contents_url":"https://api.github.com/repos/autotest/tp-qemu/contents/{+path}","compare_url":"https://api.github.com/repos/autotest/tp-qemu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autotest/tp-qemu/merges","archive_url":"https://api.github.com/repos/autotest/tp-qemu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autotest/tp-qemu/downloads","issues_url":"https://api.github.com/repos/autotest/tp-qemu/issues{/number}","pulls_url":"https://api.github.com/repos/autotest/tp-qemu/pulls{/number}","milestones_url":"https://api.github.com/repos/autotest/tp-qemu/milestones{/number}","notifications_url":"https://api.github.com/repos/autotest/tp-qemu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autotest/tp-qemu/labels{/name}","releases_url":"https://api.github.com/repos/autotest/tp-qemu/releases{/id}","deployments_url":"https://api.github.com/repos/autotest/tp-qemu/deployments","created_at":"2014-01-23T17:51:34Z","updated_at":"2018-11-05T08:49:11Z","pushed_at":"2018-11-05T08:49:00Z","git_url":"git://github.com/autotest/tp-qemu.git","ssh_url":"git@github.com:autotest/tp-qemu.git","clone_url":"https://github.com/autotest/tp-qemu.git","svn_url":"https://github.com/autotest/tp-qemu","homepage":null,"size":34368,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":122,"mirror_url":null,"archived":false,"open_issues_count":74,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":122,"open_issues":74,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240"},"html":{"href":"https://github.com/autotest/tp-qemu/pull/1240"},"issue":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/1240"},"comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/issues/1240/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240/comments"},"review_comment":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/autotest/tp-qemu/pulls/1240/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/tp-qemu/statuses/2cadf522bb0f7ee67ca32e0345cfe28d72a990d4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vivianQizhu"}}