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

Remove skips for timezone tests #425

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions tests/test_plugins_os_unix_log_auth.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import platform
from datetime import datetime, timezone
from io import BytesIO
from unittest.mock import patch
from zoneinfo import ZoneInfo

import pytest
from flow.record.fieldtypes import datetime as dt

from dissect.target.filesystem import VirtualFilesystem
Expand All @@ -13,7 +11,6 @@
from ._utils import absolute_path


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_auth_plugin(target_unix, fs_unix: VirtualFilesystem):
fs_unix.map_file_fh("/etc/timezone", BytesIO("Europe/Amsterdam".encode()))

Expand All @@ -35,7 +32,6 @@ def test_auth_plugin(target_unix, fs_unix: VirtualFilesystem):
assert results[-1].message == "CRON[1]: pam_unix(cron:session): session opened for user root by (uid=0)"


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_auth_plugin_with_gz(target_unix, fs_unix: VirtualFilesystem):
fs_unix.map_file_fh("/etc/timezone", BytesIO("Pacific/Honolulu".encode()))

Expand All @@ -60,7 +56,6 @@ def test_auth_plugin_with_gz(target_unix, fs_unix: VirtualFilesystem):
assert results[-1].message == "CRON[1]: pam_unix(cron:session): session opened for user root by (uid=0)"


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_auth_plugin_with_bz(target_unix, fs_unix: VirtualFilesystem):
fs_unix.map_file_fh("/etc/timezone", BytesIO("America/Nuuk".encode()))

Expand All @@ -85,7 +80,6 @@ def test_auth_plugin_with_bz(target_unix, fs_unix: VirtualFilesystem):
assert results[-1].message == "CRON[1]: pam_unix(cron:session): session opened for user root by (uid=0)"


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_auth_plugin_year_rollover(target_unix, fs_unix: VirtualFilesystem):
fs_unix.map_file_fh("/etc/timezone", BytesIO("Etc/UTC".encode()))

Expand Down
5 changes: 0 additions & 5 deletions tests/test_plugins_os_unix_log_messages.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import platform
import tarfile
import textwrap
from datetime import datetime, timezone
from io import BytesIO
from unittest.mock import patch
from zoneinfo import ZoneInfo

import pytest
from flow.record.fieldtypes import datetime as dt
from flow.record.fieldtypes import path

Expand All @@ -18,7 +16,6 @@
from ._utils import absolute_path


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_unix_log_messages_plugin(target_unix_users, fs_unix):
fs_unix.map_file_fh("/etc/timezone", BytesIO(b"Europe/Amsterdam"))

Expand Down Expand Up @@ -51,7 +48,6 @@ def test_unix_log_messages_plugin(target_unix_users, fs_unix):
assert isinstance(syslogs[0], type(MessagesRecord()))


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_unix_log_messages_compressed_timezone_year_rollover():
target = Target()
bio = BytesIO()
Expand Down Expand Up @@ -90,7 +86,6 @@ def test_unix_log_messages_compressed_timezone_year_rollover():
assert results[1].ts == dt(2021, 1, 1, 13, 37, 0, tzinfo=ZoneInfo("America/Chicago"))


@pytest.mark.skipif(platform.system() == "Windows", reason="ZoneInfoNotFoundError. Needs to be fixed.")
def test_unix_log_messages_malformed_log_year_rollover(target_unix_users, fs_unix):
fs_unix.map_file_fh("/etc/timezone", BytesIO(b"Europe/Amsterdam"))

Expand Down