From 28887fac795e20c2026818d83cb3fbed54666043 Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Tue, 28 Nov 2017 10:52:55 -0500 Subject: [PATCH] update tests --- docs/cli_hacking_guide.adoc | 2 +- hack/lib/start.sh | 14 +++++++------- pkg/oc/admin/diagnostics/diagnostics/README.md | 4 ++-- test/cmd/diagnostics.sh | 4 ++-- test/cmd/help.sh | 8 ++++---- test/extended/gssapi.sh | 2 +- test/extended/setup.sh | 8 ++++---- tools/clicheck/check_cli_conventions.go | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/cli_hacking_guide.adoc b/docs/cli_hacking_guide.adoc index 52e0f1e9f9aa..7b94741dcf75 100644 --- a/docs/cli_hacking_guide.adoc +++ b/docs/cli_hacking_guide.adoc @@ -29,7 +29,7 @@ Commands are organized in the package structure as: * https://github.com/openshift/origin/tree/master/pkg/oc[pkg/oc] ** https://github.com/openshift/origin/tree/master/pkg/oc/cli[pkg/cmd/cli] - `oc` or `openshift cli`, and `kubectl` commands. -** https://github.com/openshift/origin/tree/master/pkg/oc/experimental[pkg/cmd/experimental] - `openshift ex` command. +** https://github.com/openshift/origin/tree/master/pkg/oc/experimental[pkg/cmd/experimental] - `oc ex` command. === Command Structure diff --git a/hack/lib/start.sh b/hack/lib/start.sh index 938b46842631..c63bb10978ae 100644 --- a/hack/lib/start.sh +++ b/hack/lib/start.sh @@ -161,13 +161,13 @@ readonly -f os::start::internal::configure_master function os::start::internal::patch_master_config() { local sudo=${USE_SUDO:+sudo} cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.orig.yaml" - openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig.yaml" --patch="{\"etcdConfig\": {\"address\": \"${API_HOST}:${ETCD_PORT}\"}}" | \ - openshift ex config patch - --patch="{\"etcdConfig\": {\"servingInfo\": {\"bindAddress\": \"${API_HOST}:${ETCD_PORT}\"}}}" | \ - openshift ex config patch - --type json --patch="[{\"op\": \"replace\", \"path\": \"/etcdClientInfo/urls\", \"value\": [\"${API_SCHEME}://${API_HOST}:${ETCD_PORT}\"]}]" | \ - openshift ex config patch - --patch="{\"etcdConfig\": {\"peerAddress\": \"${API_HOST}:${ETCD_PEER_PORT}\"}}" | \ - openshift ex config patch - --patch="{\"etcdConfig\": {\"peerServingInfo\": {\"bindAddress\": \"${API_HOST}:${ETCD_PEER_PORT}\"}}}" | \ - openshift ex config patch - --patch="{\"auditConfig\": {\"enabled\": true}}" | \ - openshift ex config patch - --patch="{\"imagePolicyConfig\": {\"maxImagesBulkImportedPerRepository\": ${MAX_IMAGES_BULK_IMPORTED_PER_REPOSITORY:-5}}}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" + oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig.yaml" --patch="{\"etcdConfig\": {\"address\": \"${API_HOST}:${ETCD_PORT}\"}}" | \ + oc ex config patch - --patch="{\"etcdConfig\": {\"servingInfo\": {\"bindAddress\": \"${API_HOST}:${ETCD_PORT}\"}}}" | \ + oc ex config patch - --type json --patch="[{\"op\": \"replace\", \"path\": \"/etcdClientInfo/urls\", \"value\": [\"${API_SCHEME}://${API_HOST}:${ETCD_PORT}\"]}]" | \ + oc ex config patch - --patch="{\"etcdConfig\": {\"peerAddress\": \"${API_HOST}:${ETCD_PEER_PORT}\"}}" | \ + oc ex config patch - --patch="{\"etcdConfig\": {\"peerServingInfo\": {\"bindAddress\": \"${API_HOST}:${ETCD_PEER_PORT}\"}}}" | \ + oc ex config patch - --patch="{\"auditConfig\": {\"enabled\": true}}" | \ + oc ex config patch - --patch="{\"imagePolicyConfig\": {\"maxImagesBulkImportedPerRepository\": ${MAX_IMAGES_BULK_IMPORTED_PER_REPOSITORY:-5}}}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" # Make oc use ${MASTER_CONFIG_DIR}/admin.kubeconfig, and ignore anything in the running user's $HOME dir export ADMIN_KUBECONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig" diff --git a/pkg/oc/admin/diagnostics/diagnostics/README.md b/pkg/oc/admin/diagnostics/diagnostics/README.md index f410c98dbf57..4a14710c6ab3 100644 --- a/pkg/oc/admin/diagnostics/diagnostics/README.md +++ b/pkg/oc/admin/diagnostics/diagnostics/README.md @@ -52,7 +52,7 @@ logic. This provides two major benefits: Having configuration files where ansible places them means you will generally not even need to specify where to find them. Running: - openshift ex diagnostics + oc ex diagnostics by itself will look for master and node configs (in addition to client config file) in the standard locations and use them if found; so this @@ -60,7 +60,7 @@ should make the ansible-installed use case as simple as possible. It's also very easy to use configuration files when they are not in the expected Enterprise locations: - openshift ex diagnostics --master-config=... --node-config=... + oc ex diagnostics --master-config=... --node-config=... Having logs in journald is necessary for the current log analysis logic. Other usage may have logs going into files, output to stdout, diff --git a/test/cmd/diagnostics.sh b/test/cmd/diagnostics.sh index ce13c7bb544e..ddb8f487552e 100755 --- a/test/cmd/diagnostics.sh +++ b/test/cmd/diagnostics.sh @@ -41,7 +41,7 @@ os::cmd::expect_failure_and_text 'oc adm diagnostics AnalyzeLogs AlsoMissing' 'N os::cmd::expect_success_and_text 'oc adm diagnostics MetricsApiProxy' 'Skipping diagnostic: MetricsApiProxy' os::cmd::expect_success_and_text 'oc adm diagnostics NetworkCheck --prevent-modification' 'Skipping diagnostic: NetworkCheck' -# openshift ex diagnostics is deprecated but not removed. Make sure it works until we consciously remove it. -os::cmd::expect_success 'openshift ex diagnostics ClusterRoleBindings ClusterRoles ConfigContexts ' +# oc ex diagnostics is deprecated but not removed. Make sure it works until we consciously remove it. +os::cmd::expect_success 'oc ex diagnostics ClusterRoleBindings ClusterRoles ConfigContexts ' echo "diagnostics: ok" os::test::junit::declare_suite_end diff --git a/test/cmd/help.sh b/test/cmd/help.sh index 477d98e36250..ad924ffe136a 100755 --- a/test/cmd/help.sh +++ b/test/cmd/help.sh @@ -7,9 +7,9 @@ os::test::junit::declare_suite_start "cmd/help" # verify some default commands os::cmd::expect_success 'openshift' -os::cmd::expect_success 'openshift ex' os::cmd::expect_success 'kubectl' os::cmd::expect_success 'oc' +os::cmd::expect_success 'oc ex' os::cmd::expect_success 'origin' # help for root commands must be consistent @@ -75,9 +75,9 @@ os::cmd::expect_failure_and_text 'oc login --certificate-authority=/path/to/inva os::cmd::expect_failure 'oc policy TYPO' os::cmd::expect_failure 'oc secrets TYPO' -# make sure that LDAP group sync and prune exist under both parents -os::cmd::expect_success_and_text 'openshift ex sync-groups --help' 'external provider' -os::cmd::expect_success_and_text 'openshift ex prune-groups --help' 'external provider' +# make sure that LDAP group sync and prune exist under both experimental and `oc adm` +os::cmd::expect_success_and_text 'oc ex sync-groups --help' 'external provider' +os::cmd::expect_success_and_text 'oc ex prune-groups --help' 'external provider' os::cmd::expect_success_and_text 'oc adm groups sync --help' 'external provider' os::cmd::expect_success_and_text 'oc adm groups prune --help' 'external provider' os::cmd::expect_success_and_text 'oc adm prune groups --help' 'external provider' diff --git a/test/extended/gssapi.sh b/test/extended/gssapi.sh index 82c8505e8d13..54add10f5b18 100755 --- a/test/extended/gssapi.sh +++ b/test/extended/gssapi.sh @@ -45,7 +45,7 @@ backend='https://openshift.default.svc.cluster.local:443' oauth_patch="$(sed "s/HOST_NAME/${host}/" "${test_data_location}/config/oauth_config.json")" cp "${SERVER_CONFIG_DIR}/master/master-config.yaml" "${SERVER_CONFIG_DIR}/master/master-config.tmp.yaml" -openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.tmp.yaml" --patch="${oauth_patch}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" +oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.tmp.yaml" --patch="${oauth_patch}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" os::start::server export KUBECONFIG="${ADMIN_KUBECONFIG}" diff --git a/test/extended/setup.sh b/test/extended/setup.sh index 80b0ec5ebe88..bcc91997a2c1 100644 --- a/test/extended/setup.sh +++ b/test/extended/setup.sh @@ -113,24 +113,24 @@ function os::test::extended::setup () { # 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" - openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="{\"auditConfig\": {\"enabled\": true, \"auditFilePath\": \"${LOG_DIR}/audit.log\"}}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" + oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="{\"auditConfig\": {\"enabled\": true, \"auditFilePath\": \"${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" - openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="{\"templateServiceBrokerConfig\": {\"templateNamespaces\": [\"openshift\"]}}" > "${SERVER_CONFIG_DIR}/master/master-config.yaml" + oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig2.yaml" --patch="{\"templateServiceBrokerConfig\": {\"templateNamespaces\": [\"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" - openshift ex config patch "${NODE_CONFIG_DIR}/node-config.orig2.yaml" --patch='{"volumeConfig":{"localQuota":{"perFSGroup":"4480Mi"}}}' > "${NODE_CONFIG_DIR}/node-config.yaml" + oc ex config patch "${NODE_CONFIG_DIR}/node-config.orig2.yaml" --patch='{"volumeConfig":{"localQuota":{"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" - openshift ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig3.yaml" --patch='{"kubernetesMasterConfig":{"controllerArguments":{"terminated-pod-gc-threshold":["100"], "enable-hostpath-provisioner":["true"]}}}' > "${SERVER_CONFIG_DIR}/master/master-config.yaml" + oc ex config patch "${SERVER_CONFIG_DIR}/master/master-config.orig3.yaml" --patch='{"kubernetesMasterConfig":{"controllerArguments":{"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:-}" diff --git a/tools/clicheck/check_cli_conventions.go b/tools/clicheck/check_cli_conventions.go index b0af230bad6f..2f1d79d478f3 100644 --- a/tools/clicheck/check_cli_conventions.go +++ b/tools/clicheck/check_cli_conventions.go @@ -14,7 +14,7 @@ var ( "openshift start kubernetes", // TODO enable when we upstream all these conventions "openshift cli create quota", // TODO has examples starting with '//', enable when we upstream all these conventions "openshift cli adm", // already checked in 'openshift admin' - "openshift ex", // we will only care about experimental when they get promoted + "openshift cli ex", // we will only care about experimental when they get promoted "openshift cli types", } )