diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-09-24 11:28:58 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-09-24 18:10:22 -0700 |
commit | 9fcafbb42cbe759711db4a47c2969bd34229e4a0 (patch) | |
tree | 7c9d0bbc15a90ee6e652b1c53fa6f30ff81c73ac | |
parent | 71ae732669d641cf8b3fd7f6fa73ead4634178f1 (diff) | |
download | samba-9fcafbb42cbe759711db4a47c2969bd34229e4a0.tar.gz samba-9fcafbb42cbe759711db4a47c2969bd34229e4a0.tar.bz2 samba-9fcafbb42cbe759711db4a47c2969bd34229e4a0.zip |
support NT_STATUS_XX:NT_STATUS_YY syntax in ignore files
-rw-r--r-- | source4/torture/gentest.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 176fc035e7..1b8f97596b 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -1165,6 +1165,8 @@ static void idle_func_smb2(struct smb2_transport *transport, void *private) */ static bool compare_status(NTSTATUS status1, NTSTATUS status2) { + char *s; + if (NT_STATUS_EQUAL(status1, status2)) return true; /* one code being an error and the other OK is always an error */ @@ -1178,6 +1180,18 @@ static bool compare_status(NTSTATUS status1, NTSTATUS status2) ignore_pattern(nt_errstr(status2))) { return true; } + + /* also support ignore patterns of the form NT_STATUS_XX:NT_STATUS_YY + meaning that the first server returns NT_STATUS_XX and the 2nd + returns NT_STATUS_YY */ + s = talloc_asprintf(current_op.mem_ctx, "%s:%s", + nt_errstr(status1), + nt_errstr(status2)); + printf("pattern: %s\n", s); + if (ignore_pattern(s)) { + return true; + } + current_op.mismatch = nt_errstr(status1); return false; } @@ -1348,7 +1362,7 @@ again: } \ current_op.status = status[0]; \ for (i=1;i<NSERVERS;i++) { \ - if (!compare_status(status[i], status[0])) { \ + if (!compare_status(status[0], status[1])) { \ printf("status different in %s - %s %s\n", #call, \ nt_errstr(status[0]), nt_errstr(status[i])); \ current_op.mismatch = nt_errstr(status[0]); \ |