aws-crt 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/VERSION +1 -1
  4. data/aws-crt-ffi/CMakeLists.txt +49 -41
  5. data/aws-crt-ffi/crt/aws-c-auth/CMakeLists.txt +0 -10
  6. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +3 -2
  7. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +4 -4
  8. data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +1 -14
  9. data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +206 -68
  10. data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +5 -0
  11. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_cached.c +6 -6
  12. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_default_chain.c +16 -1
  13. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_ecs.c +0 -1
  14. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_process.c +0 -1
  15. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_sts_web_identity.c +0 -1
  16. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_x509.c +10 -7
  17. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +35 -26
  18. data/aws-crt-ffi/crt/aws-c-auth/source/signable_chunk.c +3 -2
  19. data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -2
  20. data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +1 -0
  21. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_ecs_tests.c +3 -0
  22. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_process_tests.c +65 -16
  23. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_tests.c +125 -0
  24. data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +68 -46
  25. data/aws-crt-ffi/crt/aws-c-cal/CMakeLists.txt +8 -3
  26. data/aws-crt-ffi/crt/aws-c-cal/bin/run_x_platform_fuzz_corpus/main.c +9 -0
  27. data/aws-crt-ffi/crt/aws-c-cal/builder.json +11 -3
  28. data/aws-crt-ffi/crt/aws-c-cal/cmake/aws-c-cal-config.cmake +14 -5
  29. data/aws-crt-ffi/crt/aws-c-cal/source/darwin/securityframework_ecc.c +6 -6
  30. data/aws-crt-ffi/crt/aws-c-cal/source/windows/bcrypt_ecc.c +12 -12
  31. data/aws-crt-ffi/crt/aws-c-cal/tests/test_case_helper.h +14 -14
  32. data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +21 -1
  33. data/aws-crt-ffi/crt/aws-c-common/README.md +8 -0
  34. data/aws-crt-ffi/crt/aws-c-common/cmake/AwsCFlags.cmake +20 -5
  35. data/aws-crt-ffi/crt/aws-c-common/cmake/AwsFeatureTests.cmake +7 -1
  36. data/aws-crt-ffi/crt/aws-c-common/format-check.sh +1 -1
  37. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +14 -0
  38. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/config.h.in +1 -0
  39. data/aws-crt-ffi/crt/{aws-c-auth/include/aws/auth → aws-c-common/include/aws/common}/external/cJSON.h +82 -74
  40. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/json.h +335 -0
  41. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/logging.h +1 -0
  42. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/math.inl +2 -2
  43. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/json_impl.h +22 -0
  44. data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +2 -0
  45. data/aws-crt-ffi/crt/aws-c-common/source/byte_buf.c +36 -0
  46. data/aws-crt-ffi/crt/aws-c-common/source/common.c +5 -2
  47. data/aws-crt-ffi/crt/aws-c-common/source/external/cJSON.c +3113 -0
  48. data/aws-crt-ffi/crt/aws-c-common/source/file.c +9 -0
  49. data/aws-crt-ffi/crt/aws-c-common/source/json.c +348 -0
  50. data/aws-crt-ffi/crt/aws-c-common/source/logging.c +7 -2
  51. data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +8 -0
  52. data/aws-crt-ffi/crt/aws-c-common/source/ref_count.c +3 -1
  53. data/aws-crt-ffi/crt/aws-c-common/source/windows/file.c +47 -0
  54. data/aws-crt-ffi/crt/aws-c-common/source/windows/system_info.c +2 -1
  55. data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +5 -0
  56. data/aws-crt-ffi/crt/aws-c-common/tests/byte_buf_test.c +69 -0
  57. data/aws-crt-ffi/crt/aws-c-common/tests/json_test.c +134 -0
  58. data/aws-crt-ffi/crt/aws-c-common/tests/memtrace_test.c +6 -2
  59. data/aws-crt-ffi/crt/aws-c-event-stream/README.md +18 -35
  60. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream.h +21 -2
  61. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_client.h +14 -2
  62. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_server.h +13 -0
  63. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/private/event_stream_rpc_priv.h +7 -7
  64. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream.c +257 -141
  65. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_channel_handler.c +1 -1
  66. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_client.c +31 -8
  67. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_server.c +63 -10
  68. data/aws-crt-ffi/crt/aws-c-event-stream/tests/CMakeLists.txt +2 -0
  69. data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_client_connection_test.c +157 -106
  70. data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_server_connection_test.c +168 -1
  71. data/aws-crt-ffi/crt/aws-c-event-stream/tests/message_deserializer_test.c +4 -2
  72. data/aws-crt-ffi/crt/aws-c-http/CMakeLists.txt +1 -0
  73. data/aws-crt-ffi/crt/aws-c-http/README.md +8 -0
  74. data/aws-crt-ffi/crt/aws-c-http/bin/elasticurl/main.c +1 -1
  75. data/aws-crt-ffi/crt/aws-c-http/builder.json +4 -3
  76. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +8 -1
  77. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection_manager.h +45 -1
  78. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http2_stream_manager.h +63 -12
  79. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +2 -1
  80. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_connection.h +20 -2
  81. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_frames.h +1 -0
  82. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_stream.h +42 -13
  83. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http2_stream_manager_impl.h +17 -0
  84. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http_impl.h +3 -0
  85. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/random_access_set.h +10 -3
  86. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +3 -17
  87. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +108 -4
  88. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/statistics.h +22 -0
  89. data/aws-crt-ffi/crt/aws-c-http/source/connection.c +8 -3
  90. data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -3
  91. data/aws-crt-ffi/crt/aws-c-http/source/connection_monitor.c +32 -14
  92. data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +14 -0
  93. data/aws-crt-ffi/crt/aws-c-http/source/h1_encoder.c +7 -4
  94. data/aws-crt-ffi/crt/aws-c-http/source/h2_connection.c +161 -45
  95. data/aws-crt-ffi/crt/aws-c-http/source/h2_decoder.c +37 -8
  96. data/aws-crt-ffi/crt/aws-c-http/source/h2_frames.c +13 -1
  97. data/aws-crt-ffi/crt/aws-c-http/source/h2_stream.c +345 -87
  98. data/aws-crt-ffi/crt/aws-c-http/source/hpack.c +3 -0
  99. data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
  100. data/aws-crt-ffi/crt/aws-c-http/source/http2_stream_manager.c +266 -39
  101. data/aws-crt-ffi/crt/aws-c-http/source/random_access_set.c +9 -3
  102. data/aws-crt-ffi/crt/aws-c-http/source/request_response.c +80 -20
  103. data/aws-crt-ffi/crt/aws-c-http/source/statistics.c +11 -0
  104. data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +28 -1
  105. data/aws-crt-ffi/crt/aws-c-http/tests/fuzz/fuzz_h2_decoder_correct.c +5 -3
  106. data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.c +133 -29
  107. data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.h +6 -0
  108. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/README.md +40 -0
  109. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/non_tls_server.py +56 -0
  110. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/server.py +329 -0
  111. data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +1 -1
  112. data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_monitor.c +2 -2
  113. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +47 -34
  114. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_encoder.c +4 -4
  115. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_server.c +15 -12
  116. data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_client.c +582 -25
  117. data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_encoder.c +3 -3
  118. data/aws-crt-ffi/crt/aws-c-http/tests/test_localhost_integ.c +530 -0
  119. data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +459 -67
  120. data/aws-crt-ffi/crt/aws-c-io/CMakeLists.txt +4 -0
  121. data/aws-crt-ffi/crt/aws-c-io/builder.json +3 -2
  122. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/channel.h +21 -0
  123. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/io.h +3 -0
  124. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/socket.h +6 -0
  125. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/stream.h +35 -5
  126. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/tls_channel_handler.h +211 -15
  127. data/aws-crt-ffi/crt/aws-c-io/source/channel.c +56 -30
  128. data/aws-crt-ffi/crt/aws-c-io/source/darwin/secure_transport_tls_channel_handler.c +0 -24
  129. data/aws-crt-ffi/crt/aws-c-io/source/io.c +9 -0
  130. data/aws-crt-ffi/crt/aws-c-io/source/{pkcs11.c → pkcs11_lib.c} +162 -22
  131. data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_private.h +18 -20
  132. data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +221 -0
  133. data/aws-crt-ffi/crt/aws-c-io/source/posix/socket.c +135 -81
  134. data/aws-crt-ffi/crt/aws-c-io/source/retry_strategy.c +12 -8
  135. data/aws-crt-ffi/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c +252 -215
  136. data/aws-crt-ffi/crt/aws-c-io/source/stream.c +65 -82
  137. data/aws-crt-ffi/crt/aws-c-io/source/tls_channel_handler.c +188 -57
  138. data/aws-crt-ffi/crt/aws-c-io/source/windows/iocp/socket.c +271 -256
  139. data/aws-crt-ffi/crt/aws-c-io/tests/CMakeLists.txt +21 -12
  140. data/aws-crt-ffi/crt/aws-c-io/tests/channel_test.c +32 -4
  141. data/aws-crt-ffi/crt/aws-c-io/tests/io_lib_test.c +37 -0
  142. data/aws-crt-ffi/crt/aws-c-io/tests/pkcs11_test.c +412 -93
  143. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.crt +15 -0
  144. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.key +5 -0
  145. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p12 +0 -0
  146. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p8 +5 -0
  147. data/aws-crt-ffi/crt/aws-c-io/tests/resources/generateCerts.sh +24 -15
  148. data/aws-crt-ffi/crt/aws-c-io/tests/socket_test.c +72 -1
  149. data/aws-crt-ffi/crt/s2n/CMakeLists.txt +6 -1
  150. data/aws-crt-ffi/crt/s2n/bindings/rust/Cargo.toml +1 -0
  151. data/aws-crt-ffi/crt/s2n/bindings/rust/generate/src/main.rs +105 -82
  152. data/aws-crt-ffi/crt/s2n/bindings/rust/generate.sh +1 -0
  153. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
  154. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/raw/config.rs +1 -1
  155. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/Cargo.toml +1 -1
  156. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/build.rs +84 -30
  157. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/src/lib.rs +4 -0
  158. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +21 -0
  159. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/cert.pem +14 -0
  160. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/key.pem +8 -0
  161. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/client.rs +45 -0
  162. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/server.rs +60 -0
  163. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/src/lib.rs +150 -0
  164. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/tests/handshake.rs +51 -0
  165. data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.c +98 -77
  166. data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.h +10 -7
  167. data/aws-crt-ffi/crt/s2n/crypto/s2n_openssl.h +2 -0
  168. data/aws-crt-ffi/crt/s2n/error/s2n_errno.c +1 -1
  169. data/aws-crt-ffi/crt/s2n/error/s2n_errno.h +1 -0
  170. data/aws-crt-ffi/crt/s2n/s2n.mk +7 -0
  171. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/repository.py +233 -0
  172. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup-proof.py +8 -7
  173. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup.py +17 -18
  174. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/util.py +41 -23
  175. data/aws-crt-ffi/crt/s2n/tests/fuzz/LD_PRELOAD/global_overrides.c +3 -3
  176. data/aws-crt-ffi/crt/s2n/tests/integration/s2n_client_endpoint_handshake_test.py +2 -2
  177. data/aws-crt-ffi/crt/s2n/tests/integrationv2/Makefile +13 -42
  178. data/aws-crt-ffi/crt/s2n/tests/integrationv2/README.md +6 -1
  179. data/aws-crt-ffi/crt/s2n/tests/integrationv2/common.py +118 -53
  180. data/aws-crt-ffi/crt/s2n/tests/integrationv2/configuration.py +108 -88
  181. data/aws-crt-ffi/crt/s2n/tests/integrationv2/conftest.py +6 -3
  182. data/aws-crt-ffi/crt/s2n/tests/integrationv2/constants.py +6 -4
  183. data/aws-crt-ffi/crt/s2n/tests/integrationv2/fixtures.py +21 -12
  184. data/aws-crt-ffi/crt/s2n/tests/integrationv2/global_flags.py +1 -0
  185. data/aws-crt-ffi/crt/s2n/tests/integrationv2/processes.py +62 -19
  186. data/aws-crt-ffi/crt/s2n/tests/integrationv2/providers.py +304 -48
  187. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_client_authentication.py +20 -11
  188. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_cross_compatibility.py +41 -17
  189. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_dynamic_record_sizes.py +6 -3
  190. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_early_data.py +105 -48
  191. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_external_psk.py +160 -76
  192. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_fragmentation.py +59 -26
  193. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_happy_path.py +42 -28
  194. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_hello_retry_requests.py +33 -13
  195. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_key_update.py +29 -11
  196. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_ocsp.py +138 -0
  197. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_pq_handshake.py +103 -36
  198. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_session_resumption.py +52 -25
  199. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_signature_algorithms.py +47 -21
  200. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sni_match.py +13 -9
  201. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sslyze.py +88 -17
  202. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +71 -22
  203. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_well_known_endpoints.py +4 -3
  204. data/aws-crt-ffi/crt/s2n/tests/integrationv2/tox.ini +1 -0
  205. data/aws-crt-ffi/crt/s2n/tests/integrationv2/utils.py +50 -15
  206. data/aws-crt-ffi/crt/s2n/tests/litani/CHANGELOG +131 -0
  207. data/aws-crt-ffi/crt/s2n/tests/litani/CONTRIBUTING.md +16 -0
  208. data/aws-crt-ffi/crt/s2n/tests/litani/README.md +36 -14
  209. data/aws-crt-ffi/crt/s2n/tests/litani/THIRD-PARTY +205 -41
  210. data/aws-crt-ffi/crt/s2n/tests/litani/doc/bin/build-html-doc +7 -7
  211. data/aws-crt-ffi/crt/s2n/tests/litani/doc/configure +27 -23
  212. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-add-job.scdoc +7 -0
  213. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-dump-run.scdoc +7 -5
  214. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-transform-jobs.scdoc +248 -0
  215. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani.scdoc +2 -2
  216. data/aws-crt-ffi/crt/s2n/tests/litani/doc/templates/index.jinja.html +4 -0
  217. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/README +12 -0
  218. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/original-run.sh +52 -0
  219. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/run-all.py +71 -0
  220. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/README +13 -0
  221. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-1.sh +34 -0
  222. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-2.sh +35 -0
  223. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-3.sh +34 -0
  224. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-all.py +60 -0
  225. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/README.md +10 -0
  226. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/assumptions.html +42 -0
  227. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/file.dat +7 -0
  228. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/histogram.dat +7 -0
  229. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-1.sh +41 -0
  230. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-2.sh +47 -0
  231. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-3.sh +41 -0
  232. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-all.py +34 -0
  233. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib-table.py +40 -0
  234. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.plt +5 -0
  235. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.py +32 -0
  236. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin-output.py +40 -0
  237. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.plt +5 -0
  238. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.py +30 -0
  239. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/fib-table.jinja.html +45 -0
  240. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/sin-output.jinja.html +30 -0
  241. data/aws-crt-ffi/crt/s2n/tests/litani/lib/add_job.py +55 -0
  242. data/aws-crt-ffi/crt/s2n/tests/litani/lib/graph.py +2 -2
  243. data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani.py +6 -1
  244. data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani_report.py +18 -21
  245. data/aws-crt-ffi/crt/s2n/tests/litani/lib/ninja.py +2 -0
  246. data/aws-crt-ffi/crt/s2n/tests/litani/lib/run_printer.py +26 -7
  247. data/aws-crt-ffi/crt/s2n/tests/litani/lib/transform_jobs.py +84 -0
  248. data/aws-crt-ffi/crt/s2n/tests/litani/litani +28 -33
  249. data/aws-crt-ffi/crt/s2n/tests/litani/script/release +220 -0
  250. data/aws-crt-ffi/crt/s2n/tests/litani/templates/dashboard.jinja.html +78 -15
  251. data/aws-crt-ffi/crt/s2n/tests/litani/templates/pipeline.jinja.html +21 -5
  252. data/aws-crt-ffi/crt/s2n/tests/litani/test/README +15 -0
  253. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/run +56 -33
  254. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/custom_stages.py +1 -0
  255. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/cwd.py +1 -0
  256. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/dump_run.py +1 -0
  257. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/graph_line_break.py +1 -0
  258. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/html_node.py +1 -0
  259. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/job_id_env.py +1 -0
  260. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/multiproc_dump_run.py +1 -0
  261. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize.py +1 -0
  262. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize_graph.py +1 -0
  263. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out.py +1 -0
  264. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ignored.py +1 -0
  265. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ok.py +1 -0
  266. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pipeline_order.py +53 -0
  267. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize.py +1 -0
  268. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize_graph.py +1 -0
  269. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/single_pool.py +1 -0
  270. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out.py +1 -0
  271. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess.py +1 -0
  272. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_multi_shell.py +1 -0
  273. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_shell.py +1 -0
  274. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ignored.py +1 -0
  275. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ok.py +1 -0
  276. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_delete_job.py +54 -0
  277. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_modify_job.py +46 -0
  278. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_no_change_job.py +44 -0
  279. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/zero_pool.py +1 -0
  280. data/aws-crt-ffi/crt/s2n/tests/litani/test/run +82 -12
  281. data/aws-crt-ffi/crt/s2n/tests/s2n_test.h +58 -33
  282. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_key_schedule_testlib.c +18 -6
  283. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_pq_kat_test_utils.c +4 -4
  284. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_testlib.h +2 -0
  285. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_retry_test.c +66 -2
  286. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +1 -1
  287. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_drbg_test.c +34 -14
  288. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_fork_generation_number_test.c +28 -5
  289. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_mem_usage_test.c +6 -0
  290. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_override_openssl_random_test.c +1 -1
  291. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_random_test.c +60 -41
  292. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_broken_pipe_test.c +2 -2
  293. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_handshake_early_data_test.c +3 -1
  294. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_hybrid_shared_secret_test.c +9 -1
  295. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_rfc8448_test.c +31 -130
  296. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_test.c +2 -4
  297. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_pq_handshake_test.c +11 -6
  298. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_rfc8448_test.c +19 -21
  299. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_test.c +109 -60
  300. data/aws-crt-ffi/crt/s2n/tls/s2n_config.c +1 -0
  301. data/aws-crt-ffi/crt/s2n/tls/s2n_config.h +1 -1
  302. data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +29 -24
  303. data/aws-crt-ffi/crt/s2n/tls/s2n_connection.h +5 -5
  304. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_hashes.h +1 -7
  305. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_io.c +2 -0
  306. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_transcript.c +0 -44
  307. data/aws-crt-ffi/crt/s2n/tls/s2n_internal.h +0 -1
  308. data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +1 -1
  309. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_key_schedule.c +1 -2
  310. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.c +84 -44
  311. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.h +3 -9
  312. data/aws-crt-ffi/crt/s2n/utils/s2n_blob.h +15 -8
  313. data/aws-crt-ffi/crt/s2n/utils/s2n_fork_detection.c +2 -6
  314. data/aws-crt-ffi/crt/s2n/utils/s2n_random.c +9 -9
  315. data/aws-crt-ffi/src/input_stream.c +32 -15
  316. data/ext/compile.rb +13 -5
  317. data/lib/aws-crt/platforms.rb +14 -5
  318. data/lib/aws-crt/string_blob.rb +3 -3
  319. metadata +61 -7
  320. data/aws-crt-ffi/crt/aws-c-auth/source/external/cJSON.c +0 -2987
  321. data/aws-crt-ffi/crt/aws-c-auth/tests/external/cJSON.c +0 -2986
  322. data/aws-crt-ffi/crt/aws-c-io/tests/error_test.c +0 -20
@@ -0,0 +1,84 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License").
4
+ # You may not use this file except in compliance with the License.
5
+ # A copy of the License is located at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # or in the "license" file accompanying this file. This file is distributed
10
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11
+ # express or implied. See the License for the specific language governing
12
+ # permissions and limitations under the License.
13
+
14
+
15
+ import dataclasses
16
+ import json
17
+ import logging
18
+ import os
19
+ import pathlib
20
+ import sys
21
+
22
+ import lib.litani
23
+ import lib.add_job
24
+
25
+
26
+ @dataclasses.dataclass
27
+ class _JobsTransformer:
28
+ jobs_dir: pathlib.Path
29
+ old_uuids: list
30
+
31
+
32
+ async def __call__(self, user_jobs):
33
+ self._delete_old_jobs()
34
+ await self._add_new_jobs(user_jobs)
35
+
36
+
37
+ async def _add_new_jobs(self, user_jobs):
38
+ for job in user_jobs:
39
+ job["subcommand"] = "add-job"
40
+ await lib.add_job.add_job(job)
41
+
42
+
43
+ def _delete_old_jobs(self):
44
+ for uuid in self.old_uuids:
45
+ job_file = self.jobs_dir / ("%s.json" % uuid)
46
+ try:
47
+ os.unlink(job_file)
48
+ except FileNotFoundError:
49
+ continue
50
+
51
+
52
+
53
+ def _print_jobs(job_paths):
54
+ out = []
55
+ for job in job_paths:
56
+ with open(job) as handle:
57
+ job_dict = json.load(handle)
58
+ for key in ("job_id", "status_file", "subcommand"):
59
+ job_dict.pop(key)
60
+ out.append(job_dict)
61
+ print(json.dumps(out, indent=2))
62
+ sys.stdout.flush()
63
+ os.close(sys.stdout.fileno())
64
+
65
+
66
+ def _read_jobs():
67
+ in_text = sys.stdin.read()
68
+ return json.loads(in_text)
69
+
70
+
71
+ async def main(_):
72
+ jobs_dir = lib.litani.get_cache_dir() / lib.litani.JOBS_DIR
73
+ old_jobs = list()
74
+ old_uuids = set()
75
+ for job in jobs_dir.iterdir():
76
+ old_jobs.append(job)
77
+ old_uuids.add(str(job.stem))
78
+
79
+ _print_jobs(old_jobs)
80
+
81
+ new_jobs = _read_jobs()
82
+
83
+ transform = _JobsTransformer(jobs_dir, old_uuids)
84
+ await transform(new_jobs)
@@ -32,6 +32,7 @@ import traceback
32
32
  import uuid
33
33
 
34
34
  from lib import litani, litani_report, ninja_syntax
35
+ import lib.add_job
35
36
  import lib.capabilities
36
37
  import lib.graph
37
38
  import lib.job_outcome
@@ -40,6 +41,7 @@ import lib.ninja
40
41
  import lib.pid_file
41
42
  import lib.process
42
43
  import lib.run_printer
44
+ import lib.transform_jobs
43
45
  import lib.validation
44
46
 
45
47
 
@@ -259,6 +261,11 @@ def get_args():
259
261
  "help":
260
262
  "how many times to retry loading the run in 1 second intervals"
261
263
  " (Default: %(default)s)"
264
+ }, {
265
+ "flags": ["-o", "--out-file"],
266
+ "metavar": "F",
267
+ "type": _non_directory_path,
268
+ "help": "Output file to dump run file in"
262
269
  }]:
263
270
  flags = arg.pop("flags")
264
271
  dump_run_pars.add_argument(*flags, **arg)
@@ -274,6 +281,13 @@ def get_args():
274
281
  flags = arg.pop("flags")
275
282
  graph_pars.add_argument(*flags, **arg)
276
283
 
284
+ transform_jobs_pars = subs.add_parser("transform-jobs",
285
+ help="print jobs, then read jobs on stdin to save")
286
+ transform_jobs_pars.set_defaults(func=lib.transform_jobs.main)
287
+ for arg in []:
288
+ flags = arg.pop("flags")
289
+ transform_jobs_pars.add_argument(*flags, **arg)
290
+
277
291
  caps_pars = subs.add_parser("print-capabilities",
278
292
  help="Print out Litani's capabilities in a list")
279
293
  caps_pars.set_defaults(func=lib.capabilities.dump)
@@ -408,6 +422,14 @@ def non_negative_int(arg):
408
422
  return ret
409
423
 
410
424
 
425
+ def _non_directory_path(arg):
426
+ path = pathlib.Path(arg)
427
+ if path.exists() and path.is_dir():
428
+ raise ValueError(
429
+ f"--out-file flag expects a file and not a directory: {arg}")
430
+ return path
431
+
432
+
411
433
  def list_of_ints(arg):
412
434
  ret = []
413
435
  for rc in arg:
@@ -620,39 +642,7 @@ async def init(args):
620
642
 
621
643
 
622
644
  async def add_job(args):
623
- cache_file = litani.get_cache_dir() / litani.CACHE_FILE
624
- with open(cache_file) as handle:
625
- cache_contents = json.load(handle)
626
- if args.ci_stage not in cache_contents["stages"]:
627
- valid_stages = "', '".join(cache_contents["stages"])
628
- logging.error(
629
- "Invalid stage name '%s' was provided, possible "
630
- "stage names are: '%s'", args.ci_stage, valid_stages)
631
- sys.exit(1)
632
-
633
- jobs_dir = litani.get_cache_dir() / litani.JOBS_DIR
634
- jobs_dir.mkdir(exist_ok=True, parents=True)
635
-
636
- if args.phony_outputs:
637
- if not args.outputs:
638
- args.outputs = args.phony_outputs
639
- else:
640
- for phony_output in args.phony_outputs:
641
- if phony_output not in args.outputs:
642
- args.outputs.append(phony_output)
643
-
644
- job = vars(args)
645
- job.pop("func")
646
-
647
- job_id = str(uuid.uuid4())
648
- job["job_id"] = job_id
649
- job["status_file"] = str(
650
- litani.get_status_dir() / ("%s.json" % job_id))
651
-
652
- logging.debug("Adding job: %s", json.dumps(job, indent=2))
653
-
654
- with litani.atomic_write(jobs_dir / ("%s.json" % job_id)) as handle:
655
- print(json.dumps(job, indent=2), file=handle)
645
+ await lib.add_job.add_job(vars(args))
656
646
 
657
647
 
658
648
  async def run_build(args):
@@ -782,6 +772,11 @@ async def exec_job(args):
782
772
  with litani.atomic_write(arg_file) as handle:
783
773
  print(out_str, file=handle)
784
774
 
775
+ if out_data["wrapper_return_code"] and out_data["stderr"]:
776
+ print(
777
+ "\n".join([l.rstrip() for l in out_data["stderr"]]),
778
+ file=sys.stderr)
779
+
785
780
  timestamp("end_time", out_data)
786
781
  out_str = json.dumps(out_data, indent=2)
787
782
  logging.debug("run status: %s", out_str)
@@ -0,0 +1,220 @@
1
+ #!/bin/sh
2
+ # vim: syntax=make ft=make
3
+ #
4
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License").
7
+ # You may not use this file except in compliance with the License.
8
+ # A copy of the License is located at #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # or in the "license" file accompanying this file. This file is distributed
12
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
+ # express or implied. See the License for the specific language governing
14
+ # permissions and limitations under the License.
15
+
16
+
17
+ # This file is a shell script that writes the bottom half of itself to a
18
+ # Makefile, and then runs that Makefile with make. It maintains state in the
19
+ # tmp/litani-release directory, so you can read the files in there to help with
20
+ # debugging.
21
+
22
+ MAKEFILE_START_LINE=$(\
23
+ grep -ne '^# 8><' "$0" \
24
+ | tail -n 1 \
25
+ | awk -F: '{print $1}')
26
+
27
+ LITANI_RELEASE=tmp/litani-release
28
+ mkdir -p "${LITANI_RELEASE}"
29
+
30
+ MAKEFILE=${LITANI_RELEASE}/Makefile
31
+ tail -n+${MAKEFILE_START_LINE} "$0" > "${MAKEFILE}"
32
+
33
+ make -Bj 1 -f "${MAKEFILE}"
34
+ SUCCESS="$?"
35
+
36
+ exit "${SUCCESS}"
37
+
38
+ # 8>< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
39
+ #
40
+ # Makefile starts here
41
+
42
+ TMP=tmp/litani-release
43
+
44
+ SANITY_CHECKS = \
45
+ check-upstream-origin \
46
+ check-branches-up-to-date \
47
+ check-tac-installed
48
+
49
+ RELEASE_PROCESS = \
50
+ checkout-develop \
51
+ merge-develop-release \
52
+ commit-changelog \
53
+ tag-release \
54
+ create-rc
55
+
56
+ STATE_FILES = \
57
+ $(TMP)/current-release-number \
58
+ $(TMP)/rc-number \
59
+ $(TMP)/commits.json
60
+
61
+ create-release: $(SANITY_CHECKS) $(STATE_FILES) $(RELEASE_PROCESS)
62
+ $(info --- Finished)
63
+ git checkout release
64
+ @>&2 printf '\n```````````````````````````````````````````````````````````\n'
65
+ @>&2 printf "Now run\n\n"
66
+ @>&2 printf " git push -u origin release\n"
67
+ @>&2 printf " git checkout develop\n"
68
+ @>&2 printf " git push -u origin develop\n"
69
+ @>&2 printf " git push origin --tags\n\n"
70
+ @>&2 printf '___________________________________________________________\n'
71
+
72
+ .PHONY: $(SANITY_CHECKS) $(PHONY_DEPS)
73
+
74
+ check-upstream-origin:
75
+ $(info --- Checking that 'origin' remote points to upstream repository)
76
+ git remote show -n origin \
77
+ | grep -e 'Fetch URL:\s\+.\+awslabs/aws-build-accumulator'
78
+
79
+ check-branches-up-to-date:
80
+ $(info --- Ensuring local branches track upstream)
81
+ [ $$(git rev-parse develop) = $$(git rev-parse origin/develop) ]
82
+ [ $$(git rev-parse release) = $$(git rev-parse origin/release) ]
83
+
84
+
85
+ check-tac-installed:
86
+ $(info --- Testing for 'tac' installation)
87
+ printf '' | tac
88
+
89
+ checkout-develop:
90
+ $(info --- Checking out develop)
91
+ git checkout develop
92
+
93
+ create-rc: $(TMP)/rc-number
94
+ $(info --- Creating new release candidate on develop branching off release)
95
+ git checkout -B develop
96
+ new_minor=$$(cat $(TMP)/rc-number); \
97
+ sed -E \
98
+ -e "s/^VERSION_MINOR.+/VERSION_MINOR = $${new_minor}/g" \
99
+ -I '' lib/litani.py
100
+ sed -E -e 's/^RC *= *False/RC = True/g' -I '' lib/litani.py
101
+ git add lib/litani.py
102
+ major=$$(grep -e '^VERSION_MAJOR' lib/litani.py | head -n 1 | awk -F= '{print $$2}'); \
103
+ minor=$$(cat $(TMP)/rc-number); \
104
+ git commit -m "Create version$${major}.$${minor} release candidate"
105
+
106
+ $(TMP)/rc-number:
107
+ $(info --- Generating RC number)
108
+ printf "%d\n" \
109
+ $$(( $$(grep -e '^VERSION_MINOR' lib/litani.py | awk '{print $$3}') + 1 )) \
110
+ > $@
111
+ cat $@
112
+
113
+ $(TMP)/current-release-number:
114
+ $(info --- Generating current release number)
115
+ printf "%d.%d.%d\n" \
116
+ $$(grep -e '^VERSION_MAJOR' lib/litani.py | awk '{print $$3}') \
117
+ $$(grep -e '^VERSION_MINOR' lib/litani.py | awk '{print $$3}') \
118
+ $$(grep -e '^VERSION_PATCH' lib/litani.py | awk '{print $$3}') \
119
+ > "$@"
120
+ cat $@
121
+
122
+ merge-develop-release: $(TMP)/current-release-number
123
+ $(info --- Merging develop into release branch)
124
+ git checkout release
125
+ git merge \
126
+ --no-ff \
127
+ --message="Bump version to $$(cat $(TMP)/current-release-number)" \
128
+ develop
129
+
130
+ commit-changelog: $(TMP)/updated-changelog
131
+ $(info --- Turning off '-rc' suffix in version number)
132
+ sed -e 's/^RC *= *True/RC = False/g' -I '' lib/litani.py
133
+ $(info --- Adding changelog and updated version number)
134
+ cp $(TMP)/updated-changelog CHANGELOG
135
+ git add lib/litani.py CHANGELOG
136
+ git commit --amend --reuse-message=HEAD
137
+
138
+ $(TMP)/updated-changelog: \
139
+ $(TMP)/current-release-number \
140
+ $(TMP)/user-changelog \
141
+ $(TMP)/old-changelog
142
+ $(info --- Assembling new changelog from user input)
143
+ printf " CHANGELOG\n" > $@
144
+ printf ' `````````\n\n' >> $@
145
+ printf "Version %s -- %s\n" \
146
+ $$(cat $(TMP)/current-release-number) \
147
+ $$(date +%Y-%m-%d) >> $@
148
+ printf -- "----------------------------\n" >> $@
149
+ printf "%s" \
150
+ "$$(echo "$$(grep -ve '^#' $(TMP)/user-changelog)" | tac)" | tac >> $@
151
+ printf "\n\n" >> $@
152
+ cat $(TMP)/old-changelog >> $@
153
+
154
+ $(TMP)/old-changelog:
155
+ $(info --- Dumping old changelog)
156
+ start_line=$$(\
157
+ grep -ne '^Version ' CHANGELOG \
158
+ | head -n 1 \
159
+ | awk -F: '{print $$1}' \
160
+ ); \
161
+ tail -n+$${start_line} CHANGELOG > $@
162
+
163
+ $(TMP)/user-changelog: $(TMP)/commits.json
164
+ $(info --- Generating changelog for this release from feature list)
165
+ printf "" > $@
166
+ printf "%s\n" "# This will be the changelog entry for this release." >> $@
167
+ printf "%s\n" "# Lines beginning with '#' will be ignored." >> $@
168
+ printf "%s\n" "" >> $@
169
+ jq -r '[.[] | [ \
170
+ "- " + .subject, \
171
+ if (.body | length) > 1 \
172
+ then "", (.body | .[] | if (. | length) == 0 then "" else " " + . end) \
173
+ else "" end \
174
+ ] + [ \
175
+ (if (.body | length) > 1 then "", "" else "" end) \
176
+ ] \
177
+ ] | .[] | .[]' < $(TMP)/commits.json >> $@
178
+ vim +4 $@
179
+
180
+ bump-version:
181
+ $(info --- Incrementing minor version number)
182
+ next_minor=$$(( \
183
+ $$(grep -e '^VERSION_MINOR' lib/litani.py | awk '{print $$3}') + 1 \
184
+ )); \
185
+ sed -E -e 's/^VERSION_MINOR.+/VERSION_MINOR = $${next_minor}/g' \
186
+ -I '' lib/litani.py
187
+
188
+ tag-release: $(TMP)/current-release-number $(TMP)/tag-body
189
+ $(info --- Tagging release)
190
+ printf "Release %s\n\n" $$(cat $<) > $(TMP)/tag-file
191
+ cat $(TMP)/tag-body >> $(TMP)/tag-file
192
+ git tag --annotate --file=$(TMP)/tag-file $$(cat $<)
193
+
194
+ $(TMP)/tag-body: $(TMP)/commits.json
195
+ $(info --- Generating tag body)
196
+ jq -r '.[] | "- " + .subject' > $@ < $<
197
+
198
+ $(TMP)/commits.json:
199
+ $(info --- Generating JSON list of feature commits)
200
+ commit=HEAD; \
201
+ while true ; do \
202
+ author=$$(git show --no-patch --pretty=format:%an "$${commit}"); \
203
+ subject=$$(git show --no-patch --pretty=format:%s "$${commit}"); \
204
+ body=$$(git show --no-patch --pretty=format:%b "$${commit}"); \
205
+ last_rc=$$(printf "%s\n" "$${subject}" \
206
+ | grep "Create version .\+ release candidate"); \
207
+ if [ "$${last_rc}" ]; then \
208
+ break; \
209
+ fi ; \
210
+ printf '%s\n%s\n%s' "$${author}" "$${subject}" "$${body}" \
211
+ | jq --compact-output --raw-input --slurp \
212
+ 'split("\n") | {\
213
+ "author": .[0], \
214
+ "subject": .[1], \
215
+ "body": .[2:] \
216
+ }'; \
217
+ commit="$${commit}~"; \
218
+ done \
219
+ | tr '\n' ',' | sed 's/,$$/]\n/; s/^{/[{/' | jq \
220
+ > $@
@@ -52,13 +52,15 @@ h1 {
52
52
  font-size: small;
53
53
  color: #ec407a;
54
54
  }
55
+ body {
56
+ color: #263238;
57
+ }
55
58
  #content {
56
59
  max-width: 800px;
57
60
  margin-left: auto;
58
61
  margin-right: auto;
59
62
  padding-top: 2em;
60
63
  padding-bottom: 2em;
61
- color: #263238;
62
64
  font-family: Helvetica, sans-serif;
63
65
  }
64
66
  p {
@@ -251,6 +253,42 @@ p {
251
253
  font-weight: bold;
252
254
  }
253
255
 
256
+ .job-outputs-header {
257
+ color: #263238;
258
+ }
259
+ .job-output-content {
260
+ background-color: #eceff1;
261
+ padding: 0.3em 1em;
262
+ border-radius: 0.3em;
263
+ margin-bottom: 4em;
264
+ }
265
+ .job-output-title {
266
+ margin: 0.3em 0 1em;
267
+ }
268
+ .job-output-title a {
269
+ text-decoration: none;
270
+ color: #29b6f6;
271
+ }
272
+ .job-output-title a:link, .job-output-title a:visited {
273
+ color: #29b6f6;
274
+ }
275
+ .job-output-title a:hover, .job-output-title a:visited:hover {
276
+ color: #ec407a;
277
+ text-decoration: none;
278
+ }
279
+ .job-output-title a:active, .job-output-title a:visited:active {
280
+ color: #ffeb3b;
281
+ text-decoration: none;
282
+ }
283
+ .job-output-box {
284
+ margin-top: 0.4em;
285
+ margin-bottom: 0.2em;
286
+ padding: 1em;
287
+ border-radius: 0.5em;
288
+ overflow-x: auto;
289
+ overflow-y: auto;
290
+ }
291
+
254
292
  @media (max-width: 640px){
255
293
  .pipeline-progress {
256
294
  width: 10em;
@@ -266,9 +304,6 @@ p {
266
304
  .status-icon-in-progress { fill: #ddd; }
267
305
  .status-icon-in-progress circle { stroke: #ddd; }
268
306
 
269
- .pipeline-header {
270
- color: #eceff1;
271
- }
272
307
  .downloads-header {
273
308
  color: #eceff1;
274
309
  }
@@ -279,17 +314,22 @@ p {
279
314
  .downloads a {
280
315
  color: #29b6f6;
281
316
  }
282
- .pipeline-row {
317
+ .job-outputs-header {
318
+ color: #eceff1;
319
+ }
320
+ .job-output-content {
321
+ background-color: #37474f;
322
+ }
323
+ .job-output-title {
283
324
  color: #eceff1;
325
+ }
326
+ .pipeline-row {
284
327
  background-color: #37474f;
285
328
  }
286
329
  body {
287
330
  color: #babdbe;
288
331
  background-color: #263238;
289
332
  }
290
- p {
291
- color: #babdbe;
292
- }
293
333
  #subtitle {
294
334
  color: #fff;
295
335
  }
@@ -381,7 +421,7 @@ p {
381
421
  </div><!-- class="pipeline-row" -->
382
422
 
383
423
  {% for pipe in run["pipelines"] %}
384
- <div class="pipeline-row">
424
+ <div class="pipeline-row" id="pipe_row_{{ pipe['name'] }}">
385
425
 
386
426
  <div class="pipeline-link">
387
427
  <svg height="16px" width="32px" class="pipeline-icon">
@@ -445,10 +485,36 @@ p {
445
485
  {% endfor %}{# pipe in run["pipelines"] #}
446
486
  </div><!-- id="pipeline-table" -->
447
487
 
488
+ {% if front_page_outputs %}
489
+ <div class="job-outputs">
490
+ <div class="job-outputs-header">
491
+ <h2>Job Outputs</h2>
492
+ </div>
493
+ {% for job_desc, job in front_page_outputs.items() %}
494
+ <div
495
+ class="job-output-content"
496
+ id="job_front_page_output_{{ job['wrapper_arguments']['job_id']}}">
497
+ <div class="job-output-title">
498
+ <h3>Output of job &quot;<a
499
+ href="pipelines/{{ job['wrapper_arguments']['pipeline_name'] }}/
500
+ index.html#job-{{ job['wrapper_arguments']['job_id'] }}"
501
+ >{{ job_desc }}</a>&quot;:</h3>
502
+ </div>
503
+ <div class="job-output-box">
504
+ {% for line in job["stdout"] %}
505
+ {{ line.strip() }}
506
+ {%- endfor %}{# line in job["stdout"] #}
507
+ </div>
508
+ </div>
509
+ {% endfor %}{# job_desc, job in front_page_outputs.items() #}
510
+ </div>
511
+ {% endif %}{# front_page_outputs #}
448
512
 
449
513
  {% for title, svg_list in svgs.items() %}
450
514
  {% if svg_list %}
451
- <h2 class="downloads-header">{{ title }}</h2>
515
+ <h2
516
+ class="downloads-header"
517
+ id="svg_{{ title }}">{{ title }}</h2>
452
518
  <div class="graphs">
453
519
  {% for svg in svg_list %}
454
520
  <div class="graph">
@@ -462,7 +528,7 @@ p {
462
528
  {% endfor -%}{# title, svg_list in svgs #}
463
529
 
464
530
 
465
- <h2 class="downloads-header">Downloads</h2>
531
+ <h2 class="downloads-header" id="downloads">Downloads</h2>
466
532
  <div class="downloads">
467
533
  <ul>
468
534
  <li>
@@ -482,15 +548,12 @@ p {
482
548
  </ul>
483
549
  </div>
484
550
 
485
- <div class="footer">
551
+ <div class="footer" id="footer">
486
552
  <div class="footer-cell">
487
553
  <p>
488
554
  Report generated with
489
555
  <a href="https://github.com/awslabs/aws-build-accumulator">Litani</a>
490
556
  {{ litani_version }}
491
- {% if litani_hash is not none %}
492
- (<code>{{ litani_hash }}</code>)
493
- {% endif %}{# litani_hash is not none #}
494
557
  </p>
495
558
  </div><!-- class="footer-cell" -->
496
559
  </div><!-- class="footer" -->
@@ -194,6 +194,14 @@ p {
194
194
  text-shadow: 0 0 2px #82ada944;
195
195
  font-weight: bold;
196
196
  }
197
+ .literal-stdout {
198
+ margin-top: 0.4em;
199
+ margin-bottom: 0.2em;
200
+ padding: 1em;
201
+ border-radius: 0.5em;
202
+ overflow-x: auto;
203
+ overflow-y: auto;
204
+ }
197
205
  .output-box {
198
206
  margin-top: 0.4em;
199
207
  margin-bottom: 0.2em;
@@ -773,12 +781,20 @@ a:visited:active {
773
781
 
774
782
 
775
783
  {% if job["stdout"] %}
776
- <div class="output-box"><xmp>stdout:
777
- {% for line in job["stdout"] %}
784
+ {% if job["wrapper_arguments"]["tags"] is not none and "literal-stdout" in job["wrapper_arguments"]["tags"] %}
785
+ <div class="literal-stdout">
786
+ {% for line in job["stdout"] %}
778
787
  {{ line.strip() }}
779
- {%- endfor %}{# line in job["stdout"] #}
780
- </xmp>
781
- </div><!-- class="output-box" -->
788
+ {%- endfor %}{# line in job["stdout"] #}
789
+ </div><!-- class="literal-stdout" -->
790
+ {% else %}
791
+ <div class="output-box"><xmp>stdout:
792
+ {% for line in job["stdout"] %}
793
+ {{ line.strip() }}
794
+ {%- endfor %}{# line in job["stdout"] #}
795
+ </xmp>
796
+ </div><!-- class="output-box" -->
797
+ {% endif %}{# is literal-stdout in tags #}
782
798
  {% endif %}{# job["stdout"] #}
783
799
 
784
800
  {% if job["stderr"] %}
@@ -4,3 +4,18 @@
4
4
  The `run` script uses litani to run a variety of unit and system tests.
5
5
  The dashboard showing the output of the latest test run will always be
6
6
  symlinked from test/output/latest/html/index.html.
7
+
8
+ # OPTIONS
9
+
10
+ *--output-dir*
11
+ Litani will write all of its test output files for this run to this path
12
+
13
+ *--fast*
14
+ Do not run tests with SLOW variable set to True
15
+
16
+ ## Writing Tests
17
+
18
+ Each test is made up of 4 jobs: init, add-jobs, run-build, and check-run
19
+ If --fast flag is passed, each job is given a timeout of 10 seconds.
20
+ In the worst case, a test would take 40 seconds to run.
21
+ For each test, SLOW is set to True if jobs fail to pass the above timeout.