Skip to content

Commit 997d7fc

Browse files
amalimovnirarg
authored andcommitted
ECOPROJECT-4246 | fix: fixed complexity scores for win server
The OS name in the inventory is taken from the "VMware Tools" column, and fallsback to the "config. file" column. This means that there can be a big variation on OS names - which can cause the classification map to fail. This is a quick patch for specific misclassifications, and further fixes are probably needed in the inventory creation. Signed-off-by: Ami Malimovka <amalimov@redhat.com>
1 parent dd79518 commit 997d7fc

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

pkg/estimations/complexity/complexity.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,24 @@ var OSDifficultyScores = map[string]Score{
9191
"Debian GNU/Linux 12": 3,
9292

9393
// --- Windows Server ---
94-
"Microsoft Windows Server 2000": 3,
95-
"Microsoft Windows Server 2003": 3,
96-
"Microsoft Windows Server 2008 R2": 3,
97-
"Microsoft Windows Server 2008": 3,
98-
"Microsoft Windows Server 2012 R2": 3,
99-
"Microsoft Windows Server 2012": 3,
100-
"Microsoft Windows Server 2016": 2,
101-
"Microsoft Windows Server 2019": 2,
102-
"Microsoft Windows Server 2022": 2,
103-
"Microsoft Windows Server 2025": 2,
94+
"Windows Server 2000": 3,
95+
"Windows Server 2003": 3,
96+
"Windows Server 2008 R2": 3,
97+
"Windows Server 2008": 3,
98+
"Windows Server 2012 R2": 3,
99+
"Windows Server 2012": 3,
100+
"Windows Server 2016": 2,
101+
"Windows Server 2019": 2,
102+
"Windows Server 2022": 2,
103+
"Windows Server 2025": 2,
104104

105105
// --- Windows Desktop ---
106-
"Microsoft Windows XP": 3,
107-
"Microsoft Windows Vista": 3,
108-
"Microsoft Windows 7": 3,
109-
"Microsoft Windows 8": 3,
110-
"Microsoft Windows 10": 2,
111-
"Microsoft Windows 11": 2,
106+
"Windows XP": 3,
107+
"Windows Vista": 3,
108+
"Windows 7": 3,
109+
"Windows 8": 3,
110+
"Windows 10": 2,
111+
"Windows 11": 2,
112112

113113
// --- Oracle Solaris ---
114114
"Oracle Solaris 10": 3,

pkg/estimations/complexity/complexity_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,3 +455,16 @@ var _ = Describe("DiskBreakdown", func() {
455455
Expect(result[3].VMCount).To(Equal(1))
456456
})
457457
})
458+
459+
var _ = Describe("Correctly classify on name variations", func() {
460+
DescribeTable("OS Name variations",
461+
func(osName string, expectedScore int) {
462+
Expect(complexity.ClassifyOS(osName)).To(Equal(expectedScore))
463+
},
464+
// Windows
465+
Entry("Windows Server 2022 64-bit", "Microsoft Windows Server 2022 (64-bit)", 2),
466+
Entry("Microsoft Windows Server 2022 x64", "Microsoft Windows Server 2022 x64", 2),
467+
Entry("Windows Server 2022 x64", "Windows Server 2022 x64", 2),
468+
Entry("Windows Server 2022 (64-bit)", "Windows Server 2022 (64-bit)", 2),
469+
)
470+
})

0 commit comments

Comments
 (0)