Add logging of the test steps in NetworkWritableMtuTest
Currently when debugging the test it is hard to distinguish
between test steps and what is the expected result of the ping
command.
The change intended to simplify debugging of the test.
Change-Id: I8802e5e33bbe0b5f296496260027545bbd95afa4
diff --git a/neutron_tempest_plugin/scenario/test_mtu.py b/neutron_tempest_plugin/scenario/test_mtu.py
index fa6bc62..71a77f4 100644
--- a/neutron_tempest_plugin/scenario/test_mtu.py
+++ b/neutron_tempest_plugin/scenario/test_mtu.py
@@ -14,6 +14,7 @@
# under the License.
from neutron_lib.api.definitions import provider_net
+from oslo_log import log
from oslo_serialization import jsonutils
from tempest.common import utils
from tempest.common import waiters
@@ -27,6 +28,7 @@
from neutron_tempest_plugin.scenario import constants
CONF = config.CONF
+LOG = log.getLogger(__name__)
class NetworkMtuBaseTest(base.BaseTempestTestCase):
@@ -221,25 +223,37 @@
@decorators.idempotent_id('bc470200-d8f4-4f07-b294-1b4cbaaa35b9')
def test_connectivity_min_max_mtu(self):
server_ssh_client, _, _, fip2 = self._create_setup()
+ log_msg = ("Ping with {mtu_size} MTU of 2 networks. Fragmentation is "
+ "{fragmentation_state}. Expected result: ping "
+ "{ping_status}")
+
# ping with min mtu of 2 networks succeeds even when
# fragmentation is disabled
+ LOG.debug(log_msg.format(mtu_size='minimal',
+ fragmentation_state='disabled', ping_status='succeeded'))
self.check_remote_connectivity(
server_ssh_client, fip2['fixed_ip_address'],
mtu=self.networks[0]['mtu'], fragmentation=False)
# ping with the size above min mtu of 2 networks
# fails when fragmentation is disabled
+ LOG.debug(log_msg.format(mtu_size='size above minimal',
+ fragmentation_state='disabled', ping_status='failed'))
self.check_remote_connectivity(
server_ssh_client, fip2['fixed_ip_address'], should_succeed=False,
mtu=self.networks[0]['mtu'] + 2, fragmentation=False)
# ping with max mtu of 2 networks succeeds when
# fragmentation is enabled
+ LOG.debug(log_msg.format(mtu_size='maximal',
+ fragmentation_state='enabled', ping_status='succeeded'))
self.check_remote_connectivity(
server_ssh_client, fip2['fixed_ip_address'],
mtu=self.networks[1]['mtu'])
# ping with max mtu of 2 networks fails when fragmentation is disabled
+ LOG.debug(log_msg.format(mtu_size='maximal',
+ fragmentation_state='disabled', ping_status='failed'))
self.check_remote_connectivity(
server_ssh_client, fip2['fixed_ip_address'], should_succeed=False,
mtu=self.networks[1]['mtu'], fragmentation=False)