#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
+#include "system/filesys.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
int fnum;
const char *fname = BASEDIR "\\test.txt";
- if (smbcli_deltree(cli->tree, BASEDIR) == -1 ||
- NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) {
- printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree));
+ if (!torture_setup_dir(cli, BASEDIR)) {
return False;
}
int fnum;
const char *fname = BASEDIR "\\test.txt";
- if (smbcli_deltree(cli->tree, BASEDIR) == -1 ||
- NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) {
- printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree));
+ if (!torture_setup_dir(cli, BASEDIR)) {
return False;
}
BOOL ret = True;
int fnum;
const char *fname = BASEDIR "\\test.txt";
- char c = 1;
+ uint8_t c = 1;
- if (smbcli_deltree(cli->tree, BASEDIR) == -1 ||
- NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) {
- printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree));
+ if (!torture_setup_dir(cli, BASEDIR)) {
return False;
}
time_t t;
struct smbcli_request *req;
- if (smbcli_deltree(cli->tree, BASEDIR) == -1 ||
- NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) {
- printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree));
+ if (!torture_setup_dir(cli, BASEDIR)) {
return False;
}
status = smb_raw_lock(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
+ t = time(NULL);
status = smbcli_request_simple_recv(req);
CHECK_STATUS(status, NT_STATUS_OK);
if (time(NULL) > t+2) {
- printf("lock cancel by unlock was not immediate (%s)\n", __location__);
+ printf("lock cancel by unlock was not immediate (%s) - took %d secs\n",
+ __location__, (int)time(NULL)-t);
ret = False;
goto done;
}
NTSTATUS status;
BOOL ret = True;
int fnum;
- char c = 0;
+ uint8_t c = 0;
const char *fname = BASEDIR "\\test.txt";
- if (smbcli_deltree(cli->tree, BASEDIR) == -1 ||
- NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) {
- printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree));
+ if (!torture_setup_dir(cli, BASEDIR)) {
return False;
}
ret &= test_changetype(cli, mem_ctx);
torture_close_connection(cli);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return ret;
}