summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-10 00:42:35 +0200
committerKarolin Seeger <kseeger@samba.org>2009-04-15 09:08:18 +0200
commit01fa1d3383095c631be71718f8848eb72f47ade3 (patch)
tree0959199127c7c0f3b0f1a58791c5c1b7620af517 /source4
parent01135bc34be5feb52de793545e90dd2c9f491e49 (diff)
downloadsamba-01fa1d3383095c631be71718f8848eb72f47ade3.tar.gz
samba-01fa1d3383095c631be71718f8848eb72f47ade3.tar.xz
samba-01fa1d3383095c631be71718f8848eb72f47ade3.zip
s4-smbtorture: perform the ntsvcs devicelist tests against the Spooler service.
Guenther (cherry picked from commit c0b71db8e155c1d5e09b5be23ea681fd90955ac7) (cherry picked from commit b2d3a08c8f9f091fb3f9576d892ec2c80bb64a62)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/ntsvcs.c56
1 files changed, 38 insertions, 18 deletions
diff --git a/source4/torture/rpc/ntsvcs.c b/source4/torture/rpc/ntsvcs.c
index 5453102039f..04494b3223b 100644
--- a/source4/torture/rpc/ntsvcs.c
+++ b/source4/torture/rpc/ntsvcs.c
@@ -47,18 +47,26 @@ static bool test_PNP_GetVersion(struct torture_context *tctx,
static bool test_PNP_GetDeviceListSize(struct torture_context *tctx,
struct dcerpc_pipe *p)
{
- NTSTATUS status;
struct PNP_GetDeviceListSize r;
uint32_t size = 0;
r.in.devicename = NULL;
- r.in.flags = 0;
+ r.in.flags = CM_GETIDLIST_FILTER_SERVICE;
r.out.size = &size;
- status = dcerpc_PNP_GetDeviceListSize(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceListSize(p, tctx, &r),
+ "PNP_GetDeviceListSize");
+ torture_assert_werr_equal(tctx, r.out.result, WERR_CM_INVALID_POINTER,
+ "PNP_GetDeviceListSize");
+
+ r.in.devicename = "Spooler";
- torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceListSize");
- torture_assert_werr_ok(tctx, r.out.result, "PNP_GetDeviceListSize");
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceListSize(p, tctx, &r),
+ "PNP_GetDeviceListSize");
+ torture_assert_werr_ok(tctx, r.out.result,
+ "PNP_GetDeviceListSize");
return true;
}
@@ -66,7 +74,6 @@ static bool test_PNP_GetDeviceListSize(struct torture_context *tctx,
static bool test_PNP_GetDeviceList(struct torture_context *tctx,
struct dcerpc_pipe *p)
{
- NTSTATUS status;
struct PNP_GetDeviceList r;
uint16_t *buffer = NULL;
uint32_t length = 0;
@@ -74,25 +81,35 @@ static bool test_PNP_GetDeviceList(struct torture_context *tctx,
buffer = talloc_array(tctx, uint16_t, 0);
r.in.filter = NULL;
- r.in.flags = 0;
+ r.in.flags = CM_GETIDLIST_FILTER_SERVICE;
r.in.length = &length;
r.out.length = &length;
r.out.buffer = buffer;
- status = dcerpc_PNP_GetDeviceList(p, tctx, &r);
- torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceList");
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceList(p, tctx, &r),
+ "PNP_GetDeviceList failed");
+ torture_assert_werr_equal(tctx, r.out.result, WERR_CM_INVALID_POINTER,
+ "PNP_GetDeviceList failed");
+
+ r.in.filter = "Spooler";
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceList(p, tctx, &r),
+ "PNP_GetDeviceList failed");
if (W_ERROR_EQUAL(r.out.result, WERR_CM_BUFFER_SMALL)) {
struct PNP_GetDeviceListSize s;
- s.in.devicename = NULL;
- s.in.flags = 0;
+ s.in.devicename = "Spooler";
+ s.in.flags = CM_GETIDLIST_FILTER_SERVICE;
s.out.size = &length;
- status = dcerpc_PNP_GetDeviceListSize(p, tctx, &s);
-
- torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceListSize");
- torture_assert_werr_ok(tctx, s.out.result, "PNP_GetDeviceListSize");
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceListSize(p, tctx, &s),
+ "PNP_GetDeviceListSize failed");
+ torture_assert_werr_ok(tctx, s.out.result,
+ "PNP_GetDeviceListSize failed");
}
buffer = talloc_array(tctx, uint16_t, length);
@@ -101,9 +118,12 @@ static bool test_PNP_GetDeviceList(struct torture_context *tctx,
r.out.length = &length;
r.out.buffer = buffer;
- status = dcerpc_PNP_GetDeviceList(p, tctx, &r);
- torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceList");
- torture_assert_werr_ok(tctx, r.out.result, "PNP_GetDeviceList");
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_PNP_GetDeviceList(p, tctx, &r),
+ "PNP_GetDeviceList failed");
+
+ torture_assert_werr_ok(tctx, r.out.result,
+ "PNP_GetDeviceList failed");
return true;
}