aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/subsystem/linux/maintainers_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-01-10 12:03:02 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-02-10 14:34:44 +0100
commitf67b38c100fe027e65530ef702b7b4dc45b53ccd (patch)
tree0e7081a87743cb494505e0a90bc160688f3044e0 /pkg/subsystem/linux/maintainers_test.go
parent7ee3f3729011edc355cf089f7823ec8c8f366457 (diff)
pkg/subsystem: add the MAINTAINERS file parsing code
Diffstat (limited to 'pkg/subsystem/linux/maintainers_test.go')
-rw-r--r--pkg/subsystem/linux/maintainers_test.go174
1 files changed, 174 insertions, 0 deletions
diff --git a/pkg/subsystem/linux/maintainers_test.go b/pkg/subsystem/linux/maintainers_test.go
new file mode 100644
index 000000000..874bdcaa7
--- /dev/null
+++ b/pkg/subsystem/linux/maintainers_test.go
@@ -0,0 +1,174 @@
+// Copyright 2023 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+package linux
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+)
+
+func TestLinuxMaintainers(t *testing.T) {
+ result, err := parseLinuxMaintainers(
+ strings.NewReader(maintainersSample),
+ )
+ if err != nil {
+ t.Fatal(err)
+ }
+ targetResult := []*maintainersRecord{
+ {
+ name: "3C59X NETWORK DRIVER",
+ includePatterns: []string{
+ "Documentation/networking/device_drivers/ethernet/3com/vortex.rst",
+ "drivers/net/ethernet/3com/3c59x.c",
+ },
+ lists: []string{"netdev@vger.kernel.org"},
+ maintainers: []string{"email1@kernel.org"},
+ },
+ {
+ name: "ABI/API",
+ includePatterns: []string{
+ "include/linux/syscalls.h",
+ "kernel/sys_ni.c",
+ },
+ excludePatterns: []string{
+ "include/uapi/",
+ "arch/*/include/uapi/",
+ },
+ lists: []string{"linux-api@vger.kernel.org"},
+ },
+ {
+ name: "AD1889 ALSA SOUND DRIVER",
+ includePatterns: []string{"sound/pci/ad1889.*"},
+ lists: []string{"linux-parisc@vger.kernel.org"},
+ },
+ {
+ name: "PVRUSB2 VIDEO4LINUX DRIVER",
+ includePatterns: []string{
+ "Documentation/driver-api/media/drivers/pvrusb2*",
+ "drivers/media/usb/pvrusb2/",
+ },
+ lists: []string{
+ "pvrusb2@isely.net",
+ "linux-media@vger.kernel.org",
+ },
+ maintainers: []string{"email2@kernel.org"},
+ },
+ {
+ name: "RISC-V ARCHITECTURE",
+ includePatterns: []string{"arch/riscv/"},
+ regexps: []string{"riscv"},
+ lists: []string{"linux-riscv@lists.infradead.org"},
+ maintainers: []string{
+ "email3@kernel.org",
+ "email4@kernel.org",
+ "email5@kernel.org",
+ },
+ },
+ {
+ name: "THE REST",
+ includePatterns: []string{"*", "*/"},
+ lists: []string{"linux-kernel@vger.kernel.org"},
+ maintainers: []string{"email6@kernel.org"},
+ },
+ }
+ if diff := cmp.Diff(targetResult, result,
+ cmp.AllowUnexported(maintainersRecord{})); diff != "" {
+ t.Fatal(diff)
+ }
+}
+
+const maintainersSample = `
+List of maintainers and how to submit kernel changes
+====================================================
+
+Please try to follow the guidelines below. This will make things
+easier on the maintainers. Not all of these guidelines matter for every
+trivial patch so apply some common sense.
+
+Tips for patch submitters
+-------------------------
+
+1. Always *test* your changes, however small, on at least 4 or
+ 5 people, preferably many more.
+
+< ... >
+
+8. Happy hacking.
+
+Descriptions of section entries and preferred order
+---------------------------------------------------
+
+ M: *Mail* patches to: FullName <address@domain>
+ R: Designated *Reviewer*: FullName <address@domain>
+ These reviewers should be CCed on patches.
+< ... >
+ K: *Content regex* (perl extended) pattern match in a patch or file.
+ For instance:
+ K: of_get_profile
+ matches patches or files that contain "of_get_profile"
+ K: \b(printk|pr_(info|err))\b
+ matches patches or files that contain one or more of the words
+ printk, pr_info or pr_err
+ One regex pattern per line. Multiple K: lines acceptable.
+
+Maintainers List
+----------------
+
+.. note:: When reading this list, please look for the most precise areas
+ first. When adding to this list, please keep the entries in
+ alphabetical order.
+
+3C59X NETWORK DRIVER
+M: Name1 Surname <email1@kernel.org>
+L: netdev@vger.kernel.org
+S: Odd Fixes
+F: Documentation/networking/device_drivers/ethernet/3com/vortex.rst
+F: drivers/net/ethernet/3com/3c59x.c
+
+ABI/API
+L: linux-api@vger.kernel.org
+F: include/linux/syscalls.h
+F: kernel/sys_ni.c
+X: include/uapi/
+X: arch/*/include/uapi/
+
+AD1889 ALSA SOUND DRIVER
+L: linux-parisc@vger.kernel.org
+S: Maintained
+W: https://parisc.wiki.kernel.org/index.php/AD1889
+F: sound/pci/ad1889.*
+
+PVRUSB2 VIDEO4LINUX DRIVER
+M: Name2 <email2@kernel.org>
+L: pvrusb2@isely.net (subscribers-only)
+L: linux-media@vger.kernel.org
+S: Maintained
+W: http://www.isely.net/pvrusb2/
+T: git git://linuxtv.org/media_tree.git
+F: Documentation/driver-api/media/drivers/pvrusb2*
+F: drivers/media/usb/pvrusb2/
+
+RISC-V ARCHITECTURE
+M: Name3 <email3@kernel.org>
+M: Name4 <email4@kernel.org>
+M: Name5 <email5@kernel.org>
+L: linux-riscv@lists.infradead.org
+S: Supported
+Q: https://patchwork.kernel.org/project/linux-riscv/list/
+P: Documentation/riscv/patch-acceptance.rst
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
+F: arch/riscv/
+N: riscv
+K: riscv
+
+THE REST
+M: Name6 <email6@kernel.org>
+L: linux-kernel@vger.kernel.org
+S: Buried alive in reporters
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+F: *
+F: */
+`