manually fix unit tests

This commit is contained in:
Chao Xu
2017-06-09 16:41:54 -07:00
parent 847b048fa0
commit 945593d4de
4 changed files with 25 additions and 23 deletions

View File

@@ -19,11 +19,12 @@ package qos
import (
"testing"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/helper/qos"
"k8s.io/api/core/v1"
k8sv1 "k8s.io/kubernetes/pkg/api/v1"
)
func TestGetPodQOS(t *testing.T) {
@@ -137,7 +138,7 @@ func TestGetPodQOS(t *testing.T) {
// Convert v1.Pod to api.Pod, and then check against `api.helper.GetPodQOS`.
pod := api.Pod{}
v1.Convert_v1_Pod_To_api_Pod(testCase.pod, &pod, nil)
k8sv1.Convert_v1_Pod_To_api_Pod(testCase.pod, &pod, nil)
if actual := qos.GetPodQOS(&pod); api.PodQOSClass(testCase.expected) != actual {
t.Errorf("[%d]: invalid qos pod %s, expected: %s, actual: %s", id, testCase.pod.Name, testCase.expected, actual)