1710N/A# The contents of this file are subject to the terms of the 1710N/A# Common Development and Distribution License (the "License"). 1710N/A# You may not use this file except in compliance with the License. 1710N/A# See the License for the specific language governing permissions 1710N/A# and limitations under the License. 1710N/A# When distributing Covered Code, include this CDDL HEADER in each 1710N/A# If applicable, add the following below this CDDL HEADER, with the 1710N/A# fields enclosed by brackets "[]" replaced with your own identifying 1710N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3339N/A# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. 1710N/A # restart the depot for every test 1710N/A """Verify that a locked image cannot be modified if it is 1710N/A already locked and that the API will raise an appropriate 1710N/A # Get an image object and tests its manual lock mechanism. 1710N/A # Verify a lock file is created and is not zero size. 1710N/A # Verify attempting to re-lock when locked fails. 1710N/A # Verify lock file still exists on failure. 1710N/A # Verify that an API function will fail the same way. 1710N/A # Now verify that after unlocking the image that it will work. 1710N/A # Verify that after unlock, lock file still exists, but is 1710N/A # Verify that if a state change occurs at any point after 1710N/A # planning before a plan successfully executes, that an 1710N/A # InvalidPlanError will be raised. 1710N/A # Both of these should succeed since no state change exists yet. 1710N/A # Now verify preparing second plan fails since first has changed 1710N/A # Prepare second and first plan. 1710N/A # Execute second plan, which should mean that the first can't 1710N/A # execute due to state change since plan was created. 1710N/A """Verify that image locking works across processes.""" 1710N/A # Get an image object and tests its manual lock mechanism. 1710N/A # Verify a lock file is created. 1710N/A # Verify attempting to re-lock when lock fails. 1710N/A # Verify that the pkg process will fail if the image is locked. 1710N/A # Now verify that after unlocking the image that it will work. 1710N/A # Now plan an uninstall using the API object. 1710N/A # Execute the client to actually uninstall the package, and then 1710N/A # attempt to execute the plan which should fail since the image 1710N/A # state has changed since the plan was created. 3065N/A on lock file, the lock file is not a symlink.""" 3065N/A # Get an image object and tests its manual lock mechanism. 3065N/A # Verify a lock file is created. 3065N/A # Make lock file a symlink by pointing it to a random file . 3065N/A # Verify that both pkg install and refresh generate an error 3065N/A # if the lock file is a symlink.