Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RESULT validation #1279

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion encrypt-device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /home/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down
2 changes: 1 addition & 1 deletion encrypt-swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down
2 changes: 1 addition & 1 deletion escrow-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down
2 changes: 1 addition & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ check_result_file() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down
2 changes: 1 addition & 1 deletion nosave-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
else
Expand Down
2 changes: 1 addition & 1 deletion nosave-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
else
Expand Down
2 changes: 1 addition & 1 deletion nosave-3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
else
Expand Down
12 changes: 2 additions & 10 deletions proxy-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,8 @@ validate() {
fi
fi

result=$(cat ${tmpdir}/RESULT)
if [[ $? != 0 ]]; then
echo '*** /root/RESULT does not exist in VM image.'
return 1
elif [[ "${result}" != SUCCESS* ]]; then
echo "${result}"
return 1
else
return 0
fi
check_result_file "${tmpdir}"
return $?
}

cleanup() {
Expand Down
12 changes: 2 additions & 10 deletions proxy-cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ validate() {

check_proxy_settings $tmpdir

result=$(cat ${tmpdir}/RESULT)
if [[ $? != 0 ]]; then
echo '*** /root/RESULT does not exist in VM image.'
return 1
elif [[ "${result}" != SUCCESS* ]]; then
echo "${result}"
return 1
else
return 0
fi
check_result_file "${tmpdir}"
return $?
}
12 changes: 2 additions & 10 deletions proxy-kickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,8 @@ validate() {
fi
fi

result=$(cat ${tmpdir}/RESULT)
if [[ $? != 0 ]]; then
echo '*** /root/RESULT does not exist in VM image.'
return 1
elif [[ "${result}" != SUCCESS* ]]; then
echo "${result}"
return 1
else
return 0
fi
check_result_file "${tmpdir}"
return $?
}

cleanup() {
Expand Down
2 changes: 1 addition & 1 deletion raid-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down
2 changes: 1 addition & 1 deletion raid-ddf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ validate() {
if [[ $? != 0 ]]; then
status=1
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != SUCCESS* ]]; then
elif [[ "${result%% *}" != SUCCESS ]]; then
status=1
echo "${result}"
fi
Expand Down