Browse Source

Added '--brittle' flag (although don't use it yet).

Shane Kerr 14 years ago
parent
commit
888bcbc103
2 changed files with 11 additions and 0 deletions
  1. 2 0
      src/bin/bind10/bind10.py.in
  2. 9 0
      src/bin/bind10/tests/bind10_test.py.in

+ 2 - 0
src/bin/bind10/bind10.py.in

@@ -856,6 +856,8 @@ def parse_args(args=sys.argv[1:], Parser=OptionParser):
     parser.add_option("--pid-file", dest="pid_file", type="string",
                       default=None,
                       help="file to dump the PID of the BIND 10 process")
+    parser.add_option("--brittle", dest="brittle", action="store_true",
+                      help="debugging flag: exit if any component dies")
 
     (options, args) = parser.parse_args(args)
 

+ 9 - 0
src/bin/bind10/tests/bind10_test.py.in

@@ -550,6 +550,15 @@ class TestParseArgs(unittest.TestCase):
         options = parse_args(['--cmdctl-port=1234'], TestOptParser)
         self.assertEqual(1234, options.cmdctl_port)
 
+    def test_brittle(self):
+        """
+        Test we can use the "brittle" flag.
+        """
+        options = parse_args([], TestOptParser)
+        self.assertFalse(options.brittle)
+        options = parse_args(['--brittle'], TestOptParser)
+        self.assertTrue(options.brittle)
+
 class TestPIDFile(unittest.TestCase):
     def setUp(self):
         self.pid_file = '@builddir@' + os.sep + 'bind10.pid'