Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TestTurbiniaTaskBase allows to pass Evidence Class as parameter but instantiates RawDisk anyway #1373

Open
HolzmanoLagrene opened this issue Oct 12, 2023 · 0 comments
Labels
bug Needs triage New issues that need triage

Comments

@HolzmanoLagrene
Copy link
Contributor

What steps will reproduce the bug?

Using the regular developer setups as proposed in the Wiki when trying to create new Tests that do not use RawDisk as Evidence type

What is the expected behavior?

In my opinion when I look at these lines of code

def setUp(self, task_class=TurbiniaTask, evidence_class=evidence.RawDisk):
self.task_class = task_class
self.evidence_class = evidence_class

I expect to be able to pass a Evidence type and use that in the unittest.

What do you see instead?

Looking at a couple of lines later we see this:

self.evidence = evidence.RawDisk(source_path=test_disk_path)

This will, in any case, set the self.evidence object to Evidence of type RawDisk

Additional information

Not sure if this is a bug or a misunderstanding on my side, but intuitively I would expect the Evidence type class to be instantiated and assigned to self.evidence later. Something like this:

self.task_class = task_class
self.evidence_class = evidence_class
...
self.evidence = self.evidence_class()

The task_class parameter does that in the line:

self.task = self.task_class(base_output_dir=self.base_output_dir)

@HolzmanoLagrene HolzmanoLagrene added bug Needs triage New issues that need triage labels Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs triage New issues that need triage
Projects
None yet
Development

No branches or pull requests

1 participant