Debian Codegraph @

crt/s2n/tests/unit/s2n_random_test.c

raw symbols SCIP
1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 #ifdef __FreeBSD__
17 /* FreeBSD requires POSIX compatibility off for its syscalls (enables __BSD_VISIBLE)
18 * Without the below line, <sys/wait.h> cannot be imported (it requires __BSD_VISIBLE) */
19 #undef _POSIX_C_SOURCE
20 #else
21 /* For clone() */
22 #define _GNU_SOURCE
23 #endif
24
25 #include "utils/s2n_random.h"
26
27 #include <openssl/rand.h>
28 #include <pthread.h>
29 #include <stdlib.h>
30 #include <sys/wait.h>
31 #include <unistd.h>
32
33 #include "api/s2n.h"
34 #include "crypto/s2n_fips.h"
35 #include "crypto/s2n_libcrypto.h"
36 #include "s2n_test.h"
37
38 #define MAX_NUMBER_OF_TEST_THREADS 2
39
40 #define CLONE_TEST_NO 0
41 #define CLONE_TEST_YES 1
42 #define CLONE_TEST_DETERMINE_AT_RUNTIME 2
43
44 #define RANDOM_GENERATE_DATA_SIZE 100
45 #define MAX_RANDOM_GENERATE_DATA_SIZE 5120
46
47 #define NUMBER_OF_BOUNDS 10
48 #define NUMBER_OF_RANGE_FUNCTION_CALLS 200
49 #define MAX_REPEATED_OUTPUT 4
50
51 bool s2n_libcrypto_is_fips(void);
52 bool s2n_libcrypto_is_openssl(void);
53 S2N_RESULT s2n_rand_device_validate(struct s2n_rand_device *device);
54 S2N_RESULT s2n_rand_get_urandom_for_test(struct s2n_rand_device **device);
55
56 struct random_test_case {
57 const char *test_case_label;
58 int (*test_case_cb)(struct random_test_case *test_case);
59 int test_case_must_pass_clone_test;
60 int expected_return_status;
61 };
62
63 struct random_communication {
64 S2N_RESULT (*s2n_get_random_data_cb_1)(struct s2n_blob *blob);
65 S2N_RESULT (*s2n_get_random_data_cb_2)(struct s2n_blob *blob);
66 uint8_t thread_data[RANDOM_GENERATE_DATA_SIZE];
67 int *pipes;
68 };
69
70 static void s2n_verify_child_exit_status(pid_t proc_pid, int expected_status)
71 {
72 int status = 0;
73 #if S2N_CLONE_SUPPORTED
74 EXPECT_EQUAL(waitpid(proc_pid, &status, __WALL), proc_pid);
75 #else
76 /* __WALL is not relevant when clone() is not supported
77 * https://man7.org/linux/man-pages/man2/wait.2.html#NOTES
78 */
79 EXPECT_EQUAL(waitpid(proc_pid, &status, 0), proc_pid);
80 #endif
81 /* Check that child exited with status = expected_status. If not, this
82 * indicates that an error was encountered in the unit tests executed in
83 * that child process.
84 */
85 EXPECT_NOT_EQUAL(WIFEXITED(status), 0);
86 EXPECT_EQUAL(WEXITSTATUS(status), expected_status);
87 }
88
89 int qsort_comparator(const void *pval1, const void *pval2)
90 {
91 const uint64_t val1 = *(const uint64_t *) pval1;
92 const uint64_t val2 = *(const uint64_t *) pval2;
93
94 if (val1 < val2) {
95 return -1;
96 } else if (val1 > val2) {
97 return 1;
98 } else {
99 return 0;
100 }
101 }
102
103 static S2N_RESULT s2n_tests_get_range(void)
104 {
105 uint64_t range_results[NUMBER_OF_RANGE_FUNCTION_CALLS] = { 0 };
106 uint64_t current_output = 0;
107 /* The type of the `bound` parameter in s2n_public_random() is signed */
108 int64_t chosen_upper_bound = 0;
109 struct s2n_blob upper_bound_blob = { 0 };
110 EXPECT_SUCCESS(s2n_blob_init(&upper_bound_blob, (void *) &chosen_upper_bound, sizeof(chosen_upper_bound)));
111
112 /* 0 is not a legal upper bound */
113 chosen_upper_bound = 0;
114 EXPECT_ERROR_WITH_ERRNO(s2n_public_random(chosen_upper_bound, &current_output), S2N_ERR_SAFETY);
115
116 /* For an upper bound of 1, 0 should be the only possible output */
117 chosen_upper_bound = 1;
118 EXPECT_OK(s2n_public_random(chosen_upper_bound, &current_output));
119 EXPECT_EQUAL(current_output, 0);
120
121 /* For a upper bound of 2, 0 and 1 should be the only possible outputs */
122 chosen_upper_bound = 1;
123 EXPECT_OK(s2n_public_random(chosen_upper_bound, &current_output));
124 EXPECT_TRUE((current_output == 0) || (current_output == 1));
125
126 /* Test NUMBER_OF_BOUNDS upper bounds. For each resulting range, draw
127 * NUMBER_OF_RANGE_FUNCTION_CALLS numbers from s2n_public_random() and
128 * verify the output. Set 2^30 * NUMBER_OF_RANGE_FUNCTION_CALLS as the
129 * minimal value for the upper bound. The minimal upper bound value is
130 * chosen to make the likelihood of a false positive small - see below for
131 * probability calculations.
132 */
133 int64_t minimal_upper_bound = (int64_t) 0x40000000 * (int64_t) NUMBER_OF_RANGE_FUNCTION_CALLS;
134 for (size_t bound_ctr = 0; bound_ctr < NUMBER_OF_BOUNDS; bound_ctr++) {
135 /* chosen_upper_bound is supposedly chosen uniformly at random and
136 * minimal_upper_bound is only 2^30 * NUMBER_OF_RANGE_FUNCTION_CALLS, so
137 * this should not iterate for too long
138 */
139 do {
140 EXPECT_OK(s2n_get_private_random_data(&upper_bound_blob));
141 } while (chosen_upper_bound < minimal_upper_bound);
142
143 /* Pick NUMBER_OF_RANGE_FUNCTION_CALLS numbers in the given interval.
144 * While doing that, also verify that the upper bound is respected.
145 */
146 for (size_t func_call_ctr = 0; func_call_ctr < NUMBER_OF_RANGE_FUNCTION_CALLS; func_call_ctr++) {
147 EXPECT_OK(s2n_public_random(chosen_upper_bound, &range_results[func_call_ctr]));
148 EXPECT_TRUE(range_results[func_call_ctr] < chosen_upper_bound);
149 }
150
151 /* The probability of "at least MAX_REPEATED_OUTPUT repeated values"
152 * follows a binomial distribution. Hence, we can get an upper bound via
153 * Markov's inequality:
154 * P("at least MAX_REPEATED_OUTPUT repeated values")
155 * <= E("at least MAX_REPEATED_OUTPUT repeated values") / MAX_REPEATED_OUTPUT.
156 * = (NUMBER_OF_RANGE_FUNCTION_CALLS * 1/(2^30 * NUMBER_OF_RANGE_FUNCTION_CALLS)) / MAX_REPEATED_OUTPUT
157 * = 1/(2^30 * MAX_REPEATED_OUTPUT)
158 *
159 * With current parameters
160 * NUMBER_OF_BOUNDS = 10
161 * MAX_REPEATED_OUTPUT = 4
162 * this ends up with about a ~1/2^30 probability of failing this test
163 * with a false positive.
164 *
165 * qsort() complexity is not guaranteed, but
166 * NUMBER_OF_RANGE_FUNCTION_CALLS is very small, so no biggie.
167 * Sorting the array means that we can check for repeated numbers by
168 * just counting from left to right resetting the count when meeting a
169 * different value.
170 */
171 qsort(range_results, NUMBER_OF_RANGE_FUNCTION_CALLS, sizeof(uint64_t),
172 qsort_comparator);
173 uint64_t current_value = range_results[0];
174 uint64_t next_value = 0;
175 size_t repeat_count = 1;
176 for (size_t ctr = 1; ctr < NUMBER_OF_RANGE_FUNCTION_CALLS - 1; ctr++) {
177 next_value = range_results[ctr];
178
179 if (current_value == next_value) {
180 repeat_count = repeat_count + 1;
181 } else {
182 RESULT_ENSURE_LT(current_value, next_value);
183 current_value = next_value;
184 repeat_count = 1;
185 }
186
187 EXPECT_TRUE(repeat_count < MAX_REPEATED_OUTPUT);
188 }
189
190 /* Reset for next iteration */
191 RESULT_CHECKED_MEMSET(&range_results[0], 0, sizeof(range_results));
192 }
193
194 return S2N_RESULT_OK;
195 }
196
197 void *s2n_thread_test_cb(void *thread_comms)
198 {
199 struct random_communication *thread_comms_ptr = (struct random_communication *) thread_comms;
200
201 struct s2n_blob thread_blob = { 0 };
202 EXPECT_SUCCESS(s2n_blob_init(&thread_blob, thread_comms_ptr->thread_data, RANDOM_GENERATE_DATA_SIZE));
203
204 EXPECT_NOT_NULL(thread_comms_ptr->s2n_get_random_data_cb_1);
205 EXPECT_OK(thread_comms_ptr->s2n_get_random_data_cb_1(&thread_blob));
206
207 return NULL;
208 }
209
210 /* Creates two threads and generates random data in those two threads as well
211 * as the parent thread. Verifies that all three resulting data blobs are
212 * different.
213 */
214 static S2N_RESULT s2n_thread_test(
215 S2N_RESULT (*s2n_get_random_data_cb)(struct s2n_blob *blob),
216 S2N_RESULT (*s2n_get_random_data_cb_thread)(struct s2n_blob *blob))
217 {
218 uint8_t data[RANDOM_GENERATE_DATA_SIZE];
219 struct s2n_blob blob = { 0 };
220 EXPECT_SUCCESS(s2n_blob_init(&blob, data, 0));
221 pthread_t threads[MAX_NUMBER_OF_TEST_THREADS];
222
223 struct random_communication thread_communication_0 = { .s2n_get_random_data_cb_1 = s2n_get_random_data_cb_thread };
224 struct random_communication thread_communication_1 = { .s2n_get_random_data_cb_1 = s2n_get_random_data_cb_thread };
225
226 /* Create two threads and have them each grab RANDOM_GENERATE_DATA_SIZE
227 * bytes.
228 */
229 EXPECT_EQUAL(pthread_create(&threads[0], NULL, s2n_thread_test_cb, &thread_communication_0), 0);
230 EXPECT_EQUAL(pthread_create(&threads[1], NULL, s2n_thread_test_cb, &thread_communication_1), 0);
231
232 /* Wait for those threads to finish */
233 EXPECT_EQUAL(pthread_join(threads[0], NULL), 0);
234 EXPECT_EQUAL(pthread_join(threads[1], NULL), 0);
235
236 /* Confirm that their random data differs from each other */
237 EXPECT_BYTEARRAY_NOT_EQUAL(thread_communication_0.thread_data, thread_communication_1.thread_data, RANDOM_GENERATE_DATA_SIZE);
238
239 /* Confirm that their random data differs from the parent thread */
240 blob.size = RANDOM_GENERATE_DATA_SIZE;
241 EXPECT_OK(s2n_get_random_data_cb(&blob));
242 EXPECT_BYTEARRAY_NOT_EQUAL(thread_communication_0.thread_data, data, RANDOM_GENERATE_DATA_SIZE);
243 EXPECT_BYTEARRAY_NOT_EQUAL(thread_communication_1.thread_data, data, RANDOM_GENERATE_DATA_SIZE);
244
245 return S2N_RESULT_OK;
246 }
247
248 static void s2n_fork_test_generate_randomness(int write_fd, S2N_RESULT (*s2n_get_random_data_cb)(struct s2n_blob *blob))
249 {
250 uint8_t data[RANDOM_GENERATE_DATA_SIZE];
251
252 struct s2n_blob blob = { 0 };
253 EXPECT_SUCCESS(s2n_blob_init(&blob, data, RANDOM_GENERATE_DATA_SIZE));
254 EXPECT_OK(s2n_get_random_data_cb(&blob));
255
256 /* Write the data we got to our pipe */
257 if (write(write_fd, data, RANDOM_GENERATE_DATA_SIZE) != RANDOM_GENERATE_DATA_SIZE) {
258 _exit(EXIT_FAILURE);
259 }
260
261 /* Close the pipe and exit */
262 close(write_fd);
263 exit(EXIT_SUCCESS);
264 }
265
266 static S2N_RESULT s2n_fork_test_verify_result(int *pipes, int proc_id, S2N_RESULT (*s2n_get_random_data_cb)(struct s2n_blob *blob))
267 {
268 uint8_t child_data[RANDOM_GENERATE_DATA_SIZE];
269 uint8_t parent_data[RANDOM_GENERATE_DATA_SIZE];
270 struct s2n_blob parent_blob = { 0 };
271 EXPECT_SUCCESS(s2n_blob_init(&parent_blob, parent_data, RANDOM_GENERATE_DATA_SIZE));
272
273 /* Quickly verify we are in the parent process and not the child */
274 EXPECT_NOT_EQUAL(proc_id, 0);
275
276 /* This is the parent process, close the write end of the pipe */
277 EXPECT_SUCCESS(close(pipes[1]));
278
279 /* Read the child's data from the pipe */
280 EXPECT_EQUAL(read(pipes[0], child_data, RANDOM_GENERATE_DATA_SIZE), RANDOM_GENERATE_DATA_SIZE);
281
282 /* Get RANDOM_GENERATE_DATA_SIZE bytes in this parent process */
283 EXPECT_OK(s2n_get_random_data_cb(&parent_blob));
284
285 /* Confirm that their data differs from each other */
286 EXPECT_BYTEARRAY_NOT_EQUAL(child_data, parent_data, RANDOM_GENERATE_DATA_SIZE);
287
288 EXPECT_SUCCESS(close(pipes[0]));
289
290 /* Also remember to verify that the child exited okay */
291 s2n_verify_child_exit_status(proc_id, S2N_SUCCESS);
292
293 return S2N_RESULT_OK;
294 }
295
296 /* A simple fork test. Generates random data in the parent and child, and
297 * verifies that the two resulting data blobs are different.
298 */
299 static S2N_RESULT s2n_simple_fork_test(S2N_RESULT (*s2n_get_random_data_cb)(struct s2n_blob *blob))
300 {
301 pid_t proc_id = 0;
302 int pipes[2];
303
304 EXPECT_SUCCESS(pipe(pipes));
305 proc_id = fork();
306 if (proc_id == 0) {
307 /* This is the child process, close the read end of the pipe */
308 EXPECT_SUCCESS(close(pipes[0]));
309 s2n_fork_test_generate_randomness(pipes[1], s2n_get_random_data_cb);
310 }
311 EXPECT_OK(s2n_fork_test_verify_result(pipes, proc_id, s2n_get_random_data_cb));
312
313 return S2N_RESULT_OK;
314 }
315
316 static int s2n_random_test_case_failure_cb(struct random_test_case *test_case)
317 {
318 EXPECT_SUCCESS(s2n_init());
319
320 /* This is a cheap way to ensure that failures in a fork bubble up to the
321 * parent as a failure. This should be caught in the parent when querying
322 * the return status code of the child. All s2n test macros will cause a
323 * process to exit with error status = 1. We call exit() directly to avoid
324 * messages being printed on stderr, in turn, appearing in logs.
325 */
326 exit(1);
327
328 EXPECT_SUCCESS(s2n_cleanup());
329
330 return EXIT_SUCCESS;
331 }
332
333 static int s2n_random_noop_destructor_test_cb(struct random_test_case *test_case)
334 {
335 /* Ensure that the destructor / cleanup does not require s2n_init to have been called.
336 * If applications load s2n-tls but do not actually use it, our cleanup should not fail.
337 *
338 * Other test cases may currently trigger this scenario if the feature they
339 * intend to test is not available so they exit before calling s2n_init.
340 */
341 return EXIT_SUCCESS;
342 }
343
344 static int s2n_random_rand_bytes_after_cleanup_cb(struct random_test_case *test_case)
345 {
346 EXPECT_SUCCESS(s2n_init());
347 EXPECT_SUCCESS(s2n_cleanup_final());
348
349 unsigned char rndbytes[16];
350 EXPECT_EQUAL(RAND_bytes(rndbytes, sizeof(rndbytes)), 1);
351
352 return S2N_SUCCESS;
353 }
354
355 static int s2n_random_invalid_urandom_fd_cb(struct random_test_case *test_case)
356 {
357 struct s2n_rand_device *dev_urandom = NULL;
358 EXPECT_OK(s2n_rand_get_urandom_for_test(&dev_urandom));
359 EXPECT_NOT_NULL(dev_urandom);
360
361 EXPECT_EQUAL(dev_urandom->fd, -1);
362
363 /* Validation should fail before initialization. */
364 EXPECT_ERROR(s2n_rand_device_validate(dev_urandom));
365
366 EXPECT_SUCCESS(s2n_init());
367
368 if (!s2n_use_libcrypto_rand()) {
369 /* Validation should succeed after initialization. */
370 EXPECT_OK(s2n_rand_device_validate(dev_urandom));
371
372 EXPECT_TRUE(dev_urandom->fd > STDERR_FILENO);
373
374 /* Test for closed dev_urandom fd */
375 EXPECT_EQUAL(close(dev_urandom->fd), 0);
376
377 /* Validation should fail when the file descriptor is invalid. */
378 EXPECT_ERROR(s2n_rand_device_validate(dev_urandom));
379
380 s2n_stack_blob(rand_data, 16, 16);
381 EXPECT_OK(s2n_get_public_random_data(&rand_data));
382
383 /* When the urandom implementation is used, the file descriptor is re-opened and
384 * validation should succeed.
385 */
386 EXPECT_OK(s2n_rand_device_validate(dev_urandom));
387 }
388
389 EXPECT_SUCCESS(s2n_cleanup_final());
390
391 return S2N_SUCCESS;
392 }
393
394 /* Very basic test generating random data a few times and checking that the
395 * output is different
396 */
397 static S2N_RESULT s2n_basic_generate_tests(void)
398 {
399 uint8_t data1[RANDOM_GENERATE_DATA_SIZE];
400 uint8_t data2[RANDOM_GENERATE_DATA_SIZE];
401 struct s2n_blob blob1 = { 0 };
402 EXPECT_SUCCESS(s2n_blob_init(&blob1, data1, 0));
403 struct s2n_blob blob2 = { 0 };
404 EXPECT_SUCCESS(s2n_blob_init(&blob2, data2, 0));
405
406 /* Generate two random data blobs and confirm that they are unique */
407 blob1.size = RANDOM_GENERATE_DATA_SIZE;
408 blob2.size = RANDOM_GENERATE_DATA_SIZE;
409 EXPECT_OK(s2n_get_public_random_data(&blob1));
410 EXPECT_OK(s2n_get_public_random_data(&blob2));
411 EXPECT_BYTEARRAY_NOT_EQUAL(data1, data2, RANDOM_GENERATE_DATA_SIZE);
412 EXPECT_OK(s2n_get_private_random_data(&blob1));
413 EXPECT_BYTEARRAY_NOT_EQUAL(data1, data2, RANDOM_GENERATE_DATA_SIZE);
414 EXPECT_OK(s2n_get_private_random_data(&blob2));
415 EXPECT_BYTEARRAY_NOT_EQUAL(data1, data2, RANDOM_GENERATE_DATA_SIZE);
416
417 return S2N_RESULT_OK;
418 }
419
420 /* Runs the basic set of randomness tests that exercise still-existing APIs:
421 * basic generate, thread uniqueness, fork uniqueness, and range tests.
422 */
423 static int s2n_random_common_tests_cb(struct random_test_case *test_case)
424 {
425 EXPECT_SUCCESS(s2n_init());
426
427 /* Basic tests generating randomness */
428 EXPECT_OK(s2n_basic_generate_tests());
429
430 /* Verify we generate unique data over threads */
431 EXPECT_OK(s2n_thread_test(s2n_get_public_random_data, s2n_get_public_random_data));
432 EXPECT_OK(s2n_thread_test(s2n_get_private_random_data, s2n_get_private_random_data));
433 EXPECT_OK(s2n_thread_test(s2n_get_public_random_data, s2n_get_private_random_data));
434 EXPECT_OK(s2n_thread_test(s2n_get_private_random_data, s2n_get_public_random_data));
435
436 /* Verify we generate unique data over forks */
437 EXPECT_OK(s2n_simple_fork_test(s2n_get_public_random_data));
438 EXPECT_OK(s2n_simple_fork_test(s2n_get_private_random_data));
439
440 /* Special range function tests */
441 EXPECT_OK(s2n_tests_get_range());
442
443 EXPECT_SUCCESS(s2n_cleanup());
444
445 return EXIT_SUCCESS;
446 }
447
448 struct random_test_case random_test_cases[] = {
449 { "Random API: basic generate, thread, fork, and range tests.", s2n_random_common_tests_cb, CLONE_TEST_DETERMINE_AT_RUNTIME, EXIT_SUCCESS },
450 { "Test destructor without s2n_init", s2n_random_noop_destructor_test_cb, CLONE_TEST_DETERMINE_AT_RUNTIME, EXIT_SUCCESS },
451 /* The s2n FAIL_MSG() macro uses exit(1) not exit(EXIT_FAILURE). So, we need
452 * to use 1 below and in s2n_random_test_case_failure_cb().
453 */
454 { "Test failure.", s2n_random_test_case_failure_cb, CLONE_TEST_DETERMINE_AT_RUNTIME, 1 },
455 { "Test libcrypto's RAND engine is reset correctly after manual s2n_cleanup()", s2n_random_rand_bytes_after_cleanup_cb, CLONE_TEST_DETERMINE_AT_RUNTIME, EXIT_SUCCESS },
456 { "Test getting entropy with an invalid file descriptor", s2n_random_invalid_urandom_fd_cb, CLONE_TEST_DETERMINE_AT_RUNTIME, EXIT_SUCCESS },
457 };
458
459 int main(int argc, char **argv)
460 {
461 BEGIN_TEST_NO_INIT();
462
463 /* Feature probe: Negative test */
464 {
465 if (s2n_libcrypto_is_awslc()) {
466 #if defined(S2N_LIBCRYPTO_SUPPORTS_ENGINE)
467 FAIL_MSG("Expected ENGINE feature probe to be disabled with AWS-LC");
468 #endif
469 }
470
471 if (s2n_libcrypto_is_openssl_fips()) {
472 #if !S2N_LIBCRYPTO_SUPPORTS_PRIVATE_RAND
473 FAIL_MSG("Expected private rand support from openssl3 fips");
474 #endif
475 }
476 };
477
478 /* Feature probe: Positive test
479 *
480 * TODO: Test missing due to unrelated feature probe failure on AL2.
481 * https://github.com/aws/s2n-tls/issues/4900
482 */
483
484 /* s2n_use_libcrypto_rand */
485 {
486 #if defined(S2N_LIBCRYPTO_SUPPORTS_PRIVATE_RAND) || defined(S2N_LIBCRYPTO_SUPPORTS_PUBLIC_RAND) \
487 || defined(OPENSSL_IS_AWSLC)
488 bool expected = true;
489 #else
490 bool expected = false;
491 #endif
492 EXPECT_EQUAL(s2n_use_libcrypto_rand(), expected);
493 };
494
495 /* For each test case, creates a child process that runs the test case. */
496 for (size_t i = 0; i < s2n_array_len(random_test_cases); i++) {
497 pid_t proc_id = 0;
498
499 proc_id = fork();
500 EXPECT_TRUE(proc_id >= 0);
501
502 if (proc_id == 0) {
503 /* In child */
504 EXPECT_EQUAL(random_test_cases[i].test_case_cb(&random_test_cases[i]), EXIT_SUCCESS);
505
506 /* Exit code EXIT_SUCCESS means that tests in this process finished
507 * successfully. Any errors would have exited the process with an
508 * exit code != EXIT_SUCCESS. We verify this in the parent process.
509 * Also prevents child from creating more children.
510 */
511 exit(EXIT_SUCCESS);
512 } else {
513 s2n_verify_child_exit_status(proc_id, random_test_cases[i].expected_return_status);
514 }
515 }
516
517 /* We are very paranoid when it comes to randomness. So, run the basic test
518 * set without using the fork infrastructure above.
519 */
520 EXPECT_EQUAL(random_test_cases[0].test_case_cb(&random_test_cases[0]), EXIT_SUCCESS);
521
522 END_TEST_NO_INIT();
523 }