{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/comments/87689248","pull_request_review_id":8294983,"id":87689248,"diff_hunk":"@@ -0,0 +1,141 @@\n+#!/usr/bin/env python\n+\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n+#\n+# See LICENSE for more details.\n+#\n+# Copyright: 2016 IBM\n+# Author: Basheer Khadarsabgari <basheer@linux.vnet.ibm.com>\n+\n+import os\n+import re\n+from avocado import Test\n+from avocado import main\n+from avocado.utils import process\n+from avocado.utils import distro\n+from avocado.utils.software_manager import SoftwareManager\n+\n+\n+class Supportconfig(Test):\n+    \"\"\"\n+    The supportconfig script gathers system troubleshooting information on\n+    SUSE Linux Enterprise Server systems.It captures the current system\n+    environment and generates a tar-archive.\n+\n+    The script file collects complementary information to the dbginfo.sh\n+    script. The supportconfig script is part of the Supportutils package.\n+    \"\"\"\n+\n+    def setUp(self):\n+        \"\"\"\n+        Install all the dependency packages required for Test.\n+        \"\"\"\n+        sm = SoftwareManager()\n+        dist = distro.detect()\n+\n+        if \"SuSE\" not in dist.name:\n+            self.skip(\"supportconfig is supported on the SuSE Distro only.\")\n+\n+        package = \"supportutils\"\n+        if not sm.check_installed(package) and not sm.install(package):\n+            self.skip(\"Failed to install %s required for this test.\" % package)\n+\n+    def test_supportconfig_options(self):\n+        \"\"\"\n+        Test the supportconfig options:\n+        Use the minimal option (-m):supportconfig -m\n+        Limiting the Information to a Specific Topic: supportconfig -i LVM\n+        List of feature keywords: supportconfig -F\n+        Collecting already Rotated Log Files: supportconfig -l\n+        \"\"\"\n+        # verify the normal functionality of the supportconfig\n+        ret = process.run(\"supportconfig\",\n+                          sudo=True,\n+                          ignore_status=True)\n+        logfile = re.search(r\"Log file tar ball: (\\S+)\\n\", ret.stdout).group(1)\n+        if not os.path.exists(logfile) or ret.exit_status:\n+            self.fail(\"supportconfig failed to create log file\")\n+\n+        options_to_verify = self.params.get('supportconfig_opt', default=\"m\")\n+        feature = self.params.get('feature', default=\"AUTOFS\")\n+        for option in options_to_verify:\n+            if option == \"i\":\n+                self.log.info(\"Limiting the Information to a Specific feature\")\n+                ret = process.run(\"supportconfig -%s %s\" % (option, feature),\n+                                  sudo=True,\n+                                  ignore_status=True)\n+                if not re.search(r\"%s...\\s*Done\" % feature, ret.stdout) \\\n+                   or ret.exit_status:\n+                    self.fail(\n+                        \"Failed to verify the %s feature using supportconfig\" %\n+                        feature)\n+            elif option == \"R\":\n+                self.log.info(\n+                    \"Changing default directory path for supportconfig\" +\n+                    \" output files\")\n+                ret = process.run(\"supportconfig -%s %s\" %\n+                                  (option, self.workdir),\n+                                  sudo=True,\n+                                  ignore_status=True)\n+                if self.workdir not in ret.stdout or ret.exit_status:\n+                    self.fail(\n+                        \"Failed to change the supportconfig output\" +\n+                        \" files directory\")\n+            else:\n+                self.log.info(\"verifying %s option of supportconfig\" % option)\n+                ret = process.run(\"supportconfig -%s\" % option,\n+                                  sudo=True,\n+                                  ignore_status=True)\n+                if ret.exit_status:\n+                    self.fail(\n+                        \"supportconfig %s option failed with %s exit option\" %\n+                        (option, ret.exit_status))\n+\n+    def test_enable_disable_plugins(self):\n+        \"\"\"\n+        1.create the /usr/lib/supportconfig/plugins\n+        2.copy your script file there\n+        3.output will be in the plugin-plugin_name.txt file\n+        \"\"\"\n+        plugin_dir = \"/usr/lib/supportconfig/plugins\"\n+        plugin_dir_exists = 1\n+        if not os.path.exists(plugin_dir):\n+            plugin_dir_exists = 0\n+            os.mkdir(plugin_dir)\n+        # copy the plugin file\n+        plugin_name = '/usr/bin/pstree'\n+        process.system(\"cp %s %s\" % (plugin_name, plugin_dir))\n+        ret = process.run(\"supportconfig\",","path":"toolchain/supportconfig.py","position":115,"original_position":115,"commit_id":"0b2f08d76f97817b91d1dc03ff7ee65aa5a5f2c1","original_commit_id":"0b2f08d76f97817b91d1dc03ff7ee65aa5a5f2c1","user":{"login":"PraveenPenguin","id":11898572,"avatar_url":"https://avatars.githubusercontent.com/u/11898572?v=3","gravatar_id":"","url":"https://api.github.com/users/PraveenPenguin","html_url":"https://github.com/PraveenPenguin","followers_url":"https://api.github.com/users/PraveenPenguin/followers","following_url":"https://api.github.com/users/PraveenPenguin/following{/other_user}","gists_url":"https://api.github.com/users/PraveenPenguin/gists{/gist_id}","starred_url":"https://api.github.com/users/PraveenPenguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PraveenPenguin/subscriptions","organizations_url":"https://api.github.com/users/PraveenPenguin/orgs","repos_url":"https://api.github.com/users/PraveenPenguin/repos","events_url":"https://api.github.com/users/PraveenPenguin/events{/privacy}","received_events_url":"https://api.github.com/users/PraveenPenguin/received_events","type":"User","site_admin":false},"body":"please use `process.system()` as it return exit code ","created_at":"2016-11-12T08:33:06Z","updated_at":"2016-11-12T08:34:35Z","html_url":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161#discussion_r87689248","pull_request_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/comments/87689248"},"html":{"href":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161#discussion_r87689248"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161","id":93124965,"html_url":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161","diff_url":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161.diff","patch_url":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161.patch","issue_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/161","number":161,"state":"open","locked":false,"title":"Supportconfig Testcase","user":{"login":"basheerk","id":14121980,"avatar_url":"https://avatars.githubusercontent.com/u/14121980?v=3","gravatar_id":"","url":"https://api.github.com/users/basheerk","html_url":"https://github.com/basheerk","followers_url":"https://api.github.com/users/basheerk/followers","following_url":"https://api.github.com/users/basheerk/following{/other_user}","gists_url":"https://api.github.com/users/basheerk/gists{/gist_id}","starred_url":"https://api.github.com/users/basheerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basheerk/subscriptions","organizations_url":"https://api.github.com/users/basheerk/orgs","repos_url":"https://api.github.com/users/basheerk/repos","events_url":"https://api.github.com/users/basheerk/events{/privacy}","received_events_url":"https://api.github.com/users/basheerk/received_events","type":"User","site_admin":false},"body":"The supportconfig script gathers system troubleshooting information on\r\nSUSE Linux Enterprise Server systems.It captures the current system\r\nenvironment and generates a tar-archive\r\n\r\nSigned-off-by: Basheer K<basheer@linux.vnet.ibm.com>\r\nTested-by: Basheer K<basheer@linux.vnet.ibm.com>","created_at":"2016-11-10T10:36:02Z","updated_at":"2016-11-12T08:34:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d87473026d19dccf08a030253d0613fad1a45cd8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161/commits","review_comments_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161/comments","review_comment_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/161/comments","statuses_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/statuses/0b2f08d76f97817b91d1dc03ff7ee65aa5a5f2c1","head":{"label":"basheerk:supportconfig1","ref":"supportconfig1","sha":"0b2f08d76f97817b91d1dc03ff7ee65aa5a5f2c1","user":{"login":"basheerk","id":14121980,"avatar_url":"https://avatars.githubusercontent.com/u/14121980?v=3","gravatar_id":"","url":"https://api.github.com/users/basheerk","html_url":"https://github.com/basheerk","followers_url":"https://api.github.com/users/basheerk/followers","following_url":"https://api.github.com/users/basheerk/following{/other_user}","gists_url":"https://api.github.com/users/basheerk/gists{/gist_id}","starred_url":"https://api.github.com/users/basheerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basheerk/subscriptions","organizations_url":"https://api.github.com/users/basheerk/orgs","repos_url":"https://api.github.com/users/basheerk/repos","events_url":"https://api.github.com/users/basheerk/events{/privacy}","received_events_url":"https://api.github.com/users/basheerk/received_events","type":"User","site_admin":false},"repo":{"id":73358133,"name":"avocado-misc-tests-1","full_name":"basheerk/avocado-misc-tests-1","owner":{"login":"basheerk","id":14121980,"avatar_url":"https://avatars.githubusercontent.com/u/14121980?v=3","gravatar_id":"","url":"https://api.github.com/users/basheerk","html_url":"https://github.com/basheerk","followers_url":"https://api.github.com/users/basheerk/followers","following_url":"https://api.github.com/users/basheerk/following{/other_user}","gists_url":"https://api.github.com/users/basheerk/gists{/gist_id}","starred_url":"https://api.github.com/users/basheerk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basheerk/subscriptions","organizations_url":"https://api.github.com/users/basheerk/orgs","repos_url":"https://api.github.com/users/basheerk/repos","events_url":"https://api.github.com/users/basheerk/events{/privacy}","received_events_url":"https://api.github.com/users/basheerk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/basheerk/avocado-misc-tests-1","description":"Community maintained Avocado tests repository","fork":true,"url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1","forks_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/forks","keys_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/teams","hooks_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/hooks","issue_events_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/issues/events{/number}","events_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/events","assignees_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/assignees{/user}","branches_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/branches{/branch}","tags_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/tags","blobs_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/statuses/{sha}","languages_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/languages","stargazers_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/stargazers","contributors_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/contributors","subscribers_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/subscribers","subscription_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/subscription","commits_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/contents/{+path}","compare_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/merges","archive_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/downloads","issues_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/issues{/number}","pulls_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/pulls{/number}","milestones_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/milestones{/number}","notifications_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/labels{/name}","releases_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/releases{/id}","deployments_url":"https://api.github.com/repos/basheerk/avocado-misc-tests-1/deployments","created_at":"2016-11-10T07:40:23Z","updated_at":"2016-11-10T07:40:24Z","pushed_at":"2016-11-10T10:45:10Z","git_url":"git://github.com/basheerk/avocado-misc-tests-1.git","ssh_url":"git@github.com:basheerk/avocado-misc-tests-1.git","clone_url":"https://github.com/basheerk/avocado-misc-tests-1.git","svn_url":"https://github.com/basheerk/avocado-misc-tests-1","homepage":"","size":1596,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"avocado-framework-tests:master","ref":"master","sha":"5e4f3869d38159227c00a8d852a23cbb7b389fae","user":{"login":"avocado-framework-tests","id":21237888,"avatar_url":"https://avatars.githubusercontent.com/u/21237888?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework-tests","html_url":"https://github.com/avocado-framework-tests","followers_url":"https://api.github.com/users/avocado-framework-tests/followers","following_url":"https://api.github.com/users/avocado-framework-tests/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework-tests/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework-tests/orgs","repos_url":"https://api.github.com/users/avocado-framework-tests/repos","events_url":"https://api.github.com/users/avocado-framework-tests/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework-tests/received_events","type":"Organization","site_admin":false},"repo":{"id":66541747,"name":"avocado-misc-tests","full_name":"avocado-framework-tests/avocado-misc-tests","owner":{"login":"avocado-framework-tests","id":21237888,"avatar_url":"https://avatars.githubusercontent.com/u/21237888?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework-tests","html_url":"https://github.com/avocado-framework-tests","followers_url":"https://api.github.com/users/avocado-framework-tests/followers","following_url":"https://api.github.com/users/avocado-framework-tests/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework-tests/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework-tests/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework-tests/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework-tests/orgs","repos_url":"https://api.github.com/users/avocado-framework-tests/repos","events_url":"https://api.github.com/users/avocado-framework-tests/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework-tests/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avocado-framework-tests/avocado-misc-tests","description":"Community maintained Avocado tests repository","fork":false,"url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests","forks_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/forks","keys_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/teams","hooks_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/hooks","issue_events_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/events{/number}","events_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/events","assignees_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/assignees{/user}","branches_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/branches{/branch}","tags_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/tags","blobs_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/languages","stargazers_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/stargazers","contributors_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/contributors","subscribers_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/subscribers","subscription_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/subscription","commits_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/contents/{+path}","compare_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/merges","archive_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/downloads","issues_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues{/number}","pulls_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/labels{/name}","releases_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/releases{/id}","deployments_url":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/deployments","created_at":"2016-08-25T08:50:54Z","updated_at":"2016-10-24T13:29:55Z","pushed_at":"2016-11-11T12:04:30Z","git_url":"git://github.com/avocado-framework-tests/avocado-misc-tests.git","ssh_url":"git@github.com:avocado-framework-tests/avocado-misc-tests.git","clone_url":"https://github.com/avocado-framework-tests/avocado-misc-tests.git","svn_url":"https://github.com/avocado-framework-tests/avocado-misc-tests","homepage":"","size":1787,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":12,"forks":21,"open_issues":12,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161"},"html":{"href":"https://github.com/avocado-framework-tests/avocado-misc-tests/pull/161"},"issue":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/161"},"comments":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework-tests/avocado-misc-tests/statuses/0b2f08d76f97817b91d1dc03ff7ee65aa5a5f2c1"}}}}
{"actor":{"display_login":"PraveenPenguin"}}