mirror of
https://github.com/samba-team/samba.git
synced 2025-07-30 19:42:05 +03:00
Add convenience TestCase class for testing RPC interfaces.
(This used to be commit 2f19f98144
)
This commit is contained in:
committed by
Andrew Bartlett
parent
3170ae538a
commit
02f3695897
@ -90,3 +90,10 @@ def get_loadparm():
|
|||||||
lp = param.LoadParm()
|
lp = param.LoadParm()
|
||||||
lp.load(os.getenv("SMB_CONF_PATH"))
|
lp.load(os.getenv("SMB_CONF_PATH"))
|
||||||
return lp
|
return lp
|
||||||
|
|
||||||
|
class RpcInterfaceTestCase(unittest.TestCase):
|
||||||
|
def get_loadparm(self):
|
||||||
|
return get_loadparm()
|
||||||
|
|
||||||
|
def get_credentials(self):
|
||||||
|
return None
|
||||||
|
@ -18,14 +18,13 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import winreg
|
import winreg
|
||||||
from param import LoadParm
|
|
||||||
import unittest
|
import unittest
|
||||||
from samba.tests import get_loadparm
|
from samba.tests import RpcInterfaceTestCase
|
||||||
|
|
||||||
class WinregTests(unittest.TestCase):
|
class WinregTests(RpcInterfaceTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
lp_ctx = get_loadparm()
|
self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(),
|
||||||
self.conn = winreg.winreg("ncalrpc:", lp_ctx)
|
self.get_credentials())
|
||||||
|
|
||||||
def get_hklm(self):
|
def get_hklm(self):
|
||||||
return self.conn.OpenHKLM(None,
|
return self.conn.OpenHKLM(None,
|
||||||
|
Reference in New Issue
Block a user