You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ts...@apache.org on 2013/11/18 09:50:55 UTC

[48/50] [abbrv] git commit: updated refs/heads/marvin_refactor to b784012

marvin_refactor: simple vpc lifecycle test

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


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 <ts...@apache.org>
Authored: Wed Oct 2 19:46:33 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
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