file locking and test script