From acbceaf8216ec7eff0f6784ec8caa7459e12f300 Mon Sep 17 00:00:00 2001 From: 630445639 <630445639@qq.com> Date: Tue, 4 Jun 2019 13:08:22 +0800 Subject: [PATCH 1/2] Add test information in cli_version_test.go --- test/cli_version_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cli_version_test.go b/test/cli_version_test.go index 7a4c47bd1..2c7c99e1d 100644 --- a/test/cli_version_test.go +++ b/test/cli_version_test.go @@ -5,6 +5,7 @@ import ( "runtime" "strings" + "github.com/alibaba/pouch/pkg/kernel" "github.com/alibaba/pouch/test/command" "github.com/alibaba/pouch/test/environment" "github.com/alibaba/pouch/version" @@ -37,6 +38,16 @@ func (suite *PouchVersionSuite) TestPouchVersion(c *check.C) { c.Assert(kv["Arch"], check.Equals, runtime.GOARCH) c.Assert(kv["Os"], check.Equals, runtime.GOOS) c.Assert(kv["Version"], check.Equals, version.Version) + c.Assert(kv["BuildTime"], check.Equals, version.BuildTime) + c.Assert(kv["GitCommit"], check.Equals, version.GitCommit) + + kernelVersion := "" + kerVersion, err := kernel.GetKernelVersion() + if err != nil { + kernelVersion = kerVersion.String() + } + c.Assert(kv["KernelVersion"], check.Equals, kernelVersion) + } // versionToKV reads version string into key-value mapping. From b82435d8a831e8b5f4f926ac6d10250db103db18 Mon Sep 17 00:00:00 2001 From: 630445639 <630445639@qq.com> Date: Tue, 4 Jun 2019 16:33:29 +0800 Subject: [PATCH 2/2] Add test information in cli_version_test.go Signed-off-by: 630445639 <630445639@qq.com> --- test/cli_version_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/cli_version_test.go b/test/cli_version_test.go index 2c7c99e1d..af3564049 100644 --- a/test/cli_version_test.go +++ b/test/cli_version_test.go @@ -43,11 +43,10 @@ func (suite *PouchVersionSuite) TestPouchVersion(c *check.C) { kernelVersion := "" kerVersion, err := kernel.GetKernelVersion() - if err != nil { + if err == nil { kernelVersion = kerVersion.String() } c.Assert(kv["KernelVersion"], check.Equals, kernelVersion) - } // versionToKV reads version string into key-value mapping.