diff mbox series

[20/20] KVM: selftests: Allow running a single iteration of dirty_log_test

Message ID 20241214010721.2356923-21-seanjc@google.com (mailing list archive)
State New
Headers show
Series [01/20] KVM: selftests: Support multiple write retires in dirty_log_test | expand

Commit Message

Sean Christopherson Dec. 14, 2024, 1:07 a.m. UTC
Now that dirty_log_test doesn't require running multiple iterations to
verify dirty pages, and actually runs the requested number of iterations,
drop the requirement that the test run at least "3" (which was really "2"
at the time the test was written) iterations.

Opportunistically use atoi_positive() to do the heavy lifting.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 tools/testing/selftests/kvm/dirty_log_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxim Levitsky Dec. 18, 2024, 12:03 a.m. UTC | #1
On Fri, 2024-12-13 at 17:07 -0800, Sean Christopherson wrote:
> Now that dirty_log_test doesn't require running multiple iterations to
> verify dirty pages, and actually runs the requested number of iterations,
> drop the requirement that the test run at least "3" (which was really "2"
> at the time the test was written) iterations.
> 
> Opportunistically use atoi_positive() to do the heavy lifting.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  tools/testing/selftests/kvm/dirty_log_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
> index ccc5d9800bbf..05b06476bea4 100644
> --- a/tools/testing/selftests/kvm/dirty_log_test.c
> +++ b/tools/testing/selftests/kvm/dirty_log_test.c
> @@ -880,7 +880,7 @@ int main(int argc, char *argv[])
>  		}
>  	}
>  
> -	TEST_ASSERT(p.iterations > 2, "Iterations must be greater than two");
> +	TEST_ASSERT(p.iterations > 0, "Iterations must be greater than two");
You didn't update the assert message.

>  	TEST_ASSERT(p.interval > 0, "Interval must be greater than zero");
>  
>  	pr_info("Test iterations: %"PRIu64", interval: %"PRIu64" (ms)\n",
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
index ccc5d9800bbf..05b06476bea4 100644
--- a/tools/testing/selftests/kvm/dirty_log_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_test.c
@@ -880,7 +880,7 @@  int main(int argc, char *argv[])
 		}
 	}
 
-	TEST_ASSERT(p.iterations > 2, "Iterations must be greater than two");
+	TEST_ASSERT(p.iterations > 0, "Iterations must be greater than two");
 	TEST_ASSERT(p.interval > 0, "Interval must be greater than zero");
 
 	pr_info("Test iterations: %"PRIu64", interval: %"PRIu64" (ms)\n",