Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Nov 28, 2017
1 parent 7fc4b5d commit 28fea0d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/cli_hacking_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions hack/lib/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/oc/admin/diagnostics/diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ 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
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,
Expand Down
4 changes: 2 additions & 2 deletions test/cmd/diagnostics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions test/cmd/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/extended/gssapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions test/extended/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}"

Expand Down
2 changes: 1 addition & 1 deletion tools/clicheck/check_cli_conventions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)
Expand Down

0 comments on commit 28fea0d

Please sign in to comment.