Skip to content

Commit

Permalink
Add truncated ubuntu docker image for testing #435
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <jyang@nexb.com>
  • Loading branch information
JonoYang committed May 13, 2022
1 parent 6580c38 commit 72df5de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Binary file added scanpipe/tests/data/ubuntu.tar
Binary file not shown.
24 changes: 24 additions & 0 deletions scanpipe/tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,27 @@ def test_scanpipe_docker_pipeline_rpm_integration_test(self):
result_file = output.to_json(project1)
expected_file = self.data_location / "redhat_ubi8_scan_codebase.json"
self.assertPipelineResultEqual(expected_file, result_file, regen=False)

def test_scanpipe_docker_pipeline_ubuntu_integration_test(self):
pipeline_name = "docker"
project1 = Project.objects.create(name="Analysis")

filename = "ubuntu.tar"
input_location = self.data_location / filename
project1.copy_input_from(input_location)
project1.add_input_source(filename, "https://download.url", save=True)

run = project1.add_pipeline(pipeline_name)
pipeline = run.make_pipeline_instance()

exitcode, _ = pipeline.execute()
self.assertEqual(0, exitcode)

# TODO: add correct number of resources and packages when we get the
# pipeline working
self.assertEqual(6, project1.codebaseresources.count())
self.assertEqual(1, project1.discoveredpackages.count())

result_file = output.to_json(project1)
expected_file = self.data_location / "ubuntu_scan_codebase.json"
self.assertPipelineResultEqual(expected_file, result_file, regen=True)

0 comments on commit 72df5de

Please sign in to comment.