From c8bdd8d378c05d909e67f0534b0d0c392c5ae7d2 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Mon, 1 Apr 2024 08:42:59 +0200 Subject: [PATCH] Applied updates and changes for CI tests --- .github/workflows/test_docker.yml | 35 ++++++++-------------- scripts/extract.py | 2 +- setup.cfg | 49 ------------------------------- sqliterc/resources.py | 2 +- sqliterc/yaml_definitions_file.py | 2 +- tests/resources.py | 8 ++--- tox.ini | 2 +- 7 files changed, 20 insertions(+), 80 deletions(-) diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index 8d81e76..b6a2568 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['38'] + version: ['39', '40'] container: image: registry.fedoraproject.org/fedora:${{ matrix.version }} steps: @@ -18,7 +18,7 @@ jobs: - name: Install dependencies run: | dnf copr -y enable @gift/dev - dnf install -y @development-tools python3 python3-devel libbde-python3 libcaes-python3 libcreg-python3 libewf-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 python3-artifacts python3-cffi python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-dtfabric python3-idna python3-pytsk3 python3-pyyaml python3-setuptools python3-xattr + dnf install -y @development-tools libbde-python3 libcaes-python3 libcreg-python3 libewf-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 python3 python3-artifacts python3-build python3-cffi python3-devel python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-dtfabric python3-idna python3-pytsk3 python3-pyyaml python3-setuptools python3-wheel python3-xattr - name: Run tests env: LANG: C.utf8 @@ -27,21 +27,17 @@ jobs: - name: Run end-to-end tests run: | if test -f tests/end-to-end.py; then PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini; fi - - name: Build source distribution + - name: Build source distribution (sdist) run: | - python3 ./setup.py sdist - - name: Build binary distribution + python3 -m build --no-isolation --sdist + - name: Build binary distribution (wheel) run: | - python3 ./setup.py bdist - - name: Run build and install test - run: | - python3 ./setup.py build - python3 ./setup.py install + python3 -m build --no-isolation --wheel test_ubuntu: runs-on: ubuntu-latest strategy: matrix: - version: ['22.04'] + version: ['24.04'] container: image: ubuntu:${{ matrix.version }} steps: @@ -58,7 +54,7 @@ jobs: run: | add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential python3 python3-dev libbde-python3 libcaes-python3 libcreg-python3 libewf-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 python3-artifacts python3-cffi-backend python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-distutils python3-dtfabric python3-idna python3-pip python3-pytsk3 python3-setuptools python3-wheel python3-xattr python3-yaml + apt-get install -y build-essential libbde-python3 libcaes-python3 libcreg-python3 libewf-python3 libfcrypto-python3 libfsapfs-python3 libfsext-python3 libfsfat-python3 libfshfs-python3 libfsntfs-python3 libfsxfs-python3 libfvde-python3 libfwnt-python3 libluksde-python3 libmodi-python3 libphdi-python3 libqcow-python3 libregf-python3 libsigscan-python3 libsmdev-python3 libsmraw-python3 libvhdi-python3 libvmdk-python3 libvsapm-python3 libvsgpt-python3 libvshadow-python3 libvslvm-python3 python3 python3-artifacts python3-build python3-cffi-backend python3-dev python3-dfdatetime python3-dfimagetools python3-dfvfs python3-dfwinreg python3-distutils python3-dtfabric python3-idna python3-pip python3-pytsk3 python3-setuptools python3-wheel python3-xattr python3-yaml - name: Run tests env: LANG: en_US.UTF-8 @@ -69,16 +65,9 @@ jobs: LANG: en_US.UTF-8 run: | if test -f tests/end-to-end.py; then PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini; fi - - name: Update setuptools - run: | - python3 -m pip install -U setuptools - - name: Build source distribution - run: | - python3 ./setup.py sdist - - name: Build binary distribution + - name: Build source distribution (sdist) run: | - python3 ./setup.py bdist - - name: Run build and install test + python3 -m build --no-isolation --sdist + - name: Build binary distribution (wheel) run: | - python3 ./setup.py build - python3 ./setup.py install + python3 -m build --no-isolation --wheel diff --git a/scripts/extract.py b/scripts/extract.py index f42aae0..56a9597 100755 --- a/scripts/extract.py +++ b/scripts/extract.py @@ -46,7 +46,7 @@ def Main(): command_line.AddStorageMediaImageCLIArguments(argument_parser) argument_parser.add_argument( - 'source', nargs='?', action='store', metavar='image.raw', default=None, + 'source', nargs='?', action='store', metavar='PATH', default=None, help='path of a storage media image or SQLite database file.') options = argument_parser.parse_args() diff --git a/setup.cfg b/setup.cfg index f972882..1add04e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,54 +38,5 @@ exclude = utils where = . -[bdist_rpm] -release = 1 -packager = Joachim Metz -doc_files = - ACKNOWLEDGEMENTS - AUTHORS - LICENSE - README -build_requires = python3-setuptools -requires = - libbde-python3 >= 20220121 - libcaes-python3 >= 20240114 - libcreg-python3 >= 20200725 - libewf-python3 >= 20131210 - libfcrypto-python3 >= 20240114 - libfsapfs-python3 >= 20220709 - libfsext-python3 >= 20220829 - libfsfat-python3 >= 20220925 - libfshfs-python3 >= 20220831 - libfsntfs-python3 >= 20211229 - libfsxfs-python3 >= 20220829 - libfvde-python3 >= 20220121 - libfwnt-python3 >= 20210717 - libluksde-python3 >= 20220121 - libmodi-python3 >= 20210405 - libphdi-python3 >= 20220228 - libqcow-python3 >= 20201213 - libregf-python3 >= 20201002 - libsigscan-python3 >= 20230109 - libsmdev-python3 >= 20140529 - libsmraw-python3 >= 20140612 - libvhdi-python3 >= 20201014 - libvmdk-python3 >= 20140421 - libvsapm-python3 >= 20230506 - libvsgpt-python3 >= 20211115 - libvshadow-python3 >= 20160109 - libvslvm-python3 >= 20160109 - python3-artifacts >= 20220219 - python3-cffi >= 1.9.1 - python3-dfdatetime >= 20221112 - python3-dfimagetools >= 20240107 - python3-dfvfs >= 20240115 - python3-dfwinreg >= 20211207 - python3-dtfabric >= 20230518 - python3-idna >= 2.5 - python3-pytsk3 >= 20210419 - python3-pyyaml >= 3.10 - python3-xattr >= 0.7.2 - [bdist_wheel] universal = 1 diff --git a/sqliterc/resources.py b/sqliterc/resources.py index 98ac706..73344af 100644 --- a/sqliterc/resources.py +++ b/sqliterc/resources.py @@ -23,7 +23,7 @@ class DatabaseDefinition(object): Attributes: artifact_definition (str): name of the corresponding Digital Forensics Artifact definition. - database_identifier (str): identifier of the database type. + database_identifier (str): identifier of the database. """ def __init__(self): diff --git a/sqliterc/yaml_definitions_file.py b/sqliterc/yaml_definitions_file.py index d7cbf9c..c7e1728 100644 --- a/sqliterc/yaml_definitions_file.py +++ b/sqliterc/yaml_definitions_file.py @@ -18,7 +18,7 @@ class YAMLDatabaseDefinitionsFile(object): Where: * artifact_definition, name of the corresponding Digital Forensics Artifact definition. - * database_identifier, identifier of the database type. + * database_identifier, identifier of the database. """ _SUPPORTED_KEYS = frozenset([ diff --git a/tests/resources.py b/tests/resources.py index abf7612..b0f43ba 100644 --- a/tests/resources.py +++ b/tests/resources.py @@ -14,8 +14,8 @@ class ColumnDefinitionTest(test_lib.BaseTestCase): def testInitialize(self): """Tests the __init__ function.""" - column_definition = resources.ColumnDefinition() - self.assertIsNotNone(column_definition) + test_definition = resources.ColumnDefinition() + self.assertIsNotNone(test_definition) class DatabaseDefinitionTest(test_lib.BaseTestCase): @@ -23,8 +23,8 @@ class DatabaseDefinitionTest(test_lib.BaseTestCase): def testInitialize(self): """Tests the __init__ function.""" - database_definition = resources.DatabaseDefinition() - self.assertIsNotNone(database_definition) + test_definition = resources.DatabaseDefinition() + self.assertIsNotNone(test_definition) if __name__ == '__main__': diff --git a/tox.ini b/tox.ini index 8690aab..8396660 100644 --- a/tox.ini +++ b/tox.ini @@ -62,4 +62,4 @@ commands = yamllint -v docformatter --check --diff --recursive scripts setup.py sqliterc tests pylint --rcfile=.pylintrc scripts setup.py sqliterc tests - yamllint -c .yamllint.yaml sqliterc/data test_data + yamllint -c .yamllint.yaml sqliterc test_data