self.waitForMessages(1, dn=dn)
self.discardMessages()
- def tearDown(self):
- super(AuditLogPassChangeTests, self).tearDown()
-
def test_net_change_password(self):
dn = "CN=" + USER_NAME + ",CN=Users," + self.base_dn
super(AuthLogTests, self).setUp()
self.remoteAddress = os.environ["CLIENT_IP"]
- def tearDown(self):
- super(AuthLogTests, self).tearDown()
-
def smb_connection(self, creds, use_spnego="yes", ntlmv2_auth="yes",
force_smb1=False):
# the SMB bindings rely on having a s3 loadparm
super(AuthLogTestsNcalrpc, self).setUp()
self.remoteAddress = AS_SYSTEM_MAGIC_PATH_TOKEN
- def tearDown(self):
- super(AuthLogTestsNcalrpc, self).tearDown()
-
def _test_rpc_ncaclrpc(self, authTypes, binding, creds,
protection, checkFunction):
def _authDescription(self):
return "samr_ChangePasswordUser4"
- def tearDown(self):
- super(AuthLogPassChangeTests, self).tearDown()
-
def test_admin_change_password(self):
def isLastExpectedMessage(msg):
return ((msg["type"] == "Authentication") and
"""Blackbox tests for JSON output of the net ads suite of commands."""
subcmd = None
- def setUp(self):
- super(BaseWrapper.NetAdsJSONTests_Base, self).setUp()
-
def test_json_wellformed (self):
"""The output of ``--json`` commands must parse as JSON."""
argv = "%s %s --json" % (COMMAND, self.subcmd)
class BasicSmbCaclsTests(SmbCaclsBlockboxTestBase):
- def setUp(self):
- super(BasicSmbCaclsTests, self).setUp()
-
def test_simple_single_set(self):
"""test smbcacls '--set' attempts to overwrite the ACL for the file
self.smb_cacls(["--modify", file_acl_str, self.f1])
self.smb_cacls(["--modify", file_acl_str, self.f2])
self.smb_cacls(["--modify", file_acl_str, self.f3])
-
- def tearDown(self):
- super(DfsInheritanceSmbCaclsTests, self).tearDown()
from samba import NTSTATUSError
class RpcBindingTests(RpcInterfaceTestCase):
- def setUp(self):
- super(RpcBindingTests, self).setUp()
def get_user_creds(self):
c = Credentials()
from samba.trust_utils import CreateTrustedDomainRelax
class CreateTrustedDomainRelaxTest(TestCase):
- def setUp(self):
- super(CreateTrustedDomainRelaxTest, self).setUp()
def get_user_creds(self):
c = Credentials()
self.lp,
self.creds)
- def tearDown(self):
- super(TestRPCRoundtrip, self).tearDown()
-
def rpc_update(self, fqn=None, data=None, wType=None, delete=False):
fqn = fqn or ("rpctestrec." + self.get_dns_domain())
self.base_dn = res[0]["defaultNamingContext"][0]
self.forest_level = int(res[0]["forestFunctionality"][0])
- def tearDown(self):
- super(SchemaAttributesTestCase, self).tearDown()
-
def _ldap_schemaUpdateNow(self):
ldif = """
dn:
class GlueTests(samba.tests.TestCase):
- def setUp(self):
- super(GlueTests, self).setUp()
-
def test_generate_random_str(self):
string = _glue.generate_random_str(10)
self.assertEqual(type(string), str)
self.lp.load_default()
self.creds = self.insta_creds(template=self.get_credentials())
- def tearDown(self):
- super(GPOTests, self).tearDown()
-
def test_gpo_list(self):
global poldir, dspath
gpos = get_gpo_list(self.server, self.creds, self.lp,
self.lp.load_default()
self.creds = self.insta_creds(template=self.get_credentials())
- def tearDown(self):
- super(GPOTests, self).tearDown()
-
def test_sec_ext_load_on_member(self):
cache_dir = self.lp.get('cache directory')
store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb'))
class LdapReferralTest(samba.tests.TestCase):
- def setUp(self):
- super(LdapReferralTest, self).setUp()
-
# The referral entries for an ldap request should have the ldap scheme
# i.e. then should all start with "ldap://"
def test_ldap_search(self):
self.lp.set("lock dir", self.tempdir)
self.lp.set("state directory", self.tempdir)
- def tearDown(self):
- super(NetJoinTests, self).tearDown()
-
def test_net_join(self):
netbios_name = "NetJoinTest"
machinepass = "abcdefghij"
self.lp.set("lock dir", self.tempdir)
self.lp.set("state directory", self.tempdir)
- def tearDown(self):
- super(NetJoinNoSpnegoTests, self).tearDown()
-
def test_net_join_no_spnego(self):
self.lp.set("client ipc max protocol", "NT1")
self.lp.set("client use spnego", "no")
self.ifc = os.environ["SERVER_IP"]
self.dc = os.environ["DC_NETBIOSNAME"]
- def tearDown(self):
- super(NetBiosTests, self).tearDown()
-
def test_query_name(self):
(reply_from, names, addresses) = self.n.query_name(self.dc, self.ifc, timeout=4)
assert reply_from == self.ifc
self.creds.guess(self.lp)
- def tearDown(self):
- super(NetlogonServiceTests, self).tearDown()
-
def test_have_netlogon_connection(self):
try:
c = self.get_netlogon_connection()
self.creds.set_password(os.getenv("PASSWORD"))
self.creds.set_kerberos_state(DONT_USE_KERBEROS)
- def tearDown(self):
- super(NtlmDisabledTests, self).tearDown()
-
def test_ntlm_connection(self):
try:
conn = srvsvc.srvsvc("ncacn_np:%s[smb2,ntlm]" % self.server, self.lp, self.creds)
class PassWordHashFl2003Tests(PassWordHashTests):
- def setUp(self):
- super(PassWordHashFl2003Tests, self).setUp()
-
def test_default_supplementalCredentials(self):
self.add_user(options=[("password hash userPassword schemes", "")])
class PassWordHashFl2008Tests(PassWordHashTests):
- def setUp(self):
- super(PassWordHashFl2008Tests, self).setUp()
-
def test_default_supplementalCredentials(self):
self.add_user()
class PassWordHashGpgmeTests(PassWordHashTests):
- def setUp(self):
- super(PassWordHashGpgmeTests, self).setUp()
-
def test_default_supplementalCredentials(self):
self.add_user()
if not self.lp.get("password hash gpg key ids"):
class PassWordHashLDAPTests(PassWordHashTests):
- def setUp(self):
- super(PassWordHashLDAPTests, self).setUp()
-
# Get the supplemental credentials for the user under test
def get_supplemental_creds_drs(self):
binding_str = "ncacn_ip_tcp:%s[seal]" % os.environ["SERVER"]
lp_ctx = self.get_loadparm()
self.msg_ctx = Messaging(lp_ctx=lp_ctx)
- def tearDown(self):
- super(PreforkProcessRestartTests, self).tearDown()
-
def get_process_data(self):
services = self.msg_ctx.irpc_all_servers()
class StandardModelProcessLimitTests(TestCase):
- def setUp(self):
- super(StandardModelProcessLimitTests, self).setUp()
-
- def tearDown(self):
- super(StandardModelProcessLimitTests, self).tearDown()
-
def simple_bind(self):
creds = self.insta_creds(template=self.get_credentials())
creds.set_bind_dn("%s\\%s" % (creds.get_domain(),
self.server = os.environ["SERVER"]
self.lp = self.get_loadparm()
- def tearDown(self):
- super(NetS3JoinTests, self).tearDown()
-
def test_net_join(self):
netbios_name = "S3NetJoinTest"
machinepass = "abcdefghij"
self.samdb = self.getSamDB("-H", "ldap://%s" % os.environ["DC_SERVER"],
"-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
- def tearDown(self):
- super(SchemaCmdTestCase, self).tearDown()
-
def test_display_attribute(self):
"""Tests that we can display schema attributes"""
(result, out, err) = self.runsublevelcmd("schema", ("attribute",
users = []
samdb = None
- def setUp(self):
- super(UserCmdCryptShaTestCase, self).setUp()
-
def add_user(self, hashes=""):
self.lp = samba.tests.env_loadparm()
users = []
samdb = None
- def setUp(self):
- super(UserCmdCryptShaTestCase, self).setUp()
-
def add_user(self, hashes=""):
self.lp = samba.tests.env_loadparm()
class SambaToolVisualizeDrsTest(SambaToolCmdTest):
- def setUp(self):
- super(SambaToolVisualizeDrsTest, self).setUp()
def test_ntdsconn(self):
server = "ldap://%s" % os.environ["SERVER"]
class SamDBApiTestCase(TestCaseInTempDir):
- def setUp(self):
- super(SamDBApiTestCase, self).setUp()
-
def tearDown(self):
self.rm_files("test.db", "existing.db", allow_missing=True)
class TDBUtilTests(samba.tests.TestCaseInTempDir):
- def setUp(self):
- super(TDBUtilTests, self).setUp()
-
def test_tdb_copy(self):
src_ldb_file = os.path.join(self.tempdir, "source.ldb")
dst_ldb_file = os.path.join(self.tempdir, "destination.ldb")