Skip to content

Commit

Permalink
Revert "Increase journald rate limiter when running test-end-to-end-d…
Browse files Browse the repository at this point in the history
…ocker.sh"
  • Loading branch information
stevekuznetsov authored and Michal Fojtik committed Apr 7, 2017
1 parent ec0b853 commit fc2df8f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
7 changes: 3 additions & 4 deletions hack/lib/util/misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ readonly -f os::util::format_seconds
# Return:
# None
function os::util::sed() {
local sudo="${USE_SUDO:+sudo}"
if LANG=C sed --help 2>&1 | grep -q "GNU sed"; then
${sudo} sed -i'' "$@"
sed -i'' "$@"
else
${sudo} sed -i '' "$@"
sed -i '' "$@"
fi
}
readonly -f os::util::sed
Expand Down Expand Up @@ -204,4 +203,4 @@ function os::util::curl_etcd() {
function os::util::host_platform() {
echo "$(go env GOHOSTOS)/$(go env GOHOSTARCH)"
}
readonly -f os::util::host_platform
readonly -f os::util::host_platform
11 changes: 0 additions & 11 deletions hack/test-end-to-end-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ function cleanup()
os::test::junit::generate_oscmd_report
set -e

# restore journald to previous form
${USE_SUDO:+sudo} mv /etc/systemd/{journald.conf.bak,journald.conf}
${USE_SUDO:+sudo} systemctl restart systemd-journald.service

os::log::info "Exiting"
ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"
exit $out
Expand All @@ -67,13 +63,6 @@ trap "cleanup" EXIT INT TERM

os::log::system::start

# This increases rate limits in journald to bypass the problem from
# https://github.com/openshift/origin/issues/12558.
${USE_SUDO:+sudo} cp /etc/systemd/{journald.conf,journald.conf.bak}
os::util::sed "s/^.*RateLimitInterval.*$/RateLimitInterval=1s/g" /etc/systemd/journald.conf
os::util::sed "s/^.*RateLimitBurst.*$/RateLimitBurst=10000/g" /etc/systemd/journald.conf
${USE_SUDO:+sudo} systemctl restart systemd-journald.service

out=$(
set +e
docker stop origin 2>&1
Expand Down
37 changes: 24 additions & 13 deletions test/end-to-end/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,19 +378,30 @@ os::cmd::expect_success 'oc login -u e2e-user'
os::cmd::expect_success 'oc project test'
os::cmd::expect_success 'oc whoami'

os::log::info "Running a CLI command in a container using the service account"
os::cmd::expect_success 'oc policy add-role-to-user view -z default'
os::cmd::try_until_success "oc sa get-token default"
oc run cli-with-token --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never -- cli status --loglevel=4 > "${LOG_DIR}/cli-with-token.log" 2>&1
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'In project test'
os::cmd::expect_success 'oc delete pod cli-with-token'
oc run cli-with-token-2 --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never -- cli whoami --loglevel=4 > "${LOG_DIR}/cli-with-token2.log" 2>&1
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token2.log'" 'system:serviceaccount:test:default'
os::cmd::expect_success 'oc delete pod cli-with-token-2'
oc run kubectl-with-token --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never --command -- kubectl get pods --loglevel=4 > "${LOG_DIR}/kubectl-with-token.log" 2>&1
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'kubectl-with-token'
if [[ -n "${SOLTYSH_DEBUG:-}" ]]; then
os::log::info "Running a CLI command in a container using the service account"
os::cmd::expect_success 'oc policy add-role-to-user view -z default'
os::cmd::try_until_success "oc sa get-token default"
oc run cli-with-token --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never -- cli status --loglevel=4 > "${LOG_DIR}/cli-with-token.log" 2>&1
# TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
set +o errexit
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'In project test'
set -o errexit
os::cmd::expect_success 'oc delete pod cli-with-token'
oc run cli-with-token-2 --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never -- cli whoami --loglevel=4 > "${LOG_DIR}/cli-with-token2.log" 2>&1
# TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
set +o errexit
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token2.log'" 'system:serviceaccount:test:default'
set -o errexit
os::cmd::expect_success 'oc delete pod cli-with-token-2'
oc run kubectl-with-token --attach --image="${IMAGE_PREFIX}:${TAG}" --restart=Never --command -- kubectl get pods --loglevel=4 > "${LOG_DIR}/kubectl-with-token.log" 2>&1
# TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
set +o errexit
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'kubectl-with-token'
set -o errexit
fi

os::log::info "Testing deployment logs and failing pre and mid hooks ..."
# test hook selectors
Expand Down

0 comments on commit fc2df8f

Please sign in to comment.