summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-12-24 05:50:58 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-12-25 14:15:53 +0100
commit33699bb1be03f0288562c899aa8f3963ff1cc312 (patch)
tree3f415d929b8e48a512c9d65283d557698a79314a /source4/torture/libnet
parent20c7c27322e95ab75ea711a825e593b0adac9114 (diff)
downloadsamba-33699bb1be03f0288562c899aa8f3963ff1cc312.tar.gz
samba-33699bb1be03f0288562c899aa8f3963ff1cc312.tar.bz2
samba-33699bb1be03f0288562c899aa8f3963ff1cc312.zip
s4-libnet: Simple test for net.SetPassword() python binding
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/python/samr-test.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/source4/torture/libnet/python/samr-test.py b/source4/torture/libnet/python/samr-test.py
new file mode 100644
index 0000000000..d68456b79d
--- /dev/null
+++ b/source4/torture/libnet/python/samr-test.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Unix SMB/CIFS implementation.
+# Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
+#
+# 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/>.
+#
+
+#
+# Usage:
+# export ACCOUNT_NAME=kamen
+# export NEW_PASS=test
+# export SUBUNITRUN=$samba4srcdir/scripting/bin/subunitrun
+# PYTHONPATH="$samba4srcdir/torture/libnet/python" $SUBUNITRUN samr-test -Ukma-exch.devel/Administrator%333
+#
+
+import sys
+import os
+
+from samba import net
+import unittest
+import samba.tests
+
+if not "ACCOUNT_NAME" in os.environ.keys():
+ parser.error("Please supply ACCOUNT_NAME in environment")
+
+if not "NEW_PASS" in os.environ.keys():
+ parser.error("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
+#
+
+class Libnet_SetPwdTest(unittest.TestCase):
+
+ ########################################################################################
+
+ def test_SetPassword(self):
+ net.SetPassword(account_name=account_name,
+ domain_name=creds.get_domain(),
+ newpassword=new_pass,
+ credentials=creds)
+
+ ########################################################################################
+