📄 notes.txt
字号:
-*- indented-text -*-(set lotus no)Notes on using comfychair with Samba (samba testing framework units):The tests need to rely on some external resources, such as If suitable resources are not available, need to skip particulartests. Must include a message indicating what resources would beneeded to run that test. (e.g. must be root.)We want to be able to select and run particular subsets of tests, suchas "all winbind tests".We want to keep the number of configurable parameters down as much aspossible, to make it easy on people running the tests.Wherever possible, the tests should set up their preconditions, but afew basic resources need to be provided by the people running thetests. So for example, rather than asking the user for the name of anon-root user, we should give the tests the administrator name andpassword, and it can create a new user to use.This makes it simpler to get the tests running, and possible alsomakes them more reproducible.In the future, rather than using NT machines provided by the testperson, we might have a way to drive VMWare non-persistent sessions,to make tests even more tightly controlled.Another design question is how to communicate this information to thetests. If there's a lot of settings, then it might need to be storedin a configuration file. However, if we succeed in cutting down the number of parameters, thenit might be straightforward to pass the information on the commandline or in an environment variable. Environment variables are probably better because they can't be seenby other users, and they are more easily passed down through aninvocation of "make check".Notes on Samba Testing Framework for Unittests----------------------------------------------This is to be read after reading the notes.txt from comfychair. I'mproposing a slightly more concrete description of what's describedthere.The model of having tests require named resources looks useful forincorporation into a framework that can be run by many people inwidely different environments.Some possible environments for running the test framework in are: - Casual downloader of Samba compiling from source and just wants to run 'make check'. May only have one Unix machine and a handful of clients. - Samba team member with access to a small number of other machines or VMware sessions. - PSA developer who may not have intimate knowledge of Samba internals and is only interested in testing against the PSA. - Non-team hacker wanting to run test suite after making small hacks. - Build farm environment (loaner machine with no physical access or root privilege). - HP BAT.Developers in most of these environments are also potential test caseauthors. It should be easy for people unfamiliar with the frameworkto write new tests and have them work. We should provide examples andthe existing tests should well written and understandable.Different types of tests: - Tests that check Samba internals and link against libbigballofmud.so. For example: - Upper/lowercase string functions - user_in_list() for large lists - Tests that use the Samba Python extensions. - Tests that execute Samba command line programs, for example smbpasswd. - Tests that require other resources on the network such as domain controllers or PSAs. - Tests that are performed on the documentation or the source code such as: - grep for common spelling mistakes made by abartlet (-: - grep for company copyright (IBM, HP) - Link to other existing testing frameworks (smbtorture, abartlet's bash based build farm tests)I propose a TestResourceManager which would be instantiated by a testcase. The test case would require("resourcename") as part of itsconstructor and raise a comfychair.NotRun exception if the resourcewas not present. A TestResource class could be defined which couldread a configuration file or examine a environment variable andregister a resource only if some condition was satisfied.It would be nice to be able to completely separate the PSA testingfrom the test framework. This would entail being able to define testresources dynamically, possibly with a plugin type system.class TestResourceManager: def __init__(self, name): self.resources = {} def register(self, resource): name = resource.name() if self.resources.has_key(name): raise "Test manager already has resource %s" % name self.resources[name] = resource def require(self, resource_name): if not self.resources.has_key(resource_name): raise "Test manager does not have resources %s" % resource_nameclass TestResource: def __init__(self, name): self.name = name def name(self): return self.nameimport ostrm = TestResourceManager()if os.getuid() == 0: trm.register(TestResource("root"))A config-o-matic Python module can take a list of machines andadministrator%password entries and classify them by operating systemversion and service pack. These resources would be registered withthe TestResourceManager.Some random thoughts about named resources for network servers:require("nt4.sp3")require("nt4.domaincontroller")require("psa")Some kind of format for location of passwords, libraries:require("exec(smbpasswd)")require("lib(bigballofmud)")maybe require("exec.smbpasswd") looks nicer...The require() function could return a dictionary of configurationinformation or some handle to fetch dynamic information on. We mayneed to create and destroy extra users or print queues. How to managecleanup of dynamic resources?Requirements for running stf: - Python, obviously - Samba python extensions
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -