예제 #1
0
	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
예제 #2
0
 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
예제 #3
0
	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
예제 #4
0
    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
예제 #5
0
    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)
예제 #6
0
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()
예제 #7
0
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()
예제 #8
0
 def __init__(self):
     Configuration.__init__(self, '', '')
예제 #9
0
파일: decoding.py 프로젝트: Krychuu/exabgp
	def __init__ (self):
		Configuration.__init__(self,'','')
예제 #10
0
	def test_reload (self):
		configuration = Configuration(self.valid[0],True)
		configuration.reload()
예제 #11
0
 def test_reload(self):
     configuration = Configuration(self.valid[0], True)
     configuration.reload()
예제 #12
0
 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")
예제 #13
0
	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")