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 python3 sys.platform check for Linux #15727

Merged
Merged
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: 3 additions & 3 deletions x-pack/auditbeat/tests/system/test_metricsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_metricset_host(self):

self.check_metricset("system", "host", COMMON_FIELDS + fields)

@unittest.skipUnless(sys.platform == "linux2", "Only implemented for Linux")
@unittest.skipUnless(sys.platform.startswith('linux'), "Only implemented for Linux")
@unittest.skipIf(sys.byteorder != "little", "Test only implemented for little-endian systems")
def test_metricset_login(self):
"""
Expand All @@ -43,7 +43,7 @@ def test_metricset_login(self):
self.check_metricset("system", "login", COMMON_FIELDS + fields, config, warnings_allowed=True)

@unittest.skipIf(sys.platform == "win32", "Not implemented for Windows")
@unittest.skipIf(sys.platform == "linux2" and not (os.path.isdir("/var/lib/dpkg") or os.path.isdir("/var/lib/rpm")),
@unittest.skipIf(sys.platform.startswith('linux') and not (os.path.isdir("/var/lib/dpkg") or os.path.isdir("/var/lib/rpm")),
"Only implemented for dpkg and rpm")
def test_metricset_package(self):
"""
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_metricset_process(self):
self.check_metricset("system", "process", COMMON_FIELDS + fields, {"process.hash.max_file_size": 1},
errors_allowed=True, warnings_allowed=True)

@unittest.skipUnless(sys.platform == "linux2", "Only implemented for Linux")
@unittest.skipUnless(sys.platform.startswith('linux'), "Only implemented for Linux")
def test_metricset_user(self):
"""
user metricset collects information about users on a server.
Expand Down