{"action":"created","comment":{"url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/comments/144854945","pull_request_review_id":69569872,"id":144854945,"diff_hunk":"@@ -1,80 +1,94 @@\n import logging\n-\n+import time\n+import os\n+import commands\n from autotest.client import utils\n-from autotest.client.shared import error\n-\n from virttest import virsh\n from virttest.libvirt_xml import nodedev_xml\n-\n from provider import libvirt_version\n \n \n-def do_nodedev_dumpxml(dev_name, dev_opt=\"\", **dargs):\n-    \"\"\"\n-    Do dumpxml and check the result.\n-\n-    (1).execute nodedev-dumpxml command.\n-    (2).compare info in xml with info in sysfs.\n-\n-    :param dev_name: name of device.\n-    :param dev_opt: command extra options\n-    :param dargs: extra dict args\n-    :raise TestFail: if execute command failed\n-                     or check result failed.\n-    \"\"\"\n-    result = virsh.nodedev_dumpxml(dev_name, options=dev_opt, **dargs)\n-    if result.exit_status:\n-        raise error.TestError(\"Dumpxml node device %s failed.\\n\"\n-                              \"Detail:%s.\" % (dev_name, result.stderr))\n-    logging.debug('Executing \"virsh nodedev-dumpxml %s\" finished.', dev_name)\n-    # compare info in xml with info in sysfs.\n-    nodedevxml = nodedev_xml.NodedevXML.new_from_dumpxml(dev_name)\n-    if not nodedevxml.validates:\n-        raise error.TestError(\"nodedvxml of %s is not validated.\" % (dev_name))\n-    # Get the dict of key to value in xml.\n-    # key2value_dict_xml contain the all keys and values in xml need checking.\n-    key2value_dict_xml = nodedevxml.get_key2value_dict()\n-    # Get the dict of key to path in sysfs.\n-    # key2syspath_dict contain the all keys and the path of file which contain\n-    #                 information for each key.\n-    key2syspath_dict = nodedevxml.get_key2syspath_dict()\n-    # Get the values contained in files.\n-    # key2value_dict_sys contain the all keys and values in sysfs.\n-    key2value_dict_sys = {}\n-    for key, filepath in key2syspath_dict.items():\n-        value = utils.read_one_line(filepath)\n-        key2value_dict_sys[key] = value\n-\n-    # Compare the value in xml and in syspath.\n-    for key in key2value_dict_xml:\n-        value_xml = key2value_dict_xml.get(key)\n-        value_sys = key2value_dict_sys.get(key)\n-        if not value_xml == value_sys:\n-            if (key == 'numa_node' and not\n-                    libvirt_version.version_compare(1, 2, 5)):\n-                logging.warning(\"key: %s in xml is not supported yet\" % key)\n-            else:\n-                raise error.TestError(\"key: %s in xml is %s,\"\n-                                      \"but in sysfs is %s.\" %\n-                                      (key, value_xml, value_sys))\n-        else:\n-            continue\n-\n-    logging.debug(\"Compare info in xml and info in sysfs finished\"\n-                  \"for device %s.\", dev_name)\n-\n-\n def run(test, params, env):\n     \"\"\"\n     Test command virsh nodedev-dumpxml.\n-\n     (1).get param from params.","path":"libvirt/tests/src/virsh_cmd/nodedev/virsh_nodedev_dumpxml.py","position":null,"original_position":74,"commit_id":"18a1b17abc3bd963c70be83cc418ac043ac5b3a0","original_commit_id":"fe2b6106ae32d43e39d6ecbed5074e34a6dfc506","user":{"login":"sannyshao","id":14279213,"avatar_url":"https://avatars2.githubusercontent.com/u/14279213?v=4","gravatar_id":"","url":"https://api.github.com/users/sannyshao","html_url":"https://github.com/sannyshao","followers_url":"https://api.github.com/users/sannyshao/followers","following_url":"https://api.github.com/users/sannyshao/following{/other_user}","gists_url":"https://api.github.com/users/sannyshao/gists{/gist_id}","starred_url":"https://api.github.com/users/sannyshao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sannyshao/subscriptions","organizations_url":"https://api.github.com/users/sannyshao/orgs","repos_url":"https://api.github.com/users/sannyshao/repos","events_url":"https://api.github.com/users/sannyshao/events{/privacy}","received_events_url":"https://api.github.com/users/sannyshao/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-10-16T14:01:37Z","updated_at":"2017-10-16T14:01:37Z","html_url":"https://github.com/autotest/tp-libvirt/pull/1178#discussion_r144854945","pull_request_url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/comments/144854945"},"html":{"href":"https://github.com/autotest/tp-libvirt/pull/1178#discussion_r144854945"},"pull_request":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178"}},"in_reply_to_id":140134083},"pull_request":{"url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178","id":137121856,"html_url":"https://github.com/autotest/tp-libvirt/pull/1178","diff_url":"https://github.com/autotest/tp-libvirt/pull/1178.diff","patch_url":"https://github.com/autotest/tp-libvirt/pull/1178.patch","issue_url":"https://api.github.com/repos/autotest/tp-libvirt/issues/1178","number":1178,"state":"open","locked":false,"title":"Dump/reset  the specific nodedevice from different host","user":{"login":"sannyshao","id":14279213,"avatar_url":"https://avatars2.githubusercontent.com/u/14279213?v=4","gravatar_id":"","url":"https://api.github.com/users/sannyshao","html_url":"https://github.com/sannyshao","followers_url":"https://api.github.com/users/sannyshao/followers","following_url":"https://api.github.com/users/sannyshao/following{/other_user}","gists_url":"https://api.github.com/users/sannyshao/gists{/gist_id}","starred_url":"https://api.github.com/users/sannyshao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sannyshao/subscriptions","organizations_url":"https://api.github.com/users/sannyshao/orgs","repos_url":"https://api.github.com/users/sannyshao/repos","events_url":"https://api.github.com/users/sannyshao/events{/privacy}","received_events_url":"https://api.github.com/users/sannyshao/received_events","type":"User","site_admin":false},"body":"For different hosts have different devices, device address is not the\r\nsame one written in cfg, this patch can  get the device_name from the host on testing not from the cfg.\r\n\r\nSigned-off-by: Jingjing Shao <jishao@redhat.com>","created_at":"2017-08-23T03:11:02Z","updated_at":"2017-10-16T14:01:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c545815aa7c0928a5324411427673f866c17739","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178/commits","review_comments_url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178/comments","review_comment_url":"https://api.github.com/repos/autotest/tp-libvirt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/autotest/tp-libvirt/issues/1178/comments","statuses_url":"https://api.github.com/repos/autotest/tp-libvirt/statuses/18a1b17abc3bd963c70be83cc418ac043ac5b3a0","head":{"label":"sannyshao:nodedev-dumpxml","ref":"nodedev-dumpxml","sha":"18a1b17abc3bd963c70be83cc418ac043ac5b3a0","user":{"login":"sannyshao","id":14279213,"avatar_url":"https://avatars2.githubusercontent.com/u/14279213?v=4","gravatar_id":"","url":"https://api.github.com/users/sannyshao","html_url":"https://github.com/sannyshao","followers_url":"https://api.github.com/users/sannyshao/followers","following_url":"https://api.github.com/users/sannyshao/following{/other_user}","gists_url":"https://api.github.com/users/sannyshao/gists{/gist_id}","starred_url":"https://api.github.com/users/sannyshao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sannyshao/subscriptions","organizations_url":"https://api.github.com/users/sannyshao/orgs","repos_url":"https://api.github.com/users/sannyshao/repos","events_url":"https://api.github.com/users/sannyshao/events{/privacy}","received_events_url":"https://api.github.com/users/sannyshao/received_events","type":"User","site_admin":false},"repo":{"id":96850233,"name":"tp-libvirt","full_name":"sannyshao/tp-libvirt","owner":{"login":"sannyshao","id":14279213,"avatar_url":"https://avatars2.githubusercontent.com/u/14279213?v=4","gravatar_id":"","url":"https://api.github.com/users/sannyshao","html_url":"https://github.com/sannyshao","followers_url":"https://api.github.com/users/sannyshao/followers","following_url":"https://api.github.com/users/sannyshao/following{/other_user}","gists_url":"https://api.github.com/users/sannyshao/gists{/gist_id}","starred_url":"https://api.github.com/users/sannyshao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sannyshao/subscriptions","organizations_url":"https://api.github.com/users/sannyshao/orgs","repos_url":"https://api.github.com/users/sannyshao/repos","events_url":"https://api.github.com/users/sannyshao/events{/privacy}","received_events_url":"https://api.github.com/users/sannyshao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sannyshao/tp-libvirt","description":"Test Provider for Libvirt and related virtualization backends","fork":true,"url":"https://api.github.com/repos/sannyshao/tp-libvirt","forks_url":"https://api.github.com/repos/sannyshao/tp-libvirt/forks","keys_url":"https://api.github.com/repos/sannyshao/tp-libvirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sannyshao/tp-libvirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sannyshao/tp-libvirt/teams","hooks_url":"https://api.github.com/repos/sannyshao/tp-libvirt/hooks","issue_events_url":"https://api.github.com/repos/sannyshao/tp-libvirt/issues/events{/number}","events_url":"https://api.github.com/repos/sannyshao/tp-libvirt/events","assignees_url":"https://api.github.com/repos/sannyshao/tp-libvirt/assignees{/user}","branches_url":"https://api.github.com/repos/sannyshao/tp-libvirt/branches{/branch}","tags_url":"https://api.github.com/repos/sannyshao/tp-libvirt/tags","blobs_url":"https://api.github.com/repos/sannyshao/tp-libvirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sannyshao/tp-libvirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sannyshao/tp-libvirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/sannyshao/tp-libvirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sannyshao/tp-libvirt/statuses/{sha}","languages_url":"https://api.github.com/repos/sannyshao/tp-libvirt/languages","stargazers_url":"https://api.github.com/repos/sannyshao/tp-libvirt/stargazers","contributors_url":"https://api.github.com/repos/sannyshao/tp-libvirt/contributors","subscribers_url":"https://api.github.com/repos/sannyshao/tp-libvirt/subscribers","subscription_url":"https://api.github.com/repos/sannyshao/tp-libvirt/subscription","commits_url":"https://api.github.com/repos/sannyshao/tp-libvirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/sannyshao/tp-libvirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/sannyshao/tp-libvirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/sannyshao/tp-libvirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/sannyshao/tp-libvirt/contents/{+path}","compare_url":"https://api.github.com/repos/sannyshao/tp-libvirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sannyshao/tp-libvirt/merges","archive_url":"https://api.github.com/repos/sannyshao/tp-libvirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sannyshao/tp-libvirt/downloads","issues_url":"https://api.github.com/repos/sannyshao/tp-libvirt/issues{/number}","pulls_url":"https://api.github.com/repos/sannyshao/tp-libvirt/pulls{/number}","milestones_url":"https://api.github.com/repos/sannyshao/tp-libvirt/milestones{/number}","notifications_url":"https://api.github.com/repos/sannyshao/tp-libvirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sannyshao/tp-libvirt/labels{/name}","releases_url":"https://api.github.com/repos/sannyshao/tp-libvirt/releases{/id}","deployments_url":"https://api.github.com/repos/sannyshao/tp-libvirt/deployments","created_at":"2017-07-11T04:20:45Z","updated_at":"2017-07-11T04:20:48Z","pushed_at":"2017-10-16T14:00:07Z","git_url":"git://github.com/sannyshao/tp-libvirt.git","ssh_url":"git@github.com:sannyshao/tp-libvirt.git","clone_url":"https://github.com/sannyshao/tp-libvirt.git","svn_url":"https://github.com/sannyshao/tp-libvirt","homepage":null,"size":11466,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"autotest:master","ref":"master","sha":"584e84e689d940212231a52e0bcd653db80f9ad5","user":{"login":"autotest","id":472856,"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":16180517,"name":"tp-libvirt","full_name":"autotest/tp-libvirt","owner":{"login":"autotest","id":472856,"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},"private":false,"html_url":"https://github.com/autotest/tp-libvirt","description":"Test Provider for Libvirt and related virtualization backends","fork":false,"url":"https://api.github.com/repos/autotest/tp-libvirt","forks_url":"https://api.github.com/repos/autotest/tp-libvirt/forks","keys_url":"https://api.github.com/repos/autotest/tp-libvirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autotest/tp-libvirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autotest/tp-libvirt/teams","hooks_url":"https://api.github.com/repos/autotest/tp-libvirt/hooks","issue_events_url":"https://api.github.com/repos/autotest/tp-libvirt/issues/events{/number}","events_url":"https://api.github.com/repos/autotest/tp-libvirt/events","assignees_url":"https://api.github.com/repos/autotest/tp-libvirt/assignees{/user}","branches_url":"https://api.github.com/repos/autotest/tp-libvirt/branches{/branch}","tags_url":"https://api.github.com/repos/autotest/tp-libvirt/tags","blobs_url":"https://api.github.com/repos/autotest/tp-libvirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autotest/tp-libvirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autotest/tp-libvirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/autotest/tp-libvirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autotest/tp-libvirt/statuses/{sha}","languages_url":"https://api.github.com/repos/autotest/tp-libvirt/languages","stargazers_url":"https://api.github.com/repos/autotest/tp-libvirt/stargazers","contributors_url":"https://api.github.com/repos/autotest/tp-libvirt/contributors","subscribers_url":"https://api.github.com/repos/autotest/tp-libvirt/subscribers","subscription_url":"https://api.github.com/repos/autotest/tp-libvirt/subscription","commits_url":"https://api.github.com/repos/autotest/tp-libvirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/autotest/tp-libvirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/autotest/tp-libvirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/autotest/tp-libvirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/autotest/tp-libvirt/contents/{+path}","compare_url":"https://api.github.com/repos/autotest/tp-libvirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autotest/tp-libvirt/merges","archive_url":"https://api.github.com/repos/autotest/tp-libvirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autotest/tp-libvirt/downloads","issues_url":"https://api.github.com/repos/autotest/tp-libvirt/issues{/number}","pulls_url":"https://api.github.com/repos/autotest/tp-libvirt/pulls{/number}","milestones_url":"https://api.github.com/repos/autotest/tp-libvirt/milestones{/number}","notifications_url":"https://api.github.com/repos/autotest/tp-libvirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autotest/tp-libvirt/labels{/name}","releases_url":"https://api.github.com/repos/autotest/tp-libvirt/releases{/id}","deployments_url":"https://api.github.com/repos/autotest/tp-libvirt/deployments","created_at":"2014-01-23T17:58:18Z","updated_at":"2017-09-16T18:38:53Z","pushed_at":"2017-10-16T14:00:09Z","git_url":"git://github.com/autotest/tp-libvirt.git","ssh_url":"git@github.com:autotest/tp-libvirt.git","clone_url":"https://github.com/autotest/tp-libvirt.git","svn_url":"https://github.com/autotest/tp-libvirt","homepage":null,"size":11471,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":75,"forks":97,"open_issues":75,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178"},"html":{"href":"https://github.com/autotest/tp-libvirt/pull/1178"},"issue":{"href":"https://api.github.com/repos/autotest/tp-libvirt/issues/1178"},"comments":{"href":"https://api.github.com/repos/autotest/tp-libvirt/issues/1178/comments"},"review_comments":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178/comments"},"review_comment":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/autotest/tp-libvirt/pulls/1178/commits"},"statuses":{"href":"https://api.github.com/repos/autotest/tp-libvirt/statuses/18a1b17abc3bd963c70be83cc418ac043ac5b3a0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sannyshao"}}