mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Fix assert methods
This commit is contained in:
parent
569a45fb02
commit
59dfac587f
@ -138,6 +138,8 @@ kube::test::describe_object_assert() {
|
||||
|
||||
for match in "${matches[@]}"; do
|
||||
if grep -q "${match}" <<< "${result}"; then
|
||||
echo "matched ${match}"
|
||||
else
|
||||
echo "${bold}${red}"
|
||||
echo "$(kube::test::get_caller): FAIL!"
|
||||
echo "Describe ${resource} ${object}"
|
||||
@ -204,6 +206,8 @@ kube::test::describe_resource_assert() {
|
||||
|
||||
for match in "${matches[@]}"; do
|
||||
if grep -q "${match}" <<< "${result}"; then
|
||||
echo "matched ${match}"
|
||||
else
|
||||
echo "${bold}${red}"
|
||||
echo "FAIL!"
|
||||
echo "Describe ${resource}"
|
||||
|
@ -96,11 +96,7 @@ run_kubectl_get_tests() {
|
||||
# Post-condition: POD abc should error since it doesn't exist
|
||||
kube::test::if_has_string "${output_message}" 'pods "abc" not found'
|
||||
# Post-condition: make sure we don't display an empty List
|
||||
if kube::test::if_has_string "${output_message}" 'List'; then
|
||||
echo 'Unexpected List output'
|
||||
echo "${LINENO} $(basename "$0")"
|
||||
exit 1
|
||||
fi
|
||||
kube::test::if_has_not_string "${output_message}" 'List'
|
||||
|
||||
### Test kubectl get all
|
||||
output_message=$(kubectl --v=6 --namespace default get all --chunk-size=0 2>&1 "${kube_flags[@]}")
|
||||
|
Loading…
Reference in New Issue
Block a user