Use TestCase.get_credentials() where possible.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 3 Jan 2011 00:13:09 +0000 (01:13 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 3 Jan 2011 00:48:05 +0000 (01:48 +0100)
source4/torture/drs/python/delete_object.py
source4/torture/drs/python/fsmo.py
source4/torture/drs/python/repl_schema.py
source4/torture/libnet/python/samr-test.py

index 1762d8fed9c8a8cd3cc0fb57d8eb86a5ee503162..0693898a289c42ddba2089450bb634a0ae6b5d61 100644 (file)
@@ -130,7 +130,7 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
         # find out where is net command
         samba_tool_cmd = os.path.abspath("./bin/samba-tool")
         # make command line credentials string
-        creds = samba.tests.cmdline_credentials
+        creds = self.get_credentials()
         cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(),
                                          creds.get_username(), creds.get_password())
         # bin/samba-tool drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context>
index 880c8db1b90eee236c6b94d4ea9c80f6ce23a5f9..cdee7ab51894cea4230aeabcec4f0d7b282d7de9 100644 (file)
@@ -92,7 +92,7 @@ class DrsFsmoTestCase(samba.tests.TestCase):
         # find out where is samba-tool command
         net_cmd = os.path.abspath("./bin/samba-tool")
         # make command line credentials string
-        creds = samba.tests.cmdline_credentials
+        creds = self.get_credentials()
         cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(),
                                          creds.get_username(), creds.get_password())
         # bin/samba-tool fsmo transfer --role=role --host=ldap://DC:389
index ea446264729d19942fd9d70b16eedd328aa7dad5..a98452ed13f7c4b9af4eba35813b051ac40a282a 100644 (file)
@@ -92,7 +92,7 @@ class DrsReplSchemaTestCase(samba.tests.TestCase):
         # find out where is net command
         samba_tool_cmd = os.path.abspath("./bin/samba-tool")
         # make command line credentials string
-        creds = samba.tests.cmdline_credentials
+        creds = self.get_credentials()
         cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(),
                                          creds.get_username(), creds.get_password())
         # bin/samba-tool drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context>
index a63236b7e6081373d89e28a73bada2d64a0c963a..fcd31c4b02ff5e3666ea73a408c5fbb03b8a7a3f 100644 (file)
@@ -32,16 +32,14 @@ from samba import net
 import samba.tests
 
 if not "ACCOUNT_NAME" in os.environ.keys():
-    parser.error("Please supply ACCOUNT_NAME in environment")
+    raise Exception("Please supply ACCOUNT_NAME in environment")
 
 if not "NEW_PASS" in os.environ.keys():
-    parser.error("Please supply NEW_PASS in environment")
+    raise Exception("Please supply NEW_PASS in environment")
 
 account_name = os.environ["ACCOUNT_NAME"]
 new_pass = os.environ["NEW_PASS"]
 
-creds = samba.tests.cmdline_credentials
-
 #
 # Tests start here
 #
@@ -51,6 +49,7 @@ class Libnet_SetPwdTest(samba.tests.TestCase):
     ########################################################################################
 
     def test_SetPassword(self):
+        creds = self.get_credentials()
         net.SetPassword(account_name=account_name,
                         domain_name=creds.get_domain(),
                         newpassword=new_pass,