Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKU and feature update #50

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,374 changes: 4,688 additions & 686 deletions src/main/resources/com/suse/matcher/rules/drools/PartNumbers.drl

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/45/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Scenario 45 - SLE Micro vCores and Hypervisor
=============================================

This scenario defines 3 systems running SLE Micro (id 2605)

The first system (id 100) has 24 cores and is a pure bare metal system.

The second (id 101) is a virtual system without host with 16 cores.

The last system (id 102) is a physical system running as hypervisor
with 2 sockets.


The SLE Micro subscription (id 1) can only be used for pure physical systems
or virtual systems and is counting cores, while the hypervisor requires
a SLES subcription (id 2).

Result
------

The result should be 100 consume all 3 subscription.
Subscription 200 is also fully used for system id 102.

73 changes: 73 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/45/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"timestamp": "2015-05-01T00:00:00.000+0200",
"pinned_matches": [],
"products": [
{
"id": 2605,
"name": "SUSE Linux Enterprise Micro 5.5 x86_64",
"base": true
},
{
"id": 2465,
"name": "SUSE Linux Enterprise Server 15 SP5 x86_6",
"base": true
}
],
"subscriptions": [
{
"end_date": "2030-12-31T00:00:00Z",
"id": 1,
"part_number": "874-007864",
"name": "SLEM X86-64 1-16VC L3ST S 1Y",
"product_ids": [
2605
],
"quantity": 3,
"scc_username": "UC7",
"start_date": "2013-08-01T00:00:00Z"
},
{
"end_date": "2030-12-31T00:00:00Z",
"id": 2,
"part_number": "874-006876",
"name": "SLES X86/X86-64 1-2S ULVM PR S 1Y",
"product_ids": [
2605,
2465
],
"quantity": 1,
"scc_username": "UC7",
"start_date": "2013-08-01T00:00:00Z"
}
],
"virtualization_groups": [],
"systems": [
{
"cpus": 24,
"id": 100,
"physical": true,
"product_ids": [
2605
],
"virtual_system_ids": []
},
{
"cpus": 16,
"id": 101,
"physical": false,
"product_ids": [
2605
],
"virtual_system_ids": []
},
{
"cpus": 2,
"id": 102,
"physical": true,
"product_ids": [
2605
],
"virtual_system_ids": [ 103 ]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Message,Additional data key,Additional data value
guest_with_unknown_host,id,101
62 changes: 62 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/45/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"timestamp": "2015-05-01T00:00:00.000+02",
"matches": [
{
"system_id": 100,
"subscription_id": 1,
"product_id": 2605,
"cents": 200
},
{
"system_id": 101,
"subscription_id": 1,
"product_id": 2605,
"cents": 100
},
{
"system_id": 102,
"subscription_id": 2,
"product_id": 2605,
"cents": 100
}
],
"subscription_policies": {
"1": "one_two",
"2": "unlimited_virtualization"
},
"messages": [
{
"type": "guest_with_unknown_host",
"data": {
"id": "101"
}
}
],
"subscriptions": [
{
"id": 1,
"part_number": "874-007864",
"name": "SLEM X86-64 1-16VC L3ST S 1Y",
"quantity": 3,
"start_date": "2013-08-01T02:00:00.000+02",
"end_date": "2030-12-31T01:00:00.000+01",
"scc_username": "UC7",
"product_ids": [
2605
]
},
{
"id": 2,
"part_number": "874-006876",
"name": "SLES X86/X86-64 1-2S ULVM PR S 1Y",
"quantity": 1,
"start_date": "2013-08-01T02:00:00.000+02",
"end_date": "2030-12-31T01:00:00.000+01",
"scc_username": "UC7",
"product_ids": [
2465,
2605
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Part Number,Description,Policy,Total Quantity,Matched Quantity,Start Date,End Date
874-006876,SLES X86/X86-64 1-2S ULVM PR S 1Y,Unlimited Virtual Machines,1,1,2013-08-01,2030-12-31
874-007864,SLEM X86-64 1-16VC L3ST S 1Y,1-2 Sockets or 1-2 Virtual Machines,3,3,2013-08-01,2030-12-31
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unmatched Product Name,System Name,System ID,CPUs
22 changes: 22 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/46/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Scenario 46 - SLE Micro subscription does not match hypervisor
==============================================================

This scenario defines 3 systems running SLE Micro (id 2605)

The first system (id 100) has 24 cores and is a pure bare metal system.

The second (id 101) is a virtual system without host with 16 cores.

The last system (id 102) is a physical system running as hypervisor
with 2 sockets.


The SLE Micro subscription (id 1) can only be used for pure physical systems
or virtual systems and is counting cores, while the hypervisor requires
a SLES subcription which we do not have.

Result
------

The result should be 100 consume 3 of 10 subscriptions.
System id 102 is unmatched as we miss a SLES subscription.
60 changes: 60 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/46/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"timestamp": "2015-05-01T00:00:00.000+0200",
"pinned_matches": [],
"products": [
{
"id": 2605,
"name": "SUSE Linux Enterprise Micro 5.5 x86_64",
"base": true
},
{
"id": 2465,
"name": "SUSE Linux Enterprise Server 15 SP5 x86_6",
"base": true
}
],
"subscriptions": [
{
"end_date": "2030-12-31T00:00:00Z",
"id": 1,
"part_number": "874-007864",
"name": "SLEM X86-64 1-16VC L3ST S 1Y",
"product_ids": [
2605
],
"quantity": 10,
"scc_username": "UC7",
"start_date": "2013-08-01T00:00:00Z"
}
],
"virtualization_groups": [],
"systems": [
{
"cpus": 24,
"id": 100,
"physical": true,
"product_ids": [
2605
],
"virtual_system_ids": []
},
{
"cpus": 16,
"id": 101,
"physical": false,
"product_ids": [
2605
],
"virtual_system_ids": []
},
{
"cpus": 2,
"id": 102,
"physical": true,
"product_ids": [
2605
],
"virtual_system_ids": [ 103 ]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Message,Additional data key,Additional data value
guest_with_unknown_host,id,101
42 changes: 42 additions & 0 deletions src/test/resources/com/suse/matcher/scenarios/46/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"timestamp": "2015-05-01T00:00:00.000+02",
"matches": [
{
"system_id": 100,
"subscription_id": 1,
"product_id": 2605,
"cents": 200
},
{
"system_id": 101,
"subscription_id": 1,
"product_id": 2605,
"cents": 100
}
],
"subscription_policies": {
"1": "one_two"
},
"messages": [
{
"type": "guest_with_unknown_host",
"data": {
"id": "101"
}
}
],
"subscriptions": [
{
"id": 1,
"part_number": "874-007864",
"name": "SLEM X86-64 1-16VC L3ST S 1Y",
"quantity": 10,
"start_date": "2013-08-01T02:00:00.000+02",
"end_date": "2030-12-31T01:00:00.000+01",
"scc_username": "UC7",
"product_ids": [
2605
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Part Number,Description,Policy,Total Quantity,Matched Quantity,Start Date,End Date
874-007864,SLEM X86-64 1-16VC L3ST S 1Y,1-2 Sockets or 1-2 Virtual Machines,10,3,2013-08-01,2030-12-31
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Unmatched Product Name,System Name,System ID,CPUs
SUSE Linux Enterprise Micro 5.5 x86_64,,102,2
Loading