r19153: Simple consistency check for enumprinters level 2 as well
authorVolker Lendecke <vlendec@samba.org>
Fri, 6 Oct 2006 19:02:02 +0000 (19:02 +0000)
committerVolker Lendecke <vlendec@samba.org>
Fri, 6 Oct 2006 19:02:02 +0000 (19:02 +0000)
source/torture/rpc/samba3rpc.c

index 8bfbad22e538314bb2150fe12494f9a0e51274a7..ecc0378471cea4683733fe07d9f4a085e66b666d 100644 (file)
@@ -2238,7 +2238,7 @@ static BOOL enumprinters(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *pipe,
 
        r.in.flags = PRINTER_ENUM_LOCAL;
        r.in.server = "\\\\localhost";
-       r.in.level = 1;
+       r.in.level = level;
        r.in.buffer = NULL;
        r.in.offered = 0;
 
@@ -2517,7 +2517,23 @@ BOOL torture_samba3_rpc_spoolss(struct torture_context *torture)
                }
                if (num_printers != num_enumerated) {
                        d_printf("(%s) netshareenum gave %d printers, "
-                                "enumprinters gave %d\n", __location__,
+                                "enumprinters lvl 1 gave %d\n", __location__,
+                                num_printers, num_enumerated);
+                       talloc_free(mem_ctx);
+                       return False;
+               }
+       }
+
+       {
+               int num_enumerated;
+               if (!enumprinters(mem_ctx, p, 2, &num_enumerated)) {
+                       d_printf("(%s) enumprinters failed\n", __location__);
+                       talloc_free(mem_ctx);
+                       return False;
+               }
+               if (num_printers != num_enumerated) {
+                       d_printf("(%s) netshareenum gave %d printers, "
+                                "enumprinters lvl 2 gave %d\n", __location__,
                                 num_printers, num_enumerated);
                        talloc_free(mem_ctx);
                        return False;