From a53904751658ee24d7431e2ca4ca98affc9b5853 Mon Sep 17 00:00:00 2001 From: Abyss Watcher Date: Wed, 12 Mar 2025 16:19:08 +0100 Subject: [PATCH] correctly order volshell args --- test/plugins/linux/linux.py | 2 +- test/plugins/windows/windows.py | 2 +- test/test_volatility.py | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/plugins/linux/linux.py b/test/plugins/linux/linux.py index 8ec485735..e39c1d15d 100644 --- a/test/plugins/linux/linux.py +++ b/test/plugins/linux/linux.py @@ -8,7 +8,7 @@ from test import test_volatility, LinuxSamples class TestLinuxVolshell: def test_linux_volshell(self, image, volatility, python): out = test_volatility.basic_volshell_test( - image, volatility, python, globalargs=("-l",) + image, volatility, python, volshellargs=("-l",) ) assert out.count(b" 100 diff --git a/test/plugins/windows/windows.py b/test/plugins/windows/windows.py index ce05af0cd..d19478484 100644 --- a/test/plugins/windows/windows.py +++ b/test/plugins/windows/windows.py @@ -10,7 +10,7 @@ from test import test_volatility, WindowsSamples class TestWindowsVolshell: def test_windows_volshell(self, image, volatility, python): out = test_volatility.basic_volshell_test( - image, volatility, python, globalargs=("-w",) + image, volatility, python, volshellargs=("-w",) ) assert out.count(b" 40 diff --git a/test/test_volatility.py b/test/test_volatility.py index 960ac00d1..9b7aff4be 100644 --- a/test/test_volatility.py +++ b/test/test_volatility.py @@ -62,9 +62,9 @@ def runvol_plugin( return runvol(args, volatility, python) -def runvolshell(img, volshell, python, volshellargs=None, globalargs=None): - volshellargs = volshellargs or [] - globalargs = globalargs or [] +def runvolshell( + img, volshell, python, volshellargs: Tuple = (), globalargs: Tuple = () +): args = ( globalargs + ( @@ -196,7 +196,9 @@ def count_entries_flat(plugin_json_out: List[dict]): # -def basic_volshell_test(image, volatility, python, globalargs): +def basic_volshell_test( + image, volatility, python, volshellargs: Tuple = (), globalargs: Tuple = () +): # Basic VolShell test to verify requirements and ensure VolShell runs without crashing volshell_commands = [ @@ -216,7 +218,7 @@ def basic_volshell_test(image, volatility, python, globalargs): img=image, volshell=volatility, python=python, - volshellargs=("--script", filename), + volshellargs=("--script", filename) + volshellargs, globalargs=globalargs, ) finally: