Skip to content

Commit

Permalink
Remove 107 from linux script, use 100
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Dec 6, 2024
1 parent d79ed4e commit 0fcf979
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ test-salt-vmtools-linux:
- cat /etc/salt/minion | grep 'master:\ 192.168.0.5' 1>/dev/null
- sudo -u root ps -ef | grep salt
- systemctl is-active salt-minion
- sudo -u root ./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 107 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
# VM Tools doesn't support 107 for now... until then we return 100
- sudo -u root ./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 100 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
- sudo -u root ps -ef | grep salt
- systemctl is-active salt-minion || { echo "test correct"; }
- sudo -u root ps -ef | grep salt
Expand Down Expand Up @@ -606,7 +607,8 @@ test-tags-salt-vmtools-linux:
- cat /etc/salt/minion | grep 'master:\ 192.168.0.5' 1>/dev/null
- sudo -u root ps -ef | grep salt
- sudo -u root systemctl is-active salt-minion
- sudo -u root ./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 107 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
# VM Tools doesn't support 107 for now... until then we return 100
- sudo -u root ./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 100 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
- sudo -u root ps -ef | grep salt
- systemctl is-active salt-minion || { echo "test correct"; }
- sudo -u root ps -ef | grep salt
Expand Down
2 changes: 1 addition & 1 deletion releases/1.7/svtminion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ $STATUS_CODES = @{
"removing" = 104;
"removeFailed" = 105;
"externalInstall" = 106;
"installedStopped" = 107;
"installedStopped" = 100;
"scriptFailed" = 126;
"scriptTerminated" = 130;
100 = "installed";
Expand Down
3 changes: 2 additions & 1 deletion tests/linux/test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ cat /etc/salt/minion
cat /etc/salt/minion | grep 'master:\ 192.168.0.5' 1>/dev/null
ps -ef | grep salt
systemctl is-active salt-minion
./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 107 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
## VM Tools doesn't support 107 for now... until then we return 100
./svtminion.sh --stop --loglevel debug || { _retn=$?; if [[ ${_retn} -eq 100 ]]; then echo "test correct"; else echo "test failed, salt-minion should be stopped, returned '${_retn}'"; exit 1; fi; }
ps -ef | grep salt
systemctl is-active salt-minion || { echo "test correct"; }
ps -ef | grep salt
Expand Down
9 changes: 4 additions & 5 deletions windows/svtminion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ $STATUS_CODES = @{
"removing" = 104;
"removeFailed" = 105;
"externalInstall" = 106;
"installedStopped" = 107;
# VM Tools currently doesn't support 107. We'll add this back
# once they do. So, until then, we just return 100
"installedStopped" = 100;
"scriptFailed" = 126;
"scriptTerminated" = 130;
100 = "installed";
Expand Down Expand Up @@ -615,10 +617,7 @@ function Get-Status {
$current_status = $STATUS_CODES["notInstalled"]
} elseif ( $service_status -ne "Running" ) {
Write-Log "Service not running" -Level debug
# VM Tools currently doesn't support this. We'll add this back
# once they do. So, until then, we just return installed
#$current_status = $STATUS_CODES["installedStopped"]
$current_status = $STATUS_CODES["installed"]
$current_status = $STATUS_CODES["installedStopped"]
}
}

Expand Down

0 comments on commit 0fcf979

Please sign in to comment.