[Buildbot-commits] buildbot/buildbot/test test_slaves.py, 1.12, 1.13

Brian Warner warner at users.sourceforge.net
Tue Aug 7 20:23:41 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10394/buildbot/test

Modified Files:
	test_slaves.py 
Log Message:
[project @ have BuildSlaves track their associated SlaveBuilders]

Original author: warner at lothar.com
Date: 2007-08-07 19:59:19+00:00

Index: test_slaves.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slaves.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- test_slaves.py	7 Aug 2007 19:21:40 -0000	1.12
+++ test_slaves.py	7 Aug 2007 20:23:39 -0000	1.13
@@ -440,3 +440,34 @@
         reasons = [build.getReason() for build in builds]
         self.failUnlessEqual(reasons, ["first", "second"])
 
+config_multi_builders = config_1 + """
+c['builders'] = [
+    {'name': 'dummy', 'slavenames': ['bot1','bot2','bot3'],
+     'builddir': 'b1', 'factory': f2},
+    {'name': 'dummy2', 'slavenames': ['bot1','bot2','bot3'],
+     'builddir': 'b2', 'factory': f2},
+    {'name': 'dummy3', 'slavenames': ['bot1','bot2','bot3'],
+     'builddir': 'b3', 'factory': f2},
+    ]
+
+"""
+
+class BuildSlave(RunMixin, unittest.TestCase):
+    def test_track_builders(self):
+        self.master.loadConfig(config_multi_builders)
+        self.master.readConfig = True
+        self.master.startService()
+        d = self.connectSlave()
+
+        def _check(res):
+            b = self.master.botmaster.builders['dummy']
+            self.failUnless(len(b.slaves) == 1) # just bot1
+
+            bs = b.slaves[0].slave
+            self.failUnless(len(bs.slavebuilders) == 3)
+            self.failUnless(b in [sb.builder for sb in bs.slavebuilders])
+
+            return self.master.stopService()
+        d.addCallback(_check)
+        return d
+





More information about the Commits mailing list