HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 0850 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 0850.


Report 0850 Actions


    Problem Report Number 0850
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Test Suite Deficiency (TSD)
    Problem Resolution ID TSD.X.0365
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published 1996-01-02 08:00
    Product Standard Commands and Utilities V2 (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSC version 4.1.4
    Test Identification POSIX.cmd/tail 21 22 23
    Problem Summary TSD4C.00146 This test may fail on implementations because there may be insufficient time for the background process to generate the output before it is read by the compare process.
    Problem Text
    This test may fail on implementations because there may be
    insufficient time for the background process to generate the output
    before it is read by the compare process.

    The tail command FAILS intermittently in Assertions 21, 22, 23

    We are providing below our argument and analysis for Assertion #23.
    The same argument will hold good for the assertions 21 & 22 also.

    Below is an extract from tp23 (we have underlined some lines and
    numbered them for reference in the discussion below )

    tp23() {
    $TST_TRACE
    CT_STDOUT=out.stdout
    CT_STDERR=out.stderr
    .
    .
    .

    # Obtain a private copy of the input file and create expected output file
    # by invoking utility without -f option:
    cp more_than_10 file_23_infile > /dev/null 2>&1
    if [ $? -ne 0 ]; then
    SetResult $TET_UNRESOLVED "Command failed: 'cp more_than_10
    file_23_infile > /dev/null 2>&1'"
    return
    fi

    tail -10c < file_23_infile > file_23_exp 2>/dev/null
    if [ $? -ne 0 ]; then
    SetResult $TET_UNRESOLVED "Command failed: 'tail -10c < file_23_infile
    > file_23_exp 2>/dev/null'"
    return
    fi


    # Invoke 'tail -c 10 -f < file_21_infile' as a background process,
    redirecting
    # standard output to a temporary file and capturing its pid:

    tail -c 10 -f < file_23_infile > file_23_temp 2> /dev/null & ---------> ( 1 )
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    if [ $? -ne 0 ]; then
    SetResult $TET_FAIL "Command failed: 'tail -c 10 -f < file_23_infile >
    file_23_temp 2> /dev/null &'"
    else
    SetResult $TET_PASS
    fi

    proc_id=$!

    # Verify that the command WITHOUT the -f option generates same stdout as it
    # does WITH the -f option:

    cmp -s file_23_exp file_23_temp -----------------> ( 2 )
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    if [ $? -ne 0 ]; then
    SetResult $TET_FAIL "Command failed: 'cmp -s file_23_exp file_23_temp'"
    else
    SetResult $TET_PASS
    fi


    Command (2) is being executed after puting command (1) in the
    background. This is assuming that command (1) would have completed
    writing to the file "file_23_temp" before command (2) compares it with
    the expected output file "file_23_exp". This is incorrect assumption
    and cannot be guaranteed to be valid always.

    Hence we believe this is a Test Suite Deficiency and should be waivered.

    One possible suggestion to fix the test would be to introduce a sufficient
    Delay between the two process ( i.e. the tail -f and the cmp command ).

    Test Output
    400|1 21 1 13:34:37|IC Start
    200|1 1 13:34:37|TP Start
    520|1 1 16734 1 1|Assertion #21 (A): tail -cf file writes to standard output ex
    actly what would be written by tail -10c file and then does not terminate but r
    eads other bytes from file
    520|1 1 16734 1 1|Command failed: 'cmp -s file_21_exp file_21_temp'
    220|1 1 1 13:34:48|FAIL
    410|1 21 1 13:34:48|IC End

    400|1 22 1 13:01:54|IC Start
    200|1 1 13:01:54|TP Start
    520|1 1 11351 1 1|Assertion #22 (A): When stdin a regular file, tail -f writes
    to stdout exactly what would be written without the -f option and does not term
    inate but reads other bytes from stdin when they become available.
    520|1 1 11351 1 1|Command failed: 'cmp -s file_22_temp_d file_22_exp_d'
    220|1 1 1 13:03:19|FAIL
    410|1 22 1 13:03:19|IC End

    400|1 23 1 12:53:26|IC Start
    200|1 1 12:53:26|TP Start
    520|1 1 9744 1 1|Assertion #23 (A): When stdin is regular file, tail -cf file w
    rites to stdout exactly what would be written by tail -10c file, and then does
    not terminates but reads other bytes from file
    520|1 1 9744 1 1|Command failed: 'cmp -s file_23_exp file_23_temp'
    220|1 1 1 12:53:37|FAIL
    410|1 23 1 12:53:37|IC End
    80|1 0 12:53:38|TC End

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We agree this is a test suite deficiency in the test
    suite version(s) listed.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Test Suite Deficiency (TSD)
    Review Conclusion
    This is an agreed Test Suite Deficiency.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority