def test_mixed_mode_vcf(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     self.vc = True
     self.vcf = True
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['vc_fabric'])
     self.assertEqual(self.facts['vc_mode'], 'Mixed')
 def test_multi_re_vc(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     self.vc = True
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['vc_capable'])
     self.assertTrue(self.facts['2RE'])
     self.assertEqual(self.facts['RE0-RE1']['mastership_state'], 'backup')
Пример #3
0
 def test_mixed_mode_vcf(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     self.vc = True
     self.vcf = True
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['vc_fabric'])
     self.assertEqual(self.facts['vc_mode'], 'Mixed')
Пример #4
0
 def test_multi_re_vc(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     self.vc = True
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['vc_capable'])
     self.assertTrue(self.facts['2RE'])
     self.assertEqual(self.facts['RE0-RE1']['mastership_state'], 'backup')
Пример #5
0
 def test_routing_engine_exception_ret_none(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.dev.rpc.get_route_engine_information = MagicMock(
         side_effect=ValueError)
     self.assertEqual(routing_engines(self.dev, self.facts), None)
Пример #6
0
 def test_master(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'master'
     routing_engines(self.dev, self.facts)
     self.assertEqual(self.facts['RE0']['mastership_state'], 'master')
Пример #7
0
 def test_multi_instance(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['2RE'])
 def test_routing_engine_exception_ret_none(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.dev.rpc.get_route_engine_information = MagicMock(
         side_effect=ValueError)
     self.assertEqual(routing_engines(self.dev, self.facts), None)
 def test_master(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'master'
     routing_engines(self.dev, self.facts)
     self.assertEqual(self.facts['RE0']['mastership_state'], 'master')
Пример #10
0
 def test_multi_instance(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.mode = 'multi'
     routing_engines(self.dev, self.facts)
     self.assertTrue(self.facts['2RE'])