From 919aa6b27e5fe49b70c814210aa026c19be66e8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Aug 2007 12:54:27 +0000 Subject: r24735: Use torture API in more places. (This used to be commit 1319d88c099496be29dd9214fa2492c81e848369) --- source4/torture/raw/qfsinfo.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'source4/torture/raw/qfsinfo.c') diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c index 982f348cd5..dc09e55b63 100644 --- a/source4/torture/raw/qfsinfo.c +++ b/source4/torture/raw/qfsinfo.c @@ -120,26 +120,19 @@ static union smb_fsinfo *find(const char *name) Some of the consistency tests assume that the target filesystem is quiescent, which is sometimes hard to achieve */ -BOOL torture_raw_qfsinfo(struct torture_context *torture) +bool torture_raw_qfsinfo(struct torture_context *torture, + struct smbcli_state *cli) { - struct smbcli_state *cli; int i; BOOL ret = True; int count; union smb_fsinfo *s1, *s2; - TALLOC_CTX *mem_ctx; - if (!torture_open_connection(&cli, 0)) { - return False; - } - - mem_ctx = talloc_init("torture_qfsinfo"); - /* scan all the levels, pulling the results */ for (i=0; levels[i].name; i++) { printf("Running level %s\n", levels[i].name); levels[i].fsinfo.generic.level = levels[i].level; - levels[i].status = smb_raw_fsinfo(cli->tree, mem_ctx, &levels[i].fsinfo); + levels[i].status = smb_raw_fsinfo(cli->tree, torture, &levels[i].fsinfo); } /* check for completely broken levels */ @@ -158,11 +151,10 @@ BOOL torture_raw_qfsinfo(struct torture_context *torture) } if (count != 0) { - ret = False; printf("%d levels failed\n", count); if (count > 13) { printf("too many level failures - giving up\n"); - goto done; + return False; } } @@ -303,8 +295,5 @@ BOOL torture_raw_qfsinfo(struct torture_context *torture) STR_CHECK("ATTRIBUTE_INFO", attribute_info, fs_type, STR_UNICODE); STR_CHECK("ATTRIBUTE_INFORMATION", attribute_info, fs_type, STR_UNICODE); -done: - torture_close_connection(cli); - talloc_free(mem_ctx); return ret; } -- cgit