aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/093
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2018-10-22 14:53:02 +0100
committerEduardo Habkost <ehabkost@redhat.com>2018-10-30 21:11:52 -0300
commit9a3a9a636eaf207816891f504b569b8d674987aa (patch)
treed36aa86b2797ee390d8b2b3aaedef2806ec9b729 /tests/qemu-iotests/093
parent8eb5e6746feaf9e021b69ea2521899f8dc889033 (diff)
iotests: Use // for Python integer division
In Python 3, / is always a floating-point division. We usually do not want this, and as Python 2.7 understands // as well, change all integer divisions to use that. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20181022135307.14398-5-mreitz@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/093')
-rwxr-xr-xtests/qemu-iotests/09318
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index 9d1971a56c..d88fbc182e 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -69,18 +69,18 @@ class ThrottleTestCase(iotests.QMPTestCase):
# in. The throttled requests won't be executed until we
# advance the virtual clock.
rq_size = 512
- rd_nr = max(params['bps'] / rq_size / 2,
- params['bps_rd'] / rq_size,
- params['iops'] / 2,
+ rd_nr = max(params['bps'] // rq_size // 2,
+ params['bps_rd'] // rq_size,
+ params['iops'] // 2,
params['iops_rd'])
rd_nr *= seconds * 2
- rd_nr /= ndrives
- wr_nr = max(params['bps'] / rq_size / 2,
- params['bps_wr'] / rq_size,
- params['iops'] / 2,
+ rd_nr //= ndrives
+ wr_nr = max(params['bps'] // rq_size // 2,
+ params['bps_wr'] // rq_size,
+ params['iops'] // 2,
params['iops_wr'])
wr_nr *= seconds * 2
- wr_nr /= ndrives
+ wr_nr //= ndrives
# Send I/O requests to all drives
for i in range(rd_nr):
@@ -196,7 +196,7 @@ class ThrottleTestCase(iotests.QMPTestCase):
self.configure_throttle(ndrives, settings)
# Wait for the bucket to empty so we can do bursts
- wait_ns = nsec_per_sec * burst_length * burst_rate / rate
+ wait_ns = nsec_per_sec * burst_length * burst_rate // rate
self.vm.qtest("clock_step %d" % wait_ns)
# Test I/O at the max burst rate