Files
OpenCellular/test/mutex.py
Vincent Palatin 47c740e0b2 mutex: add unit testing
Exercise all basic use cases on mutexes.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=make qemu-tests

Change-Id: I40de3ae59862db96b40a067c9ad54a978f5646b8
2012-01-25 18:23:48 +00:00

26 lines
756 B
Python

# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Mutexes test
#
def test(helper):
helper.wait_output("[Mutex main task")
# 3 locking in a row without contention
helper.wait_output("No contention :done.")
# serialization (simple contention)
helper.wait_output("Simple contention :")
helper.wait_output("MTX2: locking...done")
helper.wait_output("MTX1: blocking...")
helper.wait_output("MTX1: get lock")
# multiple contention
helper.wait_output("Massive locking/unlocking :")
#TODO check sequence
helper.wait_output("Test done.")
return True # PASS !