Don't block on sudo during integration test
parent
e9bf83d5f0
commit
3bcfebf8c9
|
@ -20,6 +20,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -147,7 +148,11 @@ func TestHyperKitDriverInstallOrUpdate(t *testing.T) {
|
||||||
t.Fatalf("Expected new semver. test: %v, got: %v", tc.name, err)
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("Failed to update driver to %v. test: %s, got: %v", newerVersion, tc.name, err)
|
t.Fatalf("Failed to update driver to %v. test: %s, got: %v", newerVersion, tc.name, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue