slavkap commented on code in PR #7170:
URL: https://github.com/apache/cloudstack/pull/7170#discussion_r1098396456


##########
test/integration/smoke/test_host_control_state.py:
##########
@@ -250,3 +255,234 @@ def test_router_host_control_state(self):
 
         self.enable_host(host_id)
         self.verify_router_host_control_state(router.id, "Enabled")
+
+
+class TestAutoEnableDisableHost(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.testClient = super(TestAutoEnableDisableHost, 
cls).getClsTestClient()
+        cls.apiclient = cls.testClient.getApiClient()
+        cls.services = cls.testClient.getParsedTestDataConfig()
+        # Get Zone, Domain and templates
+        cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        cls.hostConfig = 
cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
+        if cls.hypervisor.lower() not in ['kvm']:
+            cls.hypervisorNotSupported = True
+            return
+
+        cls.template = get_template(
+            cls.apiclient,
+            cls.zone.id,
+            cls.hypervisor
+        )
+
+        cls.logger = logging.getLogger('TestAutoEnableDisableHost')
+
+        cls._cleanup = [

Review Comment:
   The _cleanup isn't used also



##########
test/integration/smoke/test_host_control_state.py:
##########
@@ -250,3 +255,234 @@ def test_router_host_control_state(self):
 
         self.enable_host(host_id)
         self.verify_router_host_control_state(router.id, "Enabled")
+
+
+class TestAutoEnableDisableHost(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.testClient = super(TestAutoEnableDisableHost, 
cls).getClsTestClient()
+        cls.apiclient = cls.testClient.getApiClient()
+        cls.services = cls.testClient.getParsedTestDataConfig()
+        # Get Zone, Domain and templates
+        cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        cls.hostConfig = 
cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
+        if cls.hypervisor.lower() not in ['kvm']:
+            cls.hypervisorNotSupported = True
+            return
+
+        cls.template = get_template(

Review Comment:
   The template isn't used



##########
test/integration/smoke/test_host_control_state.py:
##########
@@ -250,3 +255,234 @@ def test_router_host_control_state(self):
 
         self.enable_host(host_id)
         self.verify_router_host_control_state(router.id, "Enabled")
+
+
+class TestAutoEnableDisableHost(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.testClient = super(TestAutoEnableDisableHost, 
cls).getClsTestClient()
+        cls.apiclient = cls.testClient.getApiClient()
+        cls.services = cls.testClient.getParsedTestDataConfig()
+        # Get Zone, Domain and templates
+        cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
+        cls.hostConfig = 
cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
+        if cls.hypervisor.lower() not in ['kvm']:
+            cls.hypervisorNotSupported = True
+            return
+
+        cls.template = get_template(
+            cls.apiclient,
+            cls.zone.id,
+            cls.hypervisor
+        )
+
+        cls.logger = logging.getLogger('TestAutoEnableDisableHost')
+
+        cls._cleanup = [
+        ]
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        super(TestAutoEnableDisableHost, cls).tearDownClass()
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()

Review Comment:
   Probably you have to remove the whole implementation of the setUp() method. 
You already have the `apiclient` from the `setUpClass()` and the `self.cleanup` 
isn't used



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to