Skip to content

Commit

Permalink
fixup! WIP New scripts to run post-install tests in nested hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
ydirson committed Sep 18, 2024
1 parent 59a09f3 commit 9b7b828
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 22 deletions.
19 changes: 13 additions & 6 deletions scripts/runtests-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@ set -e

# needs at least --nest=$NEST

. $(dirname $0)/lib.sh
. $(dirname $0)/lib.bash

# FIXME may depend on images
REFSHA="ff2a3238eae5abdb0effb092fadbcec2487119e4"
# subject to EQUIVS
REFSHA="$(git rev-parse HEAD)"

for conf in "${TESTCONFS[@]}"; do
IFS=- read fw sr < <(echo "$conf")
host1="install.test::Nested::boot_inst[$fw-83nightly-host1-iso-$sr]-vm1-$REFSHA"
host2="install.test::Nested::boot_inst[$fw-83nightly-host2-iso-$sr]-vm1-$REFSHA"

# FIXME? --host-version=8.3.0
run_pytest "$conf" \
--runner "./jobs.py run postinstall cache://${host1},cache://${host2}" \
--runner "./jobs.py --host-version 8.3.0 run postinstall cache://${host1}" \
--log-file=test-postinstall-$conf.log \
"$@"

run_pytest "$conf/tls" \
--runner "./jobs.py --host-version 8.3.0 run postinstall-with-tls cache://${host1},cache://${host2}" \
--log-file=test-postupgrade-tls-$conf.log \
-k "not hostA2" \
"$@"

# FIXME postinstall-intrapool-migrate needs a 2-host pool

run_pytest "$conf" \
--hosts="cache://install.test::Nested::boot_inst[$fw-83nightly-host1-iso-ext]-vm1-$GITREV" \
--hosts="cache://${host1}" \
--log-file=test-fsdiff-$conf.log \
"$@" \
tests/fs-diff/test_fsdiff_ref.py::test_fsdiff_against_ref
Expand Down
54 changes: 54 additions & 0 deletions scripts/runtests-postrestore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
set -e

# needs at least --nest=$NEST

. $(dirname $0)/lib.bash

# subject to EQUIVS
REFSHA="$(git rev-parse HEAD)"

for conf in "${REFCONFS[@]}"; do
IFS=- read fw version media sr < <(echo "$conf")
host1="install.test::Nested::boot_rst[$fw-$version-83nightly-83nightly-host1-$media-$sr]-vm1-$REFSHA"
# FIXME no such conf
#host2="install.test::Nested::boot_rst[$fw-$version-83nightly-83nightly-host2-$media-$sr]-vm1-$REFSHA"
hostorig="install.test::Nested::boot_rst[$fw-$version-host2-$media-$sr]-vm1-$REFSHA"

run_pytest "$conf" \
--runner "./jobs.py --host-version 8.3.0 run postinstall cache://${host1}" \
--log-file=test-postinstall-$conf.log \
"$@"

run_pytest "$conf/tls" \
--hosts=cache://${host1} \
--log-file=test-postupgrade-tls-$conf.log \
-k "not hostA2" \
"$@" \
tests/xapi/tls_verification

run_pytest "$conf/join" \
--hosts=cache://${host1},cache://${hostorig} \
--log-file=test-postupgrade-tls-$conf.log --log-file-mode=a \
-k "not hostA2" \
"$@" \
tests/misc/test_pool.py::test_pool_join

run_pytest "$conf/join2" \
--hosts=cache://${hostorig},cache://${host1} \
--log-file=test-postupgrade-tls-$conf.log --log-file-mode=a \
-k "not hostA2" \
"$@" \
tests/misc/test_pool.py::test_pool_join

# FIXME postinstall-intrapool-migrate needs a 2-host pool

# FIXME we would need to store fsdiff refs for old releases
#run_pytest "$conf" \
# --hosts="cache://${host1}" \
# --log-file=test-fsdiff-$conf.log \
# "$@" \
# tests/fs-diff/test_fsdiff_ref.py::test_fsdiff_against_ref
done

report_failures
31 changes: 15 additions & 16 deletions scripts/runtests-postupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,46 @@ set -e

# needs at least --nest=$NEST

. $(dirname $0)/lib.sh
. $(dirname $0)/lib.bash

# FIXME may depend on images
REFSHA="ff2a3238eae5abdb0effb092fadbcec2487119e4"

. $(dirname $0)/lib.sh
# subject to EQUIVS
REFSHA="$(git rev-parse HEAD)"

for conf in "${REFCONFS[@]}"; do
IFS=- read fw version media sr < <(echo "$conf")
[ upgrade_should_work "$version" ] || continue
upgrade_should_work "$version" || continue
host1="install.test::Nested::boot_upg[$fw-$version-83nightly-host1-$media-$sr]-vm1-$REFSHA"
host2="install.test::Nested::boot_upg[$fw-$version-83nightly-host2-$media-$sr]-vm1-$REFSHA"

run_pytest "$conf" \
--runner "./jobs.py run postinstall 'cache://${host1},cache://${host2}'" \
run_pytest "$conf/post" \
--runner "./jobs.py --host-version 8.3.0 run postinstall cache://${host1}" \
--log-file=test-postupgrade-$conf.log \
"$@"

# FIXME postinstall-intrapool-migrate needs a 2-host pool

case "$version" in
83*) continue;; # TLS already tested
*) # go on and test with TLS
83*) ;; # TLS already tested
*) # go on and test with TLS
# FIXME activate TLS

run_pytest "$conf" \
--runner "./jobs.py run postinstall-with-tls 'cache://${host1},cache://${host2}'" \
run_pytest "$conf/tls" \
--runner "./jobs.py --host-version 8.3.0 run postinstall-with-tls cache://${host1},cache://${host2}" \
--log-file=test-postupgrade-tls-$conf.log \
-k "not hostA2" \
"$@"

# FIXME: needs to cache TLS-enabled machines

# FIXME postinstall-intrapool-migrate (with TLS) needs a 2-host pool
;;
esac

# FIXME: check fsdiff with TLS activated, since that's what the 8.3+ ref have

run_pytest "$conf" \
run_pytest "$conf/fsdiff" \
--hosts="cache://${host1}" \
--log-file=test-fsdiff-$conf.log \
tests/fs-diff/test_fsdiff_ref.py::test_fsdiff_against_ref
tests/fs-diff/test_fsdiff_ref.py::test_fsdiff_against_ref \
"$@"
done

report_failures

0 comments on commit 9b7b828

Please sign in to comment.