You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. #!/bin/bash
  2. set -e
  3. source $(dirname $0)/helpers.sh
  4. # resource_dir=$(cd $(dirname $0)/../assets && pwd)
  5. # set FILE_URL_WITH_LAST_MODIFIED_INFO with a URL of a file whose HTTP HEADER info provides a Last-Modified entry
  6. # to check it do "curl -I -R <url>"
  7. export FILE_URL_WITH_LAST_MODIFIED_INFO=https://s3-us-west-1.amazonaws.com/lsilva-bpws/PCF_usage/pcf-sandbox-usage-from-2016-09-01-to-2016-09-30_1475771124.json
  8. # set FILE_URL_WITHOUT_LAST_MODIFIED_INFO with a URL of a file whose HTTP HEADER info DOES NOT provide a Last-Modified entry
  9. # to check it do "curl -I -R <url>"
  10. export FILE_URL_WITHOUT_LAST_MODIFIED_INFO=https://raw.githubusercontent.com/pivotalservices/concourse-curl-resource/master/test/data/pivotal-1.0.0.txt
  11. it_can_get_file_with_last_modified_info() {
  12. echo $resource_dir
  13. jq -n "{
  14. source: {
  15. url: $(echo $FILE_URL_WITH_LAST_MODIFIED_INFO | jq -R .)
  16. }
  17. }" | $resource_dir/check "$FILE_URL_WITH_LAST_MODIFIED_INFO" | tee /dev/stderr
  18. }
  19. it_can_get_file_without_last_modified_info() {
  20. $resource_dir/check "$FILE_URL_WITHOUT_LAST_MODIFIED_INFO" | tee /dev/stderr
  21. }
  22. run it_can_get_file_with_last_modified_info
  23. run it_can_get_file_without_last_modified_info