- rally_bench_base_url = 'https://git.opnfv.org/cgit/functest/plain/testcases/VIM/OpenStack/CI/suites/'
- bench_tests = ['authenticate', 'cinder', 'glance', 'heat', 'keystone', 'neutron', 'nova', 'quotas', 'requests', 'tempest', 'vm']
- for i in bench_tests:
- rally_bench_url = rally_bench_base_url + "opnfv-" + i + ".json"
- logger.debug("Downloading %s" %rally_bench_url)
- if not download_url(rally_bench_url,BENCH_TESTS_DIR):
- return False
-
- logger.info("Downloading OLD tests...")
- odl_base_url = 'https://git.opnfv.org/cgit/functest/plain/testcases/Controllers/ODL/CI/'
- odl_tests = ['create_venv.sh', 'requirements.pip', 'start_tests.sh', 'test_list.txt']
- for i in odl_tests:
- odl_url = odl_base_url + i
- logger.debug("Downloading %s" %odl_url)
- if not download_url(odl_url,ODL_DIR):
- return False
-
- return True
-
-
-
-def create_private_neutron_net(neutron):
- try:
- neutron.format = 'json'
- logger.debug('Creating Neutron network %s...' % NEUTRON_PRIVATE_NET_NAME)
- json_body = {'network': {'name': NEUTRON_PRIVATE_NET_NAME,
- 'admin_state_up': True}}
- netw = neutron.create_network(body=json_body)
- net_dict = netw['network']
- network_id = net_dict['id']
- logger.debug("Network '%s' created successfully" % network_id)
-
- logger.debug('Creating Subnet....')
- json_body = {'subnets': [{'name': NEUTRON_PRIVATE_SUBNET_NAME, 'cidr': NEUTRON_PRIVATE_SUBNET_CIDR,
- 'ip_version': 4, 'network_id': network_id}]}
-
- subnet = neutron.create_subnet(body=json_body)
- subnet_id = subnet['subnets'][0]['id']
- logger.debug("Subnet '%s' created successfully" % subnet_id)
-
-
- logger.debug('Creating Router...')
- json_body = {'router': {'name': ROUTER_NAME, 'admin_state_up': True}}
- router = neutron.create_router(json_body)
- router_id = router['router']['id']
- logger.debug("Router '%s' created successfully" % router_id)
-
- logger.debug('Adding router to subnet...')
- json_body = {"subnet_id": subnet_id}
- neutron.add_interface_router(router=router_id, body=json_body)
- logger.debug("Interface added successfully.")
-
- except:
- print "Error:", sys.exc_info()[0]