From 431d75fc9c7f942dcbd31f80380dda59887ac229 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 1 Feb 2010 15:32:37 +0100 Subject: [PATCH] s4:NBT-WINS: test large scopes metze --- source4/torture/nbt/wins.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c index 092215e2f11..b372de8a553 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; } -- 2.34.1