From: Ralph Boehme Date: Mon, 28 Nov 2022 17:05:28 +0000 (+0100) Subject: torture: print duration of smb2.dir.test_large_files X-Git-Tag: talloc-2.4.0~368 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cac95c3bba9f0fbd02f3e96691cd679e0cd2085e;p=thirdparty%2Fsamba.git torture: print duration of smb2.dir.test_large_files Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/smb2/dir.c b/source4/torture/smb2/dir.c index beb3688f86a..d2cebfe033e 100644 --- a/source4/torture/smb2/dir.c +++ b/source4/torture/smb2/dir.c @@ -1303,6 +1303,7 @@ static bool test_large_files(struct torture_context *tctx, int i, j = 0, file_count = 0; char **strs = NULL; unsigned count; + struct timespec ts1, ts2; torture_comment(tctx, "Testing directory enumeration in a directory with >1000 files\n"); @@ -1347,6 +1348,8 @@ static bool test_large_files(struct torture_context *tctx, f.in.max_response_size = 0x100; f.in.level = SMB2_FIND_BOTH_DIRECTORY_INFO; + clock_gettime_mono(&ts1); + do { status = smb2_find_level(tree, tree, &f, &count, &d); if (NT_STATUS_EQUAL(status, STATUS_NO_MORE_FILES)) @@ -1386,6 +1389,8 @@ static bool test_large_files(struct torture_context *tctx, torture_assert_int_equal_goto(tctx, file_count, num_files + 2, ret, done, ""); + clock_gettime_mono(&ts2); + for (i = 0; i < num_files; i++) { if (files[j].found) continue; @@ -1396,6 +1401,10 @@ static bool test_large_files(struct torture_context *tctx, ret = false; goto done; } + + torture_comment(tctx, "Directory enumeration completed in %.3f s.\n", + timespec_elapsed2(&ts1, &ts2)); + done: smb2_util_close(tree, h); smb2_deltree(tree, DNAME);