selftest: Add and use new helper function get_creds_ccache_name()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 6 Jul 2017 04:29:14 +0000 (16:29 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 27 Jul 2017 22:25:14 +0000 (00:25 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/__init__.py
source4/torture/drs/python/drs_base.py

index 07c68c4e9f2d2fc0401314b254707de6478fb7fa..2ddfd9d2273f398c72d9e5ef24f32e40d7ef61f3 100644 (file)
@@ -67,6 +67,13 @@ class TestCase(unittest.TestCase):
     def get_credentials(self):
         return cmdline_credentials
 
+    def get_creds_ccache_name(self):
+        creds = self.get_credentials()
+        ccache = creds.get_named_ccache(self.get_loadparm())
+        ccache_name = ccache.get_name()
+
+        return ccache_name
+
     def hexdump(self, src):
         N = 0
         result = ''
index 8af1af34f80630d7d2c81521b360f35d1fbd0cef..9abfa159a0292c441e4d2c502aa92706d7ee897a 100644 (file)
@@ -101,9 +101,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
     def _samba_tool_cmd_list(self, drs_command):
         # make command line credentials string
 
-        creds = self.get_credentials()
-        ccache = creds.get_named_ccache(self.get_loadparm())
-        ccache_name = ccache.get_name()
+        ccache_name = self.get_creds_ccache_name()
 
         # Tunnel the command line credentials down to the
         # subcommand to avoid a new kinit