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