[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Mon Mar 26 16:33:04 MDT 2012


The branch, master has been updated
       via  95ebb11 selftest.py: Add get_interface.
      from  a9da040 ndr: Update ABI.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 95ebb111ba7e5fbc1e8ca6c560c473d24c5d6c2d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Mar 25 21:38:59 2012 +0100

    selftest.py: Add get_interface.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Tue Mar 27 00:32:48 CEST 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/samba.py     |   34 ++++++++++++++++++++++++++++++++++
 selftest/tests/test_samba.py |   15 +++++++++++----
 2 files changed, 45 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/samba.py b/selftest/target/samba.py
index 1ea156c..666d223 100644
--- a/selftest/target/samba.py
+++ b/selftest/target/samba.py
@@ -119,3 +119,37 @@ def cleanup_child(pid, name, outf=None):
     else:
         outf.write("%s child process %d exited with value %d.\n" % (name, childpid, status >> 8))
     return childpid
+
+
+def get_interface(netbiosname):
+    """Return interface id for a particular server.
+    """
+    netbiosname = netbiosname.lower()
+
+    interfaces = {
+        "locals3dc2": 2,
+        "localmember3": 3,
+        "localshare4": 4,
+        "localserver5": 5,
+        "localktest6": 6,
+        "maptoguest": 7,
+
+        # 11-16 used by selftest.pl for client interfaces
+        "localdc": 21,
+        "localvampiredc": 22,
+        "s4member": 23,
+        "localrpcproxy": 24,
+        "dc5": 25,
+        "dc6": 26,
+        "dc7": 27,
+        "rodc": 28,
+        "localadmember": 29,
+        "plugindc": 30,
+        "localsubdc": 31,
+        "chgdcpass": 32,
+    }
+
+    # update lib/socket_wrapper/socket_wrapper.c
+    #  #define MAX_WRAPPED_INTERFACES 32
+    # if you wish to have more than 32 interfaces
+    return interfaces[netbiosname]
diff --git a/selftest/tests/test_samba.py b/selftest/tests/test_samba.py
index f06d846..b49463e 100644
--- a/selftest/tests/test_samba.py
+++ b/selftest/tests/test_samba.py
@@ -19,16 +19,13 @@
 
 """Tests for selftest.target.samba."""
 
-import os
-import sys
-
 from cStringIO import StringIO
 
 from selftest.tests import TestCase
 
 from selftest.target.samba import (
     bindir_path,
-    cleanup_child,
+    get_interface,
     mk_realms_stanza,
     write_krb5_conf,
     )
@@ -107,3 +104,13 @@ class WriteKrb5ConfTests(TestCase):
  }
 
 ''', f.getvalue())
+
+
+class GetInterfaceTests(TestCase):
+
+    def test_get_interface(self):
+        self.assertEquals(21, get_interface("localdc"))
+        self.assertEquals(4, get_interface("localshare4"))
+
+    def test_unknown(self):
+        self.assertRaises(KeyError, get_interface, "unknown")


-- 
Samba Shared Repository


More information about the samba-cvs mailing list