Test locking