s4 torture test: Adapt ndr-dfsblobs torture test to new idl
[mat/samba.git] / source4 / torture / ndr / dfsblob.c
1 /*
2    Unix SMB/CIFS implementation.
3
4    Test DFS blobs.
5
6    Copyright (C) Matthieu Patou <mat@matws.net> 2009
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/ndr/ndr.h"
24 #include "librpc/gen_ndr/ndr_dfsblobs.h"
25
26 static const uint8_t dfs_get_ref_in[] = {
27         0x03, 0x00, 0x5c, 0x00, 0x57, 0x00, 0x32, 0x00,
28         0x4b, 0x00, 0x33, 0x00, 0x00, 0x00 };
29
30 static const uint8_t dfs_get_ref_out[] = {
31         0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
32         0x00, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00,
33         0x02, 0x00, 0x58, 0x02, 0x00, 0x00, 0x22, 0x00,
34         0x01, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
35         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36         0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x57, 0x00,
37         0x32, 0x00, 0x4b, 0x00, 0x33, 0x00, 0x00, 0x00,
38         0x5c, 0x00, 0x57, 0x00, 0x32, 0x00, 0x4b, 0x00,
39         0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00,
40         0x31, 0x00, 0x00, 0x00 };
41
42 struct torture_suite *ndr_dfsblob_suite(TALLOC_CTX *ctx)
43 {
44         struct torture_suite *suite = torture_suite_create(ctx, "dfsblob");
45
46         torture_suite_add_ndr_pull_fn_test(suite, dfs_GetDFSReferral_in, dfs_get_ref_in, NDR_IN, NULL);
47         torture_suite_add_ndr_pull_fn_test(suite, dfs_referral_resp, dfs_get_ref_out, NDR_BUFFERS|NDR_SCALARS, NULL);
48
49         return suite;
50 }