From 1a7bb9d21eee4f3fcb7adaa8d669d60e7ab28dcf Mon Sep 17 00:00:00 2001 From: Justin SB Date: Sat, 5 Oct 2019 15:32:25 -0400 Subject: [PATCH] Update expected test output --- pkg/model/tests/data/bootstrapscript_0.txt | 45 ++--- pkg/model/tests/data/bootstrapscript_1.txt | 45 ++--- pkg/model/tests/data/bootstrapscript_2.txt | 45 ++--- pkg/model/tests/data/bootstrapscript_3.txt | 45 ++--- pkg/model/tests/data/bootstrapscript_4.txt | 45 ++--- pkg/model/tests/data/bootstrapscript_5.txt | 45 ++--- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 90 ++++----- .../cloudformation.json.extracted.yaml | 180 ++++++++---------- .../cloudformation.json.extracted.yaml | 180 ++++++++---------- 14 files changed, 520 insertions(+), 650 deletions(-) diff --git a/pkg/model/tests/data/bootstrapscript_0.txt b/pkg/model/tests/data/bootstrapscript_0.txt index 8fa40b20bf..199a41c57a 100644 --- a/pkg/model/tests/data/bootstrapscript_0.txt +++ b/pkg/model/tests/data/bootstrapscript_0.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/pkg/model/tests/data/bootstrapscript_1.txt b/pkg/model/tests/data/bootstrapscript_1.txt index 32f5403cd0..c04ce98b40 100644 --- a/pkg/model/tests/data/bootstrapscript_1.txt +++ b/pkg/model/tests/data/bootstrapscript_1.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/pkg/model/tests/data/bootstrapscript_2.txt b/pkg/model/tests/data/bootstrapscript_2.txt index 32f5403cd0..c04ce98b40 100644 --- a/pkg/model/tests/data/bootstrapscript_2.txt +++ b/pkg/model/tests/data/bootstrapscript_2.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/pkg/model/tests/data/bootstrapscript_3.txt b/pkg/model/tests/data/bootstrapscript_3.txt index 978fb14765..9b23f80057 100644 --- a/pkg/model/tests/data/bootstrapscript_3.txt +++ b/pkg/model/tests/data/bootstrapscript_3.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/pkg/model/tests/data/bootstrapscript_4.txt b/pkg/model/tests/data/bootstrapscript_4.txt index 2c6ec462fe..7b288d37b9 100644 --- a/pkg/model/tests/data/bootstrapscript_4.txt +++ b/pkg/model/tests/data/bootstrapscript_4.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/pkg/model/tests/data/bootstrapscript_5.txt b/pkg/model/tests/data/bootstrapscript_5.txt index 2c6ec462fe..7b288d37b9 100644 --- a/pkg/model/tests/data/bootstrapscript_5.txt +++ b/pkg/model/tests/data/bootstrapscript_5.txt @@ -60,35 +60,30 @@ download-or-bust() { urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml index c51e07aec0..155c9526f0 100644 --- a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersadditionalcidrex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -338,35 +333,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionalcidrexamplecom.Propert urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml index 288feb6c2c..297e35cfd9 100644 --- a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml @@ -54,35 +54,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -367,35 +362,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/complex/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/complex/cloudformation.json.extracted.yaml index 90d7a92d80..a585dcd2b8 100644 --- a/tests/integration/update_cluster/complex/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/complex/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amasterscomplexexampleco urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -340,35 +335,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodescomplexexamplecom.Properties.Use urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml index d692eb5e8f..8024e02518 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -338,35 +333,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml index 6d0180997c..c47bbd8ffa 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -338,35 +333,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties. urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml index d692eb5e8f..8024e02518 100644 --- a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -338,35 +333,30 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml index 8f39e5eecd..508633e986 100644 --- a/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/mixed_instances/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -340,35 +335,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -635,35 +625,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1cmastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -930,35 +915,30 @@ Resources.AWSEC2LaunchTemplatenodesmixedinstancesexamplecom.Properties.LaunchTem urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" diff --git a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml index 8f39e5eecd..508633e986 100644 --- a/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/mixed_instances_spot/cloudformation.json.extracted.yaml @@ -45,35 +45,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -340,35 +335,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -635,35 +625,30 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1cmastersmixedinstancesex urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying" @@ -930,35 +915,30 @@ Resources.AWSEC2LaunchTemplatenodesmixedinstancesexamplecom.Properties.LaunchTem urls=( $* ) while true; do for url in "${urls[@]}"; do - if [[ -e "${file}" ]]; then - echo "== File exists for ${url} ==" - - # CoreOS runs this script in a container without which (but has curl) - # Note also that busybox wget doesn't support wget --version, but busybox doesn't normally have curl - # So we default to wget unless we see curl - elif [[ $(curl --version) ]]; then - if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10 "${url}"; then - echo "== Failed to curl ${url}. Retrying. ==" + commands=( + "curl -f --ipv4 --compressed -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only --compression=auto -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + "curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --retry 6 --retry-delay 10" + "wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10" + ) + for cmd in "${commands[@]}"; do + echo "Attempting download with: ${cmd} {url}" + if ! (${cmd} "${url}"); then + echo "== Download failed with ${cmd} ==" continue fi - else - if ! wget --inet4-only -O "${file}" --connect-timeout=20 --tries=6 --wait=10 "${url}"; then - echo "== Failed to wget ${url}. Retrying. ==" - continue - fi - fi - - if [[ -n "${hash}" ]] && ! 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}) ==" + if [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then + echo "== Hash validation of ${url} failed. Retrying. ==" + rm -f "${file}" else - echo "== Downloaded ${url} ==" + if [[ -n "${hash}" ]]; then + echo "== Downloaded ${url} (SHA1 = ${hash}) ==" + else + echo "== Downloaded ${url} ==" + fi + return fi - return - fi + done done echo "All downloads failed; sleeping before retrying"