Skip to content

Commit

Permalink
Workaround system-tests failures for show-command (#7515)
Browse files Browse the repository at this point in the history
The system tests, which run inside a docker container, are failing on
older kernels (3.10 and older), because the Netlink connection to
kauditd is not allowed.
  • Loading branch information
adriansr authored and ruflin committed Jul 5, 2018
1 parent 47b35b7 commit 694cc59
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions auditbeat/tests/system/test_show_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import re
import platform
import sys
import tempfile
import unittest
Expand All @@ -14,7 +14,19 @@ def is_root():
return euid == 0


@unittest.skipUnless(re.match("(?i)linux", sys.platform), "Requires Linux")
# Require Linux greater than 3.10
# Can't connect to kauditd in 3.10 or older
def is_supported_linux():
p = platform.platform().split('-')
if p[0] != 'Linux':
return False
kv = p[1].split('.')
if int(kv[0]) < 3 or (int(kv[0]) == 3 and int(kv[1]) <= 10):
return False
return True


@unittest.skipUnless(is_supported_linux(), "Requires Linux 3.11+")
class Test(BaseTest):

def test_show_command(self):
Expand Down

0 comments on commit 694cc59

Please sign in to comment.