Exemple #1
0
    def test13_load_ucs_manager_config(self):
        """
        loads the test configuration into the UCS Manger
        """
        UCSM_USER, UCSM_PASS = get_ucs_cred()
        UCSM_IP = fit_common.fitcfg().get('ucsm_ip')

        handle = ucshandle.UcsHandle(UCSM_IP, UCSM_USER, UCSM_PASS)
        self.assertTrue(handle.login(), 'Failed to log in to UCS Manager!')
        path, file = os.path.split(fit_common.fitcfg()['ucsm_config_file'])
        try:
            import_ucs_backup(handle, file_dir=path, file_name=file)
        except Exception as e:
            log.info_5("error trying to configure UCSPE, continue testing")
            log.info_5(str(e))
        self.assertTrue(handle.logout(), 'Failed to log out from UCS Manager!')
Exemple #2
0
from common import fit_common
import time
from nosedep import depends
import flogging
from nose.plugins.attrib import attr
from config.settings import get_ucs_cred
from ucsmsdk import ucshandle
from ucsmsdk.utils.ucsbackup import import_ucs_backup
import os

logs = flogging.get_loggers()

INITIAL_NODES = {}
INITIAL_OBMS = {}
UCSM_IP = fit_common.fitcfg().get('ucsm_ip')
UCSM_USER, UCSM_PASS = get_ucs_cred()
UCS_SERVICE_URI = fit_common.fitcfg().get('ucs_service_uri')


def get_nodes_utility():
    """
    Takes inventory of the nodes available before discovering the UCS nodes.
    We will restore the nodes collection to this snapshot
    :return: return False on failure, or True otherwise
    """
    api_data = fit_common.rackhdapi('/api/2.0/nodes')
    if api_data['status'] != 200:
        logs.error(
            "get /api/2.0/nodes returned status {}, expected 200".format(
                api_data['status']))
        return False
from common import fit_common
import time
from nosedep import depends
import flogging
from nose.plugins.attrib import attr
from config.settings import get_ucs_cred
from ucsmsdk import ucshandle
from ucsmsdk.utils.ucsbackup import import_ucs_backup
import os

logs = flogging.get_loggers()

INITIAL_NODES = {}
INITIAL_OBMS = {}
UCSM_IP = fit_common.fitcfg().get('ucsm_ip')
UCSM_USER, UCSM_PASS = get_ucs_cred()
UCS_SERVICE_URI = fit_common.fitcfg().get('ucs_service_uri')


def get_nodes_utility():
    """
    Takes inventory of the nodes available before discovering the UCS nodes.
    We will restore the nodes collection to this snapshot
    :return: return False on failure, or True otherwise
    """
    api_data = fit_common.rackhdapi('/api/2.0/nodes')
    if api_data['status'] != 200:
        logs.error("get /api/2.0/nodes returned status {}, expected 200".format(api_data['status']))
        return False

    for node in api_data['json']: