Commit 09076dfe authored by Simon McVittie's avatar Simon McVittie

Remove test data in the "message builder" domain-specific language

These tests were disabled by commit 9c3d566e, which rewrote the D-Bus
type system to be fully recursive, back in 2005. The message builder
was subsequently removed by commit 9d21554d, also in early 2005.

It will probably take significant work to turn these files into
test-cases that use the current D-Bus type system and so can be run
this decade. Until that work is done, let's not ship them: we can
always fetch them from git history if we want them.

The single .message-raw file can still be read and has been retained,
although it hasn't actually tested the intended failure mode since
2005 due to changes to the D-Bus specification (it is a wire-protocol
version 0 message, and the recursive type system introduced in commit
9c3d566e changed the wire-protocol version to 1).
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103758
parent 2b98220e
......@@ -149,7 +149,7 @@ ENDFOREACH(DIR)
### copy tests to builddir so that generated tests and static tests
### are all in one place.
MESSAGE(STATUS "Copying test files to test directory")
FOREACH(FILE_TYPE *.message *.message-raw *.auth-script *.sha1 *.txt *.conf *.service)
FOREACH(FILE_TYPE *.message-raw *.auth-script *.sha1 *.txt *.conf *.service)
FOREACH(DIR ${TESTDIRS})
FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
FOREACH(FILE ${FILES})
......
......@@ -659,13 +659,7 @@ process_test_subdir (const DBusString *test_base_dir,
;
else
{
if (_dbus_string_ends_with_c_str (&filename, ".message"))
{
_dbus_test_diag ("SKIP: Could not load %s, message builder language no longer supported",
_dbus_string_get_const_data (&filename));
}
_dbus_verbose ("Skipping non-.message file %s\n",
_dbus_verbose ("Skipping non-.message-raw file %s\n",
_dbus_string_get_const_data (&filename));
_dbus_string_free (&full_path);
goto next;
......
......@@ -466,7 +466,6 @@ static_data = \
data/equiv-config-files/entities/basic.d/basic.conf \
data/equiv-config-files/entities/entities-1.conf \
data/equiv-config-files/entities/entities-2.conf \
data/incomplete-messages/missing-body.message \
data/invalid-config-files/badselinux-1.conf \
data/invalid-config-files/badselinux-2.conf \
data/invalid-config-files/circular-1.conf \
......@@ -476,21 +475,7 @@ static_data = \
data/invalid-config-files/not-well-formed.conf \
data/invalid-config-files/truncated-file.conf \
data/invalid-config-files/send-and-receive.conf \
data/invalid-messages/array-of-nil.message \
data/invalid-messages/array-with-mixed-types.message \
data/invalid-messages/bad-boolean-array.message \
data/invalid-messages/bad-boolean.message \
data/invalid-messages/bad-endian.message \
data/invalid-messages/bad-header-field-alignment.message \
data/invalid-messages/boolean-has-no-value.message-raw \
data/invalid-messages/local-namespace.message \
data/invalid-messages/no-dot-in-name.message \
data/invalid-messages/not-nul-header-padding.message \
data/invalid-messages/overlong-name.message \
data/invalid-messages/too-little-header-padding.message \
data/invalid-messages/too-much-header-padding-by-far.message \
data/invalid-messages/too-much-header-padding.message \
data/invalid-messages/too-short-dict.message \
data/sha-1/Readme.txt \
data/sha-1/bit-hashes.sha1 \
data/sha-1/bit-messages.sha1 \
......@@ -511,21 +496,6 @@ static_data = \
data/valid-config-files/standard-session-dirs.conf \
data/valid-config-files-system/many-rules.conf \
data/valid-config-files-system/system.d/test.conf \
data/valid-messages/array-of-array-of-uint32.message \
data/valid-messages/dict-simple.message \
data/valid-messages/dict.message \
data/valid-messages/emptiness.message \
data/valid-messages/lots-of-arguments.message \
data/valid-messages/no-padding.message \
data/valid-messages/opposite-endian.message \
data/valid-messages/recursive-types.message \
data/valid-messages/simplest-manual.message \
data/valid-messages/simplest.message \
data/valid-messages/standard-acquire-service.message \
data/valid-messages/standard-hello.message \
data/valid-messages/standard-list-services.message \
data/valid-messages/standard-service-exists.message \
data/valid-messages/unknown-header-field.message \
$(NULL)
EXTRA_DIST += $(static_data)
......
## message that's missing an expected body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
END_LENGTH Header
## create the body, then chop it off
START_LENGTH Body
TYPE INT32
INT32 37
END_LENGTH Body
CHOP 8
# Message with an array of NIL (not allowed)
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
TYPE NIL
UINT32 5
## we want it to fail because of type nil, not because the length is no good
## so pad out the message with 5 bytes
BYTE 1
BYTE 2
BYTE 3
BYTE 4
BYTE 5
END_LENGTH Body
# Message with an array of array where the child arrays are of
# different types
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
TYPE ARRAY
TYPE UINT32
LENGTH Array
START_LENGTH Array
## array of uint32
LENGTH SubArray1
START_LENGTH SubArray1
UINT32 1
UINT32 2
UINT32 3
END_LENGTH SubArray1
## array of uint32
LENGTH SubArray2
START_LENGTH SubArray2
UINT32 4
UINT32 5
END_LENGTH SubArray2
## array of boolean
LENGTH SubArray3
START_LENGTH SubArray3
BOOLEAN false
BOOLEAN true
END_LENGTH SubArray3
END_LENGTH Array
END_LENGTH Body
## a message with an invalid boolean array
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
TYPE BOOLEAN
ALIGN 4
INT32 3
BYTE 0
BYTE 1
BYTE 3
END_LENGTH Body
## a message with an invalid boolean value
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE BOOLEAN
BYTE 3
END_LENGTH Body
## message with invalid endianness tag
BYTE 'i'
BYTE 1
BYTE 0
BYTE 0
LENGTH Header
LENGTH Body
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## last field incorrectly aligned to 4 bytes
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 4
HEADER_FIELD UNKNOWN
TYPE ARRAY
TYPE BYTE
ALIGN 4
LENGTH ThisByteArray
START_LENGTH ThisByteArray
BYTE 1
BYTE 2
END_LENGTH ThisByteArray
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## a message that is in the org.freedesktop.Local. namespace and thus
## invalid
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus.Local'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Disconnected'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## a message with dotless interface
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'NoDotInHere'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## has one non-nul byte in header padding
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
## kill a padding byte and replace it
CHOP 1
BYTE 'q'
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## a message with too-long name field
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.foo.bar.this.is.really.long 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## has one byte missing from header padding
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
## kill a padding byte
CHOP 1
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## has one byte extra header padding
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
BYTE 0
ALIGN 8
BYTE 0
ALIGN 8
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
## has one byte extra header padding
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
BYTE 0
END_LENGTH Header
START_LENGTH Body
END_LENGTH Body
# Message with lots of different argument types
VALID_HEADER method_call
HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE DICT
LENGTH Dict
START_LENGTH Dict
STRING 'uint32'
TYPE UINT32
UINT32 0x8765432
STRING 'uint32'
END_LENGTH Dict
END_LENGTH Body
# Message with an array of array of uint32
VALID_HEADER method_call
REQUIRED_FIELDS
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
TYPE ARRAY
TYPE UINT32
LENGTH Array
START_LENGTH Array
## array of uint32
LENGTH SubArray1
START_LENGTH SubArray1
UINT32 1
UINT32 2
UINT32 3
END_LENGTH SubArray1
## array of uint32
LENGTH SubArray2
START_LENGTH SubArray2
UINT32 4
UINT32 5
END_LENGTH SubArray2
END_LENGTH Array
END_LENGTH Body
# A simple dict
VALID_HEADER method_call
REQUIRED_FIELDS
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE DICT
LENGTH Dict
START_LENGTH Dict
STRING 'int32'
TYPE INT32
INT32 0x12345678
END_LENGTH Dict
END_LENGTH Body
# Dict with different values
VALID_HEADER method_call
REQUIRED_FIELDS
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE DICT
LENGTH Dict
START_LENGTH Dict
STRING 'boolean'
TYPE BOOLEAN
BYTE 1
STRING 'int32'
TYPE INT32
INT32 0x12345678
STRING 'uint32'
TYPE UINT32
UINT32 0x8765432
STRING 'double'
TYPE DOUBLE
DOUBLE 3.141592653589
STRING 'string'
TYPE STRING
STRING 'This is a string'
STRING 'boolean_array'
TYPE ARRAY
TYPE BOOLEAN
BOOLEAN_ARRAY { true, false, false, true, false }
STRING 'int32_array'
TYPE ARRAY
TYPE INT32
INT32_ARRAY { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10 }
STRING 'uint32_array'
TYPE ARRAY
TYPE UINT32
UINT32_ARRAY { 11, 12, 314, 1911, 57692, 1237, 2834 }
STRING 'double_array'
TYPE ARRAY
TYPE DOUBLE
DOUBLE_ARRAY { 0.1, 0.2, 3.1415926, 2.7183, 10.0, 9.99 }
STRING 'string_array'
TYPE ARRAY
TYPE STRING
STRING_ARRAY { 'Hello', 'This', 'Is', 'A', 'String', 'Array!' }
END_LENGTH Dict
END_LENGTH Body
# Empty arrays and strings
VALID_HEADER method_call
REQUIRED_FIELDS
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE STRING
INT32 0
BYTE 0 # Strings need to be NULL-terminated
TYPE ARRAY
TYPE BOOLEAN
INT32 0
TYPE ARRAY
TYPE INT32
INT32 0
TYPE ARRAY
TYPE UINT32
INT32 0
TYPE ARRAY
TYPE DOUBLE
INT32 0
TYPE ARRAY
TYPE BYTE
INT32 0
TYPE ARRAY
TYPE STRING
INT32 0
TYPE DICT
INT32 0
# A dict with empty arrays
TYPE DICT
LENGTH Dict
START_LENGTH Dict
STRING 'boolean_array'
TYPE ARRAY
TYPE BOOLEAN
INT32 0
STRING 'int32_array'
TYPE ARRAY
TYPE INT32
INT32 0
STRING 'uint32_array'
TYPE ARRAY
TYPE UINT32
INT32 0
STRING 'double_array'
TYPE ARRAY
TYPE DOUBLE
INT32 0
STRING 'byte_array'
TYPE ARRAY
TYPE BYTE
INT32 0
STRING 'string_array' }
TYPE ARRAY
TYPE STRING
INT32 0
END_LENGTH Dict
END_LENGTH Body
# Message with lots of different argument types
VALID_HEADER method_call
REQUIRED_FIELDS
ALIGN 8
END_LENGTH Header
START_LENGTH Body
TYPE NIL
TYPE BYTE
BYTE 42
TYPE INT32
INT32 0x12345678
TYPE UINT32
UINT32 0x8765432
TYPE DOUBLE
DOUBLE 3.141592653589
TYPE STRING
STRING 'This is a string'
TYPE ARRAY
TYPE BOOLEAN
BOOLEAN_ARRAY { true, false, false, true, false }
TYPE ARRAY
TYPE INT32
INT32_ARRAY { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10 }
TYPE ARRAY
TYPE UINT32
UINT32_ARRAY { 11, 12, 314, 1911, 57692, 1237, 2834 }
TYPE ARRAY
TYPE DOUBLE
DOUBLE_ARRAY { 0.1, 0.2, 3.1415926, 2.7183, 10.0, 9.99 }
TYPE ARRAY
TYPE STRING
STRING_ARRAY { 'Hello', 'This', 'Is', 'A', 'String', 'Array!' }
TYPE CUSTOM
STRING 'named type'
BYTE_ARRAY { 'b', 'i', 'n', 'a', 'r', 'y', 'd', 'a', 't', 'a' }
TYPE ARRAY
TYPE DICT
LENGTH Array
START_LENGTH Array
LENGTH Dict1
START_LENGTH Dict1
STRING 'key1'
TYPE INT32
INT32 0x12345678
STRING 'key2'
TYPE UINT32
UINT32 0x8765432
END_LENGTH Dict1
LENGTH Dict2
START_LENGTH Dict2
STRING 'key1'
TYPE INT32
INT32 0x12345678
STRING 'key2'
TYPE UINT32
UINT32 0x8765432
END_LENGTH Dict2
END_LENGTH Array
END_LENGTH Body
## Message with no header padding
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
REQUIRED_FIELDS
## this byte array is filled with zeros to the natural length
## of the header
HEADER_FIELD UNKNOWN
TYPE ARRAY
TYPE BYTE
ALIGN 4
LENGTH ThisByteArray
START_LENGTH ThisByteArray
BYTE 1
ALIGN 8 1
END_LENGTH ThisByteArray
END_LENGTH Header