def dummy_pools(): raw_pools = import_conf('tests/test_pools.yaml') dummy_pools = [ Pool(name='{}{}'.format(PREFIX, name), **data) for name, data in raw_pools.items() ] assert dummy_pools yield dummy_pools
def dummy_nodes(): raw_nodes = import_conf('tests/test_nodes.yaml') dummy_nodes = [ Node(name='{}{}'.format(PREFIX, name), address=address) for name, address in raw_nodes.items() ] assert dummy_nodes yield dummy_nodes
def dummy_profiles(): raw_profiles = import_conf('tests/test_profiles.yaml') dummy_profiles = [ Profile(name='{}{}'.format(PREFIX, name), partition='Common', **data) for name, data in raw_profiles.items() ] dummy_profiles.sort(key=lambda x: x.name) assert dummy_profiles ## must not be empty yield dummy_profiles
def create_environments(bigip, conf_path): test_env = import_conf(conf_path) for partition, data in test_env.get('partitions').items(): create_environment(bigip, partition, data) bigip.retreive_contexts()
# not synced for device in cluster_devices: create_vlans(device, partition, d_map) create_route_domains(device, partition, d_map) bigip.sync() #create SelfIP local-only firts ## Master (as 0: in vlans: selfips) selfips = format_selfips(partition, d_map) create_selfips(bigip, selfips[0]) ## Slave (as 1) create_selfips(cluster_devices[0], selfips[1]) ## VIP create_selfips(bigip, selfips['vip']) bigip.sync() def create_environments(bigip, conf_path): test_env = import_conf(conf_path) for partition, data in test_env.get('partitions').items(): create_environment(bigip, partition, data) bigip.retreive_contexts() if __name__ == '__main__': conf = import_conf('conf.dev') bigip = Bigip( conf.get('equipments')[0], conf.get('user'), conf.get('passwd')) create_environments(bigip, './tests/test_env.yaml')
def dummy_rules(): raw_rules = import_conf('tests/test_rules.yaml') dummy_rules = [Rule(name='{}{}'.format(PREFIX, name), **data) for name, data in raw_rules.items()] assert dummy_rules yield dummy_rules
def infra(): conf = import_conf('./conf.dev') infra = Infra(conf) yield infra
def dummy_monitors(): raw_monitors = import_conf('tests/test_monitors.yaml') dummy_monitors = [Monitor(name=name, partition='Common', **data) for name, data in raw_monitors.items()] assert dummy_monitors #must not be empty yield dummy_monitors
def env(): yield import_conf('./tests/test_env.yaml')