Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move (re-license) tracing package and introduce 'allowundefined' in kprobe struct tag #37602

Merged

Conversation

pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Jan 10, 2024

Proposed commit message

This PR does the following changes required to accommodate of an alternative kprobe-based BE for the File Integrity Module being developed (initial effort to support this ticket):

  • Move and re-license tracing package from x-pack/auditbeat to auditbeat package where the above new BE for FIM will be.
  • Introduce allowundefined in kprobe struct tag to be able to support allocating struct from probe perf events that not all "tagged" fields are found in the probe format.
  • Expose the wakeup events option at the creation of the PerfChannel as it has been empirically observed that setting this 1 for FIM needs can lead to excessive CPU utilisation.
  • Remove deprecated ioutil calls with respective os ones.
  • Rename local variables that collided, in terms of naming, with built-in functions

Checklist

  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation

Author's Checklist

  • Check if tracing package re-licensing is allowed.
  • Review code changes.

How to test this PR locally

Existing unit-tests of tracing package are not affected

Related issues

@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner January 10, 2024 17:26
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 10, 2024
Copy link
Contributor

mergify bot commented Jan 10, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @pkoutsovasilis? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 47 min 57 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis pkoutsovasilis changed the title Move (re-license) tracing package and intoroduce allowundefined in kprobe struct tag Move (re-license) tracing package and introduce 'allowundefined' in kprobe struct tag Jan 10, 2024
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-10T22:08:25.096+0000

  • Duration: 27 min 5 sec

Test stats 🧪

Test Results
Failed 0
Passed 686
Skipped 72
Total 758

Steps errors 1

Expand to view the steps failures

Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'org.jenkinsci.plugins.workflow.steps.FlowInterruptedException'

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-10T22:29:25.545+0000

  • Duration: 63 min 38 sec

Test stats 🧪

Test Results
Failed 13
Passed 718
Skipped 94
Total 825

Test errors 13

Expand to view the tests failures

> Show only the first 10 test failures

Build&Test / x-pack/auditbeat-build / test_connected_udp_ipv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    test = <test_system_socket.ConnectedUDP4TestCase object at 0x7f511ddaac10>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddddd00>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    test = <test_system_socket.ConnectedUDP4TestCase object at 0x7f511ddaac10>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    test = <test_system_socket.ConnectedUDP4TestCase object at 0x7f511ddaac10>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddddd00>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv4>
    
        def test_connected_udp_ipv4(self):
            """
            test connected UDP IPv4 flow
            """
    >       self.with_runner(ConnectedUDP4TestCase())
    
    tests/system/test_system_socket.py:64: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511dc5c310>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_connected_udp_ipv6 – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    test = <test_system_socket.ConnectedUDP6TestCase object at 0x7f511d884c50>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddde020>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    test = <test_system_socket.ConnectedUDP6TestCase object at 0x7f511d884c50>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    test = <test_system_socket.ConnectedUDP6TestCase object at 0x7f511d884c50>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddde020>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_connected_udp_ipv6>
    
        def test_connected_udp_ipv6(self):
            """
            test connected UDP IPv6 flow
            """
    >       self.with_runner(ConnectedUDP6TestCase())
    
    tests/system/test_system_socket.py:70: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511dc746d0>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_dns_enrichment – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc6f9d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_enrichment>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511dddf560>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc6f9d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc6f9d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_enrichment>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511dddf560>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_enrichment>
    
        def test_dns_enrichment(self):
            """
            test DNS enrichment
            """
    >       self.with_runner(DNSTestCase())
    
    tests/system/test_system_socket.py:102: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511de149d0>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_dns_long_request – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_dns_long_request>
    test = <test_system_socket.DNSTestCase object at 0x7f511d8a9710>
    extra_conf = {'socket.flow_inactive_timeout': '2s'}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_long_request>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddddf80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_long_request>
    test = <test_system_socket.DNSTestCase object at 0x7f511d8a9710>
    extra_conf = {'socket.flow_inactive_timeout': '2s'}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_long_request>
    test = <test_system_socket.DNSTestCase object at 0x7f511d8a9710>
    extra_conf = {'socket.flow_inactive_timeout': '2s'}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_long_request>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511ddddf80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_long_request>
    
        def test_dns_long_request(self):
            """
            test DNS enrichment of long request
            This test makes sure that DNS information is kept long after the
            DNS request has been performed, even if the internal DNS state
            is expired.
            """
    >       self.with_runner(
                DNSTestCase(delay_seconds=10),
                extra_conf={
                    'socket.flow_inactive_timeout': '2s'
                })
    
    tests/system/test_system_socket.py:118: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511d8a9cd0>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_dns_udp_ipv6 – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    test = <test_system_socket.DNSTestCase object at 0x7f511dd1ba90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8ea0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    test = <test_system_socket.DNSTestCase object at 0x7f511dd1ba90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    test = <test_system_socket.DNSTestCase object at 0x7f511dd1ba90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8ea0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_udp_ipv6>
    
        def test_dns_udp_ipv6(self):
            """
            test DNS enrichment of UDP/IPv6 session
            """
    >       self.with_runner(DNSTestCase(network="ipv6", transport="udp"))
    
    tests/system/test_system_socket.py:128: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511f2e0210>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_dns_unidirectional_udp – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc39e90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e82c0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc39e90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    test = <test_system_socket.DNSTestCase object at 0x7f511dc39e90>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e82c0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_dns_unidirectional_udp>
    
        def test_dns_unidirectional_udp(self):
            """
            test DNS enrichment of unidirectional UDP
            """
    >       self.with_runner(DNSTestCase(transport="udp", bidirectional=False))
    
    tests/system/test_system_socket.py:134: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511dc4a290>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_multi_udp_upv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    test = <test_system_socket.MultiUDP4TestCase object at 0x7f511dc3c2d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8b80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    test = <test_system_socket.MultiUDP4TestCase object at 0x7f511dc3c2d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    test = <test_system_socket.MultiUDP4TestCase object at 0x7f511dc3c2d0>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8b80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_multi_udp_upv4>
    
        def test_multi_udp_upv4(self):
            """
            test multiple destination UDP IPv4 flows
            """
    >       self.with_runner(MultiUDP4TestCase())
    
    tests/system/test_system_socket.py:82: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511dc2a250>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_no_dns_enrichment – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dca0690>
    extra_conf = {'socket.dns.enabled': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e9da0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dca0690>
    extra_conf = {'socket.dns.enabled': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    test = <test_system_socket.DNSTestCase object at 0x7f511dca0690>
    extra_conf = {'socket.dns.enabled': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e9da0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_no_dns_enrichment>
    
        def test_no_dns_enrichment(self):
            """
            test DNS enrichment disabled
            """
    >       self.with_runner(
                DNSTestCase(enabled=False), extra_conf={'socket.dns.enabled': False})
    
    tests/system/test_system_socket.py:108: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511ddff4d0>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_tcp_ipv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d8c8710>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0ebec0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d8c8710>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d8c8710>
    extra_conf = {}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0ebec0>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv4>
    
        def test_tcp_ipv4(self):
            """
            test TCP IPv4 flow
            """
    >       self.with_runner(TCP4TestCase())
    
    tests/system/test_system_socket.py:52: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f51200c5290>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Build&Test / x-pack/auditbeat-build / test_tcp_ipv6_disabled – x-pack.auditbeat.tests.system.test_system_socket.Test
    Expand to view the error details

     AssertionError: Expected exit code to be 0, but it was 1 
    

    Expand to view the stacktrace

     self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d886490>
    extra_conf = {'socket.enable_ipv6': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8b80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               beat.beat.WaitTimeoutError: Timeout waiting for condition 'cond'. Waited 60 seconds:
    
    ../../libbeat/tests/system/beat/beat.py:449: WaitTimeoutError
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d886490>
    extra_conf = {'socket.enable_ipv6': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
                    self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
                except Exception as e:
    >               raise Exception('Auditbeat failed to start start').with_traceback(sys.exc_info()[2])
    
    tests/system/test_system_socket.py:155: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    test = <test_system_socket.TCP4TestCase object at 0x7f511d886490>
    extra_conf = {'socket.enable_ipv6': False}
    
        def with_runner(self, test, extra_conf=dict()):
            enable_ipv6_loopback()
            conf = {
                "socket.flow_inactive_timeout": "2s",
                "socket.flow_termination_timeout": "5s",
                "socket.development_mode": "true",
            }
            conf.update(extra_conf)
            self.render_config_template(modules=[{
                "name": "system",
                "datasets": ["socket"],
                "extras": conf,
            }])
            proc = self.start_beat()
            try:
                try:
    >               self.wait_until(lambda: self.log_contains('system/socket dataset is running.'),
                                    max_timeout=60)
    
    tests/system/test_system_socket.py:152: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    cond = <function Test.with_runner.<locals>.<lambda> at 0x7f511d0e8b80>
    max_timeout = 60, poll_interval = 0.1, name = 'cond', err_msg = ''
    
        def wait_until(self, cond, max_timeout=20, poll_interval=0.1, name="cond", err_msg=""):
            """
            TODO: this can probably be a "wait_until_output_count", among other things, since that could actually use `self`, and this can become an internal function
            Waits until the cond function returns true,
            or until the max_timeout is reached. Calls the cond
            function every poll_interval seconds.
        
            If the max_timeout is reached before cond() returns
            true, an exception is raised.
            """
            start = datetime.now()
            while not cond():
                if datetime.now() - start > timedelta(seconds=max_timeout):
                    print("Test has failed, here are the Beat logs")
                    for l in self.get_log_lines():
                        print(l)
    >               raise WaitTimeoutError(
                        f"Timeout waiting for condition '{name}'. Waited {max_timeout} seconds: {err_msg}")
    E               Exception: Auditbeat failed to start start
    
    ../../libbeat/tests/system/beat/beat.py:449: Exception
    
    During handling of the above exception, another exception occurred:
    
    self = <test_system_socket.Test testMethod=test_tcp_ipv6_disabled>
    
        def test_tcp_ipv6_disabled(self):
            """
            test IPv4/TCP with IPv6 disabled
            """
    >       self.with_runner(TCP4TestCase(),
                             extra_conf={'socket.enable_ipv6': False})
    
    tests/system/test_system_socket.py:95: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/system/test_system_socket.py:158: in with_runner
        proc.check_kill_and_wait()
    ../../libbeat/tests/system/beat/beat.py:153: in check_kill_and_wait
        return self.check_wait(exit_code=exit_code)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <beat.beat.Proc object at 0x7f511e5fd210>, exit_code = 0
    
        def check_wait(self, exit_code=0):
            """
            check_wait waits for the process to exit, and checks the return code of the process
            """
            actual_exit_code = self.wait()
    >       assert actual_exit_code == exit_code, f"Expected exit code to be {exit_code}, but it was {actual_exit_code}"
    E       AssertionError: Expected exit code to be 0, but it was 1
    
    ../../libbeat/tests/system/beat/beat.py:133: AssertionError 
    

Steps errors 4

Expand to view the steps failures

x-pack/auditbeat-build - mage update build test
  • Took 18 min 1 sec . View more details here
  • Description: mage update build test
x-pack/auditbeat-build - mage update build test
  • Took 15 min 31 sec . View more details here
  • Description: mage update build test
x-pack/auditbeat-build - mage update build test
  • Took 15 min 31 sec . View more details here
  • Description: mage update build test
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 13

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Build&Test / x-pack/auditbeat-build / test_connected_udp_ipv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_connected_udp_ipv6 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_dns_enrichment – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_dns_long_request – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_dns_udp_ipv6 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_dns_unidirectional_udp – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_multi_udp_upv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_no_dns_enrichment – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_tcp_ipv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_tcp_ipv6_disabled – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_udp_ipv4 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_udp_ipv6 – x-pack.auditbeat.tests.system.test_system_socket.Test
  • Name: Build&Test / x-pack/auditbeat-build / test_udp_ipv6_disabled – x-pack.auditbeat.tests.system.test_system_socket.Test

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis pkoutsovasilis added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Jan 11, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 11, 2024
@pkoutsovasilis pkoutsovasilis added the backport-skip Skip notification from the automated backport with mergify label Jan 11, 2024
Copy link
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relicensing of this module from x-pack's Elastic License to Apache-2.0 LGTM, on behalf of the @elastic/open-source-wg (via Slack)

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-11T10:49:00.765+0000

  • Duration: 44 min 48 sec

Test stats 🧪

Test Results
Failed 0
Passed 843
Skipped 108
Total 951

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@gtback
Copy link
Member

gtback commented Jan 11, 2024

Relicensing of this module from x-pack's Elastic License to Apache-2.0 LGTM, on behalf of the @elastic/open-source-wg (via Slack)

License changes look good to me as well!

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for well organized commits. It's much appreciated as a reviewer.

auditbeat/tracing/endian.go Outdated Show resolved Hide resolved
auditbeat/tracing/int_aligned.go Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 6 min 29 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis
Copy link
Contributor Author

LGTM. Thanks for well organized commits. It's much appreciated as a reviewer.

thx for the review @andrewkroh 🚀

@elasticmachine
Copy link
Collaborator

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 43 min 28 sec

Pipeline error 1

This error is likely related to the pipeline itself. Click here
and then you will see the error (either incorrect syntax or an invalid configuration).

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis
Copy link
Contributor Author

pkoutsovasilis commented Jan 24, 2024

@efd6 did I break the packaging Jenkins steps or is this a fluke?

05:48:36  >> Testing package contents
05:48:42  --- FAIL: TestDocker (3.55s)
05:48:42      package_test.go:234: error reading file /var/lib/jenkins/workspace/PR-37602-6-23d9a56c-e2a2-415d-91ad-ce7c7e199f49/src/github.com/elastic/beats/x-pack/auditbeat/build/distributions/auditbeat-8.13.0-SNAPSHOT-linux-arm64.docker.tar.gz: no entrypoint
05:48:42      package_test.go:234: error reading file /var/lib/jenkins/workspace/PR-37602-6-23d9a56c-e2a2-415d-91ad-ce7c7e199f49/src/github.com/elastic/beats/x-pack/auditbeat/build/distributions/auditbeat-ubi-8.13.0-SNAPSHOT-linux-arm64.docker.tar.gz: no entrypoint

@andrewkroh
Copy link
Member

did I break the packaging Jenkins steps or is this a fluke?

I see similar failures on main for metricbeat. https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fpackaging/detail/main/3610/pipeline/129

@andrewkroh
Copy link
Member

The packaging failure in tracked in #37726.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 46 min 38 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis
Copy link
Contributor Author

@andrewkroh @efd6 is this PR clear to get merged?

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after nits.

auditbeat/tracing/endian.go Show resolved Hide resolved
auditbeat/tracing/perfevent.go Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-25T00:12:56.216+0000

  • Duration: 7 min 1 sec

Steps errors 1

Expand to view the steps failures

Error signal
  • Took 0 min 0 sec . View more details here
  • Description: untar: step failed with error null

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-25T00:15:24.426+0000

  • Duration: 25 min 6 sec

Test stats 🧪

Test Results
Failed 2
Passed 103
Skipped 12
Total 117

Test errors 2

Expand to view the tests failures

Build&Test / auditbeat-rhel-9-rhel-9 / [empty] – TEST-go-unit.xml
  • no error details
  • Expand to view the stacktrace

     Test report file /var/lib/jenkins/workspace/PR-37602-9-ea765af1-bf01-4d11-bf16-814bbc3cc9a7/src/github.com/elastic/beats/build/auditbeat/build/TEST-go-unit.xml was length 0 
    

Build&Test / auditbeat-unitTest / [empty] – TEST-go-unit.xml
  • no error details
  • Expand to view the stacktrace

     Test report file /var/lib/jenkins/workspace/PR-37602-9-82877a1f-0081-4363-a0fb-1282f1184665/src/github.com/elastic/beats/build/auditbeat/build/TEST-go-unit.xml was length 0 
    

Steps errors 5

Expand to view the steps failures

x-pack/auditbeat-build - mage update build test
  • Took 1 min 16 sec . View more details here
  • Description: mage update build test
x-pack/auditbeat-rhel-9-rhel-9 - mage build unitTest
  • Took 1 min 9 sec . View more details here
  • Description: mage build unitTest
x-pack/auditbeat-rhel-9-rhel-9 - mage build unitTest
  • Took 0 min 2 sec . View more details here
  • Description: mage build unitTest
x-pack/auditbeat-rhel-9-rhel-9 - mage build unitTest
  • Took 0 min 2 sec . View more details here
  • Description: mage build unitTest
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'org.jenkinsci.plugins.workflow.steps.FlowInterruptedException'

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 45 min 11 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-01-25T11:07:18.724+0000

  • Duration: 45 min 4 sec

Test stats 🧪

Test Results
Failed 0
Passed 843
Skipped 108
Total 951

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pkoutsovasilis pkoutsovasilis merged commit 685be2f into elastic:main Jan 25, 2024
34 of 35 checks passed
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
…probe struct tag (elastic#37602)

* fix: replace deprecated io/ioutil with os

* fix: rename local vars so they don't collide with built-in functions

* feat: introduce support for allowundefined tag

* fix: remove unnecessary named return variable

* feat: expose the option to set the wakeup_events for the perf channel

* feat: move tracing from x-pack/auditbeat to auditbeat

* legal: re-license tracing from Elastic License to Apache License Version 2.0

* fix: remove deprecated ioutil in events_test.go

* fix: replace naked return(s)

* fix: pre-allocate slices wherever the len is known

* fix: use errors.Is to check for a specific error

* fix: remove unused withTime struct field from PerfChannel

* fix: properly use make(chan struct{})

* fix: use raw string with regexp.MustCompile

* fix: replace missed naked return(s)

* fix: replace pre-allocating len of the slices with cap

* feat: modernise tracing endian.go to use binary.NativeEndian

* feat: refactor copyInt and readInt to use unsafe.Slice

* fix: revert pollAll in perfevent.go to named returns as these can be properly documented

* fix: remove redundant endian.go and utilise directly binary.NativeEndian

* fix: return explicitly the named returns in pollAll

* Revert "fix: remove redundant endian.go and utilise directly binary.NativeEndian"

This reverts commit 19d9c28.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auditbeat backport-skip Skip notification from the automated backport with mergify Team:Security-Linux Platform Linux Platform Team in Security Solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants