Merge pull request #33 from sanjeevm0/master

Move test file to gpuschedulerplugin
This commit is contained in:
sanjeevm0 2018-06-22 16:42:24 -07:00 коммит произвёл GitHub
Родитель ed8bdd6ad2 224a293438
Коммит b7ffbcd169
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -1,4 +1,4 @@
package device
package gpuschedulerplugin
// to test: run
// go test --args -log_dir=/home/sanjeevm/logs -v=10
@ -14,8 +14,8 @@ import (
"strings"
"testing"
"github.com/Microsoft/KubeGPU/device-scheduler/device"
"github.com/Microsoft/KubeGPU/device-scheduler/grpalloc"
gpuscheduler "github.com/Microsoft/KubeGPU/gpuschedulerplugin"
"github.com/Microsoft/KubeGPU/types"
"github.com/Microsoft/KubeGPU/utils"
"github.com/golang/glog"
@ -211,7 +211,7 @@ func translatePod(node *types.NodeInfo, podEx *PodEx) {
}
}
func sampleTest(ds *DevicesScheduler, pod *types.PodInfo, podEx *PodEx, nodeInfo *types.NodeInfo, testCnt int) {
func sampleTest(ds *device.DevicesScheduler, pod *types.PodInfo, podEx *PodEx, nodeInfo *types.NodeInfo, testCnt int) {
//fmt.Printf("Node: %v\n", nodeInfo)
//fmt.Printf("Pod: %v\n", pod)
// now perform allocation
@ -292,7 +292,7 @@ func testPodResourceUsage(t *testing.T, pod *types.PodInfo, nodeInfo *types.Node
}
}
func testPodAllocs(t *testing.T, ds *DevicesScheduler, pod *types.PodInfo, podEx *PodEx, nodeInfo *types.NodeInfo, testCnt int) {
func testPodAllocs(t *testing.T, ds *device.DevicesScheduler, pod *types.PodInfo, podEx *PodEx, nodeInfo *types.NodeInfo, testCnt int) {
//fmt.Printf("=====TESTING CNT %d======", testCnt)
//fmt.Printf("Node: %v\n", nodeInfo)
//fmt.Printf("Pod: %v\n", pod)
@ -324,10 +324,10 @@ func testPodAllocs(t *testing.T, ds *DevicesScheduler, pod *types.PodInfo, podEx
func TestGrpAllocate1(t *testing.T) {
// create a translator & translate
device := &gpuscheduler.NvidiaGPUScheduler{}
DeviceScheduler.AddDevice(device)
dev := &NvidiaGPUScheduler{}
device.DeviceScheduler.AddDevice(dev)
//DeviceScheduler.CreateAndAddDeviceScheduler("nvidiagpu")
ds := DeviceScheduler
ds := device.DeviceScheduler
//gpusched := &nvidia.NvidiaGPUScheduler{}
//ds.Devices = append(ds.Devices, gpusched)
@ -550,5 +550,7 @@ func TestGrpAllocate1(t *testing.T) {
//sampleTest(pod, podEx, nodeInfo, testCnt)
testPodAllocs(t, ds, pod, podEx, nodeInfo, testCnt)
fmt.Printf("======\nGroup allocate test complete\n========\n")
glog.Flush()
}