def before_all_scenarios(): """ Actions before all scenarios Get the initial time at start the tests """ world.test_time_init = time.strftime("%c") # Remove lettuce log file # file = open('logs/lettuce.log', 'w') # file.write('') # file.close() log = get_logger('terrain', file=True, filename='logs/lettuce.log') world.log = log # Set test utils instances world.cep = Cep(cep_host=world.config['CEP']['host'], cep_port=world.config['CEP']['port'], service=world.config['CEP']['service'], service_path=world.config['CEP']['service_path'], mongo_host=world.config['MongoDB']['host'], mongo_port=world.config['MongoDB']['port'], mongo_db=world.config['MongoDB']['database'], mongo_orion_db_prefix=world.config['MongoOrion']['mongo_database'], mongo_orion_db_collection=world.config['MongoOrion']['mongo_collection'], cep_core_host=world.config['CEP-CORE']['host'], cep_core_port=world.config['CEP-CORE']['port'], log_instance=world.log, log_verbosity=world.config['CEP']['log_level'] ) world.rules_utils = RulesUtils() world.cards_utils = CardsUtils() world.mock_utils = Mock(world.config['Mock']['host'], world.config['Mock']['port'])
def before_all_scenarios(): """ Actions before all scenarios Get the initial time at start the tests """ world.test_time_init = time.strftime("%c") # Remove lettuce log file # file = open('logs/lettuce.log', 'w') # file.write('') # file.close() log = get_logger('terrain', file=True, filename='logs/lettuce.log') world.log = log # Set test utils instances world.cep = Cep( cep_host=world.config['CEP']['host'], cep_port=world.config['CEP']['port'], service=world.config['CEP']['service'], service_path=world.config['CEP']['service_path'], mongo_host=world.config['MongoDB']['host'], mongo_port=world.config['MongoDB']['port'], mongo_db=world.config['MongoDB']['database'], mongo_orion_db_prefix=world.config['MongoOrion']['mongo_database'], mongo_orion_db_collection=world.config['MongoOrion'] ['mongo_collection'], cep_core_host=world.config['CEP-CORE']['host'], cep_core_port=world.config['CEP-CORE']['port'], log_instance=world.log, log_verbosity=world.config['CEP']['log_level']) world.rules_utils = RulesUtils() world.cards_utils = CardsUtils() world.mock_utils = Mock(world.config['Mock']['host'], world.config['Mock']['port'])
def __init__(self, cep_host, cep_port, service, service_path, mongo_host, mongo_port, mongo_db, mongo_orion_db_prefix, mongo_orion_db_collection, cep_core_host, cep_core_port, version_url='/version', notifications_url='/notices', plain_rules_url='/rules', visual_rules_url='/m2m/vrules', core_rules_url='/perseo-core/rules', log_instance=None, log_verbosity='DEBUG'): # initialize logger if log_instance is not None: self.log = log_instance else: self.log = get_logger('cep', log_verbosity) self.cep_url = 'http://{cep_host}:{cep_port}'.format(cep_host=cep_host, cep_port=cep_port) self.cep_core_url = 'http://{cep_core_host}:{cep_core_port}'.format( cep_core_host=cep_core_host, cep_core_port=cep_core_port) self.service = service self.service_path = service_path self.mongo = Mongo(mongo_host, mongo_port, mongo_db) self.mongo_cep_db = mongo_db self.mongo_orion_db = '{mongo_orion_db_prefix}-{service}'.format( mongo_orion_db_prefix=mongo_orion_db_prefix, service=service).lower() self.mongo_orion_db_collection = mongo_orion_db_collection self.version_url = self.cep_url + version_url self.notifications_url = self.cep_url + notifications_url self.plain_rules_url = self.cep_url + plain_rules_url self.visual_rules_url = self.cep_url + visual_rules_url self.core_rule_url = self.cep_core_url + core_rules_url
def __init__(self, cep_host, cep_port, service, service_path, mongo_host, mongo_port, mongo_db, mongo_orion_db_prefix, mongo_orion_db_collection, cep_core_host, cep_core_port, version_url='/version', notifications_url='/notices', plain_rules_url='/rules', visual_rules_url='/m2m/vrules', core_rules_url='/perseo-core/rules', log_instance=None, log_verbosity='DEBUG'): # initialize logger if log_instance is not None: self.log = log_instance else: self.log = get_logger('cep', log_verbosity) self.cep_url = 'http://{cep_host}:{cep_port}'.format(cep_host=cep_host, cep_port=cep_port) self.cep_core_url = 'http://{cep_core_host}:{cep_core_port}'.format(cep_core_host=cep_core_host, cep_core_port=cep_core_port) self.service = service self.service_path = service_path self.mongo = Mongo(mongo_host, mongo_port, mongo_db) self.mongo_cep_db = mongo_db self.mongo_orion_db = '{mongo_orion_db_prefix}-{service}'.format(mongo_orion_db_prefix=mongo_orion_db_prefix, service=service).lower() self.mongo_orion_db_collection = mongo_orion_db_collection self.version_url = self.cep_url + version_url self.notifications_url = self.cep_url + notifications_url self.plain_rules_url = self.cep_url + plain_rules_url self.visual_rules_url = self.cep_url + visual_rules_url self.core_rule_url = self.cep_core_url + core_rules_url
def before_all(): world.log = get_logger('lettuce', world.config['environment']['log_level'], True, True, 'logs/lettuce.log') check_properties() world.entities = None world.attributes_consult = None world.attributes_creation = None world.context_elements = None world.notify_conditions = None world.context_registrations = None world.service = None world.subservice = None world.mock = None world.mock_data = None world.payloads_count = -1 world.response_count = -1 world.cb_count = -1 world.cb = {} world.payloads = {} world.responses = {} world.cb_config_to_start = '' world.cb_pid = get_cb_pid() world.bin_parms = None drop_all_test_databases(world.config['mongo']['host'], int(world.config['mongo']['port']))
def before_all(): # Fixme: this line is comment per changes in external library: cb_utils.py world.log = get_logger('lettuce', world.config['environment']['log_level'], True) #, True, 'logs/lettuce.log') check_properties() world.entities = None world.attributes_consult = None world.attributes_creation = None world.context_elements = None world.notify_conditions = None world.context_registrations = None world.service = None world.subservice = None world.mock = None world.mock_data = None world.payloads_count = -1 world.response_count = -1 world.cb_count = -1 world.cb = {} world.payloads = {} world.responses = {} world.cb_config_to_start = '' world.cb_pid = get_cb_pid() world.bin_parms = None
For those usages not covered by the GNU Affero General Public License please contact with::[[email protected]] """ __author__ = 'Jon Calderin Goñi <*****@*****.**>' from flask import Flask, request, Response import requests import sys import collections from iotqautils.iotqaLogger import get_logger app = Flask(__name__) log = get_logger('proxy') requested = '' last_path = '' history = [] def convert(data): """ Convert from unicode to str interable objects :param data: :return: """ if isinstance(data, basestring): return str(data) elif isinstance(data, collections.Mapping): return dict(map(convert, data.iteritems()))
For those usages not covered by the GNU Affero General Public License please contact with::[[email protected]] """ from iotqautils.accessControl import AC import sys __author__ = 'Jon Calderin Goñi <*****@*****.**>' import time from lettuce import world, before, after from iotqautils.idm_keystone import IdmUtils from iotqautils.iotqaLogger import get_logger from tools.general_utils import start_environment, initialize_keystone, initialize_ac, stop_process, start_proxy, \ stop_environment, show_times, start_mock, reset_test_variables log = get_logger('terrain', file=True, filename='logs/lettuce.log') @before.all def before_all_scenarios(): """ Actions before all scenarios Get the initial time at start the tests """ # Remove lettuce log file file = open('logs/lettuce.log', 'w') file.write('') file.close() world.log = log world.test_time_init = time.strftime("%c") log.debug('Starting environment')
If not, see http://www.gnu.org/licenses/. For those usages not covered by the GNU Affero General Public License please contact with::[[email protected]] """ _author__ = 'Jon Calderin Goñi <*****@*****.**>' from flask import Flask, request, Response import requests import sys import collections from iotqautils.iotqaLogger import get_logger app = Flask(__name__) log = get_logger('proxy') requested = '' last_path = '' history = [] def convert(data): """ Convert from unicode to str interable objects :param data: :return: """ if isinstance(data, basestring): return str(data) elif isinstance(data, collections.Mapping):
For those usages not covered by the GNU Affero General Public License please contact with::[[email protected]] """ from iotqautils.accessControl import AC import sys __author__ = 'Jon Calderin Goñi <*****@*****.**>' import time from lettuce import world, before, after from iotqautils.idm_keystone import IdmUtils from iotqautils.iotqaLogger import get_logger from tools.general_utils import start_environment, initialize_keystone, initialize_ac, stop_process, start_proxy, \ stop_environment, show_times, start_mock, reset_test_variables log = get_logger('terrain', file=True, filename='logs/lettuce.log') @before.all def before_all_scenarios(): """ Actions before all scenarios Get the initial time at start the tests """ # Remove lettuce log file file = open('logs/lettuce.log', 'w') file.write('') file.close() world.log = log world.test_time_init = time.strftime("%c")