github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/tests/suites/model/status.sh (about) 1 # Tests that juju status for empty models is consistent. 2 # There should be an empty space between the model status and the error text below it. 3 run_empty_model_status() { 4 echo 5 6 file="${TEST_DIR}/test-empty-model-status.log" 7 ensure "empty-model-status" "${file}" 8 9 echo "Print out juju status for empty model" 10 status=$(juju status 2>&1) 11 # check that the 4th line matches the expected output. 12 echo "${status}" | sed -sn 4p | check 'Model "admin/empty-model-status" is empty.' 13 # check that the 3rd line is exactly one empty line. 14 echo "${status}" | sed -sn 3p | grep -c '^$' | check 1 15 16 destroy_model "empty-model-status" 17 } 18 19 test_model_status() { 20 if [ -n "$(skip 'test_model_status')" ]; then 21 echo "==> SKIP: Asked to skip model status tests" 22 return 23 fi 24 25 ( 26 set_verbosity 27 28 cd .. || exit 29 30 run "run_empty_model_status" 31 ) 32 33 }