Esempio n. 1
0
 def test_validateMasterArgument_ok(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> without host and port parts specified.
     """
     opts = runner.CreateWorkerOptions()
     self.assertEqual(opts.validateMasterArgument("mstrhost:4321"),
                      ("mstrhost", 4321),
                      "incorrect master host and/or port")
Esempio n. 2
0
 def test_validateMasterArgument_no_port(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> argument without port specified.
     """
     opts = runner.CreateWorkerOptions()
     self.assertEqual(opts.validateMasterArgument("mstrhost"),
                      ("mstrhost", 9989),
                      "incorrect master host and/or port")
Esempio n. 3
0
 def test_validateMasterArgument_empty_master(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> without host part specified.
     """
     opts = runner.CreateWorkerOptions()
     self.assertRaisesRegexp(usage.UsageError,
                             "invalid <master> argument ':1234'",
                             opts.validateMasterArgument, ":1234")
Esempio n. 4
0
 def test_validateMasterArgument_inv_port(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> without with unparsable port part
     """
     opts = runner.CreateWorkerOptions()
     self.assertRaisesRegexp(
         usage.UsageError, "invalid master port 'apple', "
         "needs to be an number", opts.validateMasterArgument, "host:apple")
Esempio n. 5
0
 def test_validateMasterArgument_ipv6_port(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> with ipv6 host and port parts specified.
     """
     opts = runner.CreateWorkerOptions()
     self.assertEqual(opts.validateMasterArgument("[2001:1:2:3:4::1]:4321"),
                      ("2001:1:2:3:4::1", 4321),
                      "incorrect master host and/or port")
Esempio n. 6
0
 def test_validateMasterArgument_ipv4_port(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> with ipv4 host and port parts specified.
     """
     opts = runner.CreateWorkerOptions()
     self.assertEqual(opts.validateMasterArgument("192.168.0.0:4321"),
                      ("192.168.0.0", 4321),
                      "incorrect master host and/or port")
Esempio n. 7
0
 def test_validateMasterArgument_ipv6_no_bracket(self):
     """
     test calling CreateWorkerOptions.validateMasterArgument()
     on <master> with ipv6 without [] specified.
     """
     opts = runner.CreateWorkerOptions()
     with self.assertRaisesRegex(
             usage.UsageError,
             r"invalid <master> argument '2001:1:2:3:4::1:4321', "
             r"if it is an ipv6 address, it must be enclosed by \[\]"):
         opts.validateMasterArgument("2001:1:2:3:4::1:4321")
Esempio n. 8
0
 def test_synopsis(self):
     opts = runner.CreateWorkerOptions()
     self.assertIn('buildbot-worker create-worker', opts.getSynopsis())
Esempio n. 9
0
 def parse(self, *args):
     opts = runner.CreateWorkerOptions()
     opts.parseOptions(args)
     return opts
Esempio n. 10
0
 def test_synopsis(self):
     opts = runner.CreateWorkerOptions()
     self.assertIn('buildslave create-slave', opts.getSynopsis())