Skip to content

Commit

Permalink
Add missing test case for parsing device HW requirement (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
happz authored Jun 26, 2024
1 parent cd0b6e3 commit 9717fc4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/provision/mrack/test_hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ def test_maximal_constraint(root_logger: Logger) -> None:
{'or': []}
]
},
{
'and': [
{'or': []},
{'or': []},
{'or': []},
{'or': []},
{'or': []}
]
},
{
'system': {
'memory': {
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ def test_normalize_invalid_hardware(
- avx
- "= avx2"
- "!= smep"
device:
device-name: '~ .*Thunderbolt.*'
device: 79
vendor-name: '!= Intel'
vendor: "> 97"
driver: mc
disk:
- size: 40 GiB
model-name: "~ WD 100G.*"
Expand Down Expand Up @@ -235,6 +241,12 @@ def test_parse_maximal_constraint() -> None:
- cpu.flag: contains avx
- cpu.flag: contains avx2
- cpu.flag: not contains smep
- and:
- device.vendor: '> 97'
- device.device: == 79
- device.vendor-name: '!= Intel'
- device.device-name: ~ .*Thunderbolt.*
- device.driver: == mc
- and:
- gpu.vendor: == 4318
- gpu.device: == 97
Expand Down

0 comments on commit 9717fc4

Please sign in to comment.