Skip to content

Commit

Permalink
Fix: block device test fails searching for loop dev
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Pablo Chacin committed Mar 24, 2020
1 parent c2b6ef5 commit f8f4cfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libvirt/resource_libvirt_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f8f4cfa

Please sign in to comment.