summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/tests
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-10-29 15:36:36 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-10-31 08:13:56 +1100
commit42c379f0dfdeb36598bb2636aa2b6e3ca4410930 (patch)
tree0a07ca9ea71162c281d7a397763a081a2f62283e /source4/scripting/python/samba/tests
parenta732f2a621665923322422c5a3d788c9d1aa8df9 (diff)
downloadsamba-42c379f0dfdeb36598bb2636aa2b6e3ca4410930.tar.gz
samba-42c379f0dfdeb36598bb2636aa2b6e3ca4410930.tar.xz
samba-42c379f0dfdeb36598bb2636aa2b6e3ca4410930.zip
samba-tool: Add samba-tool processes subcommand
This will allow administrators to inspect the process list in a similar way to what running on a platform with setproctitle might permit. --pid= returns the registered server names for a PID (eg kdc, cldap_server) --name= returns the pids registered with a particular name. Andrew Bartlett
Diffstat (limited to 'source4/scripting/python/samba/tests')
-rw-r--r--source4/scripting/python/samba/tests/samba_tool/processes.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/samba_tool/processes.py b/source4/scripting/python/samba/tests/samba_tool/processes.py
new file mode 100644
index 00000000000..91a5266b54a
--- /dev/null
+++ b/source4/scripting/python/samba/tests/samba_tool/processes.py
@@ -0,0 +1,35 @@
+# Unix SMB/CIFS implementation.
+# Copyright (C) Andrew Bartlett 2012
+#
+# based on time.py:
+# Copyright (C) Sean Dague <sdague@linux.vnet.ibm.com> 2011
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import os
+from samba.tests.samba_tool.base import SambaToolCmdTest
+
+class ProcessCmdTestCase(SambaToolCmdTest):
+ """Tests for samba-tool process subcommands"""
+
+ def test_name(self):
+ """Run processes command"""
+ (result, out, err) = self.runcmd("processes", "--name", "samba")
+ self.assertCmdSuccess(result, "Ensuring processes ran successfully")
+
+ def test_all(self):
+ """Run processes command"""
+ (result, out, err) = self.runcmd("processes")
+ self.assertCmdSuccess(result, "Ensuring processes ran successfully")