Skip to content

Commit

Permalink
hack/update-expected.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed May 18, 2021
1 parent 753f294 commit b22d088
Show file tree
Hide file tree
Showing 110 changed files with 526 additions and 2,622 deletions.
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
24 changes: 4 additions & 20 deletions pkg/model/tests/data/bootstrapscript_5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ download-or-bust() {
echo "== Download failed with ${cmd} =="
continue
fi
if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then
if [[ ! validate-hash "${file}" "${hash}"; then
echo "== Hash validation of ${url} failed. Retrying. =="
rm -f "${file}"
else
if [[ -n "${hash}" ]]; then
echo "== Downloaded ${url} (SHA1 = ${hash}) =="
else
echo "== Downloaded ${url} =="
fi
echo "== Downloaded ${url} (SHA256 = ${hash}) =="
return
fi
done
Expand Down Expand Up @@ -101,17 +97,9 @@ function split-commas() {

function try-download-release() {
local -r nodeup_urls=( $(split-commas "${NODEUP_URL}") )
if [[ -n "${NODEUP_HASH:-}" ]]; then
local -r nodeup_hash="${NODEUP_HASH}"
else
# TODO: Remove?
echo "Downloading sha256 (not found in env)"
download-or-bust nodeup.sha256 "" "${nodeup_urls[@]/%/.sha256}"
local -r nodeup_hash=$(cat nodeup.sha256)
fi

echo "Downloading nodeup (${nodeup_urls[@]})"
download-or-bust nodeup "${nodeup_hash}" "${nodeup_urls[@]}"
download-or-bust nodeup "${NODEUP_HASH}" "${nodeup_urls[@]}"

chmod +x nodeup
}
Expand All @@ -132,12 +120,8 @@ function download-release() {
;;
esac

# In case of failure checking integrity of release, retry.
cd ${INSTALL_DIR}/bin
until try-download-release; do
sleep 15
echo "Couldn't download release. Retrying..."
done
try-download-release

echo "Running nodeup"
# We can't run in the foreground because of https://github.com/docker/docker/issues/23793
Expand Down
Loading

0 comments on commit b22d088

Please sign in to comment.