Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] support VERBOSE logging #180

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/integration/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ start_daemon() {
fi

sudo rm -rf ${OT_DAEMON_SETTINGS_PATH}
sudo "${OT_DAEMON}" "spinel+hdlc+uart://${NON_CCM_RCP}?forkpty-arg=1" > "${OT_DAEMON_LOG}" 2>&1 &
sudo "${OT_DAEMON}" "spinel+hdlc+uart://${NON_CCM_RCP}?forkpty-arg=1" 2>&1 | tee "${OT_DAEMON_LOG}" &

sleep 10
}
Expand All @@ -107,7 +107,7 @@ start_commissioner() {
local config=$1

echo "starting commissioner daemon: [ ${COMMISSIONER_DAEMON} --cli ${COMMISSIONER_CLI} ]"
python -u "${COMMISSIONER_DAEMON}" --cli "${COMMISSIONER_CLI}" --timeout 200 > "${COMMISSIONER_DAEMON_LOG}" 2>&1 &
python -u "${COMMISSIONER_DAEMON}" --cli "${COMMISSIONER_CLI}" --timeout 200 2>&1 | tee "${COMMISSIONER_DAEMON_LOG}" &
sleep 1

pgrep -f "${COMMISSIONER_DAEMON}"
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ run_test_case() {
## we cannot declare output with `local`,
## because `local` is a command and its return value iwll override
## return value of the test case.
$(set -xeuo pipefail && ${test_case} &> "${output_file}")
if [[ ${VERBOSE} ]]; then
(set -xeuo pipefail && ${test_case})
else
(set -xeuo pipefail && ${test_case} &> "${output_file}")
fi
local result=$?

if [ ${result} = 0 ]; then
Expand Down