Make external network shared and dhcp enabled

Some tests are skipped because the public network is not shared.
Enabling 'shared' option for the network will allow the tests to run.

Enabled dhcp on the public subnet to allow VMs connected to it
obtain ip addresses successfully.

Both changes above are applied only for ovn jobs since for ovs jobs
additionally require some additionall settings, e.g. to ensure that
only a single dhcp server exist on external network. This can be done
in a separate patch if needed.

Adjusted bw_limit external network qos test to use a separate VM on
external network instead of sending traffic from the test container
in order to not depend on specifics on different environments.

Change-Id: I2e6cf51a4dab7eb593362d482e2587d54e4a12d6
This commit is contained in:
Roman Safronov 2024-03-27 18:50:08 +02:00
parent 294aa809f4
commit cc3958263c
2 changed files with 23 additions and 6 deletions

View File

@ -30,6 +30,17 @@ customize_advanced_image(){
fi
}
customize_public_network_and_subnet(){
if [[ $Q_AGENT == "ovn" ]]; then
# Make external network shared with dhcp enabled to allow tests with VMs
# on external network to run. Note, we still keep these settings disabled
# for OVS jobs since they can require additional settings, like ensuring
# that only a single DHCP server is available on the external network.
openstack network set --share $PUBLIC_NETWORK_NAME
openstack subnet set --dhcp $PUBLIC_SUBNET_NAME
fi
}
if [[ "$1" == "stack" ]]; then
case "$2" in
install)
@ -39,6 +50,7 @@ if [[ "$1" == "stack" ]]; then
;;
test-config)
customize_advanced_image
customize_public_network_and_subnet
;;
esac
fi

View File

@ -988,8 +988,12 @@ class QosTestExternalNetwork(QosBaseTest):
super(QosTestExternalNetwork, self).setUp()
self.external_network = self.client.show_network(
CONF.network.public_network_id)['network']
for protocol in [constants.PROTO_NAME_TCP, constants.PROTO_NAME_UDP]:
utils.make_sure_local_port_is_open(protocol, self.IPERF_PORT)
ext_vm = self._create_server(
network=self.external_network,
create_floating_ip=False)
self.ext_vm_ssh_client = ssh.Client(
ext_vm['port']['fixed_ips'][0]['ip_address'], self.username,
pkey=self.keypair['private_key'])
@decorators.idempotent_id('c018b96b-47eb-4b5f-b750-e0c857fd86a9')
def test_dscp_bwlimit_external_network(self):
@ -1015,7 +1019,7 @@ class QosTestExternalNetwork(QosBaseTest):
# we need to test ingress from the undercloud PoV because the BW limit
# egress rule is associated to the receiver VM instance
perf_measures = self._test_ingress_bw(
self.local_client,
self.ext_vm_ssh_client,
vms['receiver']['ssh_client'],
server_ip,
protocol=constants.PROTO_NAME_TCP)
@ -1033,16 +1037,17 @@ class QosTestExternalNetwork(QosBaseTest):
LOG.debug('testing DSCP mark from the test device (undercloud) to '
'a VM instance connected to the external network')
# undercloud's interface towards the receiver IP
interface = utils.get_route_interface(self.local_client, server_ip)
interface = utils.get_route_interface(
self.ext_vm_ssh_client, server_ip)
# tcpdump filter to capture marked ping reply
filtrs = '"(ip and (ip[1] & 0xfc) >> 2 == {}) and src host {}"'.format(
dscp_mark, server_ip)
remote_capture = capture.TcpdumpCapture(
self.local_client, interface, filtrs)
self.ext_vm_ssh_client, interface, filtrs)
self.useFixture(remote_capture)
time.sleep(10)
self.check_remote_connectivity(
self.local_client, server_ip, ping_count=1)
self.ext_vm_ssh_client, server_ip, ping_count=1)
time.sleep(5)
remote_capture.stop()
msg = 'Not found packets with expected DSCP value'