Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define NO_SYSLOG
-
#include "includes.h"
+extern char *optarg;
+extern int optind;
+
static fstring host, workgroup, share, password, username, myname;
static int max_protocol = PROTOCOL_NT1;
static const char *sockops="TCP_NODELAY";
uint8 eclass, uint32 ecode, NTSTATUS nterr)
{
if (cli_is_dos_error(c)) {
- uint8 class;
+ uint8 cclass;
uint32 num;
/* Check DOS error */
- cli_dos_error(c, &class, &num);
+ cli_dos_error(c, &cclass, &num);
- if (eclass != class || ecode != num) {
+ if (eclass != cclass || ecode != num) {
printf("unexpected error code class=%d code=%d\n",
- (int)class, (int)num);
+ (int)cclass, (int)num);
printf(" expected %d/%d %s (line=%d)\n",
(int)eclass, (int)ecode, nt_errstr(nterr), line);
return False;
static BOOL run_readwritetest(int dummy)
{
static struct cli_state *cli1, *cli2;
- BOOL test1, test2;
+ BOOL test1, test2 = False;
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
return False;
static struct cli_state *cli1;
int fnum1;
const char *lockfname = "\\large.dat";
- size_t fsize;
+ SMB_OFF_T fsize;
char buf[126*1024];
BOOL correct = True;
{
struct cli_state *cli;
int i;
- fstring fname;
pstring line;
char cname[20];
FILE *f;
nb_setup(cli);
- slprintf(cname,sizeof(fname), "client%d", client);
+ slprintf(cname,sizeof(cname)-1, "client%d", client);
f = fopen(client_txt, "r");
static BOOL run_maxfidtest(int dummy)
{
struct cli_state *cli;
- const char *template = "\\maxfid.%d.%d";
+ const char *ftemplate = "\\maxfid.%d.%d";
fstring fname;
int fnums[0x11000], i;
int retries=4;
cli_sockopt(cli, sockops);
for (i=0; i<0x11000; i++) {
- slprintf(fname,sizeof(fname)-1,template, i,(int)getpid());
+ slprintf(fname,sizeof(fname)-1,ftemplate, i,(int)getpid());
if ((fnums[i] = cli_open(cli, fname,
O_RDWR|O_CREAT|O_TRUNC, DENY_NONE)) ==
-1) {
printf("cleaning up\n");
for (;i>=0;i--) {
- slprintf(fname,sizeof(fname)-1,template, i,(int)getpid());
+ slprintf(fname,sizeof(fname)-1,ftemplate, i,(int)getpid());
cli_close(cli, fnums[i]);
if (!cli_unlink(cli, fname)) {
printf("unlink of %s failed (%s)\n",
{
struct cli_state *cli;
int fnum;
- size_t size;
+ SMB_OFF_T size;
time_t c_time, a_time, m_time, w_time, m_time2;
const char *fname = "\\trans2.tst";
const char *dname = "\\trans2";
sleep(2);
- /* Ensure cli1 processes the break. */
+ /* Ensure cli1 processes the break. Empty file should always return 0
+ * bytes. */
- if (cli_read(cli1, fnum1, buf, 0, 4) != 4) {
+ if (cli_read(cli1, fnum1, buf, 0, 4) != 0) {
printf("read on fnum1 failed (%s)\n", cli_errstr(cli1));
correct = False;
}
const char *fname = "\\readonly.file";
int fnum1, fnum2;
char buf[20];
- size_t fsize;
+ SMB_OFF_T fsize;
BOOL correct = True;
char *tmp_path;
{
int i;
+ printf("WARNING samba4 test suite is much more complete nowadays.\n");
+ printf("Please use samba4 torture.\n\n");
+
printf("Usage: smbtorture //server/share <options> TEST1 TEST2 ...\n");
printf("\t-d debuglevel\n");
char *p;
int gotuser = 0;
int gotpass = 0;
- extern char *optarg;
- extern int optind;
BOOL correct = True;
dbf = x_stdout;