cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhtyd <...@git.apache.org>
Subject [GitHub] cloudstack pull request: CLOUDSTACK-9299: Out-of-band Management f...
Date Tue, 03 May 2016 08:17:27 GMT
Github user rhtyd commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1502#discussion_r61850255
  
    --- Diff: test/integration/smoke/test_outofbandmanagement.py ---
    @@ -0,0 +1,561 @@
    +# 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.
    +
    +
    +import marvin
    +from marvin.cloudstackTestCase import *
    +from marvin.cloudstackAPI import *
    +from marvin.lib.utils import *
    +from marvin.lib.base import *
    +from marvin.lib.common import *
    +from marvin.lib.utils import (random_gen)
    +from nose.plugins.attrib import attr
    +
    +from ipmisim.ipmisim import IpmiServerContext, IpmiServer, ThreadedIpmiServer
    +
    +import socket
    +import sys
    +import thread
    +import time
    +
    +
    +class TestOutOfBandManagement(cloudstackTestCase):
    +    """ Test cases for out of band management
    +    """
    +
    +    def setUp(self):
    +        self.apiclient = self.testClient.getApiClient()
    +        self.hypervisor = self.testClient.getHypervisorInfo()
    +        self.dbclient = self.testClient.getDbConnection()
    +        self.services = self.testClient.getParsedTestDataConfig()
    +        self.mgtSvrDetails = self.config.__dict__["mgtSvr"][0].__dict__
    +
    +        self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests())
    +        self.host = None
    +        self.server = None
    +
    +        # use random port for ipmisim
    +        s = socket.socket()
    +        s.bind(('', 0))
    +        self.serverPort = s.getsockname()[1]
    +        s.close()
    +
    +        self.cleanup = []
    +
    +
    +    def tearDown(self):
    +        try:
    +            self.dbclient.execute("delete from oobm where port=%d" % self.getIpmiServerPort())
    +            self.dbclient.execute("delete from mshost_peer where peer_runid=%s" % self.getFakeMsRunId())
    +            self.dbclient.execute("delete from mshost where runid=%s" % self.getFakeMsRunId())
    +            self.dbclient.execute("delete from cluster_details where name='outOfBandManagementEnabled'")
    +            self.dbclient.execute("delete from data_center_details where name='outOfBandManagementEnabled'")
    +            cleanup_resources(self.apiclient, self.cleanup)
    +            if self.server:
    +                self.server.shutdown()
    +                self.server.server_close()
    +        except Exception as e:
    +            raise Exception("Warning: Exception during cleanup : %s" % e)
    +
    +
    +    def getFakeMsId(self):
    +        return 1234567890
    --- End diff --
    
    fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message