Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 1 | #include <inttypes.h> |
Philip Tricca | 09a5bcd | 2016-03-21 13:20:19 -0700 | [diff] [blame] | 2 | #include <stdbool.h> |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 3 | #include <stdio.h> |
Philip Tricca | 910f17c | 2018-03-15 12:38:37 -0700 | [diff] [blame] | 4 | #include <string.h> |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 5 | |
Philip Tricca | 09a5bcd | 2016-03-21 13:20:19 -0700 | [diff] [blame] | 6 | #include <setjmp.h> |
| 7 | #include <cmocka.h> |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 8 | |
Philip Tricca | 8ffd3c4 | 2018-03-09 16:27:24 -0800 | [diff] [blame] | 9 | #include "tss2_mu.h" |
| 10 | #include "tss2_tcti_device.h" |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 11 | |
| 12 | #include "tss2-tcti/tcti-common.h" |
| 13 | #include "tss2-tcti/tcti-device.h" |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 14 | |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 15 | /* |
| 16 | * Size of the TPM2 buffer used in these tests. In some cases this will be |
| 17 | * the command sent (transmit tests) and in others it's used as the response |
| 18 | * buffer returned by the TCTI. The only field used by the TCTI is the size |
| 19 | * field. |
| 20 | */ |
| 21 | #define BUF_SIZE 20 |
| 22 | static uint8_t tpm2_buf [BUF_SIZE] = { |
| 23 | 0x80, 0x02, /* TAG */ |
| 24 | 0x00, 0x00, 0x00, 0x14, /* size (BUF_SIZE) */ |
| 25 | 0x00, 0x00, 0x00, 0x00, /* rc (success) */ |
| 26 | 0xde, 0xad, 0xbe, 0xef, /* junk data */ |
| 27 | 0xca, 0xfe, 0xba, 0xbe, |
| 28 | 0xfe, 0xef |
| 29 | }; |
Philip Tricca | 467d63b | 2016-11-17 18:56:41 -0800 | [diff] [blame] | 30 | /** |
| 31 | * When passed all NULL values ensure that we get back the expected RC |
| 32 | * indicating bad values. |
| 33 | */ |
| 34 | static void |
| 35 | tcti_device_init_all_null_test (void **state) |
| 36 | { |
| 37 | TSS2_RC rc; |
| 38 | |
Philip Tricca | 1ae4cff | 2018-01-19 14:41:57 -0800 | [diff] [blame] | 39 | rc = Tss2_Tcti_Device_Init (NULL, NULL, NULL); |
Philip Tricca | 467d63b | 2016-11-17 18:56:41 -0800 | [diff] [blame] | 40 | assert_int_equal (rc, TSS2_TCTI_RC_BAD_VALUE); |
| 41 | } |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 42 | /* Determine the size of a TCTI context structure. Requires calling the |
| 43 | * initialization function for the device TCTI with the first parameter |
| 44 | * (the TCTI context) NULL. |
| 45 | */ |
Philip Tricca | ae884f5 | 2016-11-17 14:54:56 -0800 | [diff] [blame] | 46 | static void |
| 47 | tcti_device_init_size_test (void **state) |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 48 | { |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 49 | size_t tcti_size = 0; |
| 50 | TSS2_RC ret = TSS2_RC_SUCCESS; |
| 51 | |
Philip Tricca | 1ae4cff | 2018-01-19 14:41:57 -0800 | [diff] [blame] | 52 | ret = Tss2_Tcti_Device_Init (NULL, &tcti_size, NULL); |
Philip Tricca | ae884f5 | 2016-11-17 14:54:56 -0800 | [diff] [blame] | 53 | assert_int_equal (ret, TSS2_RC_SUCCESS); |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 54 | } |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 55 | /* wrap functions for read & write required to test receive / transmit */ |
| 56 | ssize_t |
Philip Tricca | 7a10ee3 | 2018-03-06 12:48:39 -0800 | [diff] [blame] | 57 | __wrap_read (int fd, void *buf, size_t count) |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 58 | { |
Philip Tricca | 7a10ee3 | 2018-03-06 12:48:39 -0800 | [diff] [blame] | 59 | ssize_t ret = mock_type (ssize_t); |
| 60 | uint8_t *buf_in = mock_type (uint8_t*); |
| 61 | |
| 62 | memcpy (buf, buf_in, ret); |
| 63 | return ret; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 64 | } |
| 65 | ssize_t |
| 66 | __wrap_write (int fd, const void *buffer, size_t buffer_size) |
| 67 | { |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 68 | ssize_t ret = mock_type (ssize_t); |
| 69 | uint8_t *buf_out = mock_type (uint8_t*); |
| 70 | |
| 71 | memcpy (buf_out, buffer, ret); |
| 72 | return ret; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 73 | } |
| 74 | |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 75 | /* Setup functions to create the context for the device TCTI */ |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 76 | static int |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 77 | tcti_device_setup (void **state) |
| 78 | { |
| 79 | size_t tcti_size = 0; |
| 80 | TSS2_RC ret = TSS2_RC_SUCCESS; |
| 81 | TSS2_TCTI_CONTEXT *ctx = NULL; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 82 | |
Philip Tricca | 1ae4cff | 2018-01-19 14:41:57 -0800 | [diff] [blame] | 83 | ret = Tss2_Tcti_Device_Init (NULL, &tcti_size, NULL); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 84 | assert_true (ret == TSS2_RC_SUCCESS); |
| 85 | ctx = calloc (1, tcti_size); |
| 86 | assert_non_null (ctx); |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 87 | ret = Tss2_Tcti_Device_Init (ctx, &tcti_size, "/dev/null"); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 88 | assert_true (ret == TSS2_RC_SUCCESS); |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 89 | |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 90 | *state = ctx; |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 91 | return 0; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 92 | } |
| 93 | |
Tadeusz Struk | 2147c49 | 2017-08-09 13:40:31 -0700 | [diff] [blame] | 94 | static int |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 95 | tcti_device_teardown (void **state) |
| 96 | { |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 97 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 98 | |
Andreas Fuchs | 930b5c1 | 2017-11-20 11:28:57 +0100 | [diff] [blame] | 99 | Tss2_Tcti_Finalize (ctx); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 100 | free (ctx); |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 101 | |
Tadeusz Struk | 2147c49 | 2017-08-09 13:40:31 -0700 | [diff] [blame] | 102 | return 0; |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 103 | |
| 104 | } |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 105 | /* |
Philip Tricca | caff754 | 2018-04-04 09:00:02 -0700 | [diff] [blame] | 106 | * This test ensures that the GetPollHandles function in the device TCTI |
| 107 | * returns the expected value. Since this TCTI does not support async I/O |
| 108 | * on account of limitations in the kernel it just returns the |
| 109 | * NOT_IMPLEMENTED response code. |
| 110 | */ |
| 111 | static void |
| 112 | tcti_device_get_poll_handles_test (void **state) |
| 113 | { |
| 114 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
| 115 | size_t num_handles = 5; |
| 116 | TSS2_TCTI_POLL_HANDLE handles [5] = { 0 }; |
| 117 | TSS2_RC rc; |
| 118 | |
| 119 | rc = Tss2_Tcti_GetPollHandles (ctx, handles, &num_handles); |
| 120 | assert_int_equal (rc, TSS2_TCTI_RC_NOT_IMPLEMENTED); |
| 121 | } |
| 122 | /* |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 123 | */ |
| 124 | static void |
| 125 | tcti_device_receive_null_size_test (void **state) |
| 126 | { |
| 127 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 128 | TSS2_TCTI_COMMON_CONTEXT *tcti_common = tcti_common_context_cast (ctx); |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 129 | TSS2_RC rc; |
| 130 | |
| 131 | /* Keep state machine check in `receive` from returning error. */ |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 132 | tcti_common->state = TCTI_STATE_RECEIVE; |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 133 | rc = Tss2_Tcti_Receive (ctx, |
| 134 | NULL, /* NULL 'size' parameter */ |
| 135 | NULL, |
| 136 | TSS2_TCTI_TIMEOUT_BLOCK); |
| 137 | assert_int_equal (rc, TSS2_TCTI_RC_BAD_REFERENCE); |
| 138 | rc = Tss2_Tcti_Receive (ctx, |
| 139 | NULL, /* NULL 'size' parameter */ |
| 140 | (uint8_t*)1, /* non-NULL buffer */ |
| 141 | TSS2_TCTI_TIMEOUT_BLOCK); |
| 142 | assert_int_equal (rc, TSS2_TCTI_RC_BAD_REFERENCE); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 143 | } |
| 144 | /* |
| 145 | * A test case for a successful call to the receive function. This requires |
| 146 | * that the context and the command buffer be valid (including the size |
| 147 | * field being set appropriately). The result should be an RC indicating |
| 148 | * success and the size parameter be updated to reflect the size of the |
| 149 | * data received. |
| 150 | */ |
| 151 | static void |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 152 | tcti_device_receive_success (void **state) |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 153 | { |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 154 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 155 | TSS2_TCTI_COMMON_CONTEXT *tcti_common = tcti_common_context_cast (ctx); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 156 | TSS2_RC rc; |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 157 | /* output buffer for response */ |
| 158 | uint8_t buf_out [BUF_SIZE + 5] = { 0 }; |
| 159 | size_t size = BUF_SIZE + 5; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 160 | |
Philip Tricca | fa14abe | 2018-03-05 21:14:54 -0800 | [diff] [blame] | 161 | /* Keep state machine check in `receive` from returning error. */ |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 162 | tcti_common->state = TCTI_STATE_RECEIVE; |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 163 | will_return (__wrap_read, BUF_SIZE); |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 164 | will_return (__wrap_read, tpm2_buf); |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 165 | rc = Tss2_Tcti_Receive (ctx, |
| 166 | &size, |
| 167 | buf_out, |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 168 | TSS2_TCTI_TIMEOUT_BLOCK); |
| 169 | assert_true (rc == TSS2_RC_SUCCESS); |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 170 | assert_int_equal (BUF_SIZE, size); |
| 171 | assert_memory_equal (tpm2_buf, buf_out, size); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 172 | } |
| 173 | /* |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 174 | * Ensure that when the 'read' results in an EOF, we get a response code |
| 175 | * indicating as much. EOF happens if / when the device driver kills our |
| 176 | * connection. |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 177 | */ |
| 178 | static void |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 179 | tcti_device_receive_eof_test (void **state) |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 180 | { |
| 181 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 182 | TSS2_TCTI_COMMON_CONTEXT *tcti_common = tcti_common_context_cast (ctx); |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 183 | TSS2_RC rc; |
| 184 | /* output buffer for response */ |
| 185 | uint8_t buf_out [BUF_SIZE + 5] = { 0 }; |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 186 | size_t size = BUF_SIZE + 5; |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 187 | |
| 188 | /* Keep state machine check in `receive` from returning error. */ |
Philip Tricca | 850bb59 | 2018-04-03 09:29:22 -0700 | [diff] [blame] | 189 | tcti_common->state = TCTI_STATE_RECEIVE; |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 190 | will_return (__wrap_read, 0); |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 191 | will_return (__wrap_read, tpm2_buf); |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 192 | rc = Tss2_Tcti_Receive (ctx, |
| 193 | &size, |
| 194 | buf_out, |
| 195 | TSS2_TCTI_TIMEOUT_BLOCK); |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 196 | assert_int_equal (rc, TSS2_TCTI_RC_NO_CONNECTION); |
| 197 | } |
| 198 | /* |
| 199 | * This is a weird test: The device TCTI can't read the header for the |
| 200 | * response buffer separately from the body. This means it can't know the size |
| 201 | * of the response before reading the whole thing. In the event that the caller |
| 202 | * provides a buffer that isn't large enough to hold the full response the TCTI |
| 203 | * will just read as much data as the buffer will hold. Subsequent interactions |
| 204 | * with the kernel driver will likely result in an error. |
| 205 | */ |
| 206 | static void |
| 207 | tcti_device_receive_buffer_lt_response (void **state) |
| 208 | { |
| 209 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
| 210 | TSS2_TCTI_COMMON_CONTEXT *tcti_common = tcti_common_context_cast (ctx); |
| 211 | TSS2_RC rc; |
| 212 | uint8_t buf_out [BUF_SIZE] = { 0 }; |
| 213 | /* set size to lt the size in the header of the TPM2 response buffer */ |
| 214 | size_t size = BUF_SIZE - 1; |
| 215 | |
| 216 | /* Keep state machine check in `receive` from returning error. */ |
| 217 | tcti_common->state = TCTI_STATE_RECEIVE; |
| 218 | will_return (__wrap_read, size); |
| 219 | will_return (__wrap_read, tpm2_buf); |
| 220 | rc = Tss2_Tcti_Receive (ctx, |
| 221 | &size, |
| 222 | buf_out, |
| 223 | TSS2_TCTI_TIMEOUT_BLOCK); |
| 224 | assert_int_equal (rc, TSS2_TCTI_RC_GENERAL_FAILURE); |
Philip Tricca | 83a7df1 | 2018-03-27 08:11:44 -0700 | [diff] [blame] | 225 | } |
| 226 | /* |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 227 | * A test case for a successful call to the transmit function. This requires |
| 228 | * that the context and the cmmand buffer be valid. The only indication of |
| 229 | * success is the RC. |
| 230 | */ |
| 231 | static void |
| 232 | tcti_device_transmit_success (void **state) |
| 233 | { |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 234 | TSS2_TCTI_CONTEXT *ctx = (TSS2_TCTI_CONTEXT*)*state; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 235 | TSS2_RC rc; |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 236 | /* output buffer for response */ |
| 237 | uint8_t buf_out [BUF_SIZE] = { 0 }; |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 238 | |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 239 | will_return (__wrap_write, BUF_SIZE); |
| 240 | will_return (__wrap_write, buf_out); |
| 241 | rc = Tss2_Tcti_Transmit (ctx, |
| 242 | BUF_SIZE, |
| 243 | tpm2_buf); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 244 | assert_true (rc == TSS2_RC_SUCCESS); |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 245 | assert_memory_equal (tpm2_buf, buf_out, BUF_SIZE); |
Philip Tricca | 8e5afda | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 246 | } |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 247 | |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 248 | int |
| 249 | main(int argc, char* argv[]) |
| 250 | { |
Tadeusz Struk | 2147c49 | 2017-08-09 13:40:31 -0700 | [diff] [blame] | 251 | const struct CMUnitTest tests[] = { |
| 252 | cmocka_unit_test (tcti_device_init_all_null_test), |
| 253 | cmocka_unit_test(tcti_device_init_size_test), |
Philip Tricca | caff754 | 2018-04-04 09:00:02 -0700 | [diff] [blame] | 254 | cmocka_unit_test_setup_teardown (tcti_device_get_poll_handles_test, |
| 255 | tcti_device_setup, |
| 256 | tcti_device_teardown), |
Philip Tricca | 25789b2 | 2018-03-07 15:23:47 -0800 | [diff] [blame] | 257 | cmocka_unit_test_setup_teardown (tcti_device_receive_null_size_test, |
| 258 | tcti_device_setup, |
| 259 | tcti_device_teardown), |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 260 | cmocka_unit_test_setup_teardown (tcti_device_receive_success, |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 261 | tcti_device_setup, |
| 262 | tcti_device_teardown), |
Philip Tricca | 7ce0cc4 | 2018-04-08 18:41:05 -0700 | [diff] [blame] | 263 | cmocka_unit_test_setup_teardown (tcti_device_receive_eof_test, |
| 264 | tcti_device_setup, |
| 265 | tcti_device_teardown), |
| 266 | cmocka_unit_test_setup_teardown (tcti_device_receive_buffer_lt_response, |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 267 | tcti_device_setup, |
| 268 | tcti_device_teardown), |
Tadeusz Struk | 2147c49 | 2017-08-09 13:40:31 -0700 | [diff] [blame] | 269 | cmocka_unit_test_setup_teardown (tcti_device_transmit_success, |
Philip Tricca | 0b87044 | 2018-03-26 14:27:28 -0700 | [diff] [blame] | 270 | tcti_device_setup, |
| 271 | tcti_device_teardown), |
Philip Tricca | 097cae6 | 2018-04-08 13:42:29 -0700 | [diff] [blame] | 272 | cmocka_unit_test_setup_teardown (tcti_device_transmit_success, |
| 273 | tcti_device_setup, |
| 274 | tcti_device_teardown), |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 275 | }; |
Tadeusz Struk | 2147c49 | 2017-08-09 13:40:31 -0700 | [diff] [blame] | 276 | return cmocka_run_group_tests (tests, NULL, NULL); |
Philip Tricca | a7d2e2c | 2016-11-17 14:47:21 -0800 | [diff] [blame] | 277 | } |