Skip to content

Commit

Permalink
feat(suse): Align SUSE/OpenSUSE OS Identifiers (#7965)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose D. Gomez R <[email protected]>
  • Loading branch information
josegomezr authored Nov 21, 2024
1 parent 9688370 commit 45d3b40
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 151 deletions.
10 changes: 5 additions & 5 deletions integration/testdata/opensuse-leap-151.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ArtifactType": "container_image",
"Metadata": {
"OS": {
"Family": "opensuse.leap",
"Family": "opensuse-leap",
"Name": "15.1",
"EOSL": true
},
Expand Down Expand Up @@ -57,16 +57,16 @@
},
"Results": [
{
"Target": "testdata/fixtures/images/opensuse-leap-151.tar.gz (opensuse.leap 15.1)",
"Target": "testdata/fixtures/images/opensuse-leap-151.tar.gz (opensuse-leap 15.1)",
"Class": "os-pkgs",
"Type": "opensuse.leap",
"Type": "opensuse-leap",
"Vulnerabilities": [
{
"VulnerabilityID": "openSUSE-SU-2020:0062-1",
"PkgID": "[email protected]_64",
"PkgName": "libopenssl1_1",
"PkgIdentifier": {
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse.leap-15.1",
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse-leap-15.1",
"UID": "898b73ddd0412f57"
},
"InstalledVersion": "1.1.0i-lp151.8.3.1",
Expand Down Expand Up @@ -99,7 +99,7 @@
"PkgID": "[email protected]_64",
"PkgName": "openssl-1_1",
"PkgIdentifier": {
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse.leap-15.1",
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse-leap-15.1",
"UID": "58980d005de43f54"
},
"InstalledVersion": "1.1.0i-lp151.8.3.1",
Expand Down
8 changes: 4 additions & 4 deletions integration/testdata/opensuse-tumbleweed.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ArtifactType": "container_image",
"Metadata": {
"OS": {
"Family": "opensuse.tumbleweed",
"Family": "opensuse-tumbleweed",
"Name": "20240607"
},
"ImageID": "sha256:580e73f5c823232e6587136e9f5428a89afdf77a123bb8575d08208e0cc34b12",
Expand Down Expand Up @@ -60,16 +60,16 @@
},
"Results": [
{
"Target": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz (opensuse.tumbleweed 20240607)",
"Target": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz (opensuse-tumbleweed 20240607)",
"Class": "os-pkgs",
"Type": "opensuse.tumbleweed",
"Type": "opensuse-tumbleweed",
"Vulnerabilities": [
{
"VulnerabilityID": "openSUSE-SU-2024:13065-1",
"PkgID": "[email protected]_64",
"PkgName": "libopenssl3",
"PkgIdentifier": {
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse.tumbleweed-20240607",
"PURL": "pkg:rpm/opensuse/[email protected]?arch=x86_64\u0026distro=opensuse-tumbleweed-20240607",
"UID": "f051425f385d2b99"
},
"InstalledVersion": "3.1.4-9.1",
Expand Down
6 changes: 3 additions & 3 deletions integration/testdata/sl-micro-rancher5.4.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ArtifactType": "container_image",
"Metadata": {
"OS": {
"Family": "suse linux enterprise micro",
"Family": "slem",
"Name": "5.4"
},
"ImageID": "sha256:c45ec974938acac29c893b5d273d73e4ebdd7e6a97b6fa861dfbd8dd430b9016",
Expand Down Expand Up @@ -61,9 +61,9 @@
},
"Results": [
{
"Target": "testdata/fixtures/images/sle-micro-rancher-5.4_ndb.tar.gz (suse linux enterprise micro 5.4)",
"Target": "testdata/fixtures/images/sle-micro-rancher-5.4_ndb.tar.gz (slem 5.4)",
"Class": "os-pkgs",
"Type": "suse linux enterprise micro"
"Type": "slem"
}
]
}
12 changes: 6 additions & 6 deletions pkg/detector/ospkg/suse/suse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,20 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
want bool
}{
{
name: "opensuse.tumbleweed",
name: "opensuse-tumbleweed",
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
args: args{
osFamily: "opensuse.tumbleweed",
osFamily: "opensuse-tumbleweed",
osVer: "",
},
distribution: suse.OpenSUSETumbleweed,
want: true,
},
{
name: "opensuse.leap42.3",
name: "opensuse-leap42.3",
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
args: args{
osFamily: "opensuse.leap",
osFamily: "opensuse-leap",
osVer: "42.3",
},
distribution: suse.OpenSUSE,
Expand All @@ -266,7 +266,7 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
name: "sles12.3",
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
args: args{
osFamily: "suse linux enterprise server",
osFamily: "sles",
osVer: "12.3",
},
distribution: suse.SUSEEnterpriseLinux,
Expand All @@ -276,7 +276,7 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
name: "latest",
now: time.Date(2019, 5, 2, 23, 59, 59, 0, time.UTC),
args: args{
osFamily: "opensuse.leap",
osFamily: "opensuse-leap",
osVer: "999.0",
},
want: true,
Expand Down
6 changes: 3 additions & 3 deletions pkg/fanal/test/integration/library_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var tests = []testCase{
imageFile: "../../../../integration/testdata/fixtures/images/opensuse-leap-151.tar.gz",
wantOS: types.OS{
Name: "15.1",
Family: "opensuse.leap",
Family: "opensuse-leap",
},
},
{
Expand All @@ -100,7 +100,7 @@ var tests = []testCase{
imageFile: "../../../../integration/testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
wantOS: types.OS{
Name: "20240607",
Family: "opensuse.tumbleweed",
Family: "opensuse-tumbleweed",
},
},
{
Expand All @@ -110,7 +110,7 @@ var tests = []testCase{
imageFile: "../../../../integration/testdata/fixtures/images/suse-15.3_ndb.tar.gz",
wantOS: types.OS{
Name: "15.3",
Family: "suse linux enterprise server",
Family: "sles",
},
},
{
Expand Down
Loading

0 comments on commit 45d3b40

Please sign in to comment.