diff options
| author | Andrew Jeffery <andrew@aj.id.au> | 2018-08-07 14:10:54 +0930 |
|---|---|---|
| committer | Andrew Jeffery <andrew@aj.id.au> | 2018-09-05 17:44:24 +0930 |
| commit | b5685b3824524bc9cc768a6140eab4eb2b625a69 (patch) | |
| tree | f3b3837596e6a888efc10081e911d919b353fafe /test | |
| parent | 939bd3882ec9696de4eaaf7c66a3a76935155014 (diff) | |
| download | phosphor-mboxbridge-b5685b3824524bc9cc768a6140eab4eb2b625a69.tar.gz phosphor-mboxbridge-b5685b3824524bc9cc768a6140eab4eb2b625a69.zip | |
test: bmc_event_ack_v2 must negotiate v2
The test checks for a v2-specific masking behaviour of the BMC status
byte. Ensure we have v2 before assuming v2 semantics.
Change-Id: I9791b000b8f11db4ccc34af6da554aea2139a732
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'test')
| -rw-r--r-- | test/bmc_event_ack_v2.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/test/bmc_event_ack_v2.c b/test/bmc_event_ack_v2.c index 3d4cffd..627309c 100644 --- a/test/bmc_event_ack_v2.c +++ b/test/bmc_event_ack_v2.c @@ -15,11 +15,18 @@ #define FLAGS 0xc3 +static const uint8_t get_info[] = { + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + static const uint8_t command[] = { 0x09, 0xaa, FLAGS, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, FLAGS }; +uint8_t data[3] = { 0xaa, 0x55, 0xaa }; + #define MEM_SIZE 3 #define ERASE_SIZE 1 #define N_WINDOWS 1 @@ -36,6 +43,11 @@ int main(void) system_set_mtd_sizes(MEM_SIZE, ERASE_SIZE); ctx = mbox_create_test_context(N_WINDOWS, WINDOW_SIZE); + rc = mbox_set_mtd_data(ctx, data, sizeof(data)); + assert(rc == 0); + + rc = mbox_command_dispatch(ctx, get_info, sizeof(get_info)); + assert(rc == 1); set_bmc_events(ctx, FLAGS, SET_BMC_EVENT); @@ -45,14 +57,12 @@ int main(void) rc = fstat(ctx->fds[MBOX_FD].fd, &details); assert(rc == 0); - assert(details.st_size == 16); - map = mmap(NULL, details.st_size, PROT_READ, MAP_PRIVATE, ctx->fds[MBOX_FD].fd, 0); assert(map != MAP_FAILED); - if (map[15] != 0xc0) - return -1; + assert(details.st_size >= 16); + assert(map[15] == 0xc0); - return rc; + return 0; } |

