Fix assert methods

This commit is contained in:
Jordan Liggitt 2019-11-06 13:37:59 -05:00
parent 569a45fb02
commit 59dfac587f
2 changed files with 5 additions and 5 deletions

View File

@ -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}"

View File

@ -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[@]}")