{"action":"created","comment":{"url":"https://api.github.com/repos/openvcloud/0-templates/pulls/comments/178058603","pull_request_review_id":108050796,"id":178058603,"diff_hunk":"@@ -109,3 +109,122 @@ def test002_create_vms_with_correct_params(self):\n         self.assertEqual(vm2['vcpus'], 1)\n \n         self.log('%s ENDED' % self._testID)\n+\n+\n+class vmactions(OVC_BaseTest):\n+    def __init__(self, *args, **kwargs):\n+        super(vmactions, self).__init__(*args, **kwargs)\n+\n+    @classmethod\n+    def setUpClass(cls):\n+        self = cls()\n+        super(vmactions, self).setUp()\n+        cls.acc1 = self.random_string()\n+        cls.cs1 = self.random_string()\n+        cls.vm1 = self.random_string()\n+        cls.vdcuser = self.random_string()\n+        cls.openvcloud = self.openvcloud\n+        cls.accounts = {cls.acc1: {'openvcloud': self.openvcloud}}\n+        cls.cloudspaces = {cls.cs1: {'account': cls.acc1}}\n+        cls.vms = {cls.vm1: {'sshKey': self.key, 'vdc': self.cs1}}\n+        self.vdcusers[cls.vdcuser] = {'openvcloud': self.openvcloud,\n+                                      'provider': 'itsyouonline',\n+                                      'email': '%s@test.com' % self.random_string(),\n+                                      'groups': ['user']}\n+        cls.vdcusers = self.vdcusers\n+        cls._testID = self._testID\n+        cls.temp_actions = {'account': {'actions': ['install']},\n+                            'vdcuser': {'actions': ['install']},\n+                            'vdc': {'actions': ['install']},\n+                            'node': {'actions': ['install']}}\n+        self.log('Create vm, should succeed')\n+        res = self.create_vm(accounts=cls.accounts, cloudspaces=cls.cloudspaces,\n+                             vms=cls.vms, temp_actions=cls.temp_actions)\n+        self.wait_for_service_action_status(self.vm1, res[self.vm1]['install'])\n+        self.CLEANUP[\"accounts\"].append(cls.acc1)        \n+\n+    def tearDown(self):\n+        pass\n+\n+    def test001_adding_and_deleting_portforward(self):\n+        \"\"\" ZRT-OVC-012\n+        *Test case for adding and deleting portforward.*\n+\n+        **Test Scenario:**\n+\n+        #. Create a vm[vm1], should succeed.\n+        #. Create a portforward for [vm1], should succeed.\n+        #. Check that portforward created, should succeed.\n+        #. Delete the portforward created, should succeed.\n+        #. Check that portforward deleted, should succeed. \n+        \"\"\"\n+        self.log('%s STARTED' % self._testID)\n+\n+        self.log(\"Create portforward for [vm1], should succeed. \")        \n+        public_port = randint(1000, 60000)\n+        local_port = 22        \n+        temp_actions = {'node': {'actions': ['portforward_create'], 'service': self.vm1, \n+                                 'args': {'ports': {'source': public_port, 'destination': local_port}}}}\n+        res = self.create_vm(accounts=self.accounts, cloudspaces=self.cloudspaces,\n+                             vms=self.vms, temp_actions=temp_actions)\n+        self.wait_for_service_action_status(self.vm1, res[self.vm1]['portforward_create'])\n+\n+        self.log(\" Check that portforward created, should succeed.\")\n+        self.assertTrue(self.get_portforward_list(self.cs1, self.vm1))\n+\n+        self.log(\"Delete the portforward created, should succeed\")\n+        temp_actions = {'vdc': {'actions': ['portforward_delete'], 'service': self.vm1, \n+                        'args': {'ports': {'source': public_port, 'destination': local_port}}}}\n+        res = self.create_vm(accounts=self.accounts, cloudspaces=self.cloudspaces,\n+                             vms=self.vms, temp_actions=temp_actions)\n+        self.wait_for_service_action_status(self.vm1, res[self.vm1]['portforward_delete'])\n+\n+        self.log('Check that the portforward  deleted from cloudspace [CS1] successfully , should succeed.')\n+        self.assertFalse(self.get_portforward_list(self.cs1, self.vm1))\n+\n+    def test002_start_stop_vm(self):\n+        \"\"\" ZRT-OVC-013\n+        *Test case for testing start and stop vm .*\n+\n+        **Test Scenario:**\n+\n+        #. Create a vm[vm1], should succeed.\n+        #. Stop [VM1], should succceed.\n+        #. Check that [VM1] halted.\n+        #. Strat [VM1], should succeed.\n+        #. Check that [VM1] running.\n+        \"\"\"\n+        self.log('%s STARTED' % self._testID)\n+\n+        self.log(\"Stop [VM1], should succceed.\")\n+        temp_actions = {'node': {'actions': ['stop'], 'service': self.vm1}}\n+        res = self.create_vm(accounts=self.accounts, cloudspaces=self.cloudspaces,\n+                             vms=self.vms, temp_actions=temp_actions)\n+        self.wait_for_service_action_status(self.vm1, res[self.vm1]['stop'])\n+\n+        self.log(\" Check that [VM1] halted.\")\n+        cloudspaceId = self.get_cloudspace(self.cs1)['id']\n+        vm = self.get_vm(cloudspaceId, self.vm1)\n+        self.assertEqual(vm[\"status\"], \"HALTED\")\n+\n+        self.log(\"Start [VM1], should succceed.\")     \n+        temp_actions = {'node': {'actions': ['start'], 'service': self.vm1}}\n+        res = self.create_vm(accounts=self.accounts, cloudspaces=self.cloudspaces,\n+                             vms=self.vms, temp_actions=temp_actions)\n+        self.wait_for_service_action_status(self.vm1, res[self.vm1]['start'])\n+\n+        self.log(\" Check that [VM1] running.\")\n+        cloudspaceId = self.get_cloudspace(self.cs1)['id']\n+        vm = self.get_vm(cloudspaceId, self.vm1)\n+        self.assertEqual(vm[\"status\"], \"RUNNING\")\n+\n+    @classmethod\n+    def tearDownClass(cls):\n+        self = cls()\n+        temp_actions = {'account': {'actions': ['uninstall']}}\n+        if self.check_if_service_exist(self.acc1):\n+            res = self.create_account(openvcloud=self.openvcloud, vdcusers=self.vdcusers,\n+                                    accounts=self.accounts, temp_actions=temp_actions)\n+            self.wait_for_service_action_status(self.acc1, res[self.acc1]['uninstall'])","path":"tests/integration_tests/testsuite/ovc_tests/a_basic/vms_tests.py","position":null,"original_position":120,"commit_id":"6ef36b034b2991667a56943e571022129e05a86c","original_commit_id":"831f96e658500803542e55532a3f81fd32b7eb97","user":{"login":"john-kheir","id":15011431,"avatar_url":"https://avatars1.githubusercontent.com/u/15011431?v=4","gravatar_id":"","url":"https://api.github.com/users/john-kheir","html_url":"https://github.com/john-kheir","followers_url":"https://api.github.com/users/john-kheir/followers","following_url":"https://api.github.com/users/john-kheir/following{/other_user}","gists_url":"https://api.github.com/users/john-kheir/gists{/gist_id}","starred_url":"https://api.github.com/users/john-kheir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-kheir/subscriptions","organizations_url":"https://api.github.com/users/john-kheir/orgs","repos_url":"https://api.github.com/users/john-kheir/repos","events_url":"https://api.github.com/users/john-kheir/events{/privacy}","received_events_url":"https://api.github.com/users/john-kheir/received_events","type":"User","site_admin":false},"body":"decrease the timeout to 20 for example in case the the env hanged .. also u don't need than 10 to 20 secs till the blueprint is excuted","created_at":"2018-03-29T13:40:31Z","updated_at":"2018-03-29T13:40:31Z","html_url":"https://github.com/openvcloud/0-templates/pull/85#discussion_r178058603","pull_request_url":"https://api.github.com/repos/openvcloud/0-templates/pulls/85","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/comments/178058603"},"html":{"href":"https://github.com/openvcloud/0-templates/pull/85#discussion_r178058603"},"pull_request":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/openvcloud/0-templates/pulls/85","id":178299881,"html_url":"https://github.com/openvcloud/0-templates/pull/85","diff_url":"https://github.com/openvcloud/0-templates/pull/85.diff","patch_url":"https://github.com/openvcloud/0-templates/pull/85.patch","issue_url":"https://api.github.com/repos/openvcloud/0-templates/issues/85","number":85,"state":"open","locked":false,"title":"portforward, start, and stop actions","user":{"login":"Dinaamagdy","id":24386802,"avatar_url":"https://avatars2.githubusercontent.com/u/24386802?v=4","gravatar_id":"","url":"https://api.github.com/users/Dinaamagdy","html_url":"https://github.com/Dinaamagdy","followers_url":"https://api.github.com/users/Dinaamagdy/followers","following_url":"https://api.github.com/users/Dinaamagdy/following{/other_user}","gists_url":"https://api.github.com/users/Dinaamagdy/gists{/gist_id}","starred_url":"https://api.github.com/users/Dinaamagdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dinaamagdy/subscriptions","organizations_url":"https://api.github.com/users/Dinaamagdy/orgs","repos_url":"https://api.github.com/users/Dinaamagdy/repos","events_url":"https://api.github.com/users/Dinaamagdy/events{/privacy}","received_events_url":"https://api.github.com/users/Dinaamagdy/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-29T11:22:59Z","updated_at":"2018-03-29T13:40:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d8f8b9b91e247ec1c78b1ab79c0cacaa8810083","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":828469079,"url":"https://api.github.com/repos/openvcloud/0-templates/labels/state_inprogress","name":"state_inprogress","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openvcloud/0-templates/pulls/85/commits","review_comments_url":"https://api.github.com/repos/openvcloud/0-templates/pulls/85/comments","review_comment_url":"https://api.github.com/repos/openvcloud/0-templates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openvcloud/0-templates/issues/85/comments","statuses_url":"https://api.github.com/repos/openvcloud/0-templates/statuses/6ef36b034b2991667a56943e571022129e05a86c","head":{"label":"openvcloud:vm_actions","ref":"vm_actions","sha":"6ef36b034b2991667a56943e571022129e05a86c","user":{"login":"openvcloud","id":31403827,"avatar_url":"https://avatars1.githubusercontent.com/u/31403827?v=4","gravatar_id":"","url":"https://api.github.com/users/openvcloud","html_url":"https://github.com/openvcloud","followers_url":"https://api.github.com/users/openvcloud/followers","following_url":"https://api.github.com/users/openvcloud/following{/other_user}","gists_url":"https://api.github.com/users/openvcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/openvcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvcloud/subscriptions","organizations_url":"https://api.github.com/users/openvcloud/orgs","repos_url":"https://api.github.com/users/openvcloud/repos","events_url":"https://api.github.com/users/openvcloud/events{/privacy}","received_events_url":"https://api.github.com/users/openvcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":119681678,"name":"0-templates","full_name":"openvcloud/0-templates","owner":{"login":"openvcloud","id":31403827,"avatar_url":"https://avatars1.githubusercontent.com/u/31403827?v=4","gravatar_id":"","url":"https://api.github.com/users/openvcloud","html_url":"https://github.com/openvcloud","followers_url":"https://api.github.com/users/openvcloud/followers","following_url":"https://api.github.com/users/openvcloud/following{/other_user}","gists_url":"https://api.github.com/users/openvcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/openvcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvcloud/subscriptions","organizations_url":"https://api.github.com/users/openvcloud/orgs","repos_url":"https://api.github.com/users/openvcloud/repos","events_url":"https://api.github.com/users/openvcloud/events{/privacy}","received_events_url":"https://api.github.com/users/openvcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvcloud/0-templates","description":null,"fork":false,"url":"https://api.github.com/repos/openvcloud/0-templates","forks_url":"https://api.github.com/repos/openvcloud/0-templates/forks","keys_url":"https://api.github.com/repos/openvcloud/0-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvcloud/0-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvcloud/0-templates/teams","hooks_url":"https://api.github.com/repos/openvcloud/0-templates/hooks","issue_events_url":"https://api.github.com/repos/openvcloud/0-templates/issues/events{/number}","events_url":"https://api.github.com/repos/openvcloud/0-templates/events","assignees_url":"https://api.github.com/repos/openvcloud/0-templates/assignees{/user}","branches_url":"https://api.github.com/repos/openvcloud/0-templates/branches{/branch}","tags_url":"https://api.github.com/repos/openvcloud/0-templates/tags","blobs_url":"https://api.github.com/repos/openvcloud/0-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvcloud/0-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvcloud/0-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvcloud/0-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvcloud/0-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/openvcloud/0-templates/languages","stargazers_url":"https://api.github.com/repos/openvcloud/0-templates/stargazers","contributors_url":"https://api.github.com/repos/openvcloud/0-templates/contributors","subscribers_url":"https://api.github.com/repos/openvcloud/0-templates/subscribers","subscription_url":"https://api.github.com/repos/openvcloud/0-templates/subscription","commits_url":"https://api.github.com/repos/openvcloud/0-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvcloud/0-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvcloud/0-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvcloud/0-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvcloud/0-templates/contents/{+path}","compare_url":"https://api.github.com/repos/openvcloud/0-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvcloud/0-templates/merges","archive_url":"https://api.github.com/repos/openvcloud/0-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvcloud/0-templates/downloads","issues_url":"https://api.github.com/repos/openvcloud/0-templates/issues{/number}","pulls_url":"https://api.github.com/repos/openvcloud/0-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/openvcloud/0-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/openvcloud/0-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvcloud/0-templates/labels{/name}","releases_url":"https://api.github.com/repos/openvcloud/0-templates/releases{/id}","deployments_url":"https://api.github.com/repos/openvcloud/0-templates/deployments","created_at":"2018-01-31T12:02:17Z","updated_at":"2018-03-28T13:24:19Z","pushed_at":"2018-03-29T13:34:50Z","git_url":"git://github.com/openvcloud/0-templates.git","ssh_url":"git@github.com:openvcloud/0-templates.git","clone_url":"https://github.com/openvcloud/0-templates.git","svn_url":"https://github.com/openvcloud/0-templates","homepage":null,"size":239,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":24,"watchers":0,"default_branch":"master"}},"base":{"label":"openvcloud:master","ref":"master","sha":"3d484c948864038e89c8d4a1c56b8a7c2ecbf48a","user":{"login":"openvcloud","id":31403827,"avatar_url":"https://avatars1.githubusercontent.com/u/31403827?v=4","gravatar_id":"","url":"https://api.github.com/users/openvcloud","html_url":"https://github.com/openvcloud","followers_url":"https://api.github.com/users/openvcloud/followers","following_url":"https://api.github.com/users/openvcloud/following{/other_user}","gists_url":"https://api.github.com/users/openvcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/openvcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvcloud/subscriptions","organizations_url":"https://api.github.com/users/openvcloud/orgs","repos_url":"https://api.github.com/users/openvcloud/repos","events_url":"https://api.github.com/users/openvcloud/events{/privacy}","received_events_url":"https://api.github.com/users/openvcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":119681678,"name":"0-templates","full_name":"openvcloud/0-templates","owner":{"login":"openvcloud","id":31403827,"avatar_url":"https://avatars1.githubusercontent.com/u/31403827?v=4","gravatar_id":"","url":"https://api.github.com/users/openvcloud","html_url":"https://github.com/openvcloud","followers_url":"https://api.github.com/users/openvcloud/followers","following_url":"https://api.github.com/users/openvcloud/following{/other_user}","gists_url":"https://api.github.com/users/openvcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/openvcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvcloud/subscriptions","organizations_url":"https://api.github.com/users/openvcloud/orgs","repos_url":"https://api.github.com/users/openvcloud/repos","events_url":"https://api.github.com/users/openvcloud/events{/privacy}","received_events_url":"https://api.github.com/users/openvcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvcloud/0-templates","description":null,"fork":false,"url":"https://api.github.com/repos/openvcloud/0-templates","forks_url":"https://api.github.com/repos/openvcloud/0-templates/forks","keys_url":"https://api.github.com/repos/openvcloud/0-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvcloud/0-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvcloud/0-templates/teams","hooks_url":"https://api.github.com/repos/openvcloud/0-templates/hooks","issue_events_url":"https://api.github.com/repos/openvcloud/0-templates/issues/events{/number}","events_url":"https://api.github.com/repos/openvcloud/0-templates/events","assignees_url":"https://api.github.com/repos/openvcloud/0-templates/assignees{/user}","branches_url":"https://api.github.com/repos/openvcloud/0-templates/branches{/branch}","tags_url":"https://api.github.com/repos/openvcloud/0-templates/tags","blobs_url":"https://api.github.com/repos/openvcloud/0-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvcloud/0-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvcloud/0-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvcloud/0-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvcloud/0-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/openvcloud/0-templates/languages","stargazers_url":"https://api.github.com/repos/openvcloud/0-templates/stargazers","contributors_url":"https://api.github.com/repos/openvcloud/0-templates/contributors","subscribers_url":"https://api.github.com/repos/openvcloud/0-templates/subscribers","subscription_url":"https://api.github.com/repos/openvcloud/0-templates/subscription","commits_url":"https://api.github.com/repos/openvcloud/0-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvcloud/0-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvcloud/0-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvcloud/0-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvcloud/0-templates/contents/{+path}","compare_url":"https://api.github.com/repos/openvcloud/0-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvcloud/0-templates/merges","archive_url":"https://api.github.com/repos/openvcloud/0-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvcloud/0-templates/downloads","issues_url":"https://api.github.com/repos/openvcloud/0-templates/issues{/number}","pulls_url":"https://api.github.com/repos/openvcloud/0-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/openvcloud/0-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/openvcloud/0-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvcloud/0-templates/labels{/name}","releases_url":"https://api.github.com/repos/openvcloud/0-templates/releases{/id}","deployments_url":"https://api.github.com/repos/openvcloud/0-templates/deployments","created_at":"2018-01-31T12:02:17Z","updated_at":"2018-03-28T13:24:19Z","pushed_at":"2018-03-29T13:34:50Z","git_url":"git://github.com/openvcloud/0-templates.git","ssh_url":"git@github.com:openvcloud/0-templates.git","clone_url":"https://github.com/openvcloud/0-templates.git","svn_url":"https://github.com/openvcloud/0-templates","homepage":null,"size":239,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/85"},"html":{"href":"https://github.com/openvcloud/0-templates/pull/85"},"issue":{"href":"https://api.github.com/repos/openvcloud/0-templates/issues/85"},"comments":{"href":"https://api.github.com/repos/openvcloud/0-templates/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openvcloud/0-templates/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/openvcloud/0-templates/statuses/6ef36b034b2991667a56943e571022129e05a86c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"john-kheir"}}