summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-02-01 15:32:37 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-01 15:32:38 +0100
commit431d75fc9c7f942dcbd31f80380dda59887ac229 (patch)
treeee1a3b7cd0a78513db8cabada846001acb4090a9 /source4/torture
parent70779a46a7b7f6e5c00eba048dbf653d86bc07d4 (diff)
downloadsamba-431d75fc9c7f942dcbd31f80380dda59887ac229.tar.gz
samba-431d75fc9c7f942dcbd31f80380dda59887ac229.tar.bz2
samba-431d75fc9c7f942dcbd31f80380dda59887ac229.zip
s4:NBT-WINS: test large scopes
metze
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/nbt/wins.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index 092215e2f1..b372de8a55 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -405,6 +405,35 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
}
+static char *test_nbt_wins_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
+{
+ char *res;
+ uint8_t i;
+
+ res = talloc_array(mem_ctx, char, count+1);
+ if (res == NULL) {
+ return NULL;
+ }
+
+ for (i=0; i < count; i++) {
+ switch (i) {
+ case 63:
+ case 63 + 1 + 63:
+ case 63 + 1 + 63 + 1 + 63:
+ res[i] = '.';
+ break;
+ default:
+ res[i] = '0' + (i%10);
+ break;
+ }
+ }
+
+ res[count] = '\0';
+
+ talloc_set_name_const(res, res);
+
+ return res;
+}
/*
test operations against a WINS server
@@ -488,6 +517,14 @@ static bool nbt_test_wins(struct torture_context *tctx)
ret &= nbt_test_wins_name(tctx, address, &name,
NBT_NODE_H, false, NBT_RCODE_OK);
+ name.scope = test_nbt_wins_scope_string(tctx, 237);
+ ret &= nbt_test_wins_name(tctx, address, &name,
+ NBT_NODE_H, false, NBT_RCODE_OK);
+
+ name.scope = test_nbt_wins_scope_string(tctx, 238);
+ ret &= nbt_test_wins_name(tctx, address, &name,
+ NBT_NODE_H, false, NBT_RCODE_SVR);
+
return ret;
}