Skip to content

Commit 72df5de

Browse files
committed
Add truncated ubuntu docker image for testing #435
Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 6580c38 commit 72df5de

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

scanpipe/tests/data/ubuntu.tar

3.15 MB
Binary file not shown.

scanpipe/tests/test_pipelines.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,27 @@ def test_scanpipe_docker_pipeline_rpm_integration_test(self):
364364
result_file = output.to_json(project1)
365365
expected_file = self.data_location / "redhat_ubi8_scan_codebase.json"
366366
self.assertPipelineResultEqual(expected_file, result_file, regen=False)
367+
368+
def test_scanpipe_docker_pipeline_ubuntu_integration_test(self):
369+
pipeline_name = "docker"
370+
project1 = Project.objects.create(name="Analysis")
371+
372+
filename = "ubuntu.tar"
373+
input_location = self.data_location / filename
374+
project1.copy_input_from(input_location)
375+
project1.add_input_source(filename, "https://download.url", save=True)
376+
377+
run = project1.add_pipeline(pipeline_name)
378+
pipeline = run.make_pipeline_instance()
379+
380+
exitcode, _ = pipeline.execute()
381+
self.assertEqual(0, exitcode)
382+
383+
# TODO: add correct number of resources and packages when we get the
384+
# pipeline working
385+
self.assertEqual(6, project1.codebaseresources.count())
386+
self.assertEqual(1, project1.discoveredpackages.count())
387+
388+
result_file = output.to_json(project1)
389+
expected_file = self.data_location / "ubuntu_scan_codebase.json"
390+
self.assertPipelineResultEqual(expected_file, result_file, regen=True)

0 commit comments

Comments
 (0)