summaryrefslogtreecommitdiff
path: root/libvirt/pool_sync_test.go
diff options
context:
space:
mode:
authorDario Maiocchi <dmaiocchi@suse.com>2017-11-20 22:58:08 +0100
committerAlvaro <alvaro.saurin@gmail.com>2017-11-22 16:41:34 +0100
commit88c0dfcca51f4d301810380dacd119a9f291417c (patch)
tree3cc1989971c79abf043da151d761f21eb3c67a7c /libvirt/pool_sync_test.go
parent61fe2db30a7bb1f953c147cf9abbc0447fea2fce (diff)
downloadterraform-provider-libvirt-88c0dfcca51f4d301810380dacd119a9f291417c.tar
terraform-provider-libvirt-88c0dfcca51f4d301810380dacd119a9f291417c.tar.gz
use poolMutexKV for locking resources.
Diffstat (limited to 'libvirt/pool_sync_test.go')
-rw-r--r--libvirt/pool_sync_test.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/libvirt/pool_sync_test.go b/libvirt/pool_sync_test.go
deleted file mode 100644
index 90ad4849..00000000
--- a/libvirt/pool_sync_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package libvirt
-
-import (
- "testing"
-)
-
-func TestAcquireLock(t *testing.T) {
- ps := NewLVirtPoolSync()
-
- ps.AcquireLock("test")
-
- _, found := ps.PoolLocks["test"]
-
- if !found {
- t.Errorf("lock not found")
- }
-}
-
-func TestReleaseLock(t *testing.T) {
- ps := NewLVirtPoolSync()
-
- ps.AcquireLock("test")
-
- _, found := ps.PoolLocks["test"]
- if !found {
- t.Errorf("lock not found")
- }
-
- ps.ReleaseLock("test")
- _, found = ps.PoolLocks["test"]
- if !found {
- t.Errorf("lock not found")
- }
-}
-
-func TestReleaseNotExistingLock(t *testing.T) {
- ps := NewLVirtPoolSync()
-
- ps.ReleaseLock("test")
- _, found := ps.PoolLocks["test"]
- if found {
- t.Errorf("lock found")
- }
- // moreover there should be no runtime error because
- // we are not trying to unlock a not-locked mutex
-}