zephyr: tests: Fix lid_switch before and after routines
zephyr: tests: Fix lid_switch before and after routines

Before test suite make sure that chipset is set to S0 to prevent chipset
startup tasks from running in the middle of the test case. Powering on
may be unintentionally started by opening lid. Chipset startup tasks may
strave lid_change_deffered() for long period of time.

Before test case lid open and close is issued to make sure that next lid
change will trigger interrupt. It is important after manipulating state
of lid through command. Interrupt is triggered only when lid PIN change
level, so without changing PIN state back and forth it is impossible to
sync internal EC lid state with lid PIN state.

Cleanup function shouldn't use zassert and zassume API.

BUG=b:239914476
TEST=zmake -D test test-drivers
BRANCH=None

Signed-off-by: Tomasz Michalec <a547db31280d14f095c760a23a7523d0b1e55fe6@semihalf.com>
Change-Id: Ia8740092c2a87ce1e8c30610b812ec1e5b95b87f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3779742
Reviewed-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@chromium.org>
Commit-Queue: Tomasz Michalec <c064a6042954d4ba0805003dc021b76413ff1548@google.com>
Tested-by: Tomasz Michalec <c064a6042954d4ba0805003dc021b76413ff1548@google.com>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec