diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-11-23 03:09:59 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-11-23 03:09:59 +0000 |
commit | a1c5442abb3bc221157ca3620d35e1a013b26232 (patch) | |
tree | b3d6058c7a997d933926b3c7b2e55ab649016dcd /source3/utils | |
parent | 74f06e4062634fa4f8cb46915280dedf73d58c6f (diff) | |
download | samba-a1c5442abb3bc221157ca3620d35e1a013b26232.tar.gz samba-a1c5442abb3bc221157ca3620d35e1a013b26232.tar.bz2 samba-a1c5442abb3bc221157ca3620d35e1a013b26232.zip |
test SMBsetatr as well
(This used to be commit 2f29c24ba721e417828efca57011ed45892191a5)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/torture.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 06f9f5f1fb..d5258d2d6a 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -637,7 +637,7 @@ static void run_attrtest(void) { static struct cli_state cli; int fnum; - struct stat st; + time_t t, t2; char *fname = "\\attrib.tst"; printf("staring attrib test\n"); @@ -650,13 +650,30 @@ static void run_attrtest(void) fnum = cli_open(&cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE); cli_close(&cli, fnum); - if (!cli_stat(&cli, fname, &st)) { + if (!cli_getatr(&cli, fname, NULL, NULL, &t)) { printf("getatr failed (%s)\n", cli_errstr(&cli)); } - if (abs(st.st_mtime - time(NULL)) > 2) { + if (abs(t - time(NULL)) > 2) { printf("ERROR: SMBgetatr bug. time is %s", - ctime(&st.st_mtime)); + ctime(&t)); + t = time(NULL); + } + + t2 = t-60*60*24; /* 1 day ago */ + + if (!cli_setatr(&cli, fname, 0, t2)) { + printf("setatr failed (%s)\n", cli_errstr(&cli)); + } + + if (!cli_getatr(&cli, fname, NULL, NULL, &t)) { + printf("getatr failed (%s)\n", cli_errstr(&cli)); + } + + if (t != t2) { + printf("ERROR: getatr/setatr bug. times are\n%s", + ctime(&t)); + printf("%s", ctime(&t2)); } close_connection(&cli); |