Skip to content

Commit

Permalink
Merge pull request #11508 from gabemontero/bypassOauthPipelineExtTest
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Oct 23, 2016
2 parents 7ae5feb + bf2235a commit 35b539d
Show file tree
Hide file tree
Showing 2 changed files with 262 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/extended/jenkins/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func getAdminPassword(oc *exutil.CLI) string {
return s[1]
}
}
return ""
return "password"
}

func immediateInteractionWithJenkins(uri, method, password string, body io.Reader, status int) {
Expand Down Expand Up @@ -142,7 +142,8 @@ var _ = g.Describe("[jenkins][Slow] openshift pipeline plugin", func() {
testingSnapshot = true
} else {
// no test image, testing the base jenkins image with the current, supported version of the plugin
jenkinsEphemeralPath = exutil.FixturePath("..", "..", "examples", "jenkins", "jenkins-ephemeral-template.json")
//TODO disabling oauth until we can update getAdminPassword path to handle oauth (perhaps borrow from oauth integration tests)
jenkinsEphemeralPath = exutil.FixturePath("testdata", "jenkins-ephemeral-template-no-oauth.json")
}
err = oc.Run("new-app").Args(jenkinsEphemeralPath).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down
259 changes: 259 additions & 0 deletions test/extended/testdata/jenkins-ephemeral-template-no-oauth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "jenkins-ephemeral",
"creationTimestamp": null,
"annotations": {
"description": "Jenkins service, without persistent storage.\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
"iconClass": "icon-jenkins",
"tags": "instant-app,jenkins"
}
},
"message": "A Jenkins service has been created in your project. Log into Jenkins with your OpenShift account. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.",
"objects": [
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"creationTimestamp": null
},
"spec": {
"to": {
"kind": "Service",
"name": "${JENKINS_SERVICE_NAME}"
},
"tls": {
"termination": "edge",
"insecureEdgeTerminationPolicy": "Redirect"
}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"creationTimestamp": null
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"jenkins"
],
"from": {
"kind": "ImageStreamTag",
"name": "${JENKINS_IMAGE_STREAM_TAG}",
"namespace": "${NAMESPACE}"
},
"lastTriggeredImage": ""
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"name": "${JENKINS_SERVICE_NAME}"
}
},
"spec": {
"serviceAccountName": "${JENKINS_SERVICE_NAME}",
"containers": [
{
"name": "jenkins",
"image": " ",
"readinessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 3,
"httpGet": {
"path": "/login",
"port": 8080
}
},
"livenessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 120,
"httpGet": {
"path": "/login",
"port": 8080
}
},
"env": [
{
"name": "KUBERNETES_MASTER",
"value": "https://kubernetes.default:443"
},
{
"name": "KUBERNETES_TRUST_CERTIFICATES",
"value": "true"
},
{
"name": "JNLP_SERVICE_NAME",
"value": "${JNLP_SERVICE_NAME}"
}
],
"resources": {
"limits": {
"memory": "${MEMORY_LIMIT}"
}
},
"volumeMounts": [
{
"name": "${JENKINS_SERVICE_NAME}-data",
"mountPath": "/var/lib/jenkins"
}
],
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent",
"capabilities": {},
"securityContext": {
"capabilities": {},
"privileged": false
}
}
],
"volumes": [
{
"name": "${JENKINS_SERVICE_NAME}-data",
"emptyDir": {
"medium": ""
}
}
],
"restartPolicy": "Always",
"dnsPolicy": "ClusterFirst"
}
}
}
},
{
"kind": "ServiceAccount",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"annotations": {
"serviceaccounts.openshift.io/oauth-redirectreference.jenkins": "{\"kind\":\"OAuthRedirectReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"Route\",\"name\":\"${JENKINS_SERVICE_NAME}\"}}"
}
}
},
{
"kind": "RoleBinding",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}_edit"
},
"groupNames": null,
"subjects": [
{
"kind": "ServiceAccount",
"name": "${JENKINS_SERVICE_NAME}"
}
],
"roleRef": {
"name": "edit"
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${JNLP_SERVICE_NAME}"
},
"spec": {
"ports": [
{
"name": "agent",
"protocol": "TCP",
"port": 50000,
"targetPort": 50000,
"nodePort": 0
}
],
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"type": "ClusterIP",
"sessionAffinity": "None"
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${JENKINS_SERVICE_NAME}",
"annotations": {
"service.alpha.openshift.io/dependencies": "[{\"name\": \"${JNLP_SERVICE_NAME}\", \"namespace\": \"\", \"kind\": \"Service\"}]",
"service.openshift.io/infrastructure": "true"
},
"creationTimestamp": null
},
"spec": {
"ports": [
{
"name": "web",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 0
}
],
"selector": {
"name": "${JENKINS_SERVICE_NAME}"
},
"type": "ClusterIP",
"sessionAffinity": "None"
}
}
],
"parameters": [
{
"name": "JENKINS_SERVICE_NAME",
"displayName": "Jenkins Service Name",
"description": "The name of the OpenShift Service exposed for the Jenkins container.",
"value": "jenkins"
},
{
"name": "JNLP_SERVICE_NAME",
"displayName": "Jenkins JNLP Service Name",
"description": "The name of the service used for master/slave communication.",
"value": "jenkins-jnlp"
},
{
"name": "MEMORY_LIMIT",
"displayName": "Memory Limit",
"description": "Maximum amount of memory the container can use.",
"value": "512Mi"
},
{
"name": "NAMESPACE",
"displayName": "Jenkins ImageStream Namespace",
"description": "The OpenShift Namespace where the Jenkins ImageStream resides.",
"value": "openshift"
},
{
"name": "JENKINS_IMAGE_STREAM_TAG",
"displayName": "Jenkins ImageStreamTag",
"description": "Name of the ImageStreamTag to be used for the Jenkins image.",
"value": "jenkins:latest"
}
],
"labels": {
"template": "jenkins-ephemeral-template"
}
}

0 comments on commit 35b539d

Please sign in to comment.