git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6553940
)
s4-torture: Add more tests to DFS referral suite
author
Matthieu Patou
<mat@matws.net>
Sun, 15 May 2011 18:17:46 +0000
(22:17 +0400)
committer
Matthieu Patou
<mat@samba.org>
Mon, 16 May 2011 22:31:09 +0000
(
00:31
+0200)
source4/torture/dfs/domaindfs.c
patch
|
blob
|
history
diff --git
a/source4/torture/dfs/domaindfs.c
b/source4/torture/dfs/domaindfs.c
index a8cdd4dea195e5c98c4414c5773537fd604d9feb..fafae179a3dfca6786a830a911776360247165f2 100644
(file)
--- a/
source4/torture/dfs/domaindfs.c
+++ b/
source4/torture/dfs/domaindfs.c
@@
-69,6
+69,10
@@
static bool test_getdomainreferral(struct torture_context *tctx,
resp.referral_entries[0].referral.v3.referrals.r2.special_name) > 0,
1,
"Length of domain is 0 or less");
resp.referral_entries[0].referral.v3.referrals.r2.special_name) > 0,
1,
"Length of domain is 0 or less");
+ torture_assert_int_equal(tctx,
+ resp.referral_entries[0].referral.v3.referrals.r2.special_name[0] == '\\',
+ 1,
+ "domain didn't start with a \\");
return true;
}
return true;
}
@@
-138,8
+142,12
@@
static bool test_getdcreferral(struct torture_context *tctx,
torture_assert_int_equal(tctx, strlen(str) >0, 1 ,"Length of domain too short");
str++;
torture_assert_int_equal(tctx, strcmp(str,str2), 0,
torture_assert_int_equal(tctx, strlen(str) >0, 1 ,"Length of domain too short");
str++;
torture_assert_int_equal(tctx, strcmp(str,str2), 0,
- talloc_asprintf(tctx, "Pb domain of the dc is not"\
- "the same as the requested: domain = %s got =%s",str2 ,str));
+ talloc_asprintf(tctx, "Pb domain of the dc is not "\
+ "the same as the requested: domain was = %s got =%s",str2 ,str));
+ torture_assert_int_equal(tctx,
+ resp.referral_entries[0].referral.v3.referrals.r2.special_name[0] == '\\',
+ 1,
+ "dc name didn't start with a \\");
r3.in.req.max_referral_level = 3;
/*
r3.in.req.max_referral_level = 3;
/*
@@
-299,6
+307,9
@@
static bool test_getsysvolreferral(struct torture_context *tctx,
const char* str;
struct dfs_GetDFSReferral r, r2, r3;
struct dfs_referral_resp resp, resp2, resp3;
const char* str;
struct dfs_GetDFSReferral r, r2, r3;
struct dfs_referral_resp resp, resp2, resp3;
+ uint8_t zeros[16];
+
+ memset(zeros, 0, sizeof(zeros));
r.in.req.max_referral_level = 3;
r.in.req.servername = "";
r.in.req.max_referral_level = 3;
r.in.req.servername = "";
@@
-350,13
+361,25
@@
static bool test_getsysvolreferral(struct torture_context *tctx,
"Wrong entry flag expected to have a non domain response and got %d",
resp3.referral_entries[0].referral.v3.entry_flags));
torture_assert_int_equal(tctx, strlen(
"Wrong entry flag expected to have a non domain response and got %d",
resp3.referral_entries[0].referral.v3.entry_flags));
torture_assert_int_equal(tctx, strlen(
- resp3.referral_entries[0].referral.v3.referrals.r
2.special_name
) > 0,
+ resp3.referral_entries[0].referral.v3.referrals.r
1.DFS_path
) > 0,
1,
"Length of domain is 0 or less");
1,
"Length of domain is 0 or less");
+ torture_assert_int_equal(tctx, strstr(resp3.referral_entries[0].referral.v3.referrals.r1.DFS_path,
+ str+1) != NULL, 1,
+ talloc_asprintf(tctx,
+ "Wrong DFS_path %s unable to find substring %s in it",
+ resp3.referral_entries[0].referral.v3.referrals.r1.DFS_path,
+ str+1));
torture_assert_int_equal(tctx, strlen(
torture_assert_int_equal(tctx, strlen(
- resp2.referral_entries[0].referral.v3.referrals.r
2.expanded_names[0]
) > 0,
+ resp2.referral_entries[0].referral.v3.referrals.r
1.netw_address
) > 0,
1,
"Length of first referral is less than 0");
1,
"Length of first referral is less than 0");
+ torture_assert_int_equal(tctx, strstr(resp3.referral_entries[0].referral.v3.referrals.r1.netw_address,
+ str+1) != NULL, 1,
+ talloc_asprintf(tctx,
+ "Wrong DFS_path %s unable to find substring %s in it",
+ resp3.referral_entries[0].referral.v3.referrals.r1.netw_address,
+ str+1));
r3.in.req.max_referral_level = 4;
r3.in.req.max_referral_level = 4;
@@
-368,6
+391,9
@@
static bool test_getsysvolreferral(struct torture_context *tctx,
talloc_asprintf(tctx,
"Not expected version for referral entry 0 got %d expected 4",
resp3.referral_entries[0].version));
talloc_asprintf(tctx,
"Not expected version for referral entry 0 got %d expected 4",
resp3.referral_entries[0].version));
+ torture_assert_int_equal(tctx, memcmp(resp3.referral_entries[0].referral.v3.service_site_guid.value, zeros, 16), 0,
+ talloc_asprintf(tctx,
+ "Service_site_guid is not NULL as expected"));
#if 0
/*
* We do not support fallback indication for the moment
#if 0
/*
* We do not support fallback indication for the moment