15
0
forked from pool/python-evtx

Accepting request 922998 from home:bnavigator:branches:devel:languages:python

- Update to 0.7.4
  * relax dependencies for most users #72
  * show records by date filter
  * handling of invalid dates #43
  * handling of malformed evtx files
  * pin dependencies due to py2 deprecation #67
  * testing on pytest 4
- Drop pytest4.patch merged upstream
- Fix rpmlint alternative link errors
- Fix missing python2-xml requirement

OBS-URL: https://build.opensuse.org/request/show/922998
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-evtx?expand=0&rev=22
This commit is contained in:
Cédric Bosdonnat
2021-10-04 12:13:33 +00:00
committed by Git OBS Bridge
parent be4bd4d984
commit b84eaab3fb
5 changed files with 38 additions and 85 deletions

View File

@@ -1,60 +0,0 @@
--- a/tests/fixtures.py
+++ b/tests/fixtures.py
@@ -21,7 +21,7 @@ def system_path():
@pytest.yield_fixture
-def system():
+def system(system_path):
'''
yields the contents of the system.evtx test file.
the returned value is a memory map of the contents,
@@ -30,8 +30,7 @@ def system():
Returns:
mmap.mmap: the contents of the test file.
'''
- p = system_path()
- with open(p, 'rb') as f:
+ with open(system_path, 'rb') as f:
with contextlib.closing(mmap.mmap(f.fileno(), 0,
access=mmap.ACCESS_READ)) as buf:
yield buf
@@ -52,7 +51,7 @@ def security_path():
@pytest.yield_fixture
-def security():
+def security(security_path):
'''
yields the contents of the security.evtx test file.
the returned value is a memory map of the contents,
@@ -61,8 +60,7 @@ def security():
Returns:
mmap.mmap: the contents of the test file.
'''
- p = security_path()
- with open(p, 'rb') as f:
+ with open(security_path, 'rb') as f:
with contextlib.closing(mmap.mmap(f.fileno(), 0,
access=mmap.ACCESS_READ)) as buf:
yield buf
--- a/tests/test_records.py
+++ b/tests/test_records.py
@@ -248,7 +248,7 @@ def test_parse_record(system):
['EndOfStreamNode']]]]],
['Substitutions', None, [
['WstringTypeNode', 'System'],
- ['WstringTypeNode', 'C:\Windows\System32\Winevt\Logs\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]]
+ ['WstringTypeNode', 'C:\\Windows\\System32\\Winevt\\Logs\\Archive-System-2012-03-14-04-17-39-932.evtx']]]]]]]]]]]
assert extract_structure(record.root()) == expected
@@ -264,7 +264,7 @@ def test_render_record(system):
chunk = one(fh.chunks())
record = one(chunk.records())
- xml = record.xml()
+ xml = record.xml()
assert xml == textwrap.dedent('''\
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><System><Provider Name="Microsoft-Windows-Eventlog" Guid="{fc65ddd8-d6ef-4962-83d5-6e5cfe9ce148}"></Provider>
<EventID Qualifiers="">105</EventID>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4fc8604242dfe68929a77d45de4ff2f6f3b14593c0de984128478edf2a532302
size 295127

3
python-evtx-0.7.4.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ecf3c1736ec9e080ddd1c64b6dad23c756e20d54bd30acc21245b9706258fdd9
size 446141

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon Oct 4 08:29:55 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 0.7.4
* relax dependencies for most users #72
* show records by date filter
* handling of invalid dates #43
* handling of malformed evtx files
* pin dependencies due to py2 deprecation #67
* testing on pytest 4
- Drop pytest4.patch merged upstream
- Fix rpmlint alternative link errors
- Fix missing python2-xml requirement
-------------------------------------------------------------------
Tue May 26 06:34:09 UTC 2020 - Petr Gajdos <pgajdos@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-evtx
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,27 +18,31 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define commands dump dump_chunk_slack eid_record_numbers extract_record filter_records info record_structure structure templates
%bcond_without python2
Name: python-evtx
Version: 0.6.1
Version: 0.7.4
Release: 0
Summary: Windows Event Log files parser
License: Apache-2.0
URL: https://github.com/williballenthin/python-evtx
Source: https://github.com/williballenthin/python-evtx/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM pytest4.patch gh#williballenthin/python-evtx#66 mcepl@suse.com
# make the test suite pass under pytest 4
Patch0: pytest4.patch
BuildRequires: %{python_module hexdump}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
%if %{with python2}
BuildRequires: python2-xml
%endif
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-hexdump
Requires: python-lxml
%ifpython2
Requires: python-xml
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%python_subpackages
@@ -71,27 +75,22 @@ done
%pytest
%post
for c in %{commands}; do
%python_install_alternative evtx_$c.py
done
%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do
print(rpm.expand("%python_install_alternative evtx_" .. c .. ".py"))
end}
%postun
for c in %{commands}; do
%python_uninstall_alternative evtx_$c.py
done
%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do
print(rpm.expand("%python_uninstall_alternative evtx_" .. c .. ".py"))
end}
%files %{python_files}
%license LICENSE.TXT
%doc README.md
%{python_sitelib}/*
%python_alternative %{_bindir}/evtx_dump.py
%python_alternative %{_bindir}/evtx_dump_chunk_slack.py
%python_alternative %{_bindir}/evtx_eid_record_numbers.py
%python_alternative %{_bindir}/evtx_extract_record.py
%python_alternative %{_bindir}/evtx_filter_records.py
%python_alternative %{_bindir}/evtx_info.py
%python_alternative %{_bindir}/evtx_record_structure.py
%python_alternative %{_bindir}/evtx_structure.py
%python_alternative %{_bindir}/evtx_templates.py
%{python_sitelib}/Evtx
%{python_sitelib}/python_evtx-%{version}*-info
%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do
print(rpm.expand("%python_alternative %{_bindir}/evtx_" .. c .. ".py"))
end}
%changelog