mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #24641 from caesarxuchao/pods-test
Automatic merge from submit-queue move pods.go to pods_test.go fix #24635
This commit is contained in:
commit
926ee5b90f
@ -141,7 +141,7 @@ is [table driven testing](https://github.com/golang/go/wiki/TableDrivenTests)
|
|||||||
- Example: [TestNamespaceAuthorization](../../test/integration/auth_test.go)
|
- Example: [TestNamespaceAuthorization](../../test/integration/auth_test.go)
|
||||||
* Integration tests must run in parallel
|
* Integration tests must run in parallel
|
||||||
- Each test should create its own master, httpserver and config.
|
- Each test should create its own master, httpserver and config.
|
||||||
- Example: [TestPodUpdateActiveDeadlineSeconds](../../test/integration/pods.go)
|
- Example: [TestPodUpdateActiveDeadlineSeconds](../../test/integration/pods_test.go)
|
||||||
* See [coding conventions](coding-conventions.md).
|
* See [coding conventions](coding-conventions.md).
|
||||||
|
|
||||||
### Install etcd dependency
|
### Install etcd dependency
|
||||||
|
@ -59,7 +59,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
|
|||||||
prototypePod := func() *api.Pod {
|
prototypePod := func() *api.Pod {
|
||||||
return &api.Pod{
|
return &api.Pod{
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "XXX",
|
Name: "xxx",
|
||||||
},
|
},
|
||||||
Spec: api.PodSpec{
|
Spec: api.PodSpec{
|
||||||
Containers: []api.Container{
|
Containers: []api.Container{
|
||||||
@ -87,7 +87,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "no change, set",
|
name: "no change, set",
|
||||||
original: &i30,
|
original: &i30,
|
||||||
update: &i60,
|
update: &i30,
|
||||||
valid: true,
|
valid: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -120,17 +120,12 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
|
|||||||
update: &iNeg,
|
update: &iNeg,
|
||||||
valid: false,
|
valid: false,
|
||||||
},
|
},
|
||||||
|
// zero is not allowed, must be a positive integer
|
||||||
{
|
{
|
||||||
name: "change to zero from positive",
|
name: "change to zero from positive",
|
||||||
original: &i30,
|
original: &i30,
|
||||||
update: &iZero,
|
update: &iZero,
|
||||||
valid: true,
|
valid: false,
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "change to zero from nil",
|
|
||||||
original: nil,
|
|
||||||
update: &iZero,
|
|
||||||
valid: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "change to nil from positive",
|
name: "change to nil from positive",
|
||||||
@ -182,7 +177,7 @@ func TestPodReadOnlyFilesystem(t *testing.T) {
|
|||||||
|
|
||||||
pod := &api.Pod{
|
pod := &api.Pod{
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "XXX",
|
Name: "xxx",
|
||||||
},
|
},
|
||||||
Spec: api.PodSpec{
|
Spec: api.PodSpec{
|
||||||
Containers: []api.Container{
|
Containers: []api.Container{
|
Loading…
Reference in New Issue
Block a user