r23792: convert Samba4 to GPLv3
[sfrench/samba-autobuild/.git] / source4 / torture / local / torture.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    local testing of torture
5
6    Copyright (C) Jelmer Vernooij 2006
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #include "includes.h"
23 #include "torture/torture.h"
24 #include "system/wait.h"
25 #include "lib/events/events.h"
26 #include "libcli/raw/libcliraw.h"
27 #include "torture/util.h"
28
29 static bool test_tempdir(struct torture_context *tctx)
30 {
31         char *location = NULL;
32         TALLOC_CTX *mem_ctx = tctx;
33         
34         torture_assert_ntstatus_ok(tctx, torture_temp_dir(mem_ctx, "tempdir", &location), 
35                                                                 "torture_temp_dir should return NT_STATUS_OK" );
36
37         torture_assert(tctx, directory_exist(location), 
38                                    "created dir doesn't exist");
39         return true;
40 }
41
42 struct torture_suite *torture_local_torture(TALLOC_CTX *mem_ctx)
43 {
44         struct torture_suite *suite = torture_suite_create(mem_ctx, 
45                                                                                                            "TORTURE");
46
47         torture_suite_add_simple_test(suite, "tempdir", test_tempdir);
48
49         return suite;
50 }