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

Fix issues with macos logcollector IT in master branch #1469

Closed
spothound opened this issue Jun 18, 2021 · 1 comment · Fixed by #1478
Closed

Fix issues with macos logcollector IT in master branch #1469

spothound opened this issue Jun 18, 2021 · 1 comment · Fixed by #1478

Comments

@spothound
Copy link
Contributor

spothound commented Jun 18, 2021

Branch 1469-fix-macos-logcollector-it

We've detected some issues with macOS log collector integration tests in the master branch.

🔵 Missing argument

test_logcollector/test_macos/test_macos_format_basic.py::test_macos_format_basic[get_configuration0-macos_message1] FAILED                                                                                                             [ 92%]

        elif log_command == 'os_log':
>           logcollector.generate_macos_custom_log(macos_message['type'], macos_message['subsystem'], macos_message['category'])
E           TypeError: generate_macos_custom_log() missing 1 required positional argument: 'category'

test_logcollector/test_macos/test_macos_format_basic.py:73: TypeError

It seems that the category argument is not being passed to generate_macos_custom_log.

Fixed in 708738d

Permissions issue restarting logcollector on macOS

https://devel.ci.wazuh.info/view/Tests/job/Test_integration/718/consoleFull

00:31:14.361      @pytest.fixture(scope='module')
00:31:14.361      def restart_logcollector(get_configuration, request):
00:31:14.361          """Reset log file and start a new monitor."""
00:31:14.361  >       control_service('stop', daemon=DAEMON_NAME)

00:31:14.361      def catch_zombie(proc):
00:31:14.361          """There are some poor C APIs which incorrectly raise ESRCH when
00:31:14.361          the process is still alive or it's a zombie, or even RuntimeError
00:31:14.361          (those who don't set errno). This is here in order to solve:
00:31:14.361          https:/giampaolo/psutil/issues/1044
00:31:14.361          """
00:31:14.361          try:
00:31:14.361              yield
00:31:14.361          except (OSError, RuntimeError) as err:
00:31:14.361              if isinstance(err, RuntimeError) or err.errno == errno.ESRCH:
00:31:14.361                  try:
00:31:14.361                      # status() is not supposed to lie and correctly detect
00:31:14.361                      # zombies so if it raises ESRCH it's true.
00:31:14.361                      status = proc.status()
00:31:14.361                  except NoSuchProcess:
00:31:14.361                      raise err
00:31:14.361                  else:
00:31:14.361                      if status == _common.STATUS_ZOMBIE:
00:31:14.361                          raise ZombieProcess(proc.pid, proc._name, proc._ppid)
00:31:14.361                      else:
00:31:14.361  >                       raise AccessDenied(proc.pid, proc._name)
00:31:14.361  E                       psutil.AccessDenied: psutil.AccessDenied (pid=20926, name='kextstat')
@spothound
Copy link
Contributor Author

@spothound spothound changed the title Fix issues with macos logcollectos IT in master branch Fix issues with macos logcollector IT in master branch Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants