Browse Source

[213] Fail of dispensable components

Michal 'vorner' Vaner 13 years ago
parent
commit
114e59f9ed
1 changed files with 30 additions and 0 deletions
  1. 30 0
      src/lib/python/isc/bind10/tests/component_test.py

+ 30 - 0
src/lib/python/isc/bind10/tests/component_test.py

@@ -259,6 +259,36 @@ class ComponentTests(unittest.TestCase):
         component.failed()
         self.check_restarted(component)
 
+    def test_start_fail_dispensable(self):
+        """
+        Start and then fail a dispensable component. Should just get restarted.
+        """
+        # Just ordinary startup
+        component = self.create_component('needed')
+        self.check_startup(component)
+        component.start()
+        self.check_started(component)
+        # Make it fail right away
+        self.__start_called = False
+        component.failed()
+        self.check_restarted(component)
+
+    def test_start_fail_dispensable(self):
+        """
+        Start and then later on fail a dispensable component. Should just get
+        restarted.
+        """
+        # Just ordinary startup
+        component = self.create_component('needed')
+        self.check_startup(component)
+        component.start()
+        self.check_started(component)
+        # Make it fail later on
+        self.__start_called = False
+        self.timeskip()
+        component.failed()
+        self.check_restarted(component)
+
 if __name__ == '__main__':
     isc.log.init("bind10") # FIXME Should this be needed?
     isc.log.resetUnitTestRootLogger()