Skip to content

Commit

Permalink
CHAINSAW-234 Add rhsm.environments to schema (#145)
Browse files Browse the repository at this point in the history
* Add rhsm.environments to schema

* Make environment pattern an exact match

* Update rhsm environments schema

* Make invalids entry yet more invalid

* fix tests

* Add max length
  • Loading branch information
Tomboyo authored Jan 9, 2025
1 parent f3c1c5e commit 79b90a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions schemas/system_profile/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,17 @@ $defs:
example: "8.1, 7.5, 9.9"
type: string
maxLength: 255
environment_ids:
description: Environments ("content templates") the system is subscribed to.
example: ["262e621d10ae4475ab5732b39a9160b2"]
type: array
items:
description: An environment ID.
type: string
example: "262e621d10ae4475ab5732b39a9160b2, 01fd642e02de4e6da2da6172081a971e"
pattern: '^.*$'
maxLength: 256

system_purpose:
description: Object for system purpose information
type: object
Expand Down
1 change: 1 addition & 0 deletions tests/utils/invalids.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
{"network_interfaces": [{"ipv6_addresses": "0123:4567:89ab:cdef:0123:4567:89ab:cdef"}]},
{"network_interfaces": [{"mtu": "15"}]},
{"rhsm": {"version": "x" * 300}},
{"rhsm": {"environment_ids": [5]}}, # must be an array of strings
{"operating_system": {"name": "RHEL"}}, # Incomplete OS definition
{"operating_system": {"name": "RHEL", "major": 9}}, # Incomplete OS definition
{"operating_system": {"major": 8, "minor": 7}}, # Incomplete OS definition
Expand Down
2 changes: 2 additions & 0 deletions tests/utils/valids.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
{"network_interfaces": [{"ipv6_addresses": ["0123:4567:89ab:cdef:0123:4567:89ab:cdef"]}]},
{"network_interfaces": [{"mtu": 15}]},
{"rhsm": {"version": "99Server"}},
{"rhsm": {"environment_ids": ["46b6e690cc6a4906a3c9af4bca6e507d"]}},
{"rhsm": {"environment_ids": ["I'm an opaque token. I can be any string."]}},
{"operating_system": {"name": "RHEL", "major": 8, "minor": 10}},
{"operating_system": {"name": "CentOS", "major": 7, "minor": 0}},
{"operating_system": {"name": "CentOS Linux", "major": 7, "minor": 0}},
Expand Down

0 comments on commit 79b90a0

Please sign in to comment.