diff options
author | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2016-08-11 10:45:10 +0900 |
---|---|---|
committer | Ryota MIBU <r-mibu@cq.jp.nec.com> | 2016-08-11 10:48:10 +0900 |
commit | d2444fdaa1500223db875e516a9116a581275b9b (patch) | |
tree | 348183824c00c80112ba945256306ebf7515deb2 /tests | |
parent | 6754964d5ef7ca1951b6ab3bc2678a916d6c2d19 (diff) |
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 <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run.sh | 15 |
1 files 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 |