test_local_curl.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash -x
  2. url_path=/
  3. domain=fl.tst
  4. install_dir=/root/tmp/install_dir
  5. data_dir=/root/tmp/data_dir
  6. . /usr/share/yunohost/helpers
  7. . /root/flohmarkt_ynh/scripts/_common.sh
  8. # Here we now have TWO subroutines to compare:
  9. #
  10. # ynh_handle_getopts_args (old implementation)
  11. # flohmarkt_ynh_handle_getopts_args (new implentation)
  12. #
  13. # There shouldn't be any case in which the results of situations both can handle
  14. # differ.
  15. #
  16. # @@ TODO: write some routine that compares for a list of examples the results
  17. #
  18. # https://stackoverflow.com/questions/1203583/how-do-i-rename-a-bash-function describes how to
  19. # replace an existing subroutine with an own one.
  20. #
  21. # idea: replace ynh_handle_getopts_args by a sub that runs old and new versions and compares
  22. # output. Performance impact: yes. But testing made very simple by real use and optional fallback
  23. # to old version.
  24. flohmarkt_ynh_local_curl --location http://127.0.0.1/go_ahead -n --data blafasel -d foo -d bar -H 'header1: blafasel' --header 'header2: foobar'
  25. # -u admin -p bla
  26. # flohmarkt_ynh_local_curl -n -H '-header1' --header 'header2: bar' --header='-header3: ups' -- /path "key1=value1" "key2=value2"
  27. # ups...
  28. # flohmarkt_ynh_local_curl $*