From 0fcf9799d513dda347dcf77ce583a41992a51b56 Mon Sep 17 00:00:00 2001 From: twangboy Date: Fri, 6 Dec 2024 11:16:30 -0700 Subject: [PATCH] Remove 107 from linux script, use 100 --- .gitlab-ci.yml | 6 ++++-- releases/1.7/svtminion.ps1 | 2 +- tests/linux/test-linux.sh | 3 ++- windows/svtminion.ps1 | 9 ++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f6d405..e07a6ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -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 diff --git a/releases/1.7/svtminion.ps1 b/releases/1.7/svtminion.ps1 index 0bdc442..e910002 100644 --- a/releases/1.7/svtminion.ps1 +++ b/releases/1.7/svtminion.ps1 @@ -291,7 +291,7 @@ $STATUS_CODES = @{ "removing" = 104; "removeFailed" = 105; "externalInstall" = 106; - "installedStopped" = 107; + "installedStopped" = 100; "scriptFailed" = 126; "scriptTerminated" = 130; 100 = "installed"; diff --git a/tests/linux/test-linux.sh b/tests/linux/test-linux.sh index ea9df54..768ed1a 100755 --- a/tests/linux/test-linux.sh +++ b/tests/linux/test-linux.sh @@ -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 diff --git a/windows/svtminion.ps1 b/windows/svtminion.ps1 index c7b89c9..541d90f 100644 --- a/windows/svtminion.ps1 +++ b/windows/svtminion.ps1 @@ -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"; @@ -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"] } }