Add log lines to debug test

pull/5085/head
josedonizetti 2019-09-10 20:52:10 -03:00
parent f22a8ce4f2
commit 219109c98e
2 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package drivers
import (
"fmt"
"io"
"io/ioutil"
"os"
@ -153,7 +154,8 @@ func fixPermissions(path string) error {
// InstallOrUpdate downloads driver if it is not present, or updates it if there's a newer version
func InstallOrUpdate(driver, destination string, minikubeVersion semver.Version) error {
_, err := exec.LookPath(driver)
path, err := exec.LookPath(driver)
fmt.Printf("IntallOrUpdate: found driver at %s\n", path)
// if file driver doesn't exist, download it
if err != nil {
return download(driver, destination)
@ -168,6 +170,8 @@ func InstallOrUpdate(driver, destination string, minikubeVersion semver.Version)
v := ExtractVMDriverVersion(string(output))
fmt.Printf("IntallOrUpdate: extracted version: %s minikube version: %s\n", v, minikubeVersion.String())
// if the driver doesn't return any version, download it
if len(v) == 0 {
return download(driver, destination)

View File

@ -53,12 +53,15 @@ func TestDriverInstallOrUpdate(t *testing.T) {
}
defer os.RemoveAll(dir)
fmt.Printf("InstallOrUpdate temp dir: %s\n", dir)
_, err = os.Stat(filepath.Join(tc.path, "docker-machine-driver-kvm2"))
if err != nil {
t.Fatalf("Expected driver to exist. test: %s, got: %v", tc.name, err)
}
os.Setenv("PATH", fmt.Sprintf("%s:%s", tc.path, os.Getenv("PATH")))
fmt.Printf("InstallOrUpdate PATH: %s\n", os.Getenv("PATH"))
newerVersion, err := semver.Make("1.1.3")
if err != nil {