Let secondary VM run until it is waiting for a message.
Bug: 117270899
Change-Id: I5c72080737ab1f9468b136d7e6e59316b7031d81
diff --git a/test/vmapi/primary_with_secondaries.c b/test/vmapi/primary_with_secondaries.c
index 621e713..0570af9 100644
--- a/test/vmapi/primary_with_secondaries.c
+++ b/test/vmapi/primary_with_secondaries.c
@@ -416,10 +416,12 @@
0);
EXPECT_EQ(hf_mailbox_clear(), 0);
+ run_res = hf_vcpu_run(INTERRUPTIBLE_VM_ID, 0);
+ EXPECT_EQ(run_res.code, HF_VCPU_RUN_WAIT_FOR_INTERRUPT);
+
/* Now send a message to the secondary. */
memcpy(send_page, message, sizeof(message));
- EXPECT_EQ(hf_mailbox_send(INTERRUPTIBLE_VM_ID, sizeof(message)),
- HF_INVALID_VCPU);
+ EXPECT_EQ(hf_mailbox_send(INTERRUPTIBLE_VM_ID, sizeof(message)), 0);
run_res = hf_vcpu_run(INTERRUPTIBLE_VM_ID, 0);
EXPECT_EQ(run_res.code, HF_VCPU_RUN_MESSAGE);
EXPECT_EQ(run_res.message.size, sizeof(expected_response_2));