From f8f4cfabba6cc5cd4e5d296d20d4b4afbaaab482 Mon Sep 17 00:00:00 2001 From: Pablo Chacin Date: Tue, 24 Mar 2020 20:27:17 +0100 Subject: [PATCH] Fix: block device test fails searching for loop dev Test TestAccLibvirtDomain_BlockDevice fails searching for available loop device because the command /sbin/losetup --find is not executed as root. Signed-off-by: Pablo Chacin --- libvirt/resource_libvirt_domain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt/resource_libvirt_domain_test.go b/libvirt/resource_libvirt_domain_test.go index b10aec48b..0160c90da 100644 --- a/libvirt/resource_libvirt_domain_test.go +++ b/libvirt/resource_libvirt_domain_test.go @@ -1278,7 +1278,7 @@ func createTempBlockDev(devname string) (string, string, error) { } // Find an available loop device - cmd = exec.Command("/sbin/losetup", "--find") + cmd = exec.Command("sudo", "/sbin/losetup", "--find") loopdevStr, err := cmd.Output() fmt.Printf("Executing command: %s\n", strings.Join(cmd.Args, " ")) if err != nil {