diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py index f1e7ca3..b954b69 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py @@ -1243,7 +1243,7 @@ class QosTestSriovMinBwPlacementEnforcementTest(QosTestSriovBaseTest): class QosTestOvn(base.BaseTempestTestCaseOvn, QosBaseTest): MAX_KBPS = 1000 - MAX_BURST_KBPS = 0.8 * MAX_KBPS + MAX_BURST_KBPS = int(0.8 * MAX_KBPS) DSCP_MARK_OPTION = QosBaseTest.dscp_mark_net def _create_qos_policy_bw_and_dscp(self): @@ -1267,40 +1267,42 @@ class QosTestOvn(base.BaseTempestTestCaseOvn, QosBaseTest): return policy_id def _validate_bw_limit_nbdb_qos(self, qos_settings): + bandwidth_settings = '' for line in qos_settings.splitlines(): if line.startswith('bandwidth'): bandwidth_settings = line break - self.assertTrue( - '{burst=%d, rate=%d}' % (self.MAX_BURST_KBPS, self.MAX_KBPS) - in bandwidth_settings, - 'Bandwidth options are not set as expected') + self.assertIn(f'rate={self.MAX_KBPS:.0f}', bandwidth_settings, + 'Bandwidth options are not set as expected') + self.assertIn(f'burst={self.MAX_BURST_KBPS:.0f}', bandwidth_settings, + 'Bandwidth options are not set as expected') LOG.debug('BW limit options found') def _validate_bw_limit_nbdb_lsp(self, lsp_settings): + bandwidth_settings = '' for line in lsp_settings.splitlines(): if line.startswith('options'): bandwidth_settings = line break - self.assertTrue( - 'qos_burst="%d", qos_max_rate="%d"' % ( - self.MAX_BURST_KBPS, self.MAX_KBPS) - in bandwidth_settings, - 'Bandwidth options are not set as expected') + self.assertIn(f'qos_max_rate="{self.MAX_KBPS * 1000:.0f}"', + bandwidth_settings, + 'Bandwidth options are not set as expected') + self.assertIn(f'qos_burst="{self.MAX_BURST_KBPS * 1000:.0f}"', + bandwidth_settings, + 'Bandwidth options are not set as expected') LOG.debug('BW limit options found') def _validate_dscp_nbdb_qos(self, qos_settings): + dscp_settings = '' for line in qos_settings.splitlines(): if line.startswith('action'): dscp_settings = line break - self.assertTrue( - '{dscp=%s}' % (self.DSCP_MARK_OPTION,) - in dscp_settings, - 'DSCP options are not set as expected') + self.assertIn(f'dscp={self.DSCP_MARK_OPTION}', dscp_settings, + 'DSCP options are not set as expected') LOG.debug('DSCP options found') def _validate_qos_rules_nbdb(