| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 1 | # Apache Thrift - integration test suite |
| 2 | |
| 3 | This is the cross everything integration test suite for Apache Thrift. |
| 4 | executed by |
| 5 | |
| 6 | make cross |
| 7 | |
| 8 | at the moment, this starts the test.sh script which does the real cross test |
| 9 | with different transports, protocols and languages. |
| 10 | |
| 11 | Unit tests for languages ar usually located under lib/<lang>/test/ |
| Konrad Grochowski | 3b5dacb | 2014-11-24 10:55:31 +0100 | [diff] [blame^] | 12 | cross language tests according to [ThriftTest.thrift](ThriftTest.thrift) shall be |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 13 | provided for every language including executables with the following command |
| 14 | line interface for servers: |
| 15 | |
| 16 | $ ./cpp/TestServer -h |
| 17 | Allowed options: |
| 18 | -h [ --help ] produce help message |
| 19 | --port arg (=9090) Port number to listen |
| 20 | --domain-socket arg Unix Domain Socket (e.g. /tmp/ThriftTest.thrift) |
| Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 21 | --named-pipe arg Windows Named Pipe (e.g. MyThriftPipe) |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 22 | --server-type arg (=simple) type of server, "simple", "thread-pool", |
| 23 | "threaded", or "nonblocking" |
| Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 24 | --transport arg (=buffered) transport: buffered, framed, http, anonpipe |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 25 | --protocol arg (=binary) protocol: binary, compact, json |
| 26 | --ssl Encrypted Transport using SSL |
| 27 | --processor-events processor-events |
| 28 | -n [ --workers ] arg (=4) Number of thread pools workers. Only valid for |
| 29 | thread-pool server type |
| 30 | |
| 31 | and this for clients: |
| 32 | |
| 33 | $ ./cpp/TestClient -h |
| 34 | Allowed options: |
| 35 | -h [ --help ] produce help message |
| 36 | --host arg (=localhost) Host to connect |
| 37 | --port arg (=9090) Port number to connect |
| 38 | --domain-socket arg Domain Socket (e.g. /tmp/ThriftTest.thrift), |
| 39 | instead of host and port |
| Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 40 | --named-pipe arg Windows Named Pipe (e.g. MyThriftPipe) |
| 41 | --anon-pipes hRead hWrite Windows Anonymous Pipes pair (handles) |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 42 | --transport arg (=buffered) Transport: buffered, framed, http, evhttp |
| 43 | --protocol arg (=binary) Protocol: binary, compact, json |
| 44 | --ssl Encrypted Transport using SSL |
| 45 | -n [ --testloops ] arg (=1) Number of Tests |
| Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 46 | -t [ --threads ] arg (=1) Number of Test threads |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 47 | |
| 48 | If you have executed the **make check** or **make cross** then you will be able to browse |
| 49 | [gen-html/ThriftTest.html](gen-html/ThriftTest.html) with the test documentation. |
| 50 | |
| Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 51 | The return code (exit code) shall be 0 on success, or an integer in the range 1 - 255 on errors. |
| 52 | In order to signal failed tests, the return code shall be composed from these bits to indicate |
| 53 | failing tests: |
| 54 | |
| 55 | #define TEST_BASETYPES 1 // 0000 0001 |
| 56 | #define TEST_STRUCTS 2 // 0000 0010 |
| 57 | #define TEST_CONTAINERS 4 // 0000 0100 |
| 58 | #define TEST_EXCEPTIONS 8 // 0000 1000 |
| 59 | #define TEST_NOTUSED 240 // 1111 0000 (reserved bits) |
| 60 | |
| 61 | Tests that have not been executed at all count as errors. |
| 62 | |
| 63 | ### Example: |
| 64 | |
| 65 | During tests, the test client notices that some of the Struct tests fail. |
| 66 | Furthermore, due to some other problem none of the Exception tests is executed. |
| 67 | Therefore, the test client returns the code `10 = 2 | 8`, indicating the failure |
| 68 | of both test 2 (TEST_STRUCTS) and test 8 (TEST_EXCEPTIONS). |
| 69 | |
| Roger Meier | 4edac7f | 2014-05-02 21:07:01 +0200 | [diff] [blame] | 70 | |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 71 | ## SSL |
| 72 | Test Keys and Certificates are provided in multiple formats under the following |
| Roger Meier | 72e9c37 | 2014-05-03 00:33:46 +0200 | [diff] [blame] | 73 | directory [test/keys](keys) |
| Roger Meier | f85fdd7 | 2014-03-01 17:00:46 +0100 | [diff] [blame] | 74 | |