123 lines
2.7 KiB
YAML
123 lines
2.7 KiB
YAML
---
|
|
inputs_fixtures:
|
|
- name: valid
|
|
value:
|
|
name: web01
|
|
enabled: true
|
|
count: "3"
|
|
servers: [10.0.0.1, 10.0.0.2]
|
|
kind: a
|
|
disks:
|
|
- size: 30
|
|
users:
|
|
alice:
|
|
password: pw
|
|
keys: [ssh-ed25519 AAAA alice]
|
|
retired: ~
|
|
expect: []
|
|
|
|
- name: empty-int-is-unset
|
|
value:
|
|
name: web01
|
|
count: ""
|
|
expect: []
|
|
|
|
- name: list-for-dict
|
|
value:
|
|
name: web01
|
|
users:
|
|
- name: alice
|
|
expect: ["fixture.users: expected dict keyed by name, got list"]
|
|
|
|
- name: comma-string-for-list
|
|
value:
|
|
name: web01
|
|
servers: 10.0.0.1,10.0.0.2
|
|
expect: ["fixture.servers: expected list, got str"]
|
|
|
|
- name: yes-string-for-bool
|
|
value:
|
|
name: web01
|
|
enabled: "yes"
|
|
expect: ["fixture.enabled: expected bool, got str"]
|
|
|
|
- name: typo-key
|
|
value:
|
|
name: web01
|
|
userz: {}
|
|
expect: ["fixture.userz: unsupported key, fixture accepts count, disks, enabled, gate, kind, name, secret, servers, users"]
|
|
|
|
- name: wrong-element-type
|
|
value:
|
|
name: web01
|
|
disks:
|
|
- size: 30
|
|
- size: big
|
|
expect: ["fixture.disks[1].size: expected int, got str"]
|
|
|
|
- name: missing-required
|
|
value:
|
|
enabled: false
|
|
expect: ["fixture.name: required key is missing"]
|
|
|
|
- name: choice-mismatch
|
|
value:
|
|
name: web01
|
|
kind: c
|
|
expect: ["fixture.kind: must be one of a, b, got 'c'"]
|
|
|
|
- name: secrets-never-echoed
|
|
value:
|
|
name: web01
|
|
secret: [topsecret-value]
|
|
users:
|
|
alice:
|
|
password: [topsecret-value]
|
|
expect:
|
|
- "fixture.secret: expected str, got list"
|
|
- "fixture.users.alice.password: expected str, got list"
|
|
|
|
- name: keyed-entry-not-a-dict
|
|
value:
|
|
name: web01
|
|
users:
|
|
alice: pw
|
|
expect: ["fixture.users.alice: expected dict, got str"]
|
|
|
|
- name: two-violations-at-once
|
|
value:
|
|
name: web01
|
|
enabled: "true"
|
|
userz: {}
|
|
expect:
|
|
- "fixture.userz: unsupported key, fixture accepts count, disks, enabled, gate, kind, name, secret, servers, users"
|
|
- "fixture.enabled: expected bool, got str"
|
|
|
|
- name: raw-gate-false
|
|
value:
|
|
name: web01
|
|
gate: false
|
|
expect: []
|
|
|
|
- name: raw-gate-dict-checked
|
|
value:
|
|
name: web01
|
|
gate:
|
|
port: http
|
|
portz: 1
|
|
expect:
|
|
- "fixture.gate.portz: unsupported key, fixture.gate accepts port"
|
|
- "fixture.gate.port: expected int, got str"
|
|
|
|
- name: raw-gate-true
|
|
value:
|
|
name: web01
|
|
gate: true
|
|
expect: []
|
|
|
|
- name: raw-gate-string-rejected
|
|
value:
|
|
name: web01
|
|
gate: "yes"
|
|
expect: ["fixture.gate: expected bool or dict, got str"]
|