"allow-stderr" tests that produce stderr output always pass

Bug #1210503 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autopkgtest (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Steps to reproduce:

1. Write a test that produces stderr output, but then returns exit status 1.
2. Run adt-run against the test.

Expected results: test failure.
Actual results: test pass.

This seems to be due to the following code ("rc" contains the exit status of the test run).

        if stab.st_size != 0:
                l = open(se_read).readline()
                l = l.rstrip('\n \t\r')
                if 'allow-stderr' not in t.restriction_names:
                    if len(l) > 35: l = l[:35] + '...'
                    t.reportfail('status: %d, stderr: %s' % (rc, l))
                else:
                    t.report('PASS')
                t._debug(' - - - - - - - - - - stderr - - - - - - - - - -')
                debug_file(se_read)
        elif rc != 0:
                t.reportfail('non-zero exit status %d' % rc)
        else:
                t.report('PASS')

Tags: patch

Related branches

Revision history for this message
Robie Basak (racb) wrote :

Patch attached.

tags: added: patch
Revision history for this message
Martin Pitt (pitti) wrote :

Oh crud, sorry for this blunder. Thanks for the report and the patch!

Changed in autopkgtest (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Committed to Debian git, uploading now and will sync into saucy once it got imported. Thanks!

Changed in autopkgtest (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopkgtest - 2.3.3

---------------
autopkgtest (2.3.3) unstable; urgency=low

  * runner/adt-run: Drop "errors" keyword from decode() call to fix
    compatibility with earlier Python versions. Thanks Christoph Berg.
  * adt-run: Fail tests if they exit with nonzero if "allow-stderr"
    restriction is set. Thanks Robie Basak! (LP: #1210503)

 -- Martin Pitt <email address hidden> Mon, 09 Sep 2013 15:49:52 -0400

Changed in autopkgtest (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.