Skip to content

Commit

Permalink
Merge pull request #1279 from jkonecny12/fix-RESULT-validation
Browse files Browse the repository at this point in the history
Fix RESULT validation
  • Loading branch information
jkonecny12 authored Aug 13, 2024
2 parents 9ecebf2 + a5531a1 commit 879933b
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 39 deletions.
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 @@ -219,7 +219,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

0 comments on commit 879933b

Please sign in to comment.