Commit f998eb34 by edems

Network test

parent 7696614a
Pipeline #714 failed with stage
in 37 seconds
...@@ -16,6 +16,19 @@ subnet_manager = OpenstackSubnetManager(os) ...@@ -16,6 +16,19 @@ subnet_manager = OpenstackSubnetManager(os)
port_manager = OpenstackPortManager(os) port_manager = OpenstackPortManager(os)
floating_ip_manager = OpenstackFloatingIPManager(os) floating_ip_manager = OpenstackFloatingIPManager(os)
'''
Network setup steps:
- Create inner network
- Create subnet for inner network
- Create router
- Add public network to router as gateway
- Add inner subnet to router as interface
- Add interface (or port?) to vm
- Get the port of the vm
- Create floating ip to public network
- Associate floating ip and vm port
'''
#router = router_manager.create() #router = router_manager.create()
router = router_manager.get('3ee87bcd-b1b5-4e14-86a1-ce691bd3e5a2') router = router_manager.get('3ee87bcd-b1b5-4e14-86a1-ce691bd3e5a2')
...@@ -24,7 +37,7 @@ print('\t%s' % router) ...@@ -24,7 +37,7 @@ print('\t%s' % router)
#network = network_manager.create() #network = network_manager.create()
public_network = network_manager.get('3b349c93-8b2c-4abd-b8ce-22b7db4cca98') public_network = network_manager.get('3b349c93-8b2c-4abd-b8ce-22b7db4cca98')
inner_network = network_manager.get('ac15d5e2-f32e-4ea3-9fa5-345d3e147aa5') inner_network = network_manager.get('8df0d7ab-7d56-4496-aca0-317af66b3ebc')
print('Network:') print('Network:')
print('\tPublic: %s' % public_network) print('\tPublic: %s' % public_network)
...@@ -32,25 +45,25 @@ print('\tInner: %s' % inner_network) ...@@ -32,25 +45,25 @@ print('\tInner: %s' % inner_network)
#subnet = subnet_manager.create(network.id, 4, '10.34.0.0/16') #subnet = subnet_manager.create(network.id, 4, '10.34.0.0/16')
public_subnet = subnet_manager.get('8a7e05f8-6358-48f7-9104-990d350425a0') public_subnet = subnet_manager.get('8a7e05f8-6358-48f7-9104-990d350425a0')
inner_subnet = subnet_manager.get('b7650962-4323-475c-9ee6-08d64e2c8577') inner_subnet = subnet_manager.get('34911571-c929-4433-b4e6-305fcb585a91') #create(inner_network.id, 4, '10.0.0.0/24')
print('Subnet:') print('Subnet:')
print('\tPublic: %s' % public_subnet) print('\tPublic: %s' % public_subnet)
print('\tInner: %s' % inner_subnet) print('\tInner: %s' % inner_subnet)
vm_port = port_manager.get('bd1f0753-613d-4ecf-8605-eacc3ca63373') # inner vm_port = port_manager.get('85202d6d-7aa0-44bc-a5eb-78b0519066c5') # inner
print('Port:') print('Port:')
print('\tVM: %s' % vm_port) print('\tVM: %s' % vm_port)
#floating_ip = floating_ip_manager.create(public_network.id) #floating_ip = floating_ip_manager.create(public_network.id)
floating_ip = floating_ip_manager.get('df353eb0-9f0b-4bee-9492-148e29873450') floating_ip = floating_ip_manager.get('fe1e329f-aedb-4b3e-a649-9fec8eb3ece5')
print('Floating IP:') print('Floating IP:')
print('\tFloating IP: %s' % floating_ip) print('\tFloating IP: %s' % floating_ip)
#print(router_manager.add_interface(router.id, subnet.id)) #print(router_manager.add_interface(router.id, inner_subnet.id)) # TODO: fix error msg
#print(router_manager.add_gateway(router.id, public_network.id)) # TODO: fix it! #print(router_manager.add_gateway(router.id, public_network.id)) # TODO: fix it!
# print(floating_ip_manager.update(floating_ip.id, { # print(floating_ip_manager.update(floating_ip.id, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment