Package: autopkgtest
Version: 2.0.0
Severity: normal

Steps to reproduce:
1) apt-get source triplane
2) cd triplane-1.0.6/
3) printf '#!/bin/sh\necho executing test 1\n' > debian/tests/test1
4) printf "Tests: test1\n\n" > debian/tests/control
5) script -c 'sudo adt-run --built-tree . --- adt-virt-null' ../adt.log
6) grep "executing test 1" ../adt.log

Expected results:
6) adt-run runs the test once:

executing test 1

Actual results:
6) adt-run runs the test four times:

executing test 1
executing test 1
executing test 1
executing test 1

More info:
1) I think this happens since

        stz = None      # stz[field_name][index] = (lno, value)
                        # special field names:
                        # stz[' lno'] = number
                        # stz[' tests'] = list of Test objects
        def end_stanza(stz):
                if stz is None: return
                stz[' errs'] = 0
                stanzas.append(stz)
                stz = None
                hcurrent = None

assumes that it could set the outer 'stz' to None from the inner
function. This of course fails and it just touches the local copy.

2) After

--- adt-run.orig        2011-08-10 16:13:18.000000000 +0300
+++ adt-run     2011-08-10 16:32:44.000000000 +0300
@@ -1213,7 +1213,6 @@
                if stz is None: return
                stz[' errs'] = 0
                stanzas.append(stz)
-               stz = None
                hcurrent = None
 
        initre = regexp.compile('([A-Z][-0-9a-z]*)\s*\:\s*(.*)$')
@@ -1223,7 +1222,10 @@
                lno += 1
                if not l.endswith('\n'): badctrl('unterminated line')
                if regexp.compile('\s*\#').match(l): continue
-               if not regexp.compile('\S').match(l): end_stanza(stz); continue
+               if not regexp.compile('\S').match(l):
+                       end_stanza(stz)
+                       stz = None
+                       continue
                initmat = initre.match(l)
                if initmat:
                        (fname, l) = initmat.groups()

the test is only run once. Is

    git://git.chiark.greenend.org.uk/~ianmdlvl/autopkgtest.git

the git tree that I should be using?

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages autopkgtest depends on:
ii  python2.6                     2.6.7-3    An interactive high-level object-o

Versions of packages autopkgtest recommends:
ii  apt-utils                     0.8.15.5   APT utility programs

Versions of packages autopkgtest suggests:
ii  autopkgtest-xenlvm            2.0.0      Xen/LVM2 based testbed snapshot sy
pn  curl                          <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to