def test_valid (self): for config in self.valid: configuration = Configuration(config,True) try: self.assertEqual(configuration.reload(),True,configuration.error) except: print print config print print configuration.error print raise
def test_valid(self): for config in self.valid: configuration = Configuration(config, True) try: self.assertEqual(configuration.reload(), True, configuration.error) except: print print config print print configuration.error print raise
def test_faults (self): for config,error in self._faults.iteritems(): configuration = Configuration(config,True) try: self.assertEqual(configuration.reload(),False) self.assertEqual(config + ' '*10 + configuration.error,config + ' '*10 + error) except AssertionError: print print config print print configuration.error print raise
def test_faults(self): for config, error in self._faults.iteritems(): configuration = Configuration(config, True) try: self.assertEqual(configuration.reload(), False) self.assertEqual(config + ' ' * 10 + configuration.error, config + ' ' * 10 + error) except AssertionError: print print config print print configuration.error print raise
def __init__(self, configuration): self.ip = environment.settings().tcp.bind self.port = environment.settings().tcp.port self.max_loop_time = environment.settings().reactor.speed self.half_loop_time = self.max_loop_time / 2 self.logger = Logger() self.daemon = Daemon(self) self.processes = None self.listener = None self.configuration = Configuration(configuration) self._peers = {} self._shutdown = False self._reload = False self._reload_processes = False self._restart = False self._route_update = False self._saved_pid = False self._commands = [] self._pending = [] signal.signal(signal.SIGTERM, self.sigterm) signal.signal(signal.SIGHUP, self.sighup) signal.signal(signal.SIGALRM, self.sigalrm) signal.signal(signal.SIGUSR1, self.sigusr1) signal.signal(signal.SIGUSR2, self.sigusr2)
class TestPeer (unittest.TestCase): text_configuration = """\ neighbor 192.0.2.181 { description "a quagga test peer"; router-id 192.0.2.92; local-address 192.0.2.92; local-as 65000; peer-as 65000; static { route 10.0.5.0/24 next-hop 192.0.2.92 local-preference 10 community [ 0x87654321 ]; } } """ def setUp(self): self.configuration = Configuration(self.text_configuration,True) self.assertEqual(self.configuration.reload(),True,"could not read the configuration, run the configuration unittest") def test_connection (self): reactor = Reactor(self.configuration) reactor.run()
class TestPeer(unittest.TestCase): text_configuration = """\ neighbor 192.0.2.181 { description "a quagga test peer"; router-id 192.0.2.92; local-address 192.0.2.92; local-as 65000; peer-as 65000; static { route 10.0.5.0/24 next-hop 192.0.2.92 local-preference 10 community [ 0x87654321 ]; } } """ def setUp(self): self.configuration = Configuration(self.text_configuration, True) self.assertEqual( self.configuration.reload(), True, "could not read the configuration, run the configuration unittest") def test_connection(self): reactor = Reactor(self.configuration) reactor.run()
def __init__(self): Configuration.__init__(self, '', '')
def __init__ (self): Configuration.__init__(self,'','')
def test_reload (self): configuration = Configuration(self.valid[0],True) configuration.reload()
def test_reload(self): configuration = Configuration(self.valid[0], True) configuration.reload()
def setUp(self): self.configuration = Configuration(self.text_configuration, True) self.assertEqual( self.configuration.reload(), True, "could not read the configuration, run the configuration unittest")
def setUp(self): self.configuration = Configuration(self.text_configuration,True) self.assertEqual(self.configuration.reload(),True,"could not read the configuration, run the configuration unittest")