aboutsummaryrefslogtreecommitdiffstats
path: root/network/management.yaml
blob: 77fcd4ea930b9d9818e904b1c177c756d575089e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
heat_template_version: ocata

description: >
  Management network. System administration, SSH, DNS, NTP, etc. This network
  would usually be the default gateway for the non-controller nodes.

parameters:
  # the defaults here work for static IP assignment (IPAM) only
  ManagementNetCidr:
    default: '10.0.1.0/24'
    description: Cidr for the management network.
    type: string
  ManagementNetValueSpecs:
    default: {'provider:physical_network': 'management', 'provider:network_type': 'flat'}
    description: Value specs for the management network.
    type: json
  ManagementNetAdminStateUp:
    default: false
    description: The admin state of the network.
    type: boolean
  ManagementNetEnableDHCP:
    default: false
    description: Whether to enable DHCP on the associated subnet.
    type: boolean
  ManagementNetShared:
    default: false
    description: Whether this network is shared across all tenants.
    type: boolean
  ManagementNetName:
    default: management
    description: The name of the management network.
    type: string
  ManagementSubnetName:
    default: management_subnet
    description: The name of the management subnet in Neutron.
    type: string
  ManagementAllocationPools:
    default: [{'start': '10.0.1.4', 'end': '10.0.1.250'}]
    description: Ip allocation pool range for the management network.
    type: json
  ManagementInterfaceDefaultRoute:
    default: null
    description: The default route of the management network.
    type: string

resources:
  ManagementNetwork:
    type: OS::Neutron::Net
    properties:
      admin_state_up: {get_param: ManagementNetAdminStateUp}
      name: {get_param: ManagementNetName}
      shared: {get_param: ManagementNetShared}
      value_specs: {get_param: ManagementNetValueSpecs}

  ManagementSubnet:
    type: OS::Neutron::Subnet
    properties:
      cidr: {get_param: ManagementNetCidr}
      enable_dhcp: {get_param: ManagementNetEnableDHCP}
      name: {get_param: ManagementSubnetName}
      network: {get_resource: ManagementNetwork}
      allocation_pools: {get_param: ManagementAllocationPools}
      gateway_ip: {get_param: ManagementInterfaceDefaultRoute}

outputs:
  OS::stack_id:
    description: Neutron management network
    value: {get_resource: ManagementNetwork}
="n">GetoptError: usage() for opt, arg in opts: if opt in ('-h', '--help'): usage() elif opt in ('-x', '--xml'): xml_file = arg elif opt in ('-p', '--pod'): pod = arg elif opt in ('-i', '--installer'): installer = arg elif opt in ('-s', '--scenario'): scenario = arg else: usage() if not all(x is not None for x in (xml_file, pod, installer, scenario)): usage() with open(xml_file, "r") as myfile: xml_input = myfile.read().replace('\n', '') # dictionary populated with data from xml file all_data = xmltodict.parse(xml_input)['robot'] data = parse_suites(all_data['suite']['suite']) data['description'] = all_data['suite']['@name'] data['version'] = all_data['@generator'] data['test_project'] = "functest" data['case_name'] = "ODL" data['pod_name'] = pod data['installer'] = installer json.dumps(data, indent=4, separators=(',', ': ')) # Only used from container, we can set up absolute path with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f: functest_yaml = yaml.safe_load(f) f.close() database = functest_yaml.get("results").get("test_db_url") build_tag = functest_utils.get_build_tag() try: # example: # python odlreport2db.py -x ~/Pictures/Perso/odl/output3.xml # -i fuel # -p opnfv-jump-2 # -s os-odl_l2-ha version = functest_utils.get_version() # success criteria for ODL = 100% of tests OK status = "failed" try: tests_passed = 0 tests_failed = 0 for v in data['details']: if v['test_status']['@status'] == "PASS": tests_passed += 1 else: tests_failed += 1 if (tests_failed < 1): status = "passed" except: print("Unable to set criteria" % sys.exc_info()[0]) functest_utils.push_results_to_db(database, "functest", data['case_name'], None, data['pod_name'], version, scenario, status, build_tag, data) except: print("Error pushing results into Database '%s'" % sys.exc_info()[0]) if __name__ == "__main__": main(sys.argv[1:])