summaryrefslogtreecommitdiff
path: root/source4/torture/ndr
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2009-12-13 18:41:53 +0300
committerStefan Metzmacher <metze@samba.org>2009-12-14 10:58:32 +0100
commit155bdea7b24d70e37ecab9f6cf90ddd993f0dabf (patch)
treee59ac676d841fb3a54e0417c98f281022a3f3e67 /source4/torture/ndr
parent8f8613dcef4a7c1af322c2b5154bf2347d356170 (diff)
downloadsamba-155bdea7b24d70e37ecab9f6cf90ddd993f0dabf.tar.gz
samba-155bdea7b24d70e37ecab9f6cf90ddd993f0dabf.tar.bz2
samba-155bdea7b24d70e37ecab9f6cf90ddd993f0dabf.zip
torture: add new tests for dfsblobs
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture/ndr')
-rw-r--r--source4/torture/ndr/dfsblob.c50
-rw-r--r--source4/torture/ndr/ndr.c1
2 files changed, 51 insertions, 0 deletions
diff --git a/source4/torture/ndr/dfsblob.c b/source4/torture/ndr/dfsblob.c
new file mode 100644
index 0000000000..353f9f5af3
--- /dev/null
+++ b/source4/torture/ndr/dfsblob.c
@@ -0,0 +1,50 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ Test DFS blobs.
+
+ Copyright (C) Matthieu Patou <mat@matws.net> 2009
+
+ 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 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/ndr/ndr.h"
+#include "librpc/gen_ndr/ndr_dfsblobs.h"
+
+static const uint8_t dfs_get_ref_in[] = {
+ 0x03, 0x00, 0x5c, 0x00, 0x57, 0x00, 0x32, 0x00,
+ 0x4b, 0x00, 0x33, 0x00, 0x00, 0x00 };
+
+static const uint8_t dfs_get_ref_out[] = {
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x58, 0x02, 0x00, 0x00, 0x22, 0x00,
+ 0x01, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x57, 0x00,
+ 0x32, 0x00, 0x4b, 0x00, 0x33, 0x00, 0x00, 0x00,
+ 0x5c, 0x00, 0x57, 0x00, 0x32, 0x00, 0x4b, 0x00,
+ 0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00,
+ 0x31, 0x00, 0x00, 0x00 };
+
+struct torture_suite *ndr_dfsblob_suite(TALLOC_CTX *ctx)
+{
+ struct torture_suite *suite = torture_suite_create(ctx, "dfsblob");
+
+ torture_suite_add_ndr_pull_fn_test(suite, dfs_GetDFSReferral, dfs_get_ref_in, NDR_IN, NULL);
+ torture_suite_add_ndr_pull_fn_test(suite, dfs_GetDFSReferral, dfs_get_ref_out, NDR_OUT, NULL);
+
+ return suite;
+}
diff --git a/source4/torture/ndr/ndr.c b/source4/torture/ndr/ndr.c
index 7bd3631ad0..8602003017 100644
--- a/source4/torture/ndr/ndr.c
+++ b/source4/torture/ndr/ndr.c
@@ -252,6 +252,7 @@ struct torture_suite *torture_local_ndr(TALLOC_CTX *mem_ctx)
torture_suite_add_suite(suite, ndr_lsa_suite(suite));
torture_suite_add_suite(suite, ndr_epmap_suite(suite));
torture_suite_add_suite(suite, ndr_dfs_suite(suite));
+ torture_suite_add_suite(suite, ndr_dfsblob_suite(suite));
torture_suite_add_suite(suite, ndr_netlogon_suite(suite));
torture_suite_add_suite(suite, ndr_drsuapi_suite(suite));
torture_suite_add_suite(suite, ndr_spoolss_suite(suite));