Exemplo n.º 1
0
    def test_attached_callRemote_getSlaveInfo(self):
        slave = self.createBuildslave()
        yield slave.startService()

        ENVIRON = {}

        bot = createRemoteBot()
        bot.response['getSlaveInfo'] = mock.Mock(
            return_value=defer.succeed({
                'admin': 'TheAdmin',
                'host': 'TheHost',
                'access_uri': 'TheURI',
                'environ': ENVIRON,
                'basedir': 'TheBaseDir',
                'system': 'TheSlaveSystem'
            }))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_status.getAdmin(), "TheAdmin")
        self.assertEqual(slave.slave_status.getHost(), "TheHost")
        self.assertEqual(slave.slave_status.getAccessURI(), "TheURI")
        self.assertEqual(slave.slave_environ, ENVIRON)
        self.assertEqual(slave.slave_basedir, 'TheBaseDir')
        self.assertEqual(slave.slave_system, 'TheSlaveSystem')
Exemplo n.º 2
0
    def test_attached_remoteGetSlaveInfo(self):
        slave = self.createBuildslave()
        yield slave.startService()

        ENVIRON = {}
        COMMANDS = {'cmd1': '1', 'cmd2': '1'}

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
            'environ': ENVIRON,
            'basedir': 'TheBaseDir',
            'system': 'TheSlaveSystem',
            'version': 'version',
            'slave_commands': COMMANDS,
        }
        yield slave.attached(conn)

        # check the values get set right
        self.assertEqual(slave.slave_status.getAdmin(), "TheAdmin")
        self.assertEqual(slave.slave_status.getHost(), "TheHost")
        self.assertEqual(slave.slave_status.getAccessURI(), "TheURI")
        self.assertEqual(slave.slave_environ, ENVIRON)
        self.assertEqual(slave.slave_basedir, 'TheBaseDir')
        self.assertEqual(slave.slave_system, 'TheSlaveSystem')
        self.assertEqual(slave.slave_commands, COMMANDS)
Exemplo n.º 3
0
    def test_startService_setSlaveInfo_UpdatesDb(self):
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot',
                              info={
                                  'admin': 'TheAdmin',
                                  'host': 'TheHost',
                                  'access_uri': 'TheURI',
                                  'version': 'TheVersion',
                                  'key': 'value',
                              })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        # change a value
        slave.slave_status.updateInfo(key='new-value')
        self.clock.pump(
            [0])  # we overrode the reactor, so gotta force the calls
        yield eventual.flushEventualQueue()

        # and the db is updated too:
        slave_db = yield self.master.db.buildslaves.getBuildslaveByName("bot")

        self.assertEqual(slave_db['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(slave_db['slaveinfo']['host'], 'TheHost')
        self.assertEqual(slave_db['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(slave_db['slaveinfo']['version'], 'TheVersion')
        self.assertEqual(slave_db['slaveinfo']['key'], 'new-value')
Exemplo n.º 4
0
    def test_startService_setSlaveInfo_UpdatesDb(self):
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot', info={
                'admin': 'TheAdmin',
                'host': 'TheHost',
                'access_uri': 'TheURI',
                'version': 'TheVersion',
                'key': 'value',
            })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        # change a value
        slave.slave_status.updateInfo(key='new-value')
        self.clock.pump([0])  # we overrode the reactor, so gotta force the calls
        yield eventual.flushEventualQueue()

        # and the db is updated too:
        slave_db = yield self.master.db.buildslaves.getBuildslaveByName("bot")

        self.assertEqual(slave_db['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(slave_db['slaveinfo']['host'], 'TheHost')
        self.assertEqual(slave_db['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(slave_db['slaveinfo']['version'], 'TheVersion')
        self.assertEqual(slave_db['slaveinfo']['key'], 'new-value')
Exemplo n.º 5
0
    def test_attached_slaveInfoUpdates(self):
        # put in stale info:
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot',
                              info={
                                  'admin': 'WrongAdmin',
                                  'host': 'WrongHost',
                                  'access_uri': 'WrongURI',
                                  'version': 'WrongVersion'
                              })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
            'version': 'TheVersion',
        }
        yield slave.attached(conn)

        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')

        # and the db is updated too:
        buildslave = yield self.master.db.buildslaves.getBuildslave(name="bot")

        self.assertEqual(buildslave['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(buildslave['slaveinfo']['host'], 'TheHost')
        self.assertEqual(buildslave['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(buildslave['slaveinfo']['version'], 'TheVersion')
Exemplo n.º 6
0
    def test_attached_remoteGetSlaveInfo(self):
        slave = self.createBuildslave()
        yield slave.startService()

        ENVIRON = {}
        COMMANDS = {'cmd1': '1', 'cmd2': '1'}

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
            'environ': ENVIRON,
            'basedir': 'TheBaseDir',
            'system': 'TheSlaveSystem',
            'version': 'version',
            'slave_commands': COMMANDS,
        }
        yield slave.attached(conn)

        # check the values get set right
        self.assertEqual(slave.slave_status.getAdmin(), "TheAdmin")
        self.assertEqual(slave.slave_status.getHost(), "TheHost")
        self.assertEqual(slave.slave_status.getAccessURI(), "TheURI")
        self.assertEqual(slave.slave_environ, ENVIRON)
        self.assertEqual(slave.slave_basedir, 'TheBaseDir')
        self.assertEqual(slave.slave_system, 'TheSlaveSystem')
        self.assertEqual(slave.slave_commands, COMMANDS)
Exemplo n.º 7
0
    def test_slave_shutdown(self):
        slave = self.createBuildslave(attached=True)
        yield slave.startService()

        yield slave.shutdown()
        self.assertEqual(slave.conn.remoteCalls, [('remoteSetBuilderList', []),
                                                  ('remoteShutdown', )])
    def test_attached_callRemote_getSlaveInfo(self):
        slave = self.createBuildslave()
        yield slave.startService()

        ENVIRON = {}

        bot = createRemoteBot()
        bot.response['getSlaveInfo'] = mock.Mock(return_value=defer.succeed({
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
            'environ': ENVIRON,
            'basedir': 'TheBaseDir',
            'system': 'TheSlaveSystem'
        }))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_status.getAdmin(), "TheAdmin")
        self.assertEqual(slave.slave_status.getHost(), "TheHost")
        self.assertEqual(slave.slave_status.getAccessURI(), "TheURI")
        self.assertEqual(slave.slave_environ, ENVIRON)
        self.assertEqual(slave.slave_basedir, 'TheBaseDir')
        self.assertEqual(slave.slave_system, 'TheSlaveSystem')
Exemplo n.º 9
0
    def test_attached_slaveInfoUpdates(self):
        # put in stale info:
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot', info={
                'admin': 'WrongAdmin',
                'host': 'WrongHost',
                'access_uri': 'WrongURI',
                'version': 'WrongVersion'
            })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
            'version': 'TheVersion',
        }
        yield slave.attached(conn)

        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')

        # and the db is updated too:
        buildslave = yield self.master.db.buildslaves.getBuildslave(name="bot")

        self.assertEqual(buildslave['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(buildslave['slaveinfo']['host'], 'TheHost')
        self.assertEqual(buildslave['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(buildslave['slaveinfo']['version'], 'TheVersion')
Exemplo n.º 10
0
    def test_attached_slaveInfoUpdates(self):
        # put in stale info:
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot', info={
                'admin': 'WrongAdmin',
                'host': 'WrongHost',
                'access_uri': 'WrongURI',
                'version': 'WrongVersion'
            })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['getVersion'] = mock.Mock(
            return_value=defer.succeed("TheVersion"))
        bot.response['getSlaveInfo'] = mock.Mock(return_value=defer.succeed({
            'admin': 'TheAdmin',
            'host': 'TheHost',
            'access_uri': 'TheURI',
        }))
        yield slave.attached(bot)

        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')

        # and the db is updated too:
        buildslave = yield self.master.db.buildslaves.getBuildslaveByName("bot")

        self.assertEqual(buildslave['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(buildslave['slaveinfo']['host'], 'TheHost')
        self.assertEqual(buildslave['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(buildslave['slaveinfo']['version'], 'TheVersion')
Exemplo n.º 11
0
    def test_startService_getSlaveInfo_empty(self):
        slave = self.createBuildslave()
        yield slave.startService()

        self.assertEqual(slave.slave_status.getAdmin(), None)
        self.assertEqual(slave.slave_status.getHost(), None)
        self.assertEqual(slave.slave_status.getAccessURI(), None)
        self.assertEqual(slave.slave_status.getVersion(), None)
Exemplo n.º 12
0
    def test_startService_getSlaveInfo_empty(self):
        slave = self.createBuildslave()
        yield slave.startService()

        self.assertEqual(slave.slave_status.getAdmin(), None)
        self.assertEqual(slave.slave_status.getHost(), None)
        self.assertEqual(slave.slave_status.getAccessURI(), None)
        self.assertEqual(slave.slave_status.getVersion(), None)
Exemplo n.º 13
0
    def test_attached_callsMaybeStartBuildsForSlave(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        yield slave.attached(bot)

        self.assertEqual(self.botmaster.buildsStartedForSlaves, ["bot"])
Exemplo n.º 14
0
    def test_attached_callsMaybeStartBuildsForSlave(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        yield slave.attached(bot)

        self.assertEqual(self.botmaster.buildsStartedForSlaves, ["bot"])
Exemplo n.º 15
0
    def test_attached_callsMaybeStartBuildsForSlave(self):
        slave = self.createBuildslave()
        yield slave.startService()

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {}
        yield slave.attached(conn)

        self.assertEqual(self.botmaster.buildsStartedForSlaves, ["bot"])
Exemplo n.º 16
0
    def test_attached_callsMaybeStartBuildsForSlave(self):
        slave = self.createBuildslave()
        yield slave.startService()

        conn = fakeprotocol.FakeConnection(slave.master, slave)
        conn.info = {}
        yield slave.attached(conn)

        self.assertEqual(self.botmaster.buildsStartedForSlaves, ["bot"])
Exemplo n.º 17
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)
Exemplo n.º 18
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)
Exemplo n.º 19
0
    def test_attached_callRemote_print_raises(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['print'] = mock.Mock(
            return_value=defer.fail(ValueError()))
        yield slave.attached(bot)

        # just check that things still go on
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))
Exemplo n.º 20
0
    def test_startService_getSlaveInfo_empty(self):
        slave = self.createBuildslave()
        yield slave.startService()

        self.assertEqual(slave.slave_status.getAdmin(), None)
        self.assertEqual(slave.slave_status.getHost(), None)
        self.assertEqual(slave.slave_status.getAccessURI(), None)
        self.assertEqual(slave.slave_status.getVersion(), None)

        # check that a new slave row was added for this buildslave
        bs = yield self.master.db.buildslaves.getBuildslave(name='bot')
        self.assertEqual(bs['name'], 'bot')
Exemplo n.º 21
0
    def test_attached_callRemote_print_raises(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['print'] = mock.Mock(
            return_value=defer.fail(ValueError()))
        yield slave.attached(bot)

        # just check that things still go on
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))
Exemplo n.º 22
0
    def test_startService_getSlaveInfo_empty(self):
        slave = self.createBuildslave()
        yield slave.startService()

        self.assertEqual(slave.slave_status.getAdmin(), None)
        self.assertEqual(slave.slave_status.getHost(), None)
        self.assertEqual(slave.slave_status.getAccessURI(), None)
        self.assertEqual(slave.slave_status.getVersion(), None)

        # check that a new slave row was added for this buildslave
        bs = yield self.master.db.buildslaves.getBuildslave(name='bot')
        self.assertEqual(bs['name'], 'bot')
Exemplo n.º 23
0
    def test_attached_checkRemoteCalls(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        yield slave.attached(bot)

        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))
        self.assertEqual(bot.commands[0], ('print', 'attached'))
        self.assertEqual(bot.commands[1], ('getSlaveInfo',))
        self.assertEqual(bot.commands[2], ('getVersion',))
        self.assertEqual(bot.commands[3], ('getCommands',))
        self.assertEqual(bot.commands[4], ('setBuilderList', []))
Exemplo n.º 24
0
    def test_attached_checkRemoteCalls(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        yield slave.attached(bot)

        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))
        self.assertEqual(bot.commands[0], ('print', 'attached'))
        self.assertEqual(bot.commands[1], ('getSlaveInfo', ))
        self.assertEqual(bot.commands[2], ('getVersion', ))
        self.assertEqual(bot.commands[3], ('getCommands', ))
        self.assertEqual(bot.commands[4], ('setBuilderList', []))
Exemplo n.º 25
0
    def test_attached_callRemote_getVersion(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['getVersion'] = mock.Mock(
            return_value=defer.succeed("TheVersion"))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_status.getVersion(), "TheVersion")
Exemplo n.º 26
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)
        yield slave.stopService()

        self.assertEqual(self.master.pbmanager._unregistrations,
                         [('tcp:1234', 'bot')])
        self.assertEqual(self.master.pbmanager._registrations,
                         [('tcp:1234', 'bot', 'pass')])
Exemplo n.º 27
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)
        yield slave.stopService()

        self.assertEqual(self.master.pbmanager._unregistrations,
                         [('tcp:1234', 'bot')])
        self.assertEqual(self.master.pbmanager._registrations,
                         [('tcp:1234', 'bot', 'pass')])
Exemplo n.º 28
0
    def test_attached_callRemote_getVersion(self):
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['getVersion'] = mock.Mock(
            return_value=defer.succeed("TheVersion"))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_status.getVersion(), "TheVersion")
Exemplo n.º 29
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)
Exemplo n.º 30
0
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)
Exemplo n.º 31
0
    def test_startService_getSlaveInfo_fromDb(self):
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot', info={
                'admin': 'TheAdmin',
                'host': 'TheHost',
                'access_uri': 'TheURI',
                'version': 'TheVersion'
            })
        ])
        slave = self.createBuildslave()

        yield slave.startService()

        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')
Exemplo n.º 32
0
    def test_attached_callRemote_getCommands(self):
        slave = self.createBuildslave()
        yield slave.startService()

        COMMANDS = ['a', 'b']

        bot = createRemoteBot()
        bot.response['getCommands'] = mock.Mock(
            return_value=defer.succeed(COMMANDS))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_commands, COMMANDS)
Exemplo n.º 33
0
    def test_attached_callRemote_getCommands(self):
        slave = self.createBuildslave()
        yield slave.startService()

        COMMANDS = ['a', 'b']

        bot = createRemoteBot()
        bot.response['getCommands'] = mock.Mock(
            return_value=defer.succeed(COMMANDS))
        yield slave.attached(bot)

        # check that things were all good
        self.assertEqual(True, slave.slave_status.isConnected())
        self.assertEqual(5, len(bot.commands))

        # check the values get set right
        self.assertEqual(slave.slave_commands, COMMANDS)
Exemplo n.º 34
0
    def test_startService_getSlaveInfo_fromDb(self):
        self.master.db.insertTestData([
            fakedb.Buildslave(id=9292, name='bot', info={
                'admin': 'TheAdmin',
                'host': 'TheHost',
                'access_uri': 'TheURI',
                'version': 'TheVersion'
            })
        ])
        slave = self.createBuildslave()

        yield slave.startService()

        self.assertEqual(slave.buildslaveid, 9292)
        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')
Exemplo n.º 35
0
    def test_attached_slaveInfoUpdates(self):
        # put in stale info:
        self.master.db.insertTestData([
            fakedb.Buildslave(name='bot',
                              info={
                                  'admin': 'WrongAdmin',
                                  'host': 'WrongHost',
                                  'access_uri': 'WrongURI',
                                  'version': 'WrongVersion',
                                  'key': 'value',
                              })
        ])
        slave = self.createBuildslave()
        yield slave.startService()

        bot = createRemoteBot()
        bot.response['getVersion'] = mock.Mock(
            return_value=defer.succeed("TheVersion"))
        bot.response['getSlaveInfo'] = mock.Mock(
            return_value=defer.succeed({
                'admin': 'TheAdmin',
                'host': 'TheHost',
                'access_uri': 'TheURI',
            }))
        yield slave.attached(bot)

        self.assertEqual(slave.slave_status.getAdmin(), 'TheAdmin')
        self.assertEqual(slave.slave_status.getHost(), 'TheHost')
        self.assertEqual(slave.slave_status.getAccessURI(), 'TheURI')
        self.assertEqual(slave.slave_status.getVersion(), 'TheVersion')
        self.assertEqual(slave.slave_status.getInfo('key'), 'value')

        self.clock.pump(
            [0])  # we overrode the reactor, so gotta force the calls
        yield eventual.flushEventualQueue()

        # and the db is updated too:
        buildslave = yield self.master.db.buildslaves.getBuildslaveByName(
            "bot")

        self.assertEqual(buildslave['slaveinfo']['admin'], 'TheAdmin')
        self.assertEqual(buildslave['slaveinfo']['host'], 'TheHost')
        self.assertEqual(buildslave['slaveinfo']['access_uri'], 'TheURI')
        self.assertEqual(buildslave['slaveinfo']['version'], 'TheVersion')
Exemplo n.º 36
0
    def test_slave_shutdown(self):
        slave = self.createBuildslave(attached=True)
        yield slave.startService()

        yield slave.shutdown()
        self.assertEqual(slave.conn.remoteCalls, [('remoteShutdown',)])
Exemplo n.º 37
0
    def test_slave_shutdown_not_connected(self):
        slave = self.createBuildslave(attached=False)
        yield slave.startService()

        # No exceptions should be raised here
        yield slave.shutdown()
Exemplo n.º 38
0
    def test_slave_shutdown_not_connected(self):
        slave = self.createBuildslave(attached=False)
        yield slave.startService()

        # No exceptions should be raised here
        yield slave.shutdown()
Exemplo n.º 39
0
    def test_shutdownRequested(self):
        slave = self.createBuildslave(attached=False)
        yield slave.startService()

        yield slave.shutdownRequested()
        self.assertEqual(slave.slave_status.getGraceful(), True)
Exemplo n.º 40
0
    def test_shutdownRequested(self):
        slave = self.createBuildslave(attached=False)
        yield slave.startService()

        yield slave.shutdownRequested()
        self.assertEqual(slave.slave_status.getGraceful(), True)