Opened 8 years ago

Closed 8 years ago

#1418 closed defect (fixed)

SystemTest_Cleaning the obsolete and deprecated and incorrect outputs.

Reported by: Bang Pham Huu Owned by: Bang Pham Huu
Priority: major Milestone: 9.3
Component: systemtest Version: development
Keywords: system test Cc: Dimitar Misev, Vlad Merticariu
Complexity: Medium

Description (last modified by Dimitar Misev)

After running test.sh (e.g: test_wcs), it will collect all the failed cases and also known fails in failed_cases.

It mixed up between real error cases and known fails cases in this files and need to search for differentiating these cases.

These known fails test cases can be written to another file (failed_known_cases) to see the request detail.

Change History (9)

comment:1 by Bang Pham Huu, 8 years ago

this ticket will remove xxd in system util/common.sh for encoding WCPS test as it is simple to fix instead of upload an unnamed patch.

comment:2 by Dimitar Misev, 8 years ago

Please also replace the use of which with type or command:

util/common.sh:  which rasmgr > /dev/null
util/common.sh:  which psql > /dev/null
util/common.sh:  which wget > /dev/null
util/common.sh:  which ncdump > /dev/null
util/common.sh:  which gdal_translate > /dev/null
util/common.sh:  [ $(which sqlite3) ] || error "sqlite3 not found, please install."

comment:3 by Dimitar Misev, 8 years ago

Some of those tests actually may be outdated:

  • psql should be removed as we don't use it anymore as far as I know?
    • this should be removed as it's unused:
      util/common.sh:export PGSQL="psql -d $RASDB --port $PG_PORT"
      
    • this should probably be removed in some way:
      util/common.sh:export PSQL="psql -d $PS_DB --port $PG_PORT"
      util/petascope.sh:  id=`$PSQL -c  "select id from ps_coverage where name = '$c' " | head -3 | tail -1`
      util/petascope.sh:  $PSQL --list | egrep "\b$PS_DB\b" > /dev/null
      util/petascope.sh:  M=`psql -d petascopedb -c "SELECT * FROM information_schema.tables WHERE table_schema = 'public'" | grep ps_multipoint`
      util/petascope.sh:    c_id=$($PSQL -c  "select id from ps_coverage where name = '$c' " | head -3 | tail -1) > /dev/null
      util/petascope.sh:      $PSQL -c "DELETE FROM ps_coverage WHERE id=$c_id" > /dev/null
      
  • wget should be replaced with curl? we are using both, and it would be better if we stick to one. Here are the occurrences:
    util/common.sh:export WGET="wget"
    util/common.sh:export WGET_CODE_SERVER_ERROR=8 # See https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html
    util/common.sh:check_wget()
    util/common.sh:  which wget > /dev/null
    util/common.sh:    error "wget missing, please install."
    util/common.sh:  $WGET -q "${SECORE_URL}/crs" -O /dev/null
    util/common.sh:# when wget returns empty file, using curl to get the error in page content.
    util/common.sh:wget_error(){
    util/common.sh:                    $WGET -q "$RASQL_SERVLET?$QUERY" -O "$out"
    util/common.sh:                    WGET_EXIT_CODE=$?
    util/common.sh:                    if [[ $WGET_EXIT_CODE != 0 ]]; then
    util/common.sh:                      echo "Error when processing Rasql-Servlet request in KVP, query return error: "$WGET_EXIT_CODE
    util/common.sh:                      wget_error "$RASQL_SERVLET?$QUERY" "$out"
    util/common.sh:                    $WGET -q --post-data "query=$QUERY" $WCPS_URL -O "$out"
    util/common.sh:                    WGET_EXIT_CODE=$?
    util/common.sh:                    if [[ $WGET_EXIT_CODE != 0 ]]; then
    util/common.sh:                        echo "Error when processing WCPS request in KVP, query return error: "$WGET_EXIT_CODE
    util/common.sh:                        wget_error "$WCPS_EMBEDDED_URL""$QUERY" "$out"
    util/common.sh:                    $WGET -q --header "Content-Type: text/xml" --post-file "$postdata" "$WCS_URL" -O "$out"
    util/common.sh:                    WGET_EXIT_CODE=$?
    util/common.sh:                    if [[ $WGET_EXIT_CODE != 0 ]]; then
    util/common.sh:                      echo "Error when processing WCPS request in SOAP, query return error: "$WGET_EXIT_CODE
    util/common.sh:                      wget_error "$WCPS_EMBEDDED_URL""$QUERY" "$out"
    util/common.sh:                kvp) $WGET -q "$WCS_URL?$QUERY" -O "$out"
    util/common.sh:                     WGET_EXIT_CODE=$?
    util/common.sh:		                 # wget cannot get the error page, then need curl to download error and save to output file.
    util/common.sh:                     if [[ $WGET_EXIT_CODE != 0 ]]; then
    util/common.sh:                        echo "Error when processing WCS request in KVP, query return error: "$WGET_EXIT_CODE
    util/common.sh:                        wget_error "$WCS_URL?$QUERY" "$out"
    util/common.sh:                     $WGET -q --header "Content-Type: text/xml" --post-file "$postdata" "$WCS_URL" -O "$out"
    util/common.sh:                     WGET_EXIT_CODE=$?
    util/common.sh:      wms)    $WGET -q "$WMS_URL?$QUERY" -O "$out"
    util/common.sh:              WGET_EXIT_CODE=$?
    util/common.sh:              $WGET -q "$SECORE_URL$QUERY" -O "$out"
    util/common.sh:              WGET_EXIT_CODE=$?
    util/common.sh:              if [[ $WGET_EXIT_CODE != 0 ]]; then
    util/common.sh:                 echo "Error when processing CRS request in SECORE, query return error: "$WGET_EXIT_CODE
    util/common.sh:                 wget_error "$SECORE_URL$QUERY" "$out"
    util/common.sh:        #       but with an exception body, since `wget` does _not_ fetch the content of an error response.
    util/common.sh:        # This test is supposed to raise an exception: check wget exit code instead of the response.
    util/common.sh:        test "$WGET_CODE_SERVER_ERROR" = "$WGET_EXIT_CODE"
    util/test_oracle.sh:check_wget
    util/petascope.sh:  $WGET -q $WCPS_URL -O /dev/null
    
  • ncdump check should be moved to testcases_mandatory/test_netcdf/test.sh, where it's only needed I think
  • sqlite3 check should be moved to testcases_manual/test_crash_rasserver/test.sh where it's only used

comment:4 by Bang Pham Huu, 8 years ago

on make check

grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
grep: known_fails: No such file or directory
Last edited 8 years ago by Bang Pham Huu (previous) (diff)

comment:5 by Dimitar Misev, 8 years ago

In test_all_wcst_import the std output should be only:

importing coverage X… ok.
or
importing coverage X… failed.

The full output should go to a log file, and failed cases should be logged in failed_cases log.

comment:6 by Dimitar Misev, 8 years ago

Description: modified (diff)

Another request, some file renaming (take care to update the .gitignore):

  • failed_casesfailed_cases.log
  • logtest.log

comment:7 by Dimitar Misev, 8 years ago

Cc: Vlad Merticariu added
Description: modified (diff)

comment:8 by Bang Pham Huu, 8 years ago

Keywords: system test added
Summary: SystemTest_Remove known fails from failed_cases logSystemTest_Cleaning the obsolete and deprecated and incorrect outputs.

comment:9 by Bang Pham Huu, 8 years ago

Resolution: fixed
Status: newclosed

the patch was applied.

Note: See TracTickets for help on using tickets.