Create floating ip by normal user
In real use case, it should be the end user who will create floating
ip and associate with loadbalancer vip.
Also use config_drive when creating backend server, to keep consistent
with amphora creation in octavia itself.
Tested in devstack.
Change-Id: I2cbee37f494a5775a96f8c285f0e52c0b2550d5b
diff --git a/octavia_tempest_plugin/config.py b/octavia_tempest_plugin/config.py
index 54eeabf..c722b97 100644
--- a/octavia_tempest_plugin/config.py
+++ b/octavia_tempest_plugin/config.py
@@ -57,10 +57,6 @@
default=900,
help='Timeout in seconds to wait for a '
'loadbalancer to build.'),
- cfg.BoolOpt('premade_server',
- default=False,
- help='Allows us to use an already provisioned server to test '
- 'loadbalancing.'),
cfg.StrOpt('premade_server_ip',
default=None,
help='IP of the premade server.'),
diff --git a/octavia_tempest_plugin/tests/server_util.py b/octavia_tempest_plugin/tests/server_util.py
index 2500195..54fa4f8 100644
--- a/octavia_tempest_plugin/tests/server_util.py
+++ b/octavia_tempest_plugin/tests/server_util.py
@@ -208,9 +208,13 @@
if wait_until is None:
wait_until = 'ACTIVE'
- body = clients.servers_client.create_server(name=name, imageRef=image_id,
- flavorRef=flavor,
- **kwargs)
+ body = clients.servers_client.create_server(
+ name=name,
+ imageRef=image_id,
+ flavorRef=flavor,
+ config_drive=True,
+ **kwargs
+ )
server = rest_client.ResponseBody(body.response, body['server'])
def _setup_validation_fip():
diff --git a/octavia_tempest_plugin/tests/v2/base.py b/octavia_tempest_plugin/tests/v2/base.py
index 7fec324..fccca0c 100644
--- a/octavia_tempest_plugin/tests/v2/base.py
+++ b/octavia_tempest_plugin/tests/v2/base.py
@@ -67,7 +67,6 @@
cls.interfaces_client = cls.os_roles_lbmember.interfaces_client
cls.sg_rule_client = cls.os_roles_lbmember.security_group_rules_client
cls.floatingip_client = cls.os_roles_lbmember.floating_ips_client
- cls.floatingip_adm_client = cls.os_admin.floating_ips_client
cls.routers_adm_client = cls.os_admin.routers_client
if CONF.identity.auth_version == 'v3':
@@ -451,17 +450,17 @@
self.assertEqual(1, len(set(response_counts.values())))
def _delete_floatingip(self, floating_ip):
- self.floatingip_adm_client.update_floatingip(
+ self.floatingip_client.update_floatingip(
floating_ip,
port_id=None
)
test_utils.call_and_ignore_notfound_exc(
- self.floatingip_adm_client.delete_floatingip, floating_ip
+ self.floatingip_client.delete_floatingip, floating_ip
)
def _associate_floatingip(self):
# Associate floatingip with loadbalancer vip
- floatingip = self.floatingip_adm_client.create_floatingip(
+ floatingip = self.floatingip_client.create_floatingip(
floating_network_id=CONF.network.public_network_id
)['floatingip']
floatip_vip = floatingip['floating_ip_address']
@@ -469,7 +468,7 @@
LOG.debug('Floating ip %s created.', floatip_vip)
- self.floatingip_adm_client.update_floatingip(
+ self.floatingip_client.update_floatingip(
floatingip['id'],
port_id=self.vip_port
)