blob: 2c4cd6a4368cde6ef4d0ef8fe9ef1df65597e7e8 [file] [log] [blame]
Pau Espin Pedrol30637302020-05-06 21:11:02 +02001==== Testing dynamically generated schemas ====
2schema_case_01.conf:
3{'foobar.prefix.handover.duration': 'duration',
4 'foobar.prefix.handover.threshold': 'uint'}
5validating tests[0]
6Validation: OK
7validating tests[1]
8--- foobar.prefix.handover.duration: ERR: ValueError: Invalid duration value: '22kkk'
9Validation: Error
10validating tests[2]
11Validation: OK
12validating tests[3]
13--- -: ERR: ValueError: config item not known: 'foobar.wrongprefix.handover.duration'
14Validation: Error
15validating tests[4]
16--- -: ERR: ValueError: config item not known: 'foobar.wrongprefix.handover'
17Validation: Error
18validating tests[5]
19Validation: OK
20validating tests[6]
21--- foobar.prefix.handover.threshold: ERR: ValueError: Positive value expected instead of -2
22Validation: Error
23validating tests[7]
24--- -: ERR: ValueError: config item not known: 'foobar.prefix.handover[].threshold'
25Validation: Error
26validating tests[8]
27--- -: ERR: ValueError: config item is a list, should be 'uint': 'foobar.prefix.handover.threshold'
28Validation: Error
29----------------------
30schema_case_02.conf:
31{'foobar.prefix.hey.ho.letsgo[]': 'wrongtype'}
32validating tests[0]
33--- -: ERR: ValueError: unknown type 'wrongtype' at 'foobar.prefix.hey.ho.letsgo[]'
34Validation: Error
35----------------------
36schema_case_03.conf:
37--- -: ERR: AssertionError:
38config2schema: Error
39----------------------
40schema_case_04.conf:
41--- -: ERR: AssertionError:
42config2schema: Error
43----------------------
44schema_case_05.conf:
45{'foobar.prefix.hey.ho.letsgo[]': 'str'}
46validating tests[0]
47Validation: OK
48validating tests[1]
49Validation: OK
50validating tests[2]
51Validation: OK
52validating tests[3]
53--- -: ERR: ValueError: config item not known: 'foobar.prefix.hey.ho.letsgo'
54Validation: Error
55validating tests[4]
56Validation: OK
57validating tests[5]
58--- -: ERR: ValueError: config item is dict but should be a leaf node of type 'str': 'foobar.prefix.hey.ho.letsgo[]'
59Validation: Error
60validating tests[6]
61--- -: ERR: ValueError: config item is a list, should be 'str': 'foobar.prefix.hey.ho.letsgo[]'
62Validation: Error
63----------------------