test_astlpc: Fix OBF flag behaviour in emulated KCS status byte

The implementation wasn't properly respecting the RW0C (read,
write-zero-clear) behaviour of the OBF bit on the BMC side. Maintain the
set state of the bit if the new status value has its bit set and clear
it otherwise, but don't blindly apply the bit state of the new status
value to OBF.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If16570dd0f35f27187fc9f9edb73ba5e48c4949f
diff --git a/tests/test_astlpc.c b/tests/test_astlpc.c
index 5cee355..16e1ca5 100644
--- a/tests/test_astlpc.c
+++ b/tests/test_astlpc.c
@@ -65,7 +65,7 @@
 		mmio->kcs[MCTP_ASTLPC_KCS_REG_STATUS] |= KCS_STATUS_OBF;
 
 	if (reg == MCTP_ASTLPC_KCS_REG_STATUS)
-		mmio->kcs[reg] = val & ~0xaU;
+		mmio->kcs[reg] = (val & ~0xbU) | (val & mmio->kcs[reg] & 1);
 	else
 		mmio->kcs[reg] = val;
 
@@ -131,6 +131,8 @@
 
 	memset(&msg[0], 0x5a, MCTP_BTU);
 	memset(&msg[MCTP_BTU], 0xa5, MCTP_BTU);
+	mmio.kcs[MCTP_ASTLPC_KCS_REG_STATUS] = 0;
+	mmio.kcs[MCTP_ASTLPC_KCS_REG_DATA] = 0;
 
 	mmio.lpc_size = 1 * 1024 * 1024;
 	mmio.lpc = calloc(1, mmio.lpc_size);