Skip to content

Commit

Permalink
Translate cpu.speed hardware requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
skycastlelily committed Oct 17, 2024
1 parent e39d269 commit f7fe5b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions spec/hardware/cpu.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ description: |
# Number or string, an ID of CPU vendor.
vendor: 1234|"> 1234"

# Integer or string, CPU speed.
speed: 2300|">= 2300"

# Integer or string, CPU stepping.
stepping: 10|">= 10"

Expand Down
1 change: 1 addition & 0 deletions tests/unit/provision/mrack/test_hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def test_maximal_constraint(root_logger: Logger) -> None:
},
},
{'or': []},
{'or': []},
{
'not':
{
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def test_normalize_invalid_hardware(
- "= avx2"
- "!= smep"
hyper-threading: true
speed: ">= 2300"
device:
device-name: '~ .*Thunderbolt.*'
device: 79
Expand Down Expand Up @@ -260,6 +261,7 @@ def test_parse_maximal_constraint() -> None:
- cpu.family: < 6
- cpu.vendor: == 32902
- cpu.stepping: '!= 10'
- cpu.speed: '>= 2300'
- cpu.family-name: == Skylake
- cpu.model-name: '!~ Haswell'
- cpu.vendor-name: ~ Intel.*
Expand Down
3 changes: 2 additions & 1 deletion tmt/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ def _parse_cpu(spec: Spec) -> BaseConstraint:
'model',
'family',
'vendor',
'stepping'
'stepping',
'speed'
)
)

Expand Down

0 comments on commit f7fe5b3

Please sign in to comment.