summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-05-15 22:17:46 +0400
committerMatthieu Patou <mat@samba.org>2011-05-17 00:31:09 +0200
commit0d2019dcbaad7f82319c1aac1aae51ab45e77c52 (patch)
treedaa40f8e9a4b7f029e303845fe207ed0bf88cecf
parent6553940c0176298eb25bac850db55363c991cdec (diff)
downloadsamba-0d2019dcbaad7f82319c1aac1aae51ab45e77c52.tar.gz
samba-0d2019dcbaad7f82319c1aac1aae51ab45e77c52.tar.bz2
samba-0d2019dcbaad7f82319c1aac1aae51ab45e77c52.zip
s4-torture: Add more tests to DFS referral suite
-rw-r--r--source4/torture/dfs/domaindfs.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/source4/torture/dfs/domaindfs.c b/source4/torture/dfs/domaindfs.c
index a8cdd4dea1..fafae179a3 100644
--- 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");
+ 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;
}
@@ -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,
- 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;
/*
@@ -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;
+ uint8_t zeros[16];
+
+ memset(zeros, 0, sizeof(zeros));
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(
- resp3.referral_entries[0].referral.v3.referrals.r2.special_name) > 0,
+ resp3.referral_entries[0].referral.v3.referrals.r1.DFS_path) > 0,
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(
- resp2.referral_entries[0].referral.v3.referrals.r2.expanded_names[0]) > 0,
+ resp2.referral_entries[0].referral.v3.referrals.r1.netw_address) > 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;
@@ -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));
+ 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