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

[Auditbeat] Cherry-pick #9750 to 6.6: Fix/Skip Windows x-pack/auditbeat tests #9754

Merged
merged 1 commit into from
Dec 21, 2018
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
2 changes: 1 addition & 1 deletion metricbeat/tests/system/metricbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import os

sys.path.append(os.path.join(os.path.dirname(__file__), '../../../libbeat/tests/system'))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../libbeat/tests/system')))

from beat.beat import TestCase

Expand Down
4 changes: 4 additions & 0 deletions x-pack/auditbeat/module/system/process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
package process

import (
"runtime"
"testing"

"github.com/elastic/beats/auditbeat/core"
mbtest "github.com/elastic/beats/metricbeat/mb/testing"
)

func TestData(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Fails on Windows - https://github.com/elastic/beats/issues/9748")
}
f := mbtest.NewReportingMetricSetV2(t, getConfig())
events, errs := mbtest.ReportingFetchV2(f)
if len(errs) > 0 {
Expand Down
11 changes: 7 additions & 4 deletions x-pack/auditbeat/tests/system/auditbeat_xpack.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import jinja2
import os
import sys

from auditbeat import BaseTest as AuditbeatTest
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../metricbeat/tests/system')))

from metricbeat import BaseTest as MetricbeatTest

class AuditbeatXPackTest(AuditbeatTest):

class AuditbeatXPackTest(MetricbeatTest):

@classmethod
def setUpClass(self):
self.beat_name = "auditbeat"
self.beat_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../"))

super(AuditbeatTest, self).setUpClass()
super(MetricbeatTest, self).setUpClass()

def setUp(self):
super(AuditbeatTest, self).setUp()
super(MetricbeatTest, self).setUp()

# Hack to make jinja2 have the right paths
self.template_env = jinja2.Environment(
Expand Down
3 changes: 1 addition & 2 deletions x-pack/auditbeat/tests/system/test_metricsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import time
import unittest

sys.path.append(os.path.join(os.path.dirname(__file__), '../../../../auditbeat/tests/system'))

from auditbeat_xpack import *

COMMON_FIELDS = ["@timestamp", "host.name", "event.module", "event.dataset"]
Expand All @@ -24,6 +22,7 @@ def test_metricset_host(self):
self.check_metricset("system", "host", COMMON_FIELDS + fields, warnings_allowed=True)

@unittest.skipIf(sys.platform == "darwin" and os.geteuid != 0, "Requires root on macOS")
@unittest.skipIf(sys.platform == "win32", "Fails on Windows - https://github.com/elastic/beats/issues/9748")
def test_metricset_process(self):
"""
process metricset collects information about processes running on a system.
Expand Down