diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-02-22 12:10:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:02 -0500 |
commit | f2f3e1801b54e6ead595d66ea7c798fc2df22a0a (patch) | |
tree | bae8c3227de15ff0ead7d0bbaebad452da5a66d6 /source4/torture | |
parent | e68802a2a6600eeade91f6bf8ac591361785c76c (diff) | |
download | samba-f2f3e1801b54e6ead595d66ea7c798fc2df22a0a.tar.gz samba-f2f3e1801b54e6ead595d66ea7c798fc2df22a0a.tar.xz samba-f2f3e1801b54e6ead595d66ea7c798fc2df22a0a.zip |
r13627: split the NBT-WINSREPLICATION tests into multiple tests
metze
(This used to be commit ae559920e1d227e4e787fe34d908a965b922b284)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/nbt/winsreplication.c | 67 | ||||
-rw-r--r-- | source4/torture/torture.c | 4 |
2 files changed, 66 insertions, 5 deletions
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index cf6f3d4ed7..b53c55ca08 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9619,16 +9619,15 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } /* - test WINS replication operations + test simple WINS replication operations */ -BOOL torture_nbt_winsreplication(void) +BOOL torture_nbt_winsreplication_simple(void) { const char *address; struct nbt_name name; TALLOC_CTX *mem_ctx = talloc_new(NULL); NTSTATUS status; BOOL ret = True; - struct test_wrepl_conflict_conn *ctx; make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); @@ -9646,13 +9645,73 @@ BOOL torture_nbt_winsreplication(void) ret &= test_wins_replication(mem_ctx, address); - if (lp_parm_bool(-1, "torture", "quick", False)) goto done; +done: + talloc_free(mem_ctx); + + return ret; +} + +/* + test WINS replication replica conflicts operations +*/ +BOOL torture_nbt_winsreplication_replica(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + struct test_wrepl_conflict_conn *ctx; + + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } ctx = test_create_conflict_ctx(mem_ctx, address); if (!ctx) return False; ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); + +done: + talloc_free(mem_ctx); + + return ret; +} + +/* + test WINS replication owned conflicts operations +*/ +BOOL torture_nbt_winsreplication_owned(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + struct test_wrepl_conflict_conn *ctx; + + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } + + ctx = test_create_conflict_ctx(mem_ctx, address); + if (!ctx) return False; + ret &= test_conflict_owned_released_vs_replica(ctx); ret &= test_conflict_owned_active_vs_replica(ctx); diff --git a/source4/torture/torture.c b/source4/torture/torture.c index a7e0fdd52d..aad44e4a16 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -2346,8 +2346,10 @@ static struct { {"NBT-REGISTER", torture_nbt_register, 0}, {"NBT-WINS", torture_nbt_wins, 0}, {"NBT-DGRAM", torture_nbt_dgram, 0}, - {"NBT-WINSREPLICATION", torture_nbt_winsreplication, 0}, {"NBT-BROWSE", torture_nbt_browse, 0}, + {"NBT-WINSREPLICATION-SIMPLE", torture_nbt_winsreplication_simple, 0}, + {"NBT-WINSREPLICATION-REPLICA", torture_nbt_winsreplication_replica, 0}, + {"NBT-WINSREPLICATION-OWNED", torture_nbt_winsreplication_owned, 0}, /* libnet tests */ {"NET-USERINFO", torture_userinfo, 0}, |