Add edit command testcases

This commit is contained in:
Jordan Liggitt
2017-02-03 13:52:04 -05:00
parent 9af0dca52d
commit c43192c0c1
85 changed files with 2077 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:47Z
labels:
app: svc1modified
name: svc1
namespace: edit-test
resourceVersion: "2942"
selfLink: /api/v1/namespaces/edit-test/services/svc1
uid: 4149f70e-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.118
ports:
- name: "81"
port: 82
protocol: TCP
targetPort: 81
selector:
app: svc1
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}

View File

@@ -0,0 +1,28 @@
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:47Z
labels:
app: svc1
name: svc1
namespace: edit-test
resourceVersion: "2942"
selfLink: /api/v1/namespaces/edit-test/services/svc1
uid: 4149f70e-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.118
ports:
- name: "81"
port: 81
protocol: TCP
targetPort: 81
selector:
app: svc1
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}

View File

@@ -0,0 +1,33 @@
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "svc1",
"namespace": "edit-test",
"selfLink": "/api/v1/namespaces/edit-test/services/svc1",
"uid": "4149f70e-e9dc-11e6-8c3b-acbc32c1ca87",
"creationTimestamp": "2017-02-03T06:44:47Z",
"labels": {
"app": "svc1modified"
}
},
"spec": {
"ports": [
{
"name": "81",
"protocol": "TCP",
"port": 82,
"targetPort": 81
}
],
"selector": {
"app": "svc1"
},
"clusterIP": "10.0.0.118",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
}

View File

@@ -0,0 +1,34 @@
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "svc1",
"namespace": "edit-test",
"selfLink": "/api/v1/namespaces/edit-test/services/svc1",
"uid": "c07152b8-e9dc-11e6-8c3b-acbc32c1ca87",
"resourceVersion": "3171",
"creationTimestamp": "2017-02-03T06:48:21Z",
"labels": {
"app": "svc1modified"
}
},
"spec": {
"ports": [
{
"name": "81",
"protocol": "TCP",
"port": 82,
"targetPort": 81
}
],
"selector": {
"app": "svc1"
},
"clusterIP": "10.0.0.118",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
}

View File

@@ -0,0 +1,28 @@
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:43Z
labels:
app: svc2modified
name: svc2
namespace: edit-test
resourceVersion: "2936"
selfLink: /api/v1/namespaces/edit-test/services/svc2
uid: 3e9b10db-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.182.1
ports:
- name: "80"
port: 80
protocol: VHF
targetPort: 80
selector:
app: svc2
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}

View File

@@ -0,0 +1,28 @@
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:43Z
labels:
app: svc2
name: svc2
namespace: edit-test
resourceVersion: "2936"
selfLink: /api/v1/namespaces/edit-test/services/svc2
uid: 3e9b10db-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.182
ports:
- name: "80"
port: 80
protocol: TCP
targetPort: 80
selector:
app: svc2
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}

View File

@@ -0,0 +1,33 @@
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "svc2",
"namespace": "edit-test",
"selfLink": "/api/v1/namespaces/edit-test/services/svc2",
"uid": "3e9b10db-e9dc-11e6-8c3b-acbc32c1ca87",
"creationTimestamp": "2017-02-03T06:44:43Z",
"labels": {
"app": "svc2modified"
}
},
"spec": {
"ports": [
{
"name": "80",
"protocol": "VHF",
"port": 80,
"targetPort": 80
}
],
"selector": {
"app": "svc2"
},
"clusterIP": "10.0.0.182.1",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
}

View File

@@ -0,0 +1,25 @@
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "Service \"svc2\" is invalid: [spec.ports[0].protocol: Unsupported value: \"VHF\": supported values: TCP, UDP, spec.clusterIP: Invalid value: \"10.0.0.182.1\": must be empty, 'None', or a valid IP address]",
"reason": "Invalid",
"details": {
"name": "svc2",
"kind": "Service",
"causes": [
{
"reason": "FieldValueNotSupported",
"message": "Unsupported value: \"VHF\": supported values: TCP, UDP",
"field": "spec.ports[0].protocol"
},
{
"reason": "FieldValueInvalid",
"message": "Invalid value: \"10.0.0.182.1\": must be empty, 'None', or a valid IP address",
"field": "spec.clusterIP"
}
]
},
"code": 422
}

View File

@@ -0,0 +1,54 @@
apiVersion: v1
items:
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:47Z
labels:
app: svc1
name: svc1
namespace: edit-test
resourceVersion: "2942"
selfLink: /api/v1/namespaces/edit-test/services/svc1
uid: 4149f70e-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.118
ports:
- name: "81"
port: 81
protocol: TCP
targetPort: 81
selector:
app: svc1
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2017-02-03T06:44:43Z
labels:
app: svc2
name: svc2
namespace: edit-test
resourceVersion: "2936"
selfLink: /api/v1/namespaces/edit-test/services/svc2
uid: 3e9b10db-e9dc-11e6-8c3b-acbc32c1ca87
spec:
clusterIP: 10.0.0.182
ports:
- name: "80"
port: 80
protocol: TCP
targetPort: 80
selector:
app: svc2
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""

View File

@@ -0,0 +1,30 @@
description: create list with errors
mode: create
filename: "svc.yaml"
namespace: "edit-test"
expectedStdout:
- "service \"svc1\" created"
expectedStderr:
- "\"svc2\" is invalid"
expectedExitCode: 1
steps:
- type: edit
expectedInput: 0.original
resultingOutput: 0.edited
- type: request
expectedMethod: POST
expectedPath: /api/v1/namespaces/edit-test/services
expectedContentType: application/json
expectedInput: 1.request
resultingStatusCode: 201
resultingOutput: 1.response
- type: edit
expectedInput: 2.original
resultingOutput: 2.edited
- type: request
expectedMethod: POST
expectedPath: /api/v1/namespaces/edit-test/services
expectedContentType: application/json
expectedInput: 3.request
resultingStatusCode: 422
resultingOutput: 3.response