mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
integration: migrate plugings tests
This commit is contained in:
parent
69acad2c15
commit
6a64e24cfa
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package scheduler
|
package filters
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -36,6 +36,20 @@ import (
|
|||||||
"k8s.io/utils/pointer"
|
"k8s.io/utils/pointer"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
createPausePod = testutils.CreatePausePod
|
||||||
|
initPausePod = testutils.InitPausePod
|
||||||
|
getPod = testutils.GetPod
|
||||||
|
deletePod = testutils.DeletePod
|
||||||
|
initTest = testutils.InitTestSchedulerWithNS
|
||||||
|
createAndWaitForNodesInCache = testutils.CreateAndWaitForNodesInCache
|
||||||
|
createNamespacesWithLabels = testutils.CreateNamespacesWithLabels
|
||||||
|
podUnschedulable = testutils.PodUnschedulable
|
||||||
|
createNode = testutils.CreateNode
|
||||||
|
podScheduledIn = testutils.PodScheduledIn
|
||||||
|
waitForPodUnschedulable = testutils.WaitForPodUnschedulable
|
||||||
|
)
|
||||||
|
|
||||||
// This file tests the scheduler predicates functionality.
|
// This file tests the scheduler predicates functionality.
|
||||||
|
|
||||||
const pollInterval = 100 * time.Millisecond
|
const pollInterval = 100 * time.Millisecond
|
27
test/integration/scheduler/filters/main_test.go
Normal file
27
test/integration/scheduler/filters/main_test.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2022 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filters
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/integration/framework"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
framework.EtcdMain(m.Run)
|
||||||
|
}
|
27
test/integration/scheduler/plugins/main_test.go
Normal file
27
test/integration/scheduler/plugins/main_test.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2022 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package plugins
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/test/integration/framework"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
framework.EtcdMain(m.Run)
|
||||||
|
}
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package scheduler
|
package plugins
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -47,6 +47,19 @@ import (
|
|||||||
"k8s.io/utils/pointer"
|
"k8s.io/utils/pointer"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// imported from testutils
|
||||||
|
var (
|
||||||
|
createPausePod = testutils.CreatePausePod
|
||||||
|
initPausePod = testutils.InitPausePod
|
||||||
|
getPod = testutils.GetPod
|
||||||
|
deletePod = testutils.DeletePod
|
||||||
|
podUnschedulable = testutils.PodUnschedulable
|
||||||
|
podSchedulingError = testutils.PodSchedulingError
|
||||||
|
createAndWaitForNodesInCache = testutils.CreateAndWaitForNodesInCache
|
||||||
|
waitForPodUnschedulable = testutils.WaitForPodUnschedulable
|
||||||
|
waitForPodToScheduleWithTimeout = testutils.WaitForPodToScheduleWithTimeout
|
||||||
|
)
|
||||||
|
|
||||||
type PreFilterPlugin struct {
|
type PreFilterPlugin struct {
|
||||||
numPreFilterCalled int
|
numPreFilterCalled int
|
||||||
failPreFilter bool
|
failPreFilter bool
|
Loading…
Reference in New Issue
Block a user