ceph/qa/workunits/windows/run-tests.ps1
Lucian Petrut d6d36b535c qa: add ceph-rbd windows service restart test
We're adding a test that:

* maps a configurable number of images
* runs a specified test - we're reusing the ones from stress_test,
  making just a few minor changes to allow running the same test
  multiple times
* restarts the ceph-rbd Windows service
* waits for the images to be reconnected and refreshes the mount
  information
* reruns the test
* repeats the above workflow for a specified number of times,
  reusing the same images

This test ensures that:

* mounted images are still available after a service restart
* drive letters are retained
* the image content is retained
* there are no race conditions when connecting or disconnecting
  a large number of images in parallel
* the driver is capable of mapping a specified number of images
  simultaneously

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2024-05-15 19:49:33 +03:00

43 lines
2.1 KiB
PowerShell

$ProgressPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"
$scriptLocation = [System.IO.Path]::GetDirectoryName(
$myInvocation.MyCommand.Definition)
$env:PYTHONPATH += ";$scriptLocation"
function safe_exec() {
# Powershell doesn't check the command exit code, we'll need to
# do it ourselves. Also, in case of native commands, it treats stderr
# output as an exception, which is why we'll have to capture it.
cmd /c "$args 2>&1"
if ($LASTEXITCODE) {
throw "Command failed: $args"
}
}
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdTest --iterations 100
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdFioTest --iterations 100
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdStampTest --iterations 100
# It can take a while to setup the partition (~10s), we'll use fewer iterations.
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdFsTest --iterations 4
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdFsFioTest --iterations 4
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdFsStampTest --iterations 4
safe_exec python.exe -m py_tests.rbd_wnbd.stress_test --test-name RbdResizeFioTest --image-size-mb 64
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdTest --iterations=3 --image-count=50 --concurrency=8
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdFioTest --iterations=3 --image-count=50 --concurrency=8
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdStampTest --iterations=3 --image-count=50 --concurrency=8
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdFsTest --iterations=3 --image-count=8 --concurrency=8 --image-size-mb=64
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdFsFioTest --iterations=3 --image-count=8 --concurrency=8 --image-size-mb=64
safe_exec python.exe -m py_tests.rbd_wnbd.service_restart_test `
--test-name=RbdFsStampTest --iterations=3 --image-count=8 --concurrency=8 --image-size-mb=64