qemu-e2k/tests/qapi-schema
John Snow 4918bb7def qapi/expr.py: Check type of union and alternate 'data' member
Prior to this commit, specifying a non-object value here causes the QAPI
parser to crash in expr.py with a stack trace with (likely) an
AttributeError when we attempt to call that value's items() method.

This member needs to be an object (Dict), and not anything else. Add a
check for this with a nicer error message, and formalize that check with
new test cases that exercise that error.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210421182032.3521476-8-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2021-04-30 12:59:54 +02:00
..
include schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
allow-preconfig-test.err
allow-preconfig-test.json
allow-preconfig-test.out
alternate-any.err
alternate-any.json
alternate-any.out
alternate-array.err
alternate-array.json
alternate-array.out
alternate-base.err
alternate-base.json
alternate-base.out
alternate-branch-if-invalid.err
alternate-branch-if-invalid.json
alternate-branch-if-invalid.out
alternate-clash.err qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
alternate-clash.json qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
alternate-clash.out
alternate-conflict-bool-string.err
alternate-conflict-bool-string.json
alternate-conflict-bool-string.out
alternate-conflict-dict.err
alternate-conflict-dict.json
alternate-conflict-dict.out
alternate-conflict-enum-bool.err
alternate-conflict-enum-bool.json
alternate-conflict-enum-bool.out
alternate-conflict-enum-int.err
alternate-conflict-enum-int.json
alternate-conflict-enum-int.out
alternate-conflict-num-string.err
alternate-conflict-num-string.json
alternate-conflict-num-string.out
alternate-conflict-string.err
alternate-conflict-string.json
alternate-conflict-string.out
alternate-data-invalid.err qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
alternate-data-invalid.json qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
alternate-data-invalid.out qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
alternate-empty.err
alternate-empty.json
alternate-empty.out
alternate-invalid-dict.err
alternate-invalid-dict.json
alternate-invalid-dict.out
alternate-nested.err
alternate-nested.json
alternate-nested.out
alternate-unknown.err
alternate-unknown.json
alternate-unknown.out
args-alternate.err
args-alternate.json
args-alternate.out
args-any.err
args-any.json
args-any.out
args-array-empty.err
args-array-empty.json
args-array-empty.out
args-array-unknown.err
args-array-unknown.json
args-array-unknown.out
args-bad-boxed.err
args-bad-boxed.json
args-bad-boxed.out
args-boxed-anon.err
args-boxed-anon.json
args-boxed-anon.out
args-boxed-string.err
args-boxed-string.json
args-boxed-string.out
args-int.err
args-int.json
args-int.out
args-invalid.err
args-invalid.json
args-invalid.out
args-member-array-bad.err
args-member-array-bad.json
args-member-array-bad.out
args-member-case.err qapi: Prepare for rejecting underscore in command and member names 2021-03-23 22:31:05 +01:00
args-member-case.json
args-member-case.out
args-member-unknown.err
args-member-unknown.json
args-member-unknown.out
args-union.err
args-union.json
args-union.out
args-unknown.err
args-unknown.json
args-unknown.out
bad-base.err
bad-base.json
bad-base.out
bad-data.err
bad-data.json
bad-data.out
bad-ident.err
bad-ident.json
bad-ident.out
bad-if-empty-list.err
bad-if-empty-list.json
bad-if-empty-list.out
bad-if-empty.err
bad-if-empty.json
bad-if-empty.out
bad-if-list.err
bad-if-list.json
bad-if-list.out
bad-if.err
bad-if.json
bad-if.out
bad-type-bool.err
bad-type-bool.json
bad-type-bool.out
bad-type-dict.err
bad-type-dict.json
bad-type-dict.out
bad-type-int.err
bad-type-int.json
bad-type-int.out
base-cycle-direct.err
base-cycle-direct.json
base-cycle-direct.out
base-cycle-indirect.err
base-cycle-indirect.json
base-cycle-indirect.out
command-int.err
command-int.json
command-int.out
comments.err
comments.json
comments.out qapi: use './builtin' as the built-in module name 2021-02-08 14:15:58 +01:00
doc-bad-alternate-member.err
doc-bad-alternate-member.json
doc-bad-alternate-member.out
doc-bad-boxed-command-arg.err
doc-bad-boxed-command-arg.json
doc-bad-boxed-command-arg.out
doc-bad-command-arg.err
doc-bad-command-arg.json
doc-bad-command-arg.out
doc-bad-enum-member.err
doc-bad-enum-member.json
doc-bad-enum-member.out
doc-bad-event-arg.err
doc-bad-event-arg.json
doc-bad-event-arg.out
doc-bad-feature.err
doc-bad-feature.json
doc-bad-feature.out
doc-bad-indent.err scripts/qapi/parser.py: improve doc comment indent handling 2020-09-29 17:55:39 +02:00
doc-bad-indent.json scripts/qapi/parser.py: improve doc comment indent handling 2020-09-29 17:55:39 +02:00
doc-bad-indent.out scripts/qapi/parser.py: improve doc comment indent handling 2020-09-29 17:55:39 +02:00
doc-bad-section.err qapi: Reject section markup in definition documentation 2020-09-07 16:35:16 +02:00
doc-bad-section.json qapi: Reject section markup in definition documentation 2020-09-07 16:35:16 +02:00
doc-bad-section.out qapi: Reject section markup in definition documentation 2020-09-07 16:35:16 +02:00
doc-bad-symbol.err
doc-bad-symbol.json
doc-bad-symbol.out
doc-bad-union-member.err
doc-bad-union-member.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
doc-bad-union-member.out
doc-before-include.err
doc-before-include.json
doc-before-include.out
doc-before-pragma.err
doc-before-pragma.json
doc-before-pragma.out
doc-duplicated-arg.err
doc-duplicated-arg.json
doc-duplicated-arg.out
doc-duplicated-return.err
doc-duplicated-return.json
doc-duplicated-return.out
doc-duplicated-since.err
doc-duplicated-since.json
doc-duplicated-since.out
doc-empty-arg.err
doc-empty-arg.json
doc-empty-arg.out
doc-empty-section.err
doc-empty-section.json
doc-empty-section.out
doc-empty-symbol.err
doc-empty-symbol.json
doc-empty-symbol.out
doc-good.err
doc-good.json qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
doc-good.out qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
doc-good.rst tests/qapi-schema: Add test of the rST QAPI doc-comment output 2020-09-29 17:55:39 +02:00
doc-good.txt qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
doc-interleaved-section.err
doc-interleaved-section.json
doc-interleaved-section.out
doc-invalid-end2.err
doc-invalid-end2.json
doc-invalid-end2.out
doc-invalid-end.err
doc-invalid-end.json
doc-invalid-end.out
doc-invalid-return.err
doc-invalid-return.json qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
doc-invalid-return.out
doc-invalid-section.err
doc-invalid-section.json
doc-invalid-section.out
doc-invalid-start.err
doc-invalid-start.json
doc-invalid-start.out
doc-missing-colon.err
doc-missing-colon.json
doc-missing-colon.out
doc-missing-expr.err
doc-missing-expr.json
doc-missing-expr.out
doc-missing-space.err
doc-missing-space.json
doc-missing-space.out
doc-missing.err
doc-missing.json
doc-missing.out
doc-no-symbol.err
doc-no-symbol.json
doc-no-symbol.out
doc-undoc-feature.err
doc-undoc-feature.json
doc-undoc-feature.out
double-type.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
double-type.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
double-type.out
duplicate-key.err
duplicate-key.json
duplicate-key.out
empty.err
empty.json
empty.out qapi: use './builtin' as the built-in module name 2021-02-08 14:15:58 +01:00
enum-bad-member.err
enum-bad-member.json
enum-bad-member.out
enum-bad-name.err
enum-bad-name.json
enum-bad-name.out
enum-bad-prefix.err
enum-bad-prefix.json
enum-bad-prefix.out
enum-clash-member.err qapi: Enforce enum member naming rules 2021-03-23 22:31:43 +01:00
enum-clash-member.json qapi: Enforce enum member naming rules 2021-03-23 22:31:43 +01:00
enum-clash-member.out
enum-dict-member-unknown.err
enum-dict-member-unknown.json
enum-dict-member-unknown.out
enum-if-invalid.err
enum-if-invalid.json
enum-if-invalid.out
enum-int-member.err
enum-int-member.json
enum-int-member.out
enum-member-case.err qapi: Prepare for rejecting underscore in command and member names 2021-03-23 22:31:05 +01:00
enum-member-case.json qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
enum-member-case.out
enum-missing-data.err
enum-missing-data.json
enum-missing-data.out
enum-wrong-data.err
enum-wrong-data.json
enum-wrong-data.out
escape-outside-string.err
event-boxed-empty.err
event-boxed-empty.json
event-boxed-empty.out
event-case.err qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
event-case.json qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
event-case.out qapi: Enforce event naming rules 2021-03-23 22:31:05 +01:00
event-member-invalid-dict.err tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
event-member-invalid-dict.json tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
event-member-invalid-dict.out
event-nest-struct.err
event-nest-struct.json
event-nest-struct.out
features-bad-type.err
features-bad-type.json
features-bad-type.out
features-deprecated-type.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
features-deprecated-type.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
features-deprecated-type.out qapi: New special feature flag "deprecated" 2020-03-17 21:42:47 +01:00
features-duplicate-name.err
features-duplicate-name.json
features-duplicate-name.out
features-if-invalid.err
features-if-invalid.json
features-if-invalid.out
features-missing-name.err
features-missing-name.json
features-missing-name.out
features-name-bad-type.err
features-name-bad-type.json
features-name-bad-type.out
features-no-list.err
features-no-list.json
features-no-list.out
features-unknown-key.err
features-unknown-key.json
features-unknown-key.out
flat-union-array-branch.err
flat-union-array-branch.json
flat-union-array-branch.out
flat-union-bad-base.err
flat-union-bad-base.json
flat-union-bad-base.out
flat-union-bad-discriminator.err
flat-union-bad-discriminator.json
flat-union-bad-discriminator.out
flat-union-base-any.err
flat-union-base-any.json
flat-union-base-any.out
flat-union-base-union.err
flat-union-base-union.json
flat-union-base-union.out
flat-union-clash-member.err
flat-union-clash-member.json
flat-union-clash-member.out
flat-union-discriminator-bad-name.err
flat-union-discriminator-bad-name.json
flat-union-discriminator-bad-name.out
flat-union-empty.err
flat-union-empty.json
flat-union-empty.out
flat-union-inline-invalid-dict.err
flat-union-inline-invalid-dict.json tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
flat-union-inline-invalid-dict.out
flat-union-int-branch.err
flat-union-int-branch.json
flat-union-int-branch.out
flat-union-invalid-branch-key.err
flat-union-invalid-branch-key.json
flat-union-invalid-branch-key.out
flat-union-invalid-discriminator.err
flat-union-invalid-discriminator.json
flat-union-invalid-discriminator.out
flat-union-invalid-if-discriminator.err
flat-union-invalid-if-discriminator.json
flat-union-invalid-if-discriminator.out
flat-union-no-base.err tests/qapi-schema: Drop TODO comment on simple unions 2021-03-23 21:39:18 +01:00
flat-union-no-base.json tests/qapi-schema: Drop TODO comment on simple unions 2021-03-23 21:39:18 +01:00
flat-union-no-base.out
flat-union-optional-discriminator.err
flat-union-optional-discriminator.json
flat-union-optional-discriminator.out
flat-union-string-discriminator.err
flat-union-string-discriminator.json
flat-union-string-discriminator.out
funny-char.err
funny-char.json
funny-char.out
funny-word.err
funny-word.json
funny-word.out
ident-with-escape.err
ident-with-escape.json
ident-with-escape.out
include-before-err.err
include-before-err.json
include-before-err.out
include-cycle-b.json
include-cycle-c.json
include-cycle.err
include-cycle.json
include-cycle.out
include-extra-junk.err
include-extra-junk.json
include-extra-junk.out
include-nested-err.err
include-nested-err.json
include-nested-err.out
include-no-file.err
include-no-file.json
include-no-file.out
include-non-file.err
include-non-file.json
include-non-file.out
include-repetition-sub.json
include-repetition.err
include-repetition.json
include-repetition.out qapi: use './builtin' as the built-in module name 2021-02-08 14:15:58 +01:00
include-self-cycle.err
include-self-cycle.json
include-self-cycle.out
include-simple-sub.json
include-simple.err
include-simple.json
include-simple.out qapi: use './builtin' as the built-in module name 2021-02-08 14:15:58 +01:00
indented-expr.err
indented-expr.json
indented-expr.out qapi: use './builtin' as the built-in module name 2021-02-08 14:15:58 +01:00
leading-comma-list.err qapi: Fix parse errors for removal of null from schema language 2021-03-05 15:40:50 +01:00
leading-comma-list.json
leading-comma-list.out
leading-comma-object.err
leading-comma-object.json
leading-comma-object.out
meson.build qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
missing-colon.err
missing-colon.json
missing-colon.out
missing-comma-list.err
missing-comma-list.json
missing-comma-list.out
missing-comma-object.err
missing-comma-object.json
missing-comma-object.out
missing-type.err
missing-type.json
missing-type.out
nested-struct-data-invalid-dict.err tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
nested-struct-data-invalid-dict.json tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
nested-struct-data-invalid-dict.out
nested-struct-data.err
nested-struct-data.json tests/qapi-schema: Rework comments on longhand member definitions 2021-03-23 21:38:39 +01:00
nested-struct-data.out
non-objects.err
non-objects.json
non-objects.out
oob-coroutine.err qapi: Add a 'coroutine' flag for commands 2020-10-09 07:08:19 +02:00
oob-coroutine.json qapi: Add a 'coroutine' flag for commands 2020-10-09 07:08:19 +02:00
oob-coroutine.out qapi: Add a 'coroutine' flag for commands 2020-10-09 07:08:19 +02:00
oob-test.err
oob-test.json
oob-test.out
pragma-extra-junk.err
pragma-extra-junk.json
pragma-extra-junk.out
pragma-non-dict.err
pragma-non-dict.json
pragma-non-dict.out
pragma-unknown.err
pragma-unknown.json
pragma-unknown.out
pragma-value-not-bool.err tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-* 2021-03-23 22:31:05 +01:00
pragma-value-not-bool.json tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-* 2021-03-23 22:31:05 +01:00
pragma-value-not-bool.out tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-* 2021-03-23 22:31:05 +01:00
pragma-value-not-list-of-str.err qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
pragma-value-not-list-of-str.json qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
pragma-value-not-list-of-str.out tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-* 2021-03-23 22:31:05 +01:00
pragma-value-not-list.err qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
pragma-value-not-list.json qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
pragma-value-not-list.out tests/qapi-schema: Rename pragma-*-crap to pragma-value-not-* 2021-03-23 22:31:05 +01:00
qapi-schema-test.err
qapi-schema-test.json qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
qapi-schema-test.out qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
quoted-structural-chars.err
quoted-structural-chars.json
quoted-structural-chars.out
redefined-command.err
redefined-command.json
redefined-command.out
redefined-event.err
redefined-event.json
redefined-event.out
redefined-predefined.err tests/qapi-schema: Rename redefined-builtin to redefined-predefined 2021-03-23 22:31:05 +01:00
redefined-predefined.json tests/qapi-schema: Rename redefined-builtin to redefined-predefined 2021-03-23 22:31:05 +01:00
redefined-predefined.out tests/qapi-schema: Rename redefined-builtin to redefined-predefined 2021-03-23 22:31:05 +01:00
redefined-type.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
redefined-type.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
redefined-type.out
reserved-command-q.err
reserved-command-q.json
reserved-command-q.out
reserved-enum-q.err
reserved-enum-q.json
reserved-enum-q.out
reserved-member-has.err
reserved-member-has.json
reserved-member-has.out
reserved-member-q.err
reserved-member-q.json
reserved-member-q.out
reserved-member-u.err qapi: Fix to reject optional members with reserved names 2021-03-23 22:29:37 +01:00
reserved-member-u.json qapi: Fix to reject optional members with reserved names 2021-03-23 22:29:37 +01:00
reserved-member-u.out qapi: Fix to reject optional members with reserved names 2021-03-23 22:29:37 +01:00
reserved-member-underscore.err
reserved-member-underscore.json
reserved-member-underscore.out
reserved-type-kind.err
reserved-type-kind.json
reserved-type-kind.out
reserved-type-list.err
reserved-type-list.json
reserved-type-list.out
returns-alternate.err
returns-alternate.json
returns-alternate.out
returns-array-bad.err
returns-array-bad.json
returns-array-bad.out
returns-bad-type.err tests/qapi-schema: Rename returns-whitelist to returns-bad-type 2021-03-23 22:31:05 +01:00
returns-bad-type.json qapi: Rename pragma *-whitelist to *-exceptions 2021-03-23 22:31:05 +01:00
returns-bad-type.out tests/qapi-schema: Rename returns-whitelist to returns-bad-type 2021-03-23 22:31:05 +01:00
returns-dict.err
returns-dict.json
returns-dict.out
returns-unknown.err
returns-unknown.json
returns-unknown.out
string-code-point-31.err
string-code-point-31.json
string-code-point-31.out
string-code-point-127.err
string-code-point-127.json
string-code-point-127.out
struct-base-clash-deep.err
struct-base-clash-deep.json
struct-base-clash-deep.out
struct-base-clash.err
struct-base-clash.json
struct-base-clash.out
struct-data-invalid.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-data-invalid.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-data-invalid.out
struct-member-if-invalid.err
struct-member-if-invalid.json
struct-member-if-invalid.out
struct-member-invalid-dict.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-member-invalid-dict.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-member-invalid-dict.out
struct-member-invalid.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-member-invalid.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
struct-member-invalid.out
struct-member-name-clash.err qapi: Enforce struct member naming rules 2021-03-23 22:31:43 +01:00
struct-member-name-clash.json qapi: Enforce struct member naming rules 2021-03-23 22:31:43 +01:00
struct-member-name-clash.out tests/qapi-schema: Switch member name clash test to struct 2021-03-23 22:31:31 +01:00
sub-sub-module.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
test-qapi.py qapi: Add a 'coroutine' flag for commands 2020-10-09 07:08:19 +02:00
trailing-comma-list.err qapi: Fix parse errors for removal of null from schema language 2021-03-05 15:40:50 +01:00
trailing-comma-list.json
trailing-comma-list.out
trailing-comma-object.err
trailing-comma-object.json
trailing-comma-object.out
type-bypass-bad-gen.err
type-bypass-bad-gen.json
type-bypass-bad-gen.out
type-case.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
type-case.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
type-case.out qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
unclosed-list.err
unclosed-list.json
unclosed-list.out
unclosed-object.err
unclosed-object.json
unclosed-object.out
unclosed-string.err
unclosed-string.json
unclosed-string.out
union-base-empty.err
union-base-empty.json
union-base-empty.out
union-base-no-discriminator.err
union-base-no-discriminator.json
union-base-no-discriminator.out
union-branch-case.err qapi: Prepare for rejecting underscore in command and member names 2021-03-23 22:31:05 +01:00
union-branch-case.json
union-branch-case.out
union-branch-if-invalid.err
union-branch-if-invalid.json
union-branch-if-invalid.out
union-branch-invalid-dict.err
union-branch-invalid-dict.json
union-branch-invalid-dict.out
union-clash-branches.err qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
union-clash-branches.json qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
union-clash-branches.out
union-empty.err
union-empty.json
union-empty.out
union-invalid-base.err
union-invalid-base.json
union-invalid-base.out
union-invalid-data.err qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
union-invalid-data.json qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
union-invalid-data.out qapi/expr.py: Check type of union and alternate 'data' member 2021-04-30 12:59:54 +02:00
union-optional-branch.err
union-optional-branch.json
union-optional-branch.out
union-unknown.err
union-unknown.json
union-unknown.out
unknown-escape.err
unknown-escape.json
unknown-escape.out
unknown-expr-key.err qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
unknown-expr-key.json qapi: Enforce type naming rules 2021-03-23 22:31:05 +01:00
unknown-expr-key.out