summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-11-23 05:55:44 +0000
committerAndrew Tridgell <tridge@samba.org>1997-11-23 05:55:44 +0000
commitc16d132bf95d96e2aa572cb9ba18a68abfbbeb8d (patch)
treee2655cd5796c3eed8c4c33693b301e46e49c2e72 /source3/utils
parenta1c5442abb3bc221157ca3620d35e1a013b26232 (diff)
downloadsamba-c16d132bf95d96e2aa572cb9ba18a68abfbbeb8d.tar.gz
samba-c16d132bf95d96e2aa572cb9ba18a68abfbbeb8d.tar.bz2
samba-c16d132bf95d96e2aa572cb9ba18a68abfbbeb8d.zip
added some QPATHINFO and QFILEINFO tests into smbtorture.
This tests for things like midnight access times, sticky create times and word reversed INFO_STANDARD returns (This used to be commit 89141de14edf9e46ab279d2a74a9b026716a0ba8)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/torture.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index d5258d2d6a..fc6d5bcc15 100644
--- a/source3/utils/torture.c
+++ b/source3/utils/torture.c
@@ -682,6 +682,64 @@ static void run_attrtest(void)
}
+/*
+ This checks a couple of trans2 calls
+*/
+static void run_trans2test(void)
+{
+ static struct cli_state cli;
+ int fnum;
+ uint32 size;
+ time_t c_time, a_time, m_time;
+ char *fname = "\\trans2.tst";
+
+ printf("staring trans2 test\n");
+
+ if (!open_connection(&cli)) {
+ return;
+ }
+
+ cli_unlink(&cli, fname);
+ fnum = cli_open(&cli, fname,
+ O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
+ if (!cli_qfileinfo(&cli, fnum, &c_time, &a_time, &m_time, &size)) {
+ printf("ERROR: qfileinfo failed (%s)\n", cli_errstr(&cli));
+ }
+ cli_close(&cli, fnum);
+
+ sleep(2);
+
+ cli_unlink(&cli, fname);
+ fnum = cli_open(&cli, fname,
+ O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
+ cli_close(&cli, fnum);
+
+ if (!cli_qpathinfo(&cli, fname, &c_time, &a_time, &m_time, &size)) {
+ printf("ERROR: qpathinfo failed (%s)\n", cli_errstr(&cli));
+ } else {
+ if (c_time != m_time) {
+ printf("create time=%s", ctime(&c_time));
+ printf("modify time=%s", ctime(&m_time));
+ printf("This system appears to have sticky create times\n");
+ }
+ if (a_time % (60*60) == 0) {
+ printf("access time=%s", ctime(&a_time));
+ printf("This system appears to set a midnight access time\n");
+ }
+
+ if (abs(m_time - time(NULL)) > 60) {
+ printf("ERROR: totally incorrect times - maybe word reversed?\n");
+ }
+ }
+
+ cli_unlink(&cli, fname);
+
+ close_connection(&cli);
+
+ printf("trans2 test finished\n");
+}
+
+
static void create_procs(int nprocs, int numops)
{
int i, status;
@@ -801,6 +859,7 @@ static void create_procs(int nprocs, int numops)
run_unlinktest();
run_browsetest();
run_attrtest();
+ run_trans2test();
return(0);
}