diff --git twisted/python/test/test_dist.py twisted/python/test/test_dist.py
index 34c6789..f7c32d2 100644
--- twisted/python/test/test_dist.py
+++ twisted/python/test/test_dist.py
@@ -8,6 +8,7 @@ Tests for parts of our release automation system.
 
 import os
 import sys
+from collections import Counter
 
 from distutils.core import Distribution
 
@@ -198,6 +199,84 @@ version = versions.Version("twisted.blat", 9, 8, 10)
 
 
 
+class GetAllScriptsTest(TestCase):
+    """
+    Tests for L{dist.getAllScripts} which lists all the scripts that should be
+    included in a complete distribution of Twisted, with its subprojects.
+    """
+
+    # getAllScripts relies on a list in twisted.python.dist.twisted_subprojects
+    # to tell it what subprojects might have scripts it needs to get. It
+    # searches recursively in bin/, at the root of the Twisted distribution.
+    # Thus testing it relies on manipulating the contents of that list and
+    # directory.
+
+    def setUp(self):
+        # A mock up of Twisted's root directory.
+        basedir = self.mktemp()
+        os.mkdir(basedir)
+        os.mkdir(os.path.join(basedir, 'bin'))
+        # The temporary directories will be deleted by Trial.
+
+        # getAllScripts uses a hardcoded relative path.
+        oldCWD = os.getcwd()
+        os.chdir(basedir)
+        self.addCleanup(os.chdir, oldCWD)
+
+    def test_getsCorrectScripts(self):
+        """
+        L{getAllScripts} lists exactly the scripts in Twisted and its
+        subprojects that should be included in a distribution. It may encounter
+        additional scripts, files, or directories, but it will not list them
+        unless unless they are part of a Twisted subproject (see
+        twisted.dist.twisted_subprojects).
+        """
+        import os
+        from twisted.python import dist
+
+        # Mock up getScripts to record its interactions with getAllScripts. The
+        # real getScripts is tested separately.
+        directoriesQueried = list()
+        scriptsGiven = list()
+        def mock_getScripts(projname, basedir=''):
+            directoriesQueried.append(projname)
+            scripts = ["dummyScript", "dummyScript2"]
+            scriptsGiven.extend(scripts)
+            return scripts
+        self.patch(dist, "getScripts", mock_getScripts)
+
+        # Create some dummy subprojects for getAllScripts to look at.
+        dummySubprojects = ["random", "subproject", "names", "kitty_kat"]
+        # Also create some more directories that look like subprojects but
+        # aren't listed as subprojects. getAllScripts should ignore them.
+        redHerringDirectories = ["some", "directories", "meow"]
+        # Also create some files that match the names of subprojects.
+        # getAllScripts should ignore these as well.
+        redHerringFiles = ["a", "few", "files"]
+        # Just for kicks: files that do NOT match the name of a subproject.
+        completelyUnrelatedFiles = ["unrelated", "file"]
+
+        self.patch(dist,
+                   "twisted_subprojects",
+                   dummySubprojects + redHerringFiles)
+
+        for name in dummySubprojects + redHerringDirectories:
+            os.mkdir(os.path.join("bin", name))
+        for name in redHerringFiles + completelyUnrelatedFiles:
+            open(name, "w").close()
+        # These are in Trial's temp directory, so we don't have to worry about
+        # deleting them.
+
+        scriptsReturned = dist.getAllScripts()
+
+        # Check that getAllScripts called getScripts on the right directories.
+        self.assertEqual(Counter(directoriesQueried),
+                         Counter(dummySubprojects + ['']))
+        # Check that getAllScripts aggregated the scripts correctly.
+        self.assertEqual(Counter(scriptsReturned),
+                         Counter(scriptsGiven))
+        # For both lists: order doesn't matter, but multiplicity does.
+
 class GetScriptsTest(TestCase):
     """
     Tests for L{dist.getScripts} which returns the scripts which should be
diff --git twisted/topfiles/6137.misc twisted/topfiles/6137.misc
new file mode 100644
index 0000000..e69de29
