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 CD08A1053E for ; Mon, 18 Nov 2013 08:51:32 +0000 (UTC) Received: (qmail 88893 invoked by uid 500); 18 Nov 2013 08:50:46 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 88530 invoked by uid 500); 18 Nov 2013 08:50:38 -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 87406 invoked by uid 99); 18 Nov 2013 08:50:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Nov 2013 08:50:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 91A431FE3E; Mon, 18 Nov 2013 08:50:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tsp@apache.org To: commits@cloudstack.apache.org Date: Mon, 18 Nov 2013 08:50:55 -0000 Message-Id: <83be7a79fffd4be8a2ef9068dc50ece4@git.apache.org> In-Reply-To: <6dbdf506adf84c8ba80bc3a55ac0c415@git.apache.org> References: <6dbdf506adf84c8ba80bc3a55ac0c415@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] [abbrv] git commit: updated refs/heads/marvin_refactor to b784012 marvin_refactor: simple vpc lifecycle test Signed-off-by: Prasanna Santhanam Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f00fafe4 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f00fafe4 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f00fafe4 Branch: refs/heads/marvin_refactor Commit: f00fafe43c4b9d17d56972975d81ccbcd00a1777 Parents: b978188 Author: Prasanna Santhanam Authored: Wed Oct 2 19:46:33 2013 +0530 Committer: Prasanna Santhanam Committed: Thu Oct 31 13:54:26 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/test/test_vpc_life_cycle.py | 101 +++++++++++++++++++ 1 file changed, 101 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f00fafe4/tools/marvin/marvin/test/test_vpc_life_cycle.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/test/test_vpc_life_cycle.py b/tools/marvin/marvin/test/test_vpc_life_cycle.py new file mode 100644 index 0000000..d247673 --- /dev/null +++ b/tools/marvin/marvin/test/test_vpc_life_cycle.py @@ -0,0 +1,101 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from marvin.cloudstackTestCase import * +from marvin.factory.data.account import * +from marvin.factory.data.vm import * +from should_dsl import * +from marvin.util import * +from nose.plugins.attrib import attr + + +class TestVpcLifeCycle(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cls.apiclient = super(TestVpcLifeCycle, cls).getClsTestClient().getApiClient() + cls.zoneid = get_zone(cls.apiclient).id + cls.templateid = get_template(cls.apiclient).id, + cls.serviceofferingid = get_service_offering(cls.apiclient).id, + cls.account = UserAccount( + apiclient=cls.apiclient + ) + + @attr(tags='debug') + def test_deployvm(self): + vm = VpcVirtualMachine( + apiclient=self.apiclient, + account=self.account.name, + domainid=self.account.domainid, + zoneid=self.zoneid, + templateid=self.templateid, + serviceofferingid=self.serviceofferingid + ) + vm.state | should | equal_to('Running') + + def test_stopvm(self): + vm = VpcVirtualMachine( + apiclient=self.apiclient, + account=self.account.name, + domainid=self.account.domainid, + zoneid=self.zoneid, + templateid=self.templateid, + serviceofferingid=self.serviceofferingid + ) + vm.stop() + vm.state | should | equal_to('Stopped') + + def test_startvm(self): + vm = VpcVirtualMachine( + apiclient=self.apiclient, + account=self.account.name, + domainid=self.account.domainid, + zoneid=self.zoneid, + templateid=self.templateid, + serviceofferingid=self.serviceofferingid + ) + vm.stop() + vm.start() + vm.state | should | equal_to('Running') + + def test_rebootvm(self): + vm = VpcVirtualMachine( + apiclient=self.apiclient, + account=self.account.name, + domainid=self.account.domainid, + zoneid=self.zoneid, + templateid=self.templateid, + serviceofferingid=self.serviceofferingid + ) + vm.reboot() + vm.state | should | equal_to('Running') + + def test_destroyvm(self): + vm = VpcVirtualMachine( + apiclient=self.apiclient, + account=self.account.name, + domainid=self.account.domainid, + zoneid=self.zoneid, + templateid=self.templateid, + serviceofferingid=self.serviceofferingid + ) + vm.destroy() + vm.state | should | equal_to('Destroyed') + + @classmethod + def tearDownClass(cls): + cls.account.delete() \ No newline at end of file