Exemple #1
0
 def setUp(self):
     self.filename = util.rel_to_file('test_config.yaml')
     self.ethalon = dict(setting_1=1,
                         setting_2=2,
                         complex_setting=dict(cs_1=3, cs_2=4, cs_3=5),
                         list_setting=['a', 'b', 'c'])
     self.args = cfg.DefaultYAMLConfig(self.filename)
Exemple #2
0
import occo.util as util
import occo.constants.status as nodestate
import occo.util.config as config
from occo.infobroker.uds import UDS
import occo.infobroker.rediskvstore
from functools import wraps
import uuid, sys
import io as sio
import unittest
import nose
import logging
import logging.config

CFG_FILE=util.rel_to_file('test_configuration.yaml')
TEST_CFG_FILE=util.rel_to_file('test_input.yaml')
infracfg = config.DefaultYAMLConfig(TEST_CFG_FILE)
infracfg.parse_args([])
cfg = config.DefaultYAMLConfig(CFG_FILE)
cfg.parse_args([])

logging.config.dictConfig(cfg.logging)

log = logging.getLogger()

class SingletonLocalInstruction(object):
    def __init__(self, parent_ip, **kwargs):
        self.parent_ip = parent_ip
        self.__dict__.update(kwargs)
    def perform(self):
        raise NotImplementedError()
class CreateInfrastructureSLI(SingletonLocalInstruction):
Exemple #3
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 occo.util.config as config
import occo.util as util
import logging
import logging.config
import occo.infobroker as ib
import occo.infraprocessor.synchronization.primitives as sp

cfg = config.DefaultYAMLConfig(util.rel_to_file('test.yaml'))

logging.config.dictConfig(cfg.logging)

log = logging.getLogger('occo.unittests')

import uuid
def uid():
    return str(uuid.uuid4())

import yaml
dummydata = yaml.load(
    """
    backends.auth_data : {}
    config_manager.aux_data : {}
    node.resource.address: null
Exemple #4
0
### limitations under the License.

import unittest
import occo.util as util
import occo.exceptions as exc
import occo.util.communication as comm
import occo.util.communication.mq as mq
import occo.util.config as config
import itertools as it
import threading
import logging
import logging.config
import uuid
import time

cfg = config.DefaultYAMLConfig(util.rel_to_file('comm_test_cfg.yaml'))

logging.config.dictConfig(cfg.logging)

log = logging.getLogger()

def dummy(*args, **kwargs):
    pass

class MQBootstrapTest(unittest.TestCase):
    def setUp(self):
        self.test_config = cfg.default_mqconfig
        self.fail_config_2 = dict(protocol='amqp', processor=None)
    def test_inst(self):
        list(map(lambda cls1_cls2: \
                self.assertEqual(