From 2287b035c81fc1a7de7b3fc52f07fc02dc04dc35 Mon Sep 17 00:00:00 2001 From: Alexey Galkin Date: Fri, 3 Mar 2017 16:28:49 +0400 Subject: [PATCH] Add new test 'TestHostGuid' For issue: https://github.com/shirou/gopsutil/issues/322 --- host/host_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/host/host_test.go b/host/host_test.go index 8456d22..53c3fa8 100644 --- a/host/host_test.go +++ b/host/host_test.go @@ -91,3 +91,15 @@ func TestUserStat_String(t *testing.T) { t.Errorf("UserStat string is invalid: %v", v) } } + +func TestHostGuid(t *testing.T) { + hi, err := host.Info() + if err != nil { + t.Error(err) + } + if hi.HostID == "" { + t.Error("Host id is empty") + } else { + t.Logf("Host id value: %v", hi.HostID) + } +}