Example #1
0
 def _failure(self, why):
     from twisted.internet import reactor
     from buildbot_worker.scripts.logwatcher import WorkerTimeoutError
     if why.check(WorkerTimeoutError):
         print(rewrap("""\
             The worker took more than 10 seconds to start and/or connect
             to the buildmaster, so we were unable to confirm that it
             started and connected correctly.
             Please 'tail twistd.log' and look for a line that says
             'message from master: attached' to verify correct startup.
             If you see a bunch of messages like 'will retry in 6 seconds',
             your worker might not have the correct hostname or portnumber
             for the buildmaster, or the buildmaster might not be running.
             If you see messages like
                'Failure: twisted.cred.error.UnauthorizedLogin'
             then your worker might be using the wrong botname or password.
             Please correct these problems and then restart the worker.
             """))
     else:
         print(rewrap("""\
             Unable to confirm that the worker started correctly.
             You may need to stop it, fix the config file, and restart.
             """))
         print(why)
     self.rc = 1
     reactor.stop()
Example #2
0
 def _failure(self, why):
     from twisted.internet import reactor
     from buildbot_worker.scripts.logwatcher import WorkerTimeoutError
     if why.check(WorkerTimeoutError):
         print(
             rewrap("""\
             The worker took more than 10 seconds to start and/or connect
             to the buildmaster, so we were unable to confirm that it
             started and connected correctly.
             Please 'tail twistd.log' and look for a line that says
             'message from master: attached' to verify correct startup.
             If you see a bunch of messages like 'will retry in 6 seconds',
             your worker might not have the correct hostname or portnumber
             for the buildmaster, or the buildmaster might not be running.
             If you see messages like
                'Failure: twisted.cred.error.UnauthorizedLogin'
             then your worker might be using the wrong botname or password.
             Please correct these problems and then restart the worker.
             """))
     else:
         print(
             rewrap("""\
             Unable to confirm that the worker started correctly.
             You may need to stop it, fix the config file, and restart.
             """))
         print(why)
     self.rc = 1
     reactor.stop()
Example #3
0
    def test_main(self):
        tests = [
            ("", "", None),
            ("\n", "\n", None),
            ("\n  ", "\n", None),
            ("  \n", "\n", None),
            ("  \n  ", "\n", None),
            ("""
                multiline
                with
                indent
                """,
             "\nmultiline with indent",
             None),
            ("""\
                multiline
                with
                indent

                """,
             "multiline with indent\n",
             None),
            ("""\
                 multiline
                 with
                 indent

                 """,
             "multiline with indent\n",
             None),
            ("""\
                multiline
                with
                indent

                  and
                   formatting
                """,
             "multiline with indent\n  and\n   formatting\n",
             None),
            ("""\
                multiline
                with
                indent
                and wrapping

                  and
                   formatting
                """,
             "multiline with\nindent and\nwrapping\n  and\n   formatting\n",
             15),
        ]

        for text, expected, width in tests:
            self.assertEqual(util.rewrap(text, width=width), expected)
Example #4
0
    def test_main(self):
        tests = [
            ("", "", None),
            ("\n", "\n", None),
            ("\n  ", "\n", None),
            ("  \n", "\n", None),
            ("  \n  ", "\n", None),
            ("""
                multiline
                with
                indent
                """,
             "\nmultiline with indent",
             None),
            ("""\
                multiline
                with
                indent

                """,
             "multiline with indent\n",
             None),
            ("""\
                 multiline
                 with
                 indent

                 """,
             "multiline with indent\n",
             None),
            ("""\
                multiline
                with
                indent

                  and
                   formatting
                """,
             "multiline with indent\n  and\n   formatting\n",
             None),
            ("""\
                multiline
                with
                indent
                and wrapping

                  and
                   formatting
                """,
             "multiline with\nindent and\nwrapping\n  and\n   formatting\n",
             15),
        ]

        for text, expected, width in tests:
            self.assertEqual(util.rewrap(text, width=width), expected)