Don't block on sudo during integration test

pull/7896/head
Thomas Stromberg 2020-04-29 09:46:45 -07:00
parent e9bf83d5f0
commit 3bcfebf8c9
1 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"testing"
@ -147,7 +148,11 @@ func TestHyperKitDriverInstallOrUpdate(t *testing.T) {
t.Fatalf("Expected new semver. test: %v, got: %v", tc.name, err)
}
err = driver.InstallOrUpdate("hyperkit", dir, newerVersion, true, true)
if err := exec.Command("sudo", "-n", "ls").Run(); err != nil {
t.Skipf("password required to execute 'ls', skipping remaining test: %v", err)
}
err = driver.InstallOrUpdate("hyperkit", dir, newerVersion, false, true)
if err != nil {
t.Fatalf("Failed to update driver to %v. test: %s, got: %v", newerVersion, tc.name, err)
}