Changeset 37217


Ignore:
Timestamp:
2023-01-30T14:39:57+13:00 (15 months ago)
Author:
davidb
Message:

Better error checking/info on what to do

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-installations/test-suite/trunk/sites/test-suite/collect/filelevel-docver--paged-image/_TEST-STEP02--GET-AND-SET-ASSOCFILES.sh

    r37216 r37217  
    2626
    2727
    28 # The following posts to Greenstone3 using CURL, however GS3 action requires user authentication to run
    29 # As written the following when fail, due to it no supplying user-authentication details
    30 # A HACK to do here is edit:
    31 #   gs2build/perllib/cgiactions/metadataaction.pm
    32 # and comment out the GS3_AUTHENTICATED test, changing the Perl code so it always
    33 # loads in modmetadataaction.pm (the module that has all the set-.* actions)
    34 
    3528
    3629cd "$store_cwd"
    37 export GS3_AUTHENTICATED=true
    3830
    3931echo "========"
     
    5042     -F "assocname=09_1_1_1.gif" \
    5143     -F "fileupload=@testing-files/10_1_1_1_CHANGED.gif" \
    52      $gs_context_url/cgi-bin/metadata-server.pl
     44     $gs_context_url/cgi-bin/metadata-server.pl > curl-output.txt
     45
     46fgrep ERROR curl-output.txt >/dev/null 2>&1
     47curl_fgrep_error=$?
     48
     49cat curl-output.txt
     50/bin/rm curl-output.txt
     51
    5352echo ""
    5453echo "--------"
    5554echo ""
    5655
     56if [ $curl_fgrep_error = 0 ] ; then
    5757
    58 echo "+ Checking the following files are different:"
    59 echo "+   import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif"
    60 
    61 ls -li import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif
    62 
    63 diff import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif
    64 
    65 diff_status=$?
    66 
    67 if [ $diff_status != 0 ] ; then
    68     echo "+"
    69     echo "+  Diff-test Successful!"
    70     echo "+"
     58    echo "" >&2
     59    echo "Error: failed to run 'curl' command" >&2
     60   
     61    echo ""
     62    echo "The above 'curl' command posts a form to 'metadata-server.pl' as a URL, "
     63    echo "rather than setting QUERY_STRING and faking a run at the commandline."
     64    echo "This means it the Tomcat server operated version of metadta-server.pl that"
     65    echo "runs, and so the usual trick of setting GS3_AUTHENTICATED inside this script"
     66    echo "doesn't work, and the curl command will fail saying there is no action"
     67    echo "called 'set-archives-assocfile'"
     68    echo ""
     69    echo "A workaround is possible, by adjusting how tomcat is being run:"
     70    echo "    ant stop"
     71    echo "    export GS3_AUTHENTICATED=true"
     72    echo "    ant reset-logs"
     73    echo "    ant start"
     74    echo ""
     75    echo "This effectively pulls off the same within-script trick, only getting"
     76    echo "it into the environment so Tomcat sees it, and passess it on when it"
     77    echo "runs metadata-server.pl"
     78else
     79   
     80    echo "+ Checking the following files are different:"
     81    echo "+   import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif"
     82   
     83    ls -li import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif
     84   
     85    diff import/09/images/09_1_1_1.gif archives/HASH01b0.dir/09_1_1_1.gif
     86   
     87    diff_status=$?
     88   
     89    if [ $diff_status != 0 ] ; then
     90    echo "+"
     91    echo "+  Diff-test Successful!"
     92    echo "+"
     93    fi
    7194fi
    72 
    7395
    7496echo ""
Note: See TracChangeset for help on using the changeset viewer.