summaryrefslogtreecommitdiffstats
path: root/source4/torture/nbt/wins.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@sernet.de>2008-01-11 19:10:30 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-19 07:05:23 +0100
commit1ffcebbf0f912f4ccbff76f05280f7ed98d5e5ea (patch)
tree522a870cdfceb86bcfb37f173e1c458777a523e3 /source4/torture/nbt/wins.c
parent462e4d0cef822d90d982cfb0b38dd60015929bcc (diff)
downloadsamba-1ffcebbf0f912f4ccbff76f05280f7ed98d5e5ea.tar.gz
samba-1ffcebbf0f912f4ccbff76f05280f7ed98d5e5ea.tar.xz
samba-1ffcebbf0f912f4ccbff76f05280f7ed98d5e5ea.zip
NBT-WINS: we don't need the slow low port tests for every name
metze (from samba4wins tree 7862deca8555f960a5ef65e6315ce94af5023a2a)
Diffstat (limited to 'source4/torture/nbt/wins.c')
-rw-r--r--source4/torture/nbt/wins.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index bcae5c8bda..9f7f749677 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -46,7 +46,8 @@
test operations against a WINS server
*/
static bool nbt_test_wins_name(struct torture_context *tctx, const char *address,
- struct nbt_name *name, uint16_t nb_flags)
+ struct nbt_name *name, uint16_t nb_flags,
+ bool try_low_port)
{
struct nbt_name_register_wins io;
struct nbt_name_query query;
@@ -57,7 +58,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
const char *myaddress;
struct socket_address *socket_address;
struct interface *ifaces;
- bool low_port = true;
+ bool low_port = try_low_port;
load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
@@ -357,54 +358,54 @@ static bool nbt_test_wins(struct torture_context *tctx)
name.type = NBT_NAME_CLIENT;
name.scope = NULL;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, true);
name.type = NBT_NAME_MASTER;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP, false);
name.type = NBT_NAME_SERVER;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, true);
name.type = NBT_NAME_LOGON;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP, false);
name.type = NBT_NAME_BROWSER;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP, false);
name.type = NBT_NAME_PDC;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, true);
name.type = 0xBF;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, true);
name.type = 0xBE;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
name.scope = "example";
name.type = 0x72;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, true);
name.scope = "example";
name.type = 0x71;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H | NBT_NM_GROUP, false);
name.scope = "foo.example.com";
name.type = 0x72;
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
name.name = talloc_asprintf(tctx, "_T\01-%5u.foo", r);
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
name.name = "";
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
name.name = talloc_asprintf(tctx, ".");
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
name.name = talloc_asprintf(tctx, "%5u-\377\200\300FOO", r);
- ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H);
+ ret &= nbt_test_wins_name(tctx, address, &name, NBT_NODE_H, false);
return ret;
}