samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r13627 - in branches/SAMBA_4_0/source: script/tests to

Subject: svn commit: samba r13627 - in branches/SAMBA_4_0/source: script/tests torture torture/nbt
From:
Date: Wed, 22 Feb 2006 12:10:30 +0000 GMT
Author: metze
Date: 2006-02-22 12:10:29 +0000 (Wed, 22 Feb 2006)
New Revision: 13627

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13627

Log:
split the NBT-WINSREPLICATION tests into multiple tests

metze

Modified:
   branches/SAMBA_4_0/source/script/tests/test_nbt.sh
   branches/SAMBA_4_0/source/script/tests/tests_quick.sh
   branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_nbt.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/test_nbt.sh  2006-02-22 11:53:04 UTC 
(rev 13626)
+++ branches/SAMBA_4_0/source/script/tests/test_nbt.sh  2006-02-22 12:10:29 UTC 
(rev 13627)
@@ -21,7 +21,15 @@
 testit "nmblookup -U $SERVER $SERVER" bin/nmblookup $TORTURE_OPTIONS -U 
$SERVER $SERVER || failed=`expr $failed + 1`
 testit "nmblookup $SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER || 
failed=`expr $failed + 1`
 
-for f in NBT-REGISTER NBT-WINS NBT-WINSREPLICATION NET-API-LOOKUP 
NET-API-LOOKUPHOST NET-API-LOOKUPPDC; do
+NBT_TESTS="NBT-REGISTER NBT-WINS"
+NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION-SIMPLE"
+NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION-REPLICA"
+if [ "$TORTURE_QUICK"x = "yes"x ]; then
+       NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION-OWNED"
+fi
+NBT_TESTS="$NBT_TESTS NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-LOOKUPPDC"
+
+for f in $NBT_TESTS; do
     testit "$f" bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ $f || 
failed=`expr $failed + 1`
 done
 

Modified: branches/SAMBA_4_0/source/script/tests/tests_quick.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/tests_quick.sh       2006-02-22 
11:53:04 UTC (rev 13626)
+++ branches/SAMBA_4_0/source/script/tests/tests_quick.sh       2006-02-22 
12:10:29 UTC (rev 13627)
@@ -1,4 +1,5 @@
 TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:quick=yes"
+TORTURE_QUICK="yes"
 
 $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD || failed=`expr 
$failed + $?`
 $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD || failed=`expr 
$failed + $?`

Modified: branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/winsreplication.c     2006-02-22 
11:53:04 UTC (rev 13626)
+++ branches/SAMBA_4_0/source/torture/nbt/winsreplication.c     2006-02-22 
12:10:29 UTC (rev 13627)
@@ -9619,16 +9619,15 @@
 }
 
 /*
-  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 @@
 
        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);
 

Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c 2006-02-22 11:53:04 UTC (rev 
13626)
+++ branches/SAMBA_4_0/source/torture/torture.c 2006-02-22 12:10:29 UTC (rev 
13627)
@@ -2346,8 +2346,10 @@
        {"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},

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r13627 - in branches/SAMBA_4_0/source: script/tests torture torture/nbt, metze <=