Skip to content

Commit

Permalink
Core: Apply black to the entire codebase and add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ikelos committed Dec 7, 2022
1 parent 06ced0d commit bd40277
Showing 189 changed files with 16,615 additions and 8,464 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- uses: psf/black@stable
with:
options: "--check --diff --verbose"
src: "./volatility3"
63 changes: 33 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -6,9 +6,10 @@

from volatility3.framework import constants

with open("README.md", "r", encoding = "utf-8") as fh:
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()


def get_install_requires():
requirements = []
with open("requirements-minimal.txt", "r", encoding="utf-8") as fh:
@@ -19,32 +20,34 @@ def get_install_requires():
requirements.append(stripped_line)
return requirements

setuptools.setup(name = "volatility3",
description = "Memory forensics framework",
version = constants.PACKAGE_VERSION,
license = "VSL",
keywords = "volatility memory forensics framework windows linux volshell",
author = "Volatility Foundation",
long_description = long_description,
long_description_content_type = "text/markdown",
author_email = "volatility@volatilityfoundation.org",
url = "https://github.com/volatilityfoundation/volatility3/",
project_urls = {
"Bug Tracker": "https://github.com/volatilityfoundation/volatility3/issues",
"Documentation": "https://volatility3.readthedocs.io/",
"Source Code": "https://github.com/volatilityfoundation/volatility3",
},
python_requires = '>=3.6.0',
include_package_data = True,
exclude_package_data = {
'': ['development', 'development.*'],
'development': ['*']
},
packages = setuptools.find_namespace_packages(exclude = ["development", "development.*"]),
entry_points = {
'console_scripts': [
'vol = volatility3.cli:main',
'volshell = volatility3.cli.volshell:main',
],
},
install_requires = get_install_requires())

setuptools.setup(
name="volatility3",
description="Memory forensics framework",
version=constants.PACKAGE_VERSION,
license="VSL",
keywords="volatility memory forensics framework windows linux volshell",
author="Volatility Foundation",
long_description=long_description,
long_description_content_type="text/markdown",
author_email="volatility@volatilityfoundation.org",
url="https://github.com/volatilityfoundation/volatility3/",
project_urls={
"Bug Tracker": "https://github.com/volatilityfoundation/volatility3/issues",
"Documentation": "https://volatility3.readthedocs.io/",
"Source Code": "https://github.com/volatilityfoundation/volatility3",
},
python_requires=">=3.6.0",
include_package_data=True,
exclude_package_data={"": ["development", "development.*"], "development": ["*"]},
packages=setuptools.find_namespace_packages(
exclude=["development", "development.*"]
),
entry_points={
"console_scripts": [
"vol = volatility3.cli:main",
"volshell = volatility3.cli.volshell:main",
],
},
install_requires=get_install_requires(),
)
51 changes: 35 additions & 16 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -3,38 +3,57 @@
import os
import pytest


def pytest_addoption(parser):
parser.addoption("--volatility", action="store", default=None,
parser.addoption(
"--volatility",
action="store",
default=None,
required=True,
help="path to the volatility script")
help="path to the volatility script",
)

parser.addoption(
"--python",
action="store",
default="python3",
help="The name of the interpreter to use when running the volatility script",
)

parser.addoption("--python", action="store", default="python3",
help="The name of the interpreter to use when running the volatility script")
parser.addoption(
"--image", action="append", default=[], help="path to an image to test"
)

parser.addoption("--image", action="append", default=[],
help="path to an image to test")
parser.addoption(
"--image-dir",
action="append",
default=[],
help="path to a directory containing images to test",
)

parser.addoption("--image-dir", action="append", default=[],
help="path to a directory containing images to test")

def pytest_generate_tests(metafunc):
"""Parameterize tests based on image names"""

images = metafunc.config.getoption('image')
for image_dir in metafunc.config.getoption('image_dir'):
images = images + [os.path.join(image_dir, dir) for dir in os.listdir(image_dir)]
images = metafunc.config.getoption("image")
for image_dir in metafunc.config.getoption("image_dir"):
images = images + [
os.path.join(image_dir, dir) for dir in os.listdir(image_dir)
]

# tests with "image" parameter are run against images
if 'image' in metafunc.fixturenames:
metafunc.parametrize("image",
images,
ids=[os.path.basename(image) for image in images])
if "image" in metafunc.fixturenames:
metafunc.parametrize(
"image", images, ids=[os.path.basename(image) for image in images]
)


# Fixtures
@pytest.fixture
def volatility(request):
return request.config.getoption("--volatility")


@pytest.fixture
def python(request):
return request.config.getoption("--python")
return request.config.getoption("--python")
Loading

0 comments on commit bd40277

Please sign in to comment.