]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-windows: Collect more artifacts 2103/head
authorStefan Chivu <schivu@cloudbasesolutions.com>
Fri, 27 Jan 2023 14:08:54 +0000 (16:08 +0200)
committerStefan Chivu <schivu@cloudbasesolutions.com>
Wed, 1 Feb 2023 14:46:53 +0000 (16:46 +0200)
This commit changes the run_tests script in order to include more
logs and overall information as build artifacts, such as Windows
client logs, Windows event logs, the ceph.conf on the client, the
wnbd version and the status of the ceph cluster.

Signed-off-by: Stefan Chivu <schivu@cloudbasesolutions.com>
scripts/ceph-windows/run_tests
scripts/ceph-windows/setup_ceph_vstart

index e2d7699b77cfc7fe4eb3241c87d58c790b6be1c5..c6def137cdf2bcdfdfafb087d67ef147535015b4 100644 (file)
@@ -8,11 +8,14 @@ if [[ ! -f $CEPH_KEYRING ]]; then echo "ERROR: The Ceph keyring file doesn't exi
 
 if [[ -z $WINDOWS_SSH_USER ]]; then echo "ERROR: The WINDOWS_SSH_USER env variable is not set"; exit 1; fi
 if [[ -z $WINDOWS_VM_IP ]]; then echo "ERROR: The WINDOWS_VM_IP env variable is not set"; exit 1; fi
+if [[ -z $UBUNTU_SSH_USER ]]; then echo "ERROR: The UBUNTU_SSH_USER env variable is not set"; exit 1; fi
+if [[ -z $UBUNTU_VM_IP ]]; then echo "ERROR: The UBUNTU_VM_IP env variable is not set"; exit 1; fi
 
 export SSH_USER=$WINDOWS_SSH_USER
 export SSH_ADDRESS=$WINDOWS_VM_IP
 
 WIN_USERSPACE_CRASH_DUMPS=${WIN_USERSPACE_CRASH_DUMPS:-"C:\\userspace_crash_dumps"}
+COLLECT_EVENT_LOGS_SCRIPT_URL="https://raw.githubusercontent.com/ceph/ceph-build/main/scripts/ceph-windows/collect-event-logs.ps1"
 
 #
 # Clone ceph-win32-tests repo
@@ -28,6 +31,7 @@ ssh_exec powershell.exe /workspace/repos/ceph-win32-tests/test_host/set_userspac
 # Copy the ceph.conf and keyring to the Windows VM
 #
 ssh_exec powershell.exe mkdir -force /ProgramData/ceph/out
+ssh_exec powershell.exe mkdir -force /ProgramData/ceph/logs
 scp_upload $CEPH_WINDOWS_CONF /ProgramData/ceph/ceph.conf
 scp_upload $CEPH_KEYRING /ProgramData/ceph/keyring
 
@@ -46,6 +50,8 @@ function collect_artifacts() {
     rm -rf $WORKSPACE/artifacts
     mkdir -p $WORKSPACE/artifacts
 
+    SSH_USER=$UBUNTU_SSH_USER SSH_ADDRESS=$UBUNTU_VM_IP ssh_exec $WORKSPACE/ceph/build/bin/ceph status
+
     scp_download /workspace/test_results $WORKSPACE/artifacts/test_results
     if [[ "$INCLUDE_USERSPACE_CRASH_DUMPS" = true ]]; then
         scp_download /userspace_crash_dumps $WORKSPACE/artifacts/userspace_crash_dumps
@@ -53,9 +59,20 @@ function collect_artifacts() {
     if [[ "$INCLUDE_CEPH_ZIP" = true ]]; then
         cp $WORKSPACE/ceph.zip $WORKSPACE/artifacts/ceph.zip
     fi
+
+    mkdir -p $WORKSPACE/artifacts/client
+
+    scp_download /ProgramData/ceph/logs $WORKSPACE/artifacts/client/logs
+    cp $CEPH_WINDOWS_CONF $WORKSPACE/artifacts/client
+    ssh_exec /wnbd/wnbd-client.exe version
+    ssh_exec curl.exe --retry-max-time 30 --retry 10 -L -o /workspace/collect-event-logs.ps1 $COLLECT_EVENT_LOGS_SCRIPT_URL
+    ssh_exec powershell.exe /workspace/collect-event-logs.ps1 -LogDirectory /workspace/eventlogs
+    scp_download /workspace/eventlogs $WORKSPACE/artifacts/client/eventlogs
 }
 trap collect_artifacts EXIT
 
+# View cluster status before test run
+SSH_USER=$UBUNTU_SSH_USER SSH_ADDRESS=$UBUNTU_VM_IP ssh_exec $WORKSPACE/ceph/build/bin/ceph status
 #
 # Run the Windows tests
 #
index 798e79aa9567536dca88e361403e9a2a83021229..b067a0cc79de4211f4bd0820cb521305a7151c0d 100644 (file)
@@ -83,6 +83,7 @@ MON_HOST=$(cat $CEPH_CONF | grep -o "mon host \=.*")
 cat > $CEPH_WINDOWS_CONF << EOF
 [client]
     keyring = C:/ProgramData/ceph/keyring
+    log file = C:/ProgramData/ceph/logs/\$name.\$pid.log
     admin socket = C:/ProgramData/ceph/out/\$name.\$pid.asok
     client_mount_uid = 1000
     client_mount_gid = 1000