scripts: cros_generate_breakpad_symbols: Don't force good symbols from /usr/local

As an add-on to
https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4307796,
don't fail if an ELF from /usr/local does not generate good symbols.
/usr/local is not shipped to end-users, so we shouldn't get crash
reports from those ELFs.

BUG=b:241470012,b:270240549
TEST="cros_generate_breakpad_symbols --board=eve" runs with success and
no "unexpected failure" messages

Change-Id: I02426ae83c416fb47ebb7511a3f72c9e0e5d03f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4322863
Reviewed-by: Cindy Lin <xcl@google.com>
Commit-Queue: Ian Barkley-Yeung <iby@chromium.org>
Tested-by: Ian Barkley-Yeung <iby@chromium.org>
Auto-Submit: Ian Barkley-Yeung <iby@chromium.org>
diff --git a/scripts/cros_generate_breakpad_symbols_unittest.py b/scripts/cros_generate_breakpad_symbols_unittest.py
index 11a726c..beb8ff4 100644
--- a/scripts/cros_generate_breakpad_symbols_unittest.py
+++ b/scripts/cros_generate_breakpad_symbols_unittest.py
@@ -507,12 +507,11 @@
         self.assertNotExists(self.sym_file)
         self.assertEqual(num_errors.value, 0)
 
-    def testAllowlist(self):
-        """Binaries in the allowlist should call _DumpAllowingBasicFallback()"""
-        binary = os.path.join(self.tempdir, "usr/bin/goldctl")
+    def _testBinaryIsInLocalFallback(self, directory, filename):
+        binary = os.path.join(self.tempdir, directory, filename)
         osutils.Touch(binary, makedirs=True)
-        debug_dir = os.path.join(self.debug_dir, "usr/bin")
-        debug_file = os.path.join(debug_dir, "goldctl.debug")
+        debug_dir = os.path.join(self.debug_dir, directory)
+        debug_file = os.path.join(debug_dir, f"{filename}.debug")
         osutils.Touch(debug_file, makedirs=True)
         self.rc.AddCmdResult(["/usr/bin/file", binary], stdout=self.FILE_OUT)
         self.rc.AddCmdResult(
@@ -547,6 +546,14 @@
         self.assertNotExists(self.sym_file)
         self.assertEqual(num_errors.value, 0)
 
+    def testAllowlist(self):
+        """Binaries in the allowlist should call _DumpAllowingBasicFallback()"""
+        self._testBinaryIsInLocalFallback("usr/bin", "goldctl")
+
+    def testUsrLocalSkip(self):
+        """Binaries in /usr/local should call _DumpAllowingBasicFallback()"""
+        self._testBinaryIsInLocalFallback("usr/local", "minidump_stackwalk")
+
 
 class UtilsTestDir(cros_test_lib.TempDirTestCase):
     """Tests ReadSymsHeader."""