OSDN Git Service

test-write-threshold: rewrite test_threshold_(not_)trigger tests
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 6 May 2021 09:06:16 +0000 (12:06 +0300)
committerMax Reitz <mreitz@redhat.com>
Fri, 14 May 2021 14:14:10 +0000 (16:14 +0200)
commite46354a8aeefe4637c689de27532bc00712f9c60
tree40d6780d13b319b3facad877be06d04cd546f01f
parentad578c56d596a3250a62ae8687005ca6909d2688
test-write-threshold: rewrite test_threshold_(not_)trigger tests

These tests use bdrv_write_threshold_exceeded() API, which is used only
for test (since pre-previous commit). Better is testing real API, which
is used in block.c as well.

So, let's call bdrv_write_threshold_check_write(), and check is
bs->write_threshold_offset cleared or not (it's cleared iff threshold
triggered).

Also we get rid of BdrvTrackedRequest use here. Note, that paranoiac
bdrv_check_request() calls were added in 8b1170012b1 to protect
BdrvTrackedRequest. Drop them now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210506090621.11848-4-vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/unit/test-write-threshold.c