mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Restore original policy none test cases:
Mistakenly overwritten in earlier commit
This commit is contained in:
parent
2d1a535a35
commit
6758f95117
@ -40,6 +40,34 @@ func TestPolicyNoneName(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPolicyNoneCanAdmitPodResult(t *testing.T) {
|
||||
tcases := []struct {
|
||||
name string
|
||||
hint TopologyHint
|
||||
expected bool
|
||||
}{
|
||||
{
|
||||
name: "Preferred is set to false in topology hints",
|
||||
hint: TopologyHint{nil, false},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "Preferred is set to true in topology hints",
|
||||
hint: TopologyHint{nil, true},
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tcases {
|
||||
policy := NewNonePolicy()
|
||||
result := policy.(*nonePolicy).canAdmitPodResult(&tc.hint)
|
||||
|
||||
if result.Admit != tc.expected {
|
||||
t.Errorf("Expected Admit field in result to be %t, got %t", tc.expected, result.Admit)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPolicyNoneMerge(t *testing.T) {
|
||||
tcases := []struct {
|
||||
name string
|
||||
providersHints []map[string][]TopologyHint
|
||||
|
Loading…
Reference in New Issue
Block a user