diff --git a/tests/internal/cluster/cluster.go b/tests/internal/cluster/cluster.go index 04f9c6b2..4750ab57 100644 --- a/tests/internal/cluster/cluster.go +++ b/tests/internal/cluster/cluster.go @@ -3,10 +3,10 @@ package cluster import ( "errors" "fmt" - "log" "os" "strings" + "github.com/golang/glog" "github.com/openshift-kni/eco-goinfra/pkg/clients" "github.com/openshift-kni/eco-goinfra/pkg/clusterversion" @@ -56,7 +56,7 @@ func GetClusterName(kubeconfigEnvVar string) (string, error) { clusterName := splits[1] - log.Println("cluster name: ", clusterName) + glog.V(100).Infof("cluster name: ", clusterName) return clusterName, nil } @@ -84,7 +84,7 @@ func GetClusterVersion(apiClient *clients.Settings) (string, error) { } } - log.Println("Warning: No completed version found in clusterversion. Returning desired version") + glog.V(100).Infof("Warning: No completed version found in clusterversion. Returning desired version") return clusterVersion.Object.Status.Desired.Version, nil } diff --git a/tests/ranfunc/powermanagement/internal/powermanagementhelper/powermanagementhelper.go b/tests/ranfunc/powermanagement/internal/powermanagementhelper/powermanagementhelper.go index 40a670dc..1de54271 100644 --- a/tests/ranfunc/powermanagement/internal/powermanagementhelper/powermanagementhelper.go +++ b/tests/ranfunc/powermanagement/internal/powermanagementhelper/powermanagementhelper.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "log" "math" "os" "regexp" @@ -342,7 +341,7 @@ func CollectPowerUsageMetrics(duration, samplingInterval time.Duration, scenario return nil, err } - log.Printf("Power usage test started: %v\nPower usage test ended: %v\n", startTime, time.Now()) + glog.V(100).Infof("Power usage test started: %v\nPower usage test ended: %v\n", startTime, time.Now()) if len(powerMeasurements) < 1 { return nil, errors.New("no power usage metrics were retrieved") @@ -356,7 +355,7 @@ func CollectPowerUsageMetrics(duration, samplingInterval time.Duration, scenario func GetHostPowerUsage(nodeName string) (map[string]float64, error) { user, password, hosts := ParseBmcInfo(inittools.GeneralConfig) if len(hosts) > 1 { - log.Printf("multiple hosts detected, only using %s\n", hosts[0]) + glog.V(100).Infof("multiple hosts detected, only using %s\n", hosts[0]) } subcommands := []string{"dcmi", "power", "reading"} @@ -524,7 +523,7 @@ func CollectPowerMetricsWithSteadyWorkload(duration, samplingInterval time.Durat return nil, errors.New("not enough stress-ng pods to run test") } - log.Printf("Wait for %s for %s scenario\n", duration.String(), scenario) + glog.V(100).Infof("Wait for %s for %s scenario\n", duration.String(), scenario) result, err := CollectPowerUsageMetrics(duration, samplingInterval, scenario, tag, snoNode.Name) // Delete stress-ng pods. @@ -545,7 +544,7 @@ func DeployStressNgPods(stressNgCPUCount, stressngMaxPodCount int, node *corev1. var err error // Create and wait for stress-ng pods to be Ready - log.Printf("Creating up to %d stress-ng pods with total %d cpus", stressngMaxPodCount, stressNgCPUCount) + glog.V(100).Infof("Creating up to %d stress-ng pods with total %d cpus", stressngMaxPodCount, stressNgCPUCount) stressngPods := []*pod.Builder{} @@ -558,7 +557,7 @@ func DeployStressNgPods(stressNgCPUCount, stressngMaxPodCount int, node *corev1. } WaitForPodsHealthy(stressngPods, 20*time.Minute) - log.Printf("%d stress-ng pods with total %d cpus are created and running", len(stressngPods), stressNgCPUCount) + glog.V(100).Infof("%d stress-ng pods with total %d cpus are created and running", len(stressngPods), stressNgCPUCount) return stressngPods } diff --git a/tests/ranfunc/talm/internal/talmhelper/talmhelper.go b/tests/ranfunc/talm/internal/talmhelper/talmhelper.go index a1d24759..9ec10fcd 100644 --- a/tests/ranfunc/talm/internal/talmhelper/talmhelper.go +++ b/tests/ranfunc/talm/internal/talmhelper/talmhelper.go @@ -628,9 +628,6 @@ func FilterMissingResourceErrors(err error) error { return nil } - // Reduce logging until we can have different log levels in future project - // log.Printf("Checking error '%s'", err.Error()) - if strings.Contains(err.Error(), "server could not find the requested resource") { return nil }