{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/28430748","id":28430748,"diff_hunk":"@@ -384,7 +380,118 @@ def test_consume_content_1(self):\n \n         \"\"\"\n \n-        pass\n+        product_name = gen_string(\"alpha\", 8)\n+        repository_name = gen_string(\"alpha\", 8)\n+        activation_key_name = gen_string(\"alpha\", 8)\n+        key_content = read_data_file(ZOO_CUSTOM_GPG_KEY)\n+        # step1: Create gpg-key\n+        gpgkey_attrs = entities.GPGKey(\n+            name=key_name,\n+            content=key_content,\n+            organization=self.org_id\n+        ).create_json()\n+        # step 1.2: Create new lifecycle environments\n+        lifecycle_env = entities.LifecycleEnvironment(\n+            organization=self.org_id\n+        ).create_json()\n+        # step2: Creates new product without selecting GPGkey\n+        product_id = entities.Product(\n+            name=product_name,\n+            organization=self.org_id\n+        ).create_json()['id']\n+        # step3: Creates new repository with GPGKey\n+        repo_id = entities.Repository(\n+            name=repository_name,\n+            url=FAKE_1_YUM_REPO,\n+            product=product_id,\n+            gpg_key=gpgkey_attrs['id'],\n+        ).create_json()['id']\n+        # step 3.1: sync repository\n+        entities.Repository(id=repo_id).sync()\n+        # step 4: Create content view\n+        content_view = entities.ContentView(\n+            organization=self.org_id\n+        ).create_json()\n+        # step 5: Associate repository to new content view\n+        response = client.put(\n+            entities.ContentView(id=content_view['id']).path(),\n+            {u'repository_ids': [repo_id]},\n+            auth=get_server_credentials(),\n+            verify=False,\n+        )\n+        response.raise_for_status()\n+        # step 6: Publish content view\n+        entities.ContentView(id=content_view['id']).publish()\n+        # step 6.2: Promote content view to lifecycle_env\n+        content_view = entities.ContentView(id=content_view['id']).read_json()\n+        self.assertEqual(len(content_view['versions']), 1)\n+        entities.ContentViewVersion(\n+            id=content_view['versions'][0]['id']\n+        ).promote(lifecycle_env['id'])\n+        # step 7: Create activation key\n+        ak_id = entities.ActivationKey(\n+            name=activation_key_name,\n+            environment=lifecycle_env['id'],\n+            organization=self.org_id,\n+            content_view=content_view['id'],\n+        ).create_json()['id']\n+        for subscription in entities.Organization(\n+                id=self.org_id).subscriptions():\n+            if subscription['product_name'] == product_name:\n+                entities.ActivationKey(id=ak_id).add_subscriptions({\n+                    'quantity': 1,\n+                    'subscription_id': subscription['id'],\n+                })\n+                break\n+        # Create VM\n+        package_name = \"cow\"\n+        with VirtualMachine(distro='rhel66') as vm:\n+            # Download and Install rpm\n+            result = vm.run(\n+                \"wget -nd -r -l1 --no-parent -A '*.noarch.rpm' http://{0}/pub/\"\n+                .format(conf.properties['main.server.hostname'])\n+            )\n+            self.assertEqual(\n+                result.return_code, 0,\n+                \"failed to fetch katello-ca rpm: {0}, return code: {1}\"\n+                .format(result.stderr, result.return_code)\n+            )\n+            result = vm.run(\n+                'rpm -i katello-ca-consumer*.noarch.rpm'\n+            )\n+            self.assertEqual(\n+                result.return_code, 0,\n+                \"failed to install katello-ca rpm: {0} and return code: {1}\"\n+                .format(result.stderr, result.return_code)\n+            )\n+            # Register client with foreman server using activation-key\n+            result = vm.run(\n+                u'subscription-manager register --activationkey {0} '\n+                '--org {1} --force'\n+                .format(activation_key_name, self.org_label)\n+            )\n+            '''self.assertEqual(\n+                result.return_code, 0,\n+                \"failed to register client:: {0} and return code: {1}\"\n+                .format(result.stderr, result.return_code)\n+            )'''\n+            # Validate if gpgcheck flag is enabled in repo file\n+            repo_file = \"/etc/yum.repos.d/redhat.repo\"\n+            result = vm.run(\n+                'cat {0} | grep gpgcheck | cut -d \" \" -f3'\n+                .format(repo_file)\n+            )\n+            self.assertEqual(u'1', result.stdout[0])\n+            # Install contents from sat6 server\n+            result = vm.run('yum install -y {0}'.format(package_name))\n+            self.assertEqual(\n+                result.return_code, 0,\n+                \"Package install failed: {0} and return code: {1}\"","path":"tests/foreman/ui/test_gpgkey.py","position":168,"original_position":168,"commit_id":"97973b214ba7c098cd7220ab894ecc9f81398b5b","original_commit_id":"97973b214ba7c098cd7220ab894ecc9f81398b5b","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"body":"Nitpick: `s/\"/'/g`","created_at":"2015-04-15T15:29:34Z","updated_at":"2015-04-15T15:29:34Z","html_url":"https://github.com/SatelliteQE/robottelo/pull/2075#discussion_r28430748","pull_request_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/28430748"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2075#discussion_r28430748"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075","id":33347448,"html_url":"https://github.com/SatelliteQE/robottelo/pull/2075","diff_url":"https://github.com/SatelliteQE/robottelo/pull/2075.diff","patch_url":"https://github.com/SatelliteQE/robottelo/pull/2075.patch","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2075","number":2075,"state":"open","locked":false,"title":"Test to check if contents can be consumed on client with associated gpk-key","user":{"login":"sghai","id":620852,"avatar_url":"https://avatars.githubusercontent.com/u/620852?v=3","gravatar_id":"","url":"https://api.github.com/users/sghai","html_url":"https://github.com/sghai","followers_url":"https://api.github.com/users/sghai/followers","following_url":"https://api.github.com/users/sghai/following{/other_user}","gists_url":"https://api.github.com/users/sghai/gists{/gist_id}","starred_url":"https://api.github.com/users/sghai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sghai/subscriptions","organizations_url":"https://api.github.com/users/sghai/orgs","repos_url":"https://api.github.com/users/sghai/repos","events_url":"https://api.github.com/users/sghai/events{/privacy}","received_events_url":"https://api.github.com/users/sghai/received_events","type":"User","site_admin":false},"body":"This test is very lengthy and plan is to handle it via small functions.. We already have functions for creating repo/product/cv etc. But those functions are defined in specific test modules.\r\n\r\nI've raised another issue #2072 to get an idea where we can place such common functions in our framework. This will help to reduce duplicate code as well. \r\n\r\nFor now, I would request to please consider this test for review and merge. I'll update this with issue #2072.","created_at":"2015-04-15T12:00:00Z","updated_at":"2015-04-15T15:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e01cf6e31817fd837bac48a18a3f1fe9b88e4795","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2075/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/97973b214ba7c098cd7220ab894ecc9f81398b5b","head":{"label":"sghai:new-tests","ref":"new-tests","sha":"97973b214ba7c098cd7220ab894ecc9f81398b5b","user":{"login":"sghai","id":620852,"avatar_url":"https://avatars.githubusercontent.com/u/620852?v=3","gravatar_id":"","url":"https://api.github.com/users/sghai","html_url":"https://github.com/sghai","followers_url":"https://api.github.com/users/sghai/followers","following_url":"https://api.github.com/users/sghai/following{/other_user}","gists_url":"https://api.github.com/users/sghai/gists{/gist_id}","starred_url":"https://api.github.com/users/sghai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sghai/subscriptions","organizations_url":"https://api.github.com/users/sghai/orgs","repos_url":"https://api.github.com/users/sghai/repos","events_url":"https://api.github.com/users/sghai/events{/privacy}","received_events_url":"https://api.github.com/users/sghai/received_events","type":"User","site_admin":false},"repo":{"id":14514487,"name":"robottelo","full_name":"sghai/robottelo","owner":{"login":"sghai","id":620852,"avatar_url":"https://avatars.githubusercontent.com/u/620852?v=3","gravatar_id":"","url":"https://api.github.com/users/sghai","html_url":"https://github.com/sghai","followers_url":"https://api.github.com/users/sghai/followers","following_url":"https://api.github.com/users/sghai/following{/other_user}","gists_url":"https://api.github.com/users/sghai/gists{/gist_id}","starred_url":"https://api.github.com/users/sghai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sghai/subscriptions","organizations_url":"https://api.github.com/users/sghai/orgs","repos_url":"https://api.github.com/users/sghai/repos","events_url":"https://api.github.com/users/sghai/events{/privacy}","received_events_url":"https://api.github.com/users/sghai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sghai/robottelo","description":"An automation testing framework for the Katello project.","fork":true,"url":"https://api.github.com/repos/sghai/robottelo","forks_url":"https://api.github.com/repos/sghai/robottelo/forks","keys_url":"https://api.github.com/repos/sghai/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sghai/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sghai/robottelo/teams","hooks_url":"https://api.github.com/repos/sghai/robottelo/hooks","issue_events_url":"https://api.github.com/repos/sghai/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/sghai/robottelo/events","assignees_url":"https://api.github.com/repos/sghai/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/sghai/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/sghai/robottelo/tags","blobs_url":"https://api.github.com/repos/sghai/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sghai/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sghai/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sghai/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sghai/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/sghai/robottelo/languages","stargazers_url":"https://api.github.com/repos/sghai/robottelo/stargazers","contributors_url":"https://api.github.com/repos/sghai/robottelo/contributors","subscribers_url":"https://api.github.com/repos/sghai/robottelo/subscribers","subscription_url":"https://api.github.com/repos/sghai/robottelo/subscription","commits_url":"https://api.github.com/repos/sghai/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sghai/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sghai/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sghai/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sghai/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/sghai/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sghai/robottelo/merges","archive_url":"https://api.github.com/repos/sghai/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sghai/robottelo/downloads","issues_url":"https://api.github.com/repos/sghai/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/sghai/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/sghai/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/sghai/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sghai/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/sghai/robottelo/releases{/id}","created_at":"2013-11-19T04:46:42Z","updated_at":"2015-04-14T05:29:54Z","pushed_at":"2015-04-15T11:54:25Z","git_url":"git://github.com/sghai/robottelo.git","ssh_url":"git@github.com:sghai/robottelo.git","clone_url":"https://github.com/sghai/robottelo.git","svn_url":"https://github.com/sghai/robottelo","homepage":null,"size":8856,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"0c0ace709f86f416a7175caaf39ea0591cb204ea","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"SatelliteQE/robottelo","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/robottelo","forks_url":"https://api.github.com/repos/SatelliteQE/robottelo/forks","keys_url":"https://api.github.com/repos/SatelliteQE/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/robottelo/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/robottelo/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/events","assignees_url":"https://api.github.com/repos/SatelliteQE/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/robottelo/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/robottelo/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/robottelo/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/robottelo/merges","archive_url":"https://api.github.com/repos/SatelliteQE/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/robottelo/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/robottelo/releases{/id}","created_at":"2012-04-12T01:36:39Z","updated_at":"2015-04-15T14:57:53Z","pushed_at":"2015-04-15T15:27:34Z","git_url":"git://github.com/SatelliteQE/robottelo.git","ssh_url":"git@github.com:SatelliteQE/robottelo.git","clone_url":"https://github.com/SatelliteQE/robottelo.git","svn_url":"https://github.com/SatelliteQE/robottelo","homepage":"","size":17619,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":25,"mirror_url":null,"open_issues_count":143,"forks":25,"open_issues":143,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2075"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2075"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2075/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2075/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/97973b214ba7c098cd7220ab894ecc9f81398b5b"}}}}