From 48cfc6063136c45844d5a5c6a78ac4902c962d83 Mon Sep 17 00:00:00 2001 From: Christopher Phillips Date: Tue, 19 Dec 2023 13:25:57 -0500 Subject: [PATCH] test: update tests to new pattern Signed-off-by: Christopher Phillips --- syft/pkg/cataloger/binary/cataloger_test.go | 20 +++++++++--------- .../bash | Bin .../erlexec | Bin .../go | Bin .../haproxy | Bin .../haproxy | Bin 0 -> 642 bytes .../httpd | Bin 0 -> 639 bytes .../classifiers/positive/httpd-2.4.54/httpd | 18 ---------------- 8 files changed, 10 insertions(+), 28 deletions(-) rename syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/{bash-5.1.16 => }/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash (100%) rename syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/{erlang-25.3.2.7 => }/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec (100%) rename syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/{go-1.21.3 => }/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100/go (100%) rename syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/{haproxy-1.5.14 => }/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy (100%) create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-2.7.3-99d01769ac3457cf33b7e3eb93050453e20c09afe5631f810fd658fb5314bbd3-3156502-100/haproxy create mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54-3e11fbb6fa371cc9c3e513f49f0ab247b482773cd312248eb86e51251e36fafd-546892-100/httpd delete mode 100644 syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54/httpd diff --git a/syft/pkg/cataloger/binary/cataloger_test.go b/syft/pkg/cataloger/binary/cataloger_test.go index 0db8c478b..f9dfc0729 100644 --- a/syft/pkg/cataloger/binary/cataloger_test.go +++ b/syft/pkg/cataloger/binary/cataloger_test.go @@ -146,7 +146,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-httpd-2.4.54", - fixtureDir: "test-fixtures/classifiers/positive/httpd-2.4.54", + fixtureDir: "test-fixtures/classifiers/positive/httpd-2.4.54-3e11fbb6fa371cc9c3e513f49f0ab247b482773cd312248eb86e51251e36fafd-546892-100", expected: pkg.Package{ Name: "httpd", Version: "2.4.54", @@ -230,13 +230,13 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-haproxy-1.5.14", - fixtureDir: "test-fixtures/classifiers/positive/haproxy-1.5.14", + fixtureDir: "test-fixtures/classifiers/positive/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100", expected: pkg.Package{ Name: "haproxy", Version: "1.5.14", Type: "binary", PURL: "pkg:generic/haproxy@1.5.14", - Locations: locations("haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy"), + Locations: locations("haproxy"), Metadata: metadata("haproxy-binary"), }, }, @@ -254,7 +254,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-haproxy-2.7.3", - fixtureDir: "test-fixtures/classifiers/positive/haproxy-2.7.3", + fixtureDir: "test-fixtures/classifiers/positive/haproxy-2.7.3-99d01769ac3457cf33b7e3eb93050453e20c09afe5631f810fd658fb5314bbd3-3156502-100", expected: pkg.Package{ Name: "haproxy", Version: "2.7.3", @@ -503,7 +503,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-go", - fixtureDir: "test-fixtures/classifiers/positive/go-1.21.3", + fixtureDir: "test-fixtures/classifiers/positive/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100", expected: pkg.Package{ Name: "go", Version: "1.21.3", @@ -582,7 +582,7 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-java-oracle-macos", - fixtureDir: "test-fixtures/classifiers/positive/oracle-macos--java-19.0.1", + fixtureDir: "test-fixtures/classifiers/positive/oracle-macos-java-19.0.1", expected: pkg.Package{ Name: "java", Version: "19.0.1+10-21", @@ -717,13 +717,13 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-erlang-25.3.2.7", - fixtureDir: "test-fixtures/classifiers/positive/erlang-25.3.2.7", + fixtureDir: "test-fixtures/classifiers/positive/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100", expected: pkg.Package{ Name: "erlang", Version: "25.3.2.7", Type: "binary", PURL: "pkg:generic/erlang@25.3.2.7", - Locations: locations("erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec"), + Locations: locations("erlexec"), Metadata: metadata("erlang-binary"), }, }, @@ -753,13 +753,13 @@ func Test_Cataloger_DefaultClassifiers_PositiveCases(t *testing.T) { }, { name: "positive-bash-5.1.16", - fixtureDir: "test-fixtures/classifiers/positive/bash-5.1.16", + fixtureDir: "test-fixtures/classifiers/positive/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100", expected: pkg.Package{ Name: "bash", Version: "5.1.16", Type: "binary", PURL: "pkg:generic/bash@5.1.16", - Locations: locations("bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash"), + Locations: locations("bash"), Metadata: metadata("bash-binary"), }, }, diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/bash-5.1.16/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash similarity index 100% rename from syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/bash-5.1.16/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash rename to syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/bash-5.1.16-2c336c63e26881d2f02f34379024e7c314bce572c08cbaa319bacbbec29f93ed-1210190-100/bash diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec similarity index 100% rename from syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlang-25.3.2.7/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec rename to syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/erlexec-25.3.2.7-2224b3107551c409fb8da6d85eaa1ed730d088db438924c97d6e25851381dd28-91724-100/erlexec diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go-1.21.3/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100/go b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100/go similarity index 100% rename from syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go-1.21.3/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100/go rename to syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go-1.21.3-6a05bd57efff25a9d682b8e25ce572ee7ff723f4f5bcbba6429012121e247365-7879390-100/go diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-1.5.14/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy similarity index 100% rename from syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-1.5.14/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy rename to syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-1.5.14-5ff6ed7c0149382701391f268e78793a623d6b8fd2b9b65fe89c08b6041fd4d4-527350-100/haproxy diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-2.7.3-99d01769ac3457cf33b7e3eb93050453e20c09afe5631f810fd658fb5314bbd3-3156502-100/haproxy b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/haproxy-2.7.3-99d01769ac3457cf33b7e3eb93050453e20c09afe5631f810fd658fb5314bbd3-3156502-100/haproxy new file mode 100644 index 0000000000000000000000000000000000000000..177b05511d8a1135d28a1cd4fd29b2b881ee8ad4 GIT binary patch literal 642 zcmYLH&2H2%5Z-ey@CYO2(n?9zj$?1KQV&!uKhhQr8Nfcvnx!O$d+Te^sK(uw!(cJAorl2(VS3bIWF-d_`T2m-RrSRhZf(vs zUvDoD1bgW`bjA$m4}>tv1t(dk1W9(j{!cw6t0(kB{C*EHSzu=x2bJ@)@T`Nv;#{O9@XA5VVqFvsxl7a)_dL;wH) literal 0 HcmV?d00001 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54-3e11fbb6fa371cc9c3e513f49f0ab247b482773cd312248eb86e51251e36fafd-546892-100/httpd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54-3e11fbb6fa371cc9c3e513f49f0ab247b482773cd312248eb86e51251e36fafd-546892-100/httpd new file mode 100644 index 0000000000000000000000000000000000000000..6290cfc50dad49ffd0a16edcb2f71dd34ccce7eb GIT binary patch literal 639 zcmYjPZEM>w5ccQ(iX;Bgg6&u@cAStFR@#k0HU?=2V~nAfQ>@LkjU;!;zn{D;Z2BOM z=k6ZeJ&)2fg#-5JL_iJl1YS8ihKPmS*khO+=DxS%h@tQ;hyYI$!UHNGYanbx>J2a9 zasLFgqzuwDy-LB@4tw!}8#tdfgi%M_w}Mvn1qEP8h>@~3f~|;BYsIi4%<#1-g`|8X zc|%t#rZgjz@&;v7#{yarWU6h1L$eze~2uOL#TMckpS5GbM|={~IrqzX4p}yY>J8 literal 0 HcmV?d00001 diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54/httpd b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54/httpd deleted file mode 100644 index 441662ab1..000000000 --- a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/httpd-2.4.54/httpd +++ /dev/null @@ -1,18 +0,0 @@ -