r24741: More use of the torture API.
[gd/samba-autobuild/.git] / source4 / torture / rpc / initshutdown.c
index 4b754acf74bfcf6cfad8f2603ff80597e52c5011..aa817928abd4418729dc3f4141933664e105e7ad 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "torture/torture.h"
-#include "librpc/gen_ndr/ndr_initshutdown.h"
+#include "librpc/gen_ndr/ndr_initshutdown_c.h"
+#include "torture/rpc/rpc.h"
 
 static void init_initshutdown_String(TALLOC_CTX *mem_ctx, struct initshutdown_String *name, const char *s)
 {
@@ -112,7 +112,7 @@ static BOOL test_Abort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
        return True;
 }
 
-BOOL torture_rpc_initshutdown(void)
+BOOL torture_rpc_initshutdown(struct torture_context *torture)
 {
     NTSTATUS status;
     struct dcerpc_pipe *p;
@@ -121,15 +121,16 @@ BOOL torture_rpc_initshutdown(void)
 
        mem_ctx = talloc_init("torture_rpc_initshutdown");
 
-       status = torture_rpc_connection(mem_ctx, &p, &dcerpc_table_initshutdown);
+       status = torture_rpc_connection(torture, &p, &ndr_table_initshutdown);
 
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(mem_ctx);
                return False;
        }
 
-       if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
-               printf("initshutdown tests disabled - enable dangerous tests to use\n");
+       if (!torture_setting_bool(torture, "dangerous", False)) {
+               torture_comment(torture, 
+                                               "initshutdown tests disabled - enable dangerous tests to use\n");
        } else {
                ret &= test_Init(p, mem_ctx, "spottyfood", 30);
                ret &= test_Abort(p, mem_ctx);