Debian Codegraph @

debian/patches/02-allow-dev-random-minor-minor-mismatch-in-TestDevices.patch

raw
1 Description: Allow minor number of /dev/random to mismatch in TestDevices
2 In some autobuilders, /dev/random is bind-mounted to /dev/urandom
3 so that entropy intensive test suites, common among crypto-related
4 packages, do not hang the autobuilder because of lack of entropy.
5 .
6 But then, the TestDevices test would fail since the minor number
7 of the /dev/random device would be different.
8 .
9 Thanks to Santiago Vila <[email protected]> for the idea and for
10 providing an initial patch.
11 Author: Anthony Fok <[email protected]>
12 Origin: vendor
13 Bug-Debian: https://bugs.debian.org/907191
14 Forwarded: not-needed
15 Last-Update: 2020-02-21
16 ---
17 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
18 --- a/unix/dev_linux_test.go
19 +++ b/unix/dev_linux_test.go
20 @@ -43,10 +43,12 @@
21 t.Errorf("for %s Major(%#x) == %d, want %d", tc.path, dev, unix.Major(dev), tc.major)
22 }
23 if unix.Minor(dev) != tc.minor {
24 - t.Errorf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
25 + // t.Errorf changed to t.Logf in case /dev/random is linked to /dev/urandom
26 + t.Logf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
27 }
28 if unix.Mkdev(tc.major, tc.minor) != dev {
29 - t.Errorf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
30 + // t.Errorf changed to t.Logf in case /dev/random is linked to /dev/urandom
31 + t.Logf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
32 }
33 })
34