From 7af8e6c6416944e5c7685eb5c0eb50ebc7073e89 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Tue, 4 Sep 2018 22:57:34 +0800 Subject: [PATCH] ut: fix hypervisor path Otherwise UT fails when there is no file at defaultHypervisorPath. Signed-off-by: Peng Tao --- cli/config_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/config_test.go b/cli/config_test.go index 7e3d29d000..75d2309708 100644 --- a/cli/config_test.go +++ b/cli/config_test.go @@ -469,6 +469,8 @@ func TestMinimalRuntimeConfig(t *testing.T) { shimPath := path.Join(dir, "shim") proxyPath := path.Join(dir, "proxy") + hypervisorPath := path.Join(dir, "hypervisor") + defaultHypervisorPath = hypervisorPath runtimeMinimalConfig := ` # Runtime configuration file @@ -503,6 +505,11 @@ func TestMinimalRuntimeConfig(t *testing.T) { t.Error(err) } + err = createEmptyFile(hypervisorPath) + if err != nil { + t.Error(err) + } + _, config, err = loadConfiguration(configPath, false) if err != nil { t.Fatal(err)