1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

386 Commits

Author SHA1 Message Date
Günther Deschner
54eafcaa12 s4-torture: add test for spoolss_CorePrinterDriver().
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-23 01:06:24 +02:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Stefan Metzmacher
87bf1a6edd s4:torture/rpc: use dcerpc_secondary_auth_connection with anon creds
This is the same as calling dcerpc_secondary_connection/dcerpc_bind_auth_none.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Volker Lendecke
38628b1e32 Fix the O3 developer build
Different gcc versions complain at different places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 13:14:53 CET 2015 on sn-devel-104
2015-03-03 13:14:53 +01:00
David Disseldorp
6c4570d9c7 torture/spoolss: issue GetJob after StartDocPrinter
This reflects Windows XP spoolss client behaviour. This fails if the job
is not yet instantiated on the server, and prior to the bso#10984 fix
resulted in an unsable DCERPC pipe.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec 19 18:03:20 CET 2014 on sn-devel-104
2014-12-19 18:03:20 +01:00
David Disseldorp
ea962a656c torture/spoolss: cleanup print_job_enum test jobs
Purge print queue on startup to ensure that the test is not affected by
jobs queued for prior tests. Also, empty the queue at the end of the
test to play nice with others.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 29 14:31:52 CET 2014 on sn-devel-104
2014-10-29 14:31:52 +01:00
David Disseldorp
814b0ade8c torture/spoolss: test EnumJobs with an invalid level
This test confirms that EnumJobs WERR_INVALID_LEVEL responses remain
consistent with and without the presence of outstanding print jobs.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-28 00:43:04 +01:00
David Disseldorp
e1b6d6eab0 torture/spoolss: add werr_expected arg to EnumJobs helper
This will allow for the future testing of specific EnumJobs failure
cases.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-28 00:43:04 +01:00
David Disseldorp
b328bb07ff s4-torture: add print_test_purge
This change adds a regression test for print job purging via
SetPrinter(SPOOLSS_PRINTER_CONTROL_PURGE).

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 22 01:55:39 CEST 2014 on sn-devel-104
2014-05-22 01:55:39 +02:00
Stefan Metzmacher
983ec866af s4:torture/rpc: avoid using dcecli_connection->binding_string
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Günther Deschner
1351febcc8 s4-torture: add some tests for pre-allocated buffers in enumprinterdrivers call.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-20 16:28:26 +01:00
Günther Deschner
b905523c32 s4-torture: add test_EnumPrinterDrivers_buffers function.
This will allow to test the enumdriver call with pre-allocated buffer.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-20 16:28:26 +01:00
Volker Lendecke
7e5350602e torture: Fix a torture crash with -O3
When compiled with -O3, smbtorture can crash after the following valgrind
trace:

==16944== Conditional jump or move depends on uninitialised value(s)
==16944==    at 0x57FFAC3: ndr_push_unique_ptr (ndr_basic.c:730)
==16944==    by 0x58CB855: ndr_push_spoolss_SetPrinterInfo (ndr_spoolss.c:7939)
==16944==    by 0x58E2F95: ndr_push_spoolss_SetPrinter (ndr_spoolss.c:24724)
==16944==    by 0x417C78C: dcerpc_binding_handle_call_send (binding_handle.c:410)
==16944==    by 0x417C986: dcerpc_binding_handle_call (binding_handle.c:547)
==16944==    by 0x522059C: dcerpc_spoolss_SetPrinter_r (ndr_spoolss_c.c:1722)
==16944==    by 0x2853BD: test_sd_set_level (spoolss.c:1248)
==16944==    by 0x28F146: test_PrinterInfo_SD (spoolss.c:1962)
==16944==    by 0x2A3C31: test_EnumPrinters_old (spoolss.c:6589)
==16944==    by 0x41F6D66: internal_torture_run_test.part.0 (torture.c:442)
==16944==    by 0x41F711F: torture_run_tcase_restricted (torture.c:758)
==16944==    by 0x2018E8: run_matching.isra.1 (smbtorture.c:103)
==16944==    by 0x20176B: run_matching.isra.1 (smbtorture.c:95)
==16944==    by 0x20176B: run_matching.isra.1 (smbtorture.c:95)
==16944==    by 0x201C12: torture_run_named_tests (smbtorture.c:143)
==16944==    by 0x202F5B: main (smbtorture.c:661)

My assumption is that with optimization gcc makes use of the fact that the
structures that this patch moves go out of scope.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Feb 28 21:27:11 CET 2014 on sn-devel-104
2014-02-28 21:27:11 +01:00
Volker Lendecke
1dd2351840 torture: Fix a buffer overrun
In test_EnumPrinterDrivers we go up to driver level 8. In C, this means
we are accessing the 9th entry in the following lines:

        ctx->driver_count[level]        = count;
        ctx->drivers[level]             = info;

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-02-28 17:49:01 +01:00
Stefan Metzmacher
42eb40792a s4:torture/rpc: fix compiler warnings in spoolss.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2014-02-11 16:20:29 +01:00
Andreas Schneider
b871c3907a s4-torture: Fix out of bound array access.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
34f498525c s3-torture: Comment out dead code in spoolss test.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
3b3b52c013 s4-torture: Fix some compile warnings in spoolss.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Andreas Schneider
09cc58c1a7 s4-torture: Make sure handles are correctly initialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Arvid Requate
addabf1513 torture: test printing using "XPS_PASS" datatype
The "XPS_PASS" datatype is used by Windows 8.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10267

Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 21 15:01:30 CET 2013 on sn-devel-104
2013-11-21 15:01:30 +01:00
Michael Adam
39a965ac83 s4:torture:spoolss: use smb2_connect() instead of smb2_connet_ext()
in print_test_smbd: we don't need to pass the previous_session_id.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05 14:04:07 +02:00
David Disseldorp
b475ef008b torture: support printer publish pending responses
Windows (tested against 2k8r2) returns WERR_IO_PENDING and
DSPRINT_PENDING when a publish or unpublish is requested via
setprinter(level=7). Modify the AD printer publishing test to support
these responses.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun  3 16:06:15 CEST 2013 on sn-devel-104
2013-06-03 16:06:15 +02:00
David Disseldorp
56b0246162 torture: add AD printer publishing test
This test publishes and unpublishes a printer using setprinter(level=7).
Printer info2.attributes and info7.action flags are check at each point
to ensure MS-RPRN conformance.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-06-03 14:10:07 +02:00
Günther Deschner
00ee6a648b s4-torture: add simple tests for spoolss_{Add|Delete}PrintProcessor.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-20 18:50:01 +02:00
Günther Deschner
e8797a3ecc s4-torture: also deal with "Microsoft XPS Document Writer v4" as default driver.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-20 18:50:00 +02:00
Günther Deschner
c51866eadf s4-torture: add simple test for spoolss_RpcSendRecvBidiData.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-20 18:50:00 +02:00
Günther Deschner
aa1e5f29af s4-torture: add test for spoolss_RpcEnumJobNamedProperties.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-20 18:50:00 +02:00
Günther Deschner
b072bb76db s4-torture: add missing NTSTATUS checks in test_AddJob().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-20 18:50:00 +02:00
Andreas Schneider
6ac1435ab3 torture: Don't leak file resource handle in spoolss test.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:13 +01:00
Andreas Schneider
aff301d9eb torture: Fix array access in spoolss test.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:13 +01:00
Günther Deschner
000e6ba14a s4-torture: add some basic tests for PlayGDIScriptOnPrinterIC.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 24 19:20:52 CET 2013 on sn-devel-104
2013-01-24 19:20:52 +01:00
Günther Deschner
11fba10208 spoolss: make spoolss deal with ndr64 StartDocPrinter by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24 17:42:25 +01:00
Günther Deschner
3b94b64481 spoolss: make spoolss deal with ndr64 SetForm by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Günther Deschner
8304fe73f6 spoolss: make spoolss deal with ndr64 AddForm by using proper container object.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Günther Deschner
e8feca012e spoolss: make spoolss deal with ndr64 ULONG_PTR of devmode_ptr and secdesc_ptr.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-01-17 17:11:37 +01:00
Günther Deschner
a4dcf7b94d spoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-16 11:42:13 +01:00
Andreas Schneider
dc9fa1a026 torture: Fix torture_rpc_spoolss_printer_teardown_common().
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
David Disseldorp
98ec5e95ca s3-torture: Use static printer for smbd spooler test
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Jun 26 18:04:43 CEST 2012 on sn-devel-104
2012-06-26 18:04:43 +02:00
David Disseldorp
33f08906c6 torture: add test for smbd print job spooling
Clients can print by performing file IO on a printer share, rather than
issuing spoolss RPCs.
This commit attempts to reproduce bug 8719.
2012-06-26 16:10:39 +02:00
Michael Adam
421b3984cd s4:torture:rpc:spoolss: also initialize driverName before checking it in test_PrinterData_DsSpooler()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
David Disseldorp
3bfcf343cf torture: add spoolss overlapping driver deletion tests
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Fri Jan 20 18:20:14 CET 2012 on sn-devel-104
2012-01-20 18:20:14 +01:00
David Disseldorp
b37f66c7b7 torture: confirm printer driver file removal
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-01-20 17:44:01 +01:00
David Disseldorp
cc8cd7b038 torture: add spoolss del printer driver test
Test handling of DeletePrinterDriverEx when the DPD_DELETE_ALL_FILES
flag is set.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-01-20 17:43:54 +01:00
Günther Deschner
c8f9515f19 s4-smbtorture: restructure documentname handling in spoolss test a bit.
Guenther
2011-04-20 17:54:11 +02:00
Günther Deschner
9e6d61fb85 s4-smbtorture: add torture test to check proper add and delete driver operations.
Thanks to Bjoern Baumbach <bb@sernet.de> for pushing us to test and verify this.

Guenther
2011-02-08 17:23:52 +01:00
Günther Deschner
7d107cda89 s4-smbtorture: also run the driver timestamp spoolss test against samba.
Guenther
2011-02-08 17:23:52 +01:00
Günther Deschner
1f3fb30ed9 s4-smbtorture: make sure there is always driverextra data in spoolss devmode size tests.
Guenther
2011-01-21 10:58:20 +01:00
Günther Deschner
aefbec5270 s4-smbtorture: add tests for the size member of spoolss devicemodes.
Guenther
2011-01-21 10:58:20 +01:00
Günther Deschner
7a7b61ef08 s4-smbtorture: prepare devicemode test for expected result tests.
Guenther
2011-01-21 10:58:20 +01:00
Günther Deschner
bb51c05014 s4-smbtorture: add some paranoia checks for 0 sized devmodes.
Guenther
2011-01-21 10:58:20 +01:00