Skip to content

Commit

Permalink
Merge pull request #18816 from smarterclayton/test
Browse files Browse the repository at this point in the history
Enable a large chunk of upstream e2e tests that were accidentally not being run
  • Loading branch information
openshift-merge-robot authored Aug 31, 2018
2 parents 3a84bcd + 8017a0b commit 15be1fa
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 579 deletions.
4 changes: 2 additions & 2 deletions test/extended/conformance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exitstatus=0

# run parallel tests
os::log::info "Running parallel tests N=${PARALLEL_NODES:-<default>}"
TEST_PARALLEL="${PARALLEL_NODES:-5}" TEST_REPORT_FILE_NAME=conformance_parallel os::test::extended::run -- -suite "parallel.conformance.openshift.io" -test.timeout 6h ${TEST_EXTENDED_ARGS-} || exitstatus=$?
SUITE=openshift/conformance/parallel/minimal TEST_PARALLEL="${PARALLEL_NODES:-5}" TEST_REPORT_FILE_NAME=conformance_parallel os::test::extended::run -- -test.timeout 6h ${TEST_EXTENDED_ARGS-} || exitstatus=$?

# run tests in serial
os::log::info "Running serial tests"
TEST_REPORT_FILE_NAME=conformance_serial os::test::extended::run -- -suite "serial.conformance.openshift.io" -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$?
SUITE=openshift/conformance/serial/minimal TEST_REPORT_FILE_NAME=conformance_serial os::test::extended::run -- -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$?

exit $exitstatus
4 changes: 2 additions & 2 deletions test/extended/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ exitstatus=0

# run parallel tests
os::log::info "Running parallel tests N=${PARALLEL_NODES:-<default>}"
TEST_PARALLEL="${PARALLEL_NODES:-5}" TEST_REPORT_FILE_NAME=core_parallel os::test::extended::run -- -suite "parallel.conformance.openshift.io" -test.timeout 6h ${TEST_EXTENDED_ARGS-} || exitstatus=$?
SUITE=openshift/conformance/parallel/minimal TEST_PARALLEL="${PARALLEL_NODES:-5}" TEST_REPORT_FILE_NAME=core_parallel os::test::extended::run -- -test.timeout 6h ${TEST_EXTENDED_ARGS-} || exitstatus=$?

# run tests in serial
os::log::info ""
os::log::info "Running serial tests"
TEST_REPORT_FILE_NAME=core_serial os::test::extended::run -- -suite "serial.conformance.openshift.io" -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$?
SUITE=openshift/conformance/serial/minimal TEST_REPORT_FILE_NAME=core_serial os::test::extended::run -- -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$?

exit $exitstatus
19 changes: 19 additions & 0 deletions test/extended/extended_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ import (

_ "k8s.io/kubernetes/test/e2e"

// test sources
_ "k8s.io/kubernetes/test/e2e/apimachinery"
_ "k8s.io/kubernetes/test/e2e/apps"
_ "k8s.io/kubernetes/test/e2e/auth"
_ "k8s.io/kubernetes/test/e2e/autoscaling"
_ "k8s.io/kubernetes/test/e2e/common"
_ "k8s.io/kubernetes/test/e2e/instrumentation"
_ "k8s.io/kubernetes/test/e2e/kubectl"
// _ "k8s.io/kubernetes/test/e2e/lifecycle"
// _ "k8s.io/kubernetes/test/e2e/lifecycle/bootstrap"
// _ "k8s.io/kubernetes/test/e2e/multicluster"
_ "k8s.io/kubernetes/test/e2e/network"
_ "k8s.io/kubernetes/test/e2e/node"
_ "k8s.io/kubernetes/test/e2e/scalability"
_ "k8s.io/kubernetes/test/e2e/scheduling"
_ "k8s.io/kubernetes/test/e2e/servicecatalog"
_ "k8s.io/kubernetes/test/e2e/storage"
// _ "k8s.io/kubernetes/test/e2e/ui"

_ "github.com/openshift/origin/test/extended/builds"
_ "github.com/openshift/origin/test/extended/cli"
_ "github.com/openshift/origin/test/extended/cluster"
Expand Down
102 changes: 9 additions & 93 deletions test/extended/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ function os::test::extended::focus () {
os::log::fatal "the --ginkgo.focus flag is no longer supported, use FOCUS=foo <suite.sh> instead."
exit 1
fi
if [[ "$@[@]" =~ "-suite" ]]; then
os::log::fatal "the -suite flag is no longer supported, use SUITE=foo instead."
exit 1
fi
if [[ -n "${FOCUS:-}" ]]; then
exitstatus=0

Expand Down Expand Up @@ -56,104 +60,13 @@ function os::test::extended::setup () {
function cleanup() {
return_code=$?
os::test::junit::generate_report
os::cleanup::all
os::util::describe_return_code "${return_code}"
exit "${return_code}"
}
trap "cleanup" EXIT

if [[ -n "${TEST_ONLY-}" ]]; then
os::log::info "Running tests against existing cluster..."
return 0
fi

os::util::ensure::built_binary_exists 'openshift'

os::util::environment::use_sudo
os::cleanup::tmpdir
os::util::environment::setup_all_server_vars
os::util::ensure::iptables_privileges_exist

os::log::info "Starting server"

os::util::environment::setup_images_vars

local sudo=${USE_SUDO:+sudo}

# If the current system has the XFS volume dir mount point we configure
# in the test images, assume to use it which will allow the local storage
# quota tests to pass.
LOCAL_STORAGE_QUOTA=""
if [[ -d "/mnt/openshift-xfs-vol-dir" ]] && ${sudo} lvs | grep -q "xfs"; then
LOCAL_STORAGE_QUOTA="1"
export VOLUME_DIR="/mnt/openshift-xfs-vol-dir"
else
os::log::warning "/mnt/openshift-xfs-vol-dir does not exist, local storage quota tests may fail."
fi

os::log::system::start

if [[ -n "${SHOW_ALL:-}" ]]; then
SKIP_NODE=1
fi

# make sure the volume dir has the same label as we would apply to the default VOLUME_DIR
if selinuxenabled; then
local label=$(matchpathcon -n -m dir /var/lib/openshift/openshift.local.volumes)
${sudo} chcon "${label}" ${VOLUME_DIR}
fi
CONFIG_VERSION=""
if [[ -n "${API_SERVER_VERSION:-}" ]]; then
CONFIG_VERSION="${API_SERVER_VERSION}"
elif [[ -n "${CONTROLLER_VERSION:-}" ]]; then
CONFIG_VERSION="${CONTROLLER_VERSION}"
fi
os::start::configure_server "${CONFIG_VERSION}"
# turn on audit logging for extended tests ... mimic what is done in os::start::configure_server, but don't
# put change there - only want this for extended tests
os::log::info "Turn on audit logging"
cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml"
oc patch --local --type=json -o yaml -f "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="[{\"op\": \"replace\", \"path\": \"/auditConfig/enabled\", \"value\": true}, {\"op\": \"replace\", \"path\": \"/auditConfig/auditFilePath\", \"value\": \"${LOG_DIR}/audit.log\"}]" > "${SERVER_CONFIG_DIR}/master/master-config.yaml"

cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml"
oc patch --local --type=json -o yaml -f "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="[{\"op\": \"add\", \"path\": \"/templateServiceBrokerConfig\", \"value\": {\"templaceNamespaces\": [\"openshift\"]}}]" > "${SERVER_CONFIG_DIR}/master/master-config.yaml"

# If the XFS volume dir mount point exists enable local storage quota in node-config.yaml so these tests can pass:
if [[ -n "${LOCAL_STORAGE_QUOTA}" ]]; then
# The ec2 images usually have ~5Gi of space defined for the xfs vol for the registry; want to give /registry a good chunk of that
# to store the images created when the extended tests run
cp "${NODE_CONFIG_DIR}/node-config.yaml" "${NODE_CONFIG_DIR}/node-config.orig2.yaml"
oc patch --local --type=json -o yaml -f "${NODE_CONFIG_DIR}/node-config.orig2.yaml" --patch="[{\"op\": \"add\", \"path\": \"/volumeConfig/localQuota\", \"value\": {\"perFSGroup\": \"4480Mi\"}}]" > "${NODE_CONFIG_DIR}/node-config.yaml"
fi
os::log::info "Using VOLUME_DIR=${VOLUME_DIR}"

# This is a bit hacky, but set the pod gc threshold appropriately for the garbage_collector test
# and enable-hostpath-provisioner for StatefulSet tests
cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig3.yaml"
oc patch --local --type=json -o yaml -f "${SERVER_CONFIG_DIR}/master/master-config.orig3.yaml" --patch="[{\"op\": \"add\", \"path\": \"/kubernetesMasterConfig/controllerArguments\", \"value\": {\"terminated-pod-gc-threshold\":[\"100\"], \"enable-hostpath-provisioner\":[\"true\"]}}]" > "${SERVER_CONFIG_DIR}/master/master-config.yaml"

os::start::server "${API_SERVER_VERSION:-}" "${CONTROLLER_VERSION:-}" "${SKIP_NODE:-}"

export KUBECONFIG="${ADMIN_KUBECONFIG}"

os::start::registry
if [[ -z "${SKIP_NODE:-}" ]]; then
oc rollout status dc/docker-registry
fi
CREATE_ROUTER_CERT=true os::start::router

os::log::info "Creating image streams"
oc create -n openshift -f "${OS_ROOT}/examples/image-streams/image-streams-centos7.json" --config="${ADMIN_KUBECONFIG}"

os::log::info "Creating quickstart templates"
oc create -n openshift -f "${OS_ROOT}/examples/quickstarts" --config="${ADMIN_KUBECONFIG}"

os::log::info "Creating db-templates templates"
oc create -n openshift -f "${OS_ROOT}/examples/db-templates" --config="${ADMIN_KUBECONFIG}"

os::log::info "Creating jenkins templates"
oc create -n openshift -f "${OS_ROOT}/examples/jenkins/jenkins-ephemeral-template.json" --config="${ADMIN_KUBECONFIG}"

os::log::info "Running tests against existing cluster..."
return 0
}

# Run extended tests or print out a list of tests that need to be run
Expand All @@ -172,6 +85,9 @@ function os::test::extended::run () {
if [[ -n "${FOCUS-}" ]]; then
listArgs+=("--ginkgo.focus=${FOCUS}")
runArgs+=("-focus=${FOCUS}")
elif [[ -n "${SUITE-}" ]]; then
listArgs+=("--ginkgo.focus=${SUITE}")
runArgs+=("-focus=${SUITE}")
fi

local skip="${SKIP-}"
Expand Down
Loading

0 comments on commit 15be1fa

Please sign in to comment.