Skip to content

Commit

Permalink
Removed labels from tests (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Mar 11, 2022
1 parent 14b0bd4 commit 421057a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
5 changes: 0 additions & 5 deletions test_data/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sources:
- type: FILE
attributes: {paths: ['%%environ_systemroot%%\System32\winevt\Logs\Security.evtx']}
conditions: [os_major_version >= 6]
labels: [Logs]
supported_os: [Windows]
urls: ['http://www.forensicswiki.org/wiki/Windows_XML_Event_Log_(EVTX)']
---
Expand Down Expand Up @@ -44,7 +43,6 @@ doc: |
sources:
- type: WMI
attributes: {query: SELECT * FROM Win32_UserProfile WHERE SID='%%users.sid%%'}
labels: [Users]
provides: [users.homedir]
supported_os: [Windows]
urls: ['http://msdn.microsoft.com/en-us/library/windows/desktop/ee886409(v=vs.85).aspx']
Expand All @@ -61,7 +59,6 @@ sources:
- 'SecurityEventLogEvtx'
- 'SystemEventLog'
- 'SystemEventLogEvtx'
labels: [Logs]
supported_os: [Windows]
---
name: RedhatPackagesList
Expand All @@ -71,7 +68,6 @@ sources:
attributes:
args: [-qa]
cmd: /bin/rpm
labels: [Software]
supported_os: [Linux]
---
name: OSXLoadedKexts
Expand All @@ -81,5 +77,4 @@ sources:
attributes:
args: []
cmd: /usr/sbin/kextstat
labels: [System]
supported_os: [Darwin]
27 changes: 0 additions & 27 deletions tests/reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
class YamlArtifactsReaderTest(test_lib.BaseTestCase):
"""YAML artifacts reader tests."""

_DEFINITION_INVALID_LABELS = """\
name: BadLabel
doc: badlabel.
sources:
- type: ARTIFACT_GROUP
attributes:
names:
- 'SystemEventLogEvtx'
labels: Logs
supported_os: [Windows]
"""

_DEFINITION_INVALID_SUPPORTED_OS_1 = """\
name: BadSupportedOS
doc: supported_os should be an array of strings.
Expand All @@ -35,7 +23,6 @@ class YamlArtifactsReaderTest(test_lib.BaseTestCase):
attributes:
names:
- 'SystemEventLogEvtx'
labels: [Logs]
supported_os: Windows
"""

Expand All @@ -48,7 +35,6 @@ class YamlArtifactsReaderTest(test_lib.BaseTestCase):
names:
- 'SystemEventLogEvtx'
supported_os: [Windows]
labels: [Logs]
"""

_DEFINITION_INVALID_URLS = """\
Expand All @@ -72,7 +58,6 @@ class YamlArtifactsReaderTest(test_lib.BaseTestCase):
names:
- 'SystemEventLogEvtx'
extra_key: 'wrong'
labels: [Logs]
supported_os: [Windows]
"""

Expand Down Expand Up @@ -107,7 +92,6 @@ class YamlArtifactsReaderTest(test_lib.BaseTestCase):
_DEFINITION_WITHOUT_SOURCES = """\
name: BadSources
doc: must have one sources.
labels: [Logs]
supported_os: [Windows]
"""

Expand Down Expand Up @@ -146,9 +130,6 @@ def testReadFileObject(self):
expected_condition = 'os_major_version >= 6'
self.assertEqual(artifact_definition.conditions[0], expected_condition)

self.assertEqual(len(artifact_definition.labels), 1)
self.assertEqual(artifact_definition.labels[0], 'Logs')

self.assertEqual(len(artifact_definition.supported_os), 1)
self.assertEqual(artifact_definition.supported_os[0], 'Windows')

Expand Down Expand Up @@ -244,14 +225,6 @@ def testReadFileObject(self):
self.assertEqual(
collector_definition.type_indicator, definitions.TYPE_INDICATOR_COMMAND)

def testReadFileObjectInvalidLabels(self):
"""Tests the ReadFileObject function on an invalid labels."""
artifact_reader = reader.YamlArtifactsReader()

file_object = io.StringIO(initial_value=self._DEFINITION_INVALID_LABELS)
with self.assertRaises(errors.FormatError):
_ = list(artifact_reader.ReadFileObject(file_object))

def testReadFileObjectInvalidSupportedOS(self):
"""Tests the ReadFileObject function on an invalid supported_os."""
artifact_reader = reader.YamlArtifactsReader()
Expand Down

0 comments on commit 421057a

Please sign in to comment.