Skip to content

Commit 7ac09b0

Browse files
committed
Slim upgrade tests down to upgrade-specific checks
Drop binaries-present, PATH, and ping checks from the post-upgrade battery on both platforms - those are generic install checks already covered by the major/exact-version jobs. Keep status, service running, config preservation, and version bump, since those are the only things that actually exercise upgrade-specific behavior (stop-old/start-new transition, config carried forward). Cuts unnecessary work per upgrade CI job.
1 parent 0270ed6 commit 7ac09b0

2 files changed

Lines changed: 8 additions & 24 deletions

File tree

tests/linux/test-linux.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,15 @@ _run_upgrade_check() {
215215

216216
./svtminion.sh --upgrade --install --loglevel debug --minionversion "${_to}"
217217

218-
# Full battery after the upgrade - this is the state that matters.
218+
# Only check things that relate to the upgrade itself - binaries
219+
# present and ping are already covered by the fresh-install tests and
220+
# don't exercise anything upgrade-specific.
219221
./svtminion.sh --status --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 100 ]]; then echo "test correct"; else echo "test failed, salt-minion should be installed after upgrade ${_from} -> ${_to}, returned '${_retn}'"; exit 1; fi; }
220-
ls -alh /opt/saltstack/salt/salt-minion || { echo "test failed, salt-minion binary missing after upgrade ${_from} -> ${_to}"; exit 1; }
221-
ls -alh /usr/bin/salt-call || { echo "test failed, salt-call binary missing after upgrade ${_from} -> ${_to}"; exit 1; }
222-
ls -alh /usr/bin/salt-minion || { echo "test failed, salt-minion binary missing after upgrade ${_from} -> ${_to}"; exit 1; }
223-
ps -ef | grep salt
224222
systemctl is-active salt-minion || { echo "test failed, salt-minion service not active after upgrade ${_from} -> ${_to}"; exit 1; }
225-
cat /etc/salt/minion
223+
# An upgrade preserves the existing config - the guest vars passed to
224+
# the upgrade call above are expected to be ignored.
226225
cat /etc/salt/minion | grep 'master:\ 192.168.0.5' 1>/dev/null || { echo "test failed, master not preserved after upgrade ${_from} -> ${_to}"; exit 1; }
227226
cat /etc/salt/minion | grep 'id:\ tup' 1>/dev/null || { echo "test failed, id not preserved after upgrade ${_from} -> ${_to}"; exit 1; }
228-
/usr/bin/salt-call --local test.ping | grep -qi "true" || { echo "test failed, salt-call test.ping failed after upgrade ${_from} -> ${_to}"; exit 1; }
229227
if [[ "$(/usr/bin/salt-call --local test.version --out=pprint | awk '{print $2}' | cut -d "'" -f 2)" != "${_to}" ]]; then echo "test failed, wrong version after upgrade ${_from} -> ${_to}"; exit 1; fi
230228

231229
./svtminion.sh --remove || { _retn=$?; echo "test failed, did not uninstall the salt-minion, returned '${_retn}'"; exit 1; }

tests/windows/integration/test_upgrade.ps1

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ function test_upgrade_steps {
5252
Write-Done
5353
$Upgrade = $false
5454

55+
# Only check things that relate to the upgrade itself - binaries
56+
# present, path, and ping are already covered by the fresh-install
57+
# tests and don't exercise anything upgrade-specific.
5558
try {
5659
$current_status = Get-ItemPropertyValue -Path $vmtools_base_reg -Name $vmtools_salt_minion_status_name
5760
} catch {
@@ -61,16 +64,10 @@ function test_upgrade_steps {
6164
$failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): status not installed"
6265
}
6366

64-
if (!(Test-Path $ssm_bin)) { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): ssm binary missing" }
65-
if (!(Test-Path "$salt_dir\salt-call.exe")) { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): salt-call.exe missing" }
66-
if (!(Test-Path "$salt_dir\salt-minion.exe")) { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): salt-minion.exe missing" }
67-
6867
$service = Get-Service -Name salt-minion -ErrorAction SilentlyContinue
6968
if (!($service)) { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): service not registered" }
7069
elseif ($service.Status -ne "Running") { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): service not running" }
7170

72-
if (!(Test-Path $salt_config_file)) { $failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): config missing" }
73-
7471
# An upgrade preserves the existing config - the guest vars passed to
7572
# the upgrade call above are expected to be ignored.
7673
$minion_not_found = 1
@@ -83,17 +80,6 @@ function test_upgrade_steps {
8380
$failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): config not preserved across upgrade"
8481
}
8582

86-
$path_reg_key = "HKLM:\System\CurrentControlSet\Control\Session Manager\Environment"
87-
$current_path = (Get-ItemProperty -Path $path_reg_key -Name Path).Path
88-
if (!($current_path -like "*$salt_dir*")) {
89-
$failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): salt not added to path"
90-
}
91-
92-
$result = & "$salt_dir\salt-call" --local test.ping
93-
if (!($result -like "local:*") -or !($result -like "*True")) {
94-
$failed = 1; Write-Host "FAILED ($start_ver -> $upgrade_ver): salt-call test.ping failed"
95-
}
96-
9783
$result = & "$salt_dir\salt-call" --version
9884
if (!($result -like "*$upgrade_ver*")) {
9985
$failed = 1

0 commit comments

Comments
 (0)