Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C42917E3D for ; Wed, 23 Sep 2015 09:32:15 +0000 (UTC) Received: (qmail 91600 invoked by uid 500); 23 Sep 2015 09:31:53 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 91554 invoked by uid 500); 23 Sep 2015 09:31:53 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 91541 invoked by uid 99); 23 Sep 2015 09:31:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2015 09:31:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0261AE0063; Wed, 23 Sep 2015 09:31:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sanjeev@apache.org To: commits@cloudstack.apache.org Date: Wed, 23 Sep 2015 09:31:52 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: updated refs/heads/master to 2f7852b Repository: cloudstack Updated Branches: refs/heads/master 1a474374b -> 2f7852bc5 CLOUDSTACK-8893: Fixing script as per the latest functionality Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fbc2e2e9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fbc2e2e9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fbc2e2e9 Branch: refs/heads/master Commit: fbc2e2e983938e6a16b7e44eb19db9e659b7a570 Parents: 1a47437 Author: sanjeev Authored: Tue Sep 22 14:47:37 2015 +0530 Committer: sanjeev Committed: Wed Sep 23 11:52:08 2015 +0530 ---------------------------------------------------------------------- test/integration/smoke/test_vm_snapshots.py | 32 ++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fbc2e2e9/test/integration/smoke/test_vm_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py index 93f1c3e..79e8173 100644 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@ -19,7 +19,7 @@ from marvin.codes import FAILED, KVM, PASS from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.utils import random_gen, cleanup_resources, validateList +from marvin.lib.utils import random_gen, cleanup_resources, validateList, is_snapshot_on_nfs from marvin.lib.base import (Account, ServiceOffering, VirtualMachine, @@ -28,7 +28,8 @@ from marvin.lib.base import (Account, Snapshot) from marvin.lib.common import (get_zone, get_domain, - get_template) + get_template, + list_snapshots) import time @@ -337,6 +338,7 @@ class TestSnapshots(cloudstackTestCase): def setUp(self): self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() self.cleanup = [] if self.unsupportedHypervisor: @@ -390,9 +392,25 @@ class TestSnapshots(cloudstackTestCase): self.assertEqual(validateList(volumes)[0], PASS, "Failed to get root volume of the VM") - volume = volumes[0] - - with self.assertRaises(Exception): - Snapshot.create(self.apiclient, - volume_id=volume.id) + snapshot = Snapshot.create( + self.apiclient, + volumes[0].id, + account=self.account.name, + domainid=self.account.domainid + ) + self.debug("Snapshot created: ID - %s" % snapshot.id) + snapshots = list_snapshots( + self.apiclient, + id=snapshot.id + ) + self.assertEqual( + validateList(snapshots)[0], + PASS, + "Invalid snapshot list" + ) + self.assertEqual( + snapshots[0].id, + snapshot.id, + "Check resource id in list resources call" + ) return