remove logf to clean up tests output
This commit is contained in:
parent
5855283d24
commit
75e6d3240f
10 changed files with 4 additions and 26 deletions
|
|
@ -17,17 +17,13 @@ func TestGetDisks(t *testing.T) {
|
|||
if len(disks) < 1 {
|
||||
t.Errorf("Could not get disks")
|
||||
}
|
||||
|
||||
t.Logf("Result: %v", disks)
|
||||
}
|
||||
|
||||
func TestSystemRebootRequired(t *testing.T) {
|
||||
result, err := a.SystemRebootRequired()
|
||||
_, err := a.SystemRebootRequired()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
t.Logf("Result: %t", result)
|
||||
}
|
||||
|
||||
func TestLoggedOnUser(t *testing.T) {
|
||||
|
|
@ -35,6 +31,4 @@ func TestLoggedOnUser(t *testing.T) {
|
|||
if result == "" {
|
||||
t.Errorf("Could not get logged on user.")
|
||||
}
|
||||
|
||||
t.Logf("Result: %s", result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ func TestGetDisks(t *testing.T) {
|
|||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := disk.GetDisks()
|
||||
t.Logf("Result: (%v)", result)
|
||||
if fmt.Sprintf("%T", result) != "[]disk.Disk" {
|
||||
t.Errorf("expected type %T, got type %T", tt.expected, result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ func TestPublicIP(t *testing.T) {
|
|||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := network.PublicIP(tt.proxy)
|
||||
t.Logf("result: (%v)", result)
|
||||
if result != tt.expected {
|
||||
t.Errorf("expected %s, got %s", tt.expected, result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ func TestGetUpdates(t *testing.T) {
|
|||
|
||||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := patching.GetUpdates()
|
||||
t.Logf("result: (%v)", result)
|
||||
_, err := patching.GetUpdates()
|
||||
if !errors.Is(tt.expectedError, err) {
|
||||
t.Errorf("expected (%v), got (%v)", tt.expectedError, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ func TestGetInstalledSoftware(t *testing.T) {
|
|||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := software.GetInstalledSoftware()
|
||||
t.Logf("result: (%v)", result)
|
||||
if len(result) < tt.atLeast {
|
||||
t.Errorf("expected at least %d, got %d", tt.atLeast, len(result))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,4 @@ func TestRunScript(t *testing.T) {
|
|||
if exitcode != 0 {
|
||||
t.Fatalf("Error: Exit Code %d", exitcode)
|
||||
}
|
||||
|
||||
t.Logf("Result: %s", stdout)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func TestRunScript(t *testing.T) {
|
||||
stdout, stderr, exitcode, err := system.RunScript("#!/bin/sh\ncat /etc/os-release", "/bin/sh", nil, 30)
|
||||
_, stderr, exitcode, err := system.RunScript("#!/bin/sh\ncat /etc/os-release", "/bin/sh", nil, 30)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -22,6 +22,4 @@ func TestRunScript(t *testing.T) {
|
|||
if exitcode != 0 {
|
||||
t.Fatalf("Error: Exit Code %d", exitcode)
|
||||
}
|
||||
|
||||
t.Logf("Result: %s", stdout)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ func TestSystemRebootRequired(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
t.Logf("System Reboot Required %t", required)
|
||||
}
|
||||
|
||||
func TestShowStatus(t *testing.T) {
|
||||
|
|
@ -41,8 +39,6 @@ func TestLoggedOnUser(t *testing.T) {
|
|||
if user == "" {
|
||||
t.Fatalf("Expected a user, got empty")
|
||||
}
|
||||
|
||||
t.Logf("Logged on user: %s", user)
|
||||
}
|
||||
|
||||
func TestOsString(t *testing.T) {
|
||||
|
|
@ -50,6 +46,4 @@ func TestOsString(t *testing.T) {
|
|||
if osString == "error getting host info" {
|
||||
t.Fatalf("Unable to get OS string")
|
||||
}
|
||||
|
||||
t.Logf("OS String: %s", osString)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ func TestGetInfo(t *testing.T) {
|
|||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, _ := umi.GetInfo()
|
||||
t.Logf("result: (%v)", result)
|
||||
if len(result) < tt.atLeast {
|
||||
t.Errorf("expected at least %d, got %d", tt.atLeast, len(result))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ func TestByteCountSI(t *testing.T) {
|
|||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := utils.ByteCountSI(tt.bytes)
|
||||
t.Logf("result: (%v)", result)
|
||||
if result != tt.expected {
|
||||
t.Errorf("expected %s, got %s", tt.expected, result)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue