From d2444fdaa1500223db875e516a9116a581275b9b Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Thu, 11 Aug 2016 10:45:10 +0900 Subject: improve log printings Now, we can see log messages in INFO level, but it's not clear from where to where comes from which log file. This patch adding file names in INFO level. Change-Id: I3c8fa9f28c2c9ca3e758536243a8110849591825 Signed-off-by: Ryota MIBU --- tests/run.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index 14a80c47..87411f97 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -174,6 +174,11 @@ create_alarm() { -q "traits.state=string::error; traits.instance_id=string::$vm_id" } +print_log() { + log_file=$1 + echo "$log_file:" + sed -e 's/^/ /' "$log_file" +} start_monitor() { pgrep -f "python monitor.py" && return 0 @@ -184,7 +189,7 @@ start_monitor() { stop_monitor() { pgrep -f "python monitor.py" || return 0 sudo kill $(pgrep -f "python monitor.py") - cat monitor.log + print_log monitor.log } start_inspector() { @@ -195,7 +200,7 @@ start_inspector() { stop_inspector() { pgrep -f "python inspector.py" || return 0 kill $(pgrep -f "python inspector.py") - cat inspector.log + print_log inspector.log } start_consumer() { @@ -206,7 +211,7 @@ start_consumer() { stop_consumer() { pgrep -f "python consumer.py" || return 0 kill $(pgrep -f "python consumer.py") - cat consumer.log + print_log consumer.log } wait_for_vm_launch() { @@ -281,8 +286,8 @@ cleanup() { python ./nova_force_down.py "$COMPUTE_HOST" --unset sleep 240 check_host_status "UP" - ssh $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP" \ - "[ -e disable_network.log ] && cat disable_network.log" + scp $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP:disable_network.log" . + print_log disable_network.log openstack $as_doctor_user server list | grep -q " $VM_NAME " && openstack $as_doctor_user server delete "$VM_NAME" sleep 1 -- cgit 1.2.3-korg