|
|
|
|
@ -279,7 +279,27 @@ func TestBackendStateForceUnlock(t *testing.T, b1, b2 Backend) {
|
|
|
|
|
testLocks(t, b1, b2, true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TestBackendStateLocksInWS will test the locking functionality of the remote
|
|
|
|
|
// state backend.
|
|
|
|
|
func TestBackendStateLocksInWS(t *testing.T, b1, b2 Backend, ws string) {
|
|
|
|
|
t.Helper()
|
|
|
|
|
testLocksInWorkspace(t, b1, b2, false, ws)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TestBackendStateForceUnlockInWS verifies that the lock error is the expected
|
|
|
|
|
// type, and the lock can be unlocked using the ID reported in the error.
|
|
|
|
|
// Remote state backends that support -force-unlock should call this in at
|
|
|
|
|
// least one of the acceptance tests.
|
|
|
|
|
func TestBackendStateForceUnlockInWS(t *testing.T, b1, b2 Backend, ws string) {
|
|
|
|
|
t.Helper()
|
|
|
|
|
testLocksInWorkspace(t, b1, b2, true, ws)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testLocks(t *testing.T, b1, b2 Backend, testForceUnlock bool) {
|
|
|
|
|
testLocksInWorkspace(t, b1, b2, testForceUnlock, DefaultStateName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testLocksInWorkspace(t *testing.T, b1, b2 Backend, testForceUnlock bool, workspace string) {
|
|
|
|
|
t.Helper()
|
|
|
|
|
|
|
|
|
|
// Get the default state for each
|
|
|
|
|
|