예제 #1
0

import logging
import unittest
from nose.plugins.attrib import attr
from fuelweb_test.integration.base_node_test_case import BaseNodeTestCase
from fuelweb_test.integration.decorators import snapshot_errors, \
    debug, fetch_logs

logging.basicConfig(
    format=':%(lineno)d: %(asctime)s %(message)s',
    level=logging.DEBUG
)

logger = logging.getLogger(__name__)
logwrap = debug(logger)


class TestNode(BaseNodeTestCase):
    @snapshot_errors
    @logwrap
    @fetch_logs
    @attr(releases=['centos'], test_thread='thread_4')
    def test_ha_cluster_flat(self):
        cluster_id = self.prepare_environment(
            name="ha_flat",
            mode="ha_compact",
            settings={
                'nodes': {
                    'slave-01': ['controller'],
                    'slave-02': ['controller'],
예제 #2
0
#
#         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 logging
from fuelweb_test.helpers import HTTPClient
from fuelweb_test.integration.decorators import debug, json_parse
from fuelweb_test.settings import OPENSTACK_RELEASE

logger = logging.getLogger(__name__)
logwrap = debug(logger)


class NailgunClient(object):
    def __init__(self, ip):
        self.client = HTTPClient(url="http://%s:8000" % ip)
        super(NailgunClient, self).__init__()

    @logwrap
    def get_root(self):
        return self.client.get("/")

    @logwrap
    @json_parse
    def list_nodes(self):
        return self.client.get("/api/nodes/")