From c79e4323a8928d5085ac2fe906f0470a27e39612 Mon Sep 17 00:00:00 2001 From: Ritesh Shukla Date: Wed, 23 Nov 2016 19:38:40 -0800 Subject: [PATCH] Get hostd logs for CI runs --- misc/drone-scripts/deploy-and-test-wrapper.sh | 11 ++--------- misc/drone-scripts/dump_log.sh | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/misc/drone-scripts/deploy-and-test-wrapper.sh b/misc/drone-scripts/deploy-and-test-wrapper.sh index 86b65ed09..938f0cbf0 100755 --- a/misc/drone-scripts/deploy-and-test-wrapper.sh +++ b/misc/drone-scripts/deploy-and-test-wrapper.sh @@ -74,13 +74,6 @@ dump_logs() { dump_log_vm $VM2 } -truncate_vm_logs() { - $SSH $USER@$1 "cat /dev/null > /var/log/docker-volume-vsphere.log" -} - -truncate_esx_logs() { - $SSH $USER@$ESX "cat /dev/null > /var/log/vmware/vmdk_ops.log" -} log "truncate vm logs" truncate_vm_logs $VM1 @@ -93,8 +86,8 @@ log "starting deploy and test" if make -s deploy-esx deploy-vm testasroot testremote TEST_VOL_NAME=vol.build$BUILD_NUMBER; then - dump_logs - stop_build $VM1 $BUILD_NUMBER + dump_logs + stop_build $VM1 $BUILD_NUMBER else log "Build + Test not successful" dump_logs diff --git a/misc/drone-scripts/dump_log.sh b/misc/drone-scripts/dump_log.sh index 80e4c07ec..4e3ce40c0 100755 --- a/misc/drone-scripts/dump_log.sh +++ b/misc/drone-scripts/dump_log.sh @@ -16,14 +16,25 @@ # A few helper functions for dumping logs VM_LOGFILE="/var/log/docker-volume-vsphere.log" -VM_STDLOG="/tmp/plugin.log" ESX_LOGFILE="/var/log/vmware/vmdk_ops.log" +HOSTD_LOGFILE="/var/log/hostd.log" dump_log_esx() { + log $ESX_LOGFILE $SSH $USER@$1 cat $ESX_LOGFILE + log $HOSTD_LOGFILE + $SSH $USER@$1 cat $HOSTD_LOGFILE } dump_log_vm(){ - $SSH $USER@$1 cat $VM_STDLOG $SSH $USER@$1 cat $VM_LOGFILE } + +truncate_vm_logs() { + $SSH $USER@$1 "echo > $VM_LOGFILE" +} + +truncate_esx_logs() { + $SSH $USER@$1 "echo > $ESX_LOGFILE" + $SSH $USER@$1 "echo > $HOSTD_LOGFILE" +}