From 52b625c3b85969cd074b43fa4ad64983944c0841 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Wed, 23 Mar 2016 16:10:30 +0100 Subject: [PATCH 1/2] Remove v1beta3 from end-to-end tests --- test/end-to-end/core.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/end-to-end/core.sh b/test/end-to-end/core.sh index 184607cf5dfb..50de803626e9 100755 --- a/test/end-to-end/core.sh +++ b/test/end-to-end/core.sh @@ -23,7 +23,7 @@ function wait_for_app() { echo "[INFO] Waiting for database service to start" os::cmd::try_until_text "oc get -n $1 services" 'database' "$(( 2 * TIME_MIN ))" - DB_IP=$(oc get -n "$1" --output-version=v1beta3 --template="{{ .spec.portalIP }}" service database) + DB_IP=$(oc get -n "$1" --template="{{ .spec.portalIP }}" service database) echo "[INFO] Waiting for frontend pod to start" os::cmd::try_until_text "oc get -n $1 pods" 'frontend.+Running' "$(( 2 * TIME_MIN ))" @@ -31,7 +31,7 @@ function wait_for_app() { echo "[INFO] Waiting for frontend service to start" os::cmd::try_until_text "oc get -n $1 services" 'frontend' "$(( 2 * TIME_MIN ))" - FRONTEND_IP=$(oc get -n "$1" --output-version=v1beta3 --template="{{ .spec.portalIP }}" service frontend) + FRONTEND_IP=$(oc get -n "$1" --template="{{ .spec.portalIP }}" service frontend) echo "[INFO] Waiting for database to start..." wait_for_url_timed "http://${DB_IP}:5434" "[INFO] Database says: " $((3*TIME_MIN)) @@ -90,7 +90,7 @@ os::cmd::expect_success_and_text "oc rsh dc/docker-registry cat config.yml" "500 os::cmd::expect_success_and_text "oc rsh rc/docker-registry-1 cat config.yml" "5000" # services can end up on any IP. Make sure we get the IP we need for the docker registry -DOCKER_REGISTRY=$(oc get --output-version=v1beta3 --template="{{ .spec.portalIP }}:{{ with index .spec.ports 0 }}{{ .port }}{{ end }}" service docker-registry) +DOCKER_REGISTRY=$(oc get --template="{{ .spec.portalIP }}:{{ (index .spec.ports 0).port }}" service docker-registry) os::cmd::expect_success_and_text "dig @${API_HOST} docker-registry.default.svc.cluster.local. +short A | head -n 1" "${DOCKER_REGISTRY/:5000}" @@ -297,7 +297,7 @@ os::cmd::expect_success "oc project ${CLUSTER_ADMIN_CONTEXT}" # ensure the router is started # TODO: simplify when #4702 is fixed upstream -os::cmd::try_until_text "oc get endpoints router --output-version=v1beta3 --template='{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}'" '[1-9]+' $((5*TIME_MIN)) +os::cmd::try_until_text "oc get endpoints router --template='{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}'" '[1-9]+' $((5*TIME_MIN)) echo "[INFO] Waiting for router to start..." router_pod=$(oc get pod -n default -l deploymentconfig=router --template='{{(index .items 0).metadata.name}}') healthz_uri="http://$(oc get pod "${router_pod}" --template='{{.status.podIP}}'):1936/healthz" From 66072ae1cb4a4863eec3e80c196a8bb7e550f627 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Wed, 23 Mar 2016 16:35:32 +0100 Subject: [PATCH 2/2] Added tagged pull e2e tests --- test/end-to-end/core.sh | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/test/end-to-end/core.sh b/test/end-to-end/core.sh index 50de803626e9..4a0254e72289 100755 --- a/test/end-to-end/core.sh +++ b/test/end-to-end/core.sh @@ -132,6 +132,51 @@ os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/cache/mysql:pullthrough" echo "[INFO] Docker start with GCS" os::cmd::expect_failure_and_text "docker run -e REGISTRY_STORAGE=\"gcs: {}\" openshift/origin-docker-registry:${TAG}" "No bucket parameter provided" +# verify we can pull from tagged image (using tag) +imageid=$(docker images | grep centos/ruby-22-centos7 | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +echo "[INFO] Tagging ruby-22-centos7:latest to the same image stream and pulling it" +os::cmd::expect_success "oc tag ruby-22-centos7:latest ruby-22-centos7:new-tag" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/cache/ruby-22-centos7:new-tag" +echo "[INFO] The same image stream pull successful" + +imageid=$(docker images | grep cache/ruby-22-centos7 | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +echo "[INFO] Tagging ruby-22-centos7:latest to cross repository and pulling it" +os::cmd::expect_success "oc tag ruby-22-centos7:latest cross:repo-pull" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/cache/cross:repo-pull" +echo "[INFO] Cross repository pull successful" + +imageid=$(docker images | grep cache/cross | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +echo "[INFO] Tagging ruby-22-centos7:latest to cross namespace and pulling it" +os::cmd::expect_success "oc tag cache/ruby-22-centos7:latest cross:namespace-pull -n custom" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/custom/cross:namespace-pull" +echo "[INFO] Cross namespace pull successful" + +# verify we can pull from tagged image (using imageid) +imageid=$(docker images | grep custom/cross | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +tagid=$(oc get istag ruby-22-centos7:latest --template={{.image.metadata.name}}) +echo "[INFO] Tagging ruby-22-centos7@${tagid} to the same image stream and pulling it" +os::cmd::expect_success "oc tag ruby-22-centos7@${tagid} ruby-22-centos7:new-id-tag" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/cache/ruby-22-centos7:new-id-tag" +echo "[INFO] The same image stream pull successful" + +imageid=$(docker images | grep cache/ruby-22-centos7 | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +echo "[INFO] Tagging ruby-22-centos7@${tagid} to cross repository and pulling it" +os::cmd::expect_success "oc tag ruby-22-centos7@${tagid} cross:repo-pull-id" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/cache/cross:repo-pull-id" +echo "[INFO] Cross repository pull successful" + +imageid=$(docker images | grep cache/cross | awk '{ print $3 }') +os::cmd::expect_success "docker rmi -f ${imageid}" +echo "[INFO] Tagging ruby-22-centos7@${tagid} to cross namespace and pulling it" +os::cmd::expect_success "oc tag cache/ruby-22-centos7@${tagid} cross:namespace-pull-id -n custom" +os::cmd::expect_success "docker pull ${DOCKER_REGISTRY}/custom/cross:namespace-pull-id" +echo "[INFO] Cross namespace pull successful" + # check to make sure an image-pusher can push an image os::cmd::expect_success 'oc policy add-role-to-user system:image-pusher pusher' os::cmd::expect_success 'oc login -u pusher -p pass'