Debian Codegraph @

tests/test_linux_debian_8_7_1_ppc64le.py

raw
1
2
3 import unittest
4 from cpuinfo import *
5 import helpers
6
7
8 class MockDataSource:
9 bits = '64bit'
10 cpu_count = 2
11 is_windows = False
12 arch_string_raw = 'ppc64le'
13 uname_string_raw = ''
14 can_cpuid = False
15
16 @staticmethod
17 def has_proc_cpuinfo():
18 return True
19
20 @staticmethod
21 def has_dmesg():
22 return True
23
24 @staticmethod
25 def has_lscpu():
26 return True
27
28 @staticmethod
29 def has_ibm_pa_features():
30 return True
31
32 @staticmethod
33 def ibm_pa_features():
34 returncode = 0
35 output = r'''
36 /proc/device-tree/cpus/PowerPC,POWER8@0/ibm,pa-features
37 18 00 f6 3f c7 c0 80 f0 80 00 00 00 00 00 00 00...?............
38 00 00 80 00 80 00 80 00 80 00 ..........
39
40 '''
41 return returncode, output
42
43 @staticmethod
44 def cat_proc_cpuinfo():
45 returncode = 0
46 output = r'''
47 processor : 0
48 cpu : POWER7 (raw), altivec supported
49 clock : 1000.000000MHz
50 revision : 2.3 (pvr 003f 0203)
51
52 processor : 1
53 cpu : POWER7 (raw), altivec supported
54 clock : 1000.000000MHz
55 revision : 2.3 (pvr 003f 0203)
56
57 timebase : 512000000
58 platform : pSeries
59 model : IBM pSeries (emulated by qemu)
60 machine : CHRP IBM pSeries (emulated by qemu)
61
62 '''
63 return returncode, output
64
65 @staticmethod
66 def dmesg_a():
67 returncode = 0
68 output = r'''
69 [ 0.000000] Allocated 4718592 bytes for 2048 pacas at c00000000fb80000
70 [ 0.000000] Using pSeries machine description
71 [ 0.000000] Page sizes from device-tree:
72 [ 0.000000] base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0
73 [ 0.000000] base_shift=24: shift=24, sllp=0x0100, avpnm=0x00000001, tlbiel=0, penc=0
74 [ 0.000000] Page orders: linear mapping = 24, virtual = 12, io = 12, vmemmap = 24
75 [ 0.000000] Using 1TB segments
76 [ 0.000000] kvm_cma: CMA: reserved 128 MiB
77 [ 0.000000] Found initrd at 0xc000000002f00000:0xc000000003e49d2c
78 [ 0.000000] Partition configured for 2 cpus.
79 [ 0.000000] CPU maps initialized for 1 thread per core
80 [ 0.000000] (thread shift is 0)
81 [ 0.000000] Freed 4653056 bytes for unused pacas
82 [ 0.000000] Starting Linux PPC64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07)
83 [ 0.000000] -----------------------------------------------------
84 [ 0.000000] ppc64_pft_size = 0x18
85 [ 0.000000] physicalMemorySize = 0x80000000
86 [ 0.000000] htab_hash_mask = 0x1ffff
87 [ 0.000000] -----------------------------------------------------
88 [ 0.000000] Initializing cgroup subsys cpuset
89 [ 0.000000] Initializing cgroup subsys cpu
90 [ 0.000000] Initializing cgroup subsys cpuacct
91 [ 0.000000] Linux version 3.16.0-4-powerpc64le ([email protected]) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07)
92 [ 0.000000] [boot]0012 Setup Arch
93 [ 0.000000] Node 0 Memory: 0x0-0x80000000
94 [ 0.000000] PCI host bridge /pci@800000020000000 ranges:
95 [ 0.000000] IO 0x0000010080000000..0x000001008000ffff -> 0x0000000000000000
96 [ 0.000000] MEM 0x00000100a0000000..0x000001101fffffff -> 0x0000000080000000
97 [ 0.000000] PPC64 nvram contains 65536 bytes
98 [ 0.000000] Unable to enable relocation on exceptions: -55
99 [ 0.000000] Zone ranges:
100 [ 0.000000] DMA [mem 0x00000000-0x7fffffff]
101 [ 0.000000] Normal empty
102 [ 0.000000] Movable zone start for each node
103 [ 0.000000] Early memory node ranges
104 [ 0.000000] node 0: [mem 0x00000000-0x7fffffff]
105 [ 0.000000] On node 0 totalpages: 32768
106 [ 0.000000] DMA zone: 28 pages used for memmap
107 [ 0.000000] DMA zone: 0 pages reserved
108 [ 0.000000] DMA zone: 32768 pages, LIFO batch:1
109 [ 0.000000] [boot]0015 Setup Done
110 [ 0.000000] PERCPU: Embedded 2 pages/cpu @c000000000e00000 s102400 r0 d28672 u524288
111 [ 0.000000] pcpu-alloc: s102400 r0 d28672 u524288 alloc=1*1048576
112 [ 0.000000] pcpu-alloc: [0] 0 1
113 [ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 32740
114 [ 0.000000] Policy zone: DMA
115 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinux-3.16.0-4-powerpc64le root=UUID=35034901-f68b-4f2f-8073-ced7a2a5cd6f ro quiet
116 [ 0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes)
117 [ 0.000000] Sorting __ex_table...
118 [ 0.000000] Memory: 1918848K/2097152K available (7168K kernel code, 1280K rwdata, 1740K rodata, 896K init, 2197K bss, 178304K reserved)
119 [ 0.000000] Hierarchical RCU implementation.
120 [ 0.000000] CONFIG_RCU_FANOUT set to non-default value of 32
121 [ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
122 [ 0.000000] RCU restricting CPUs from NR_CPUS=2048 to nr_cpu_ids=2.
123 [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
124 [ 0.000000] NR_IRQS:512 nr_irqs:512 16
125 [ 0.000000] pic: no ISA interrupt controller
126 [ 0.000000] time_init: decrementer frequency = 512.000000 MHz
127 [ 0.000000] time_init: processor frequency = 1000.000000 MHz
128 [ 0.000350] clocksource: timebase mult[1f40000] shift[24] registered
129 [ 0.000553] clockevent: decrementer mult[83126e98] shift[32] cpu[0]
130 [ 0.013730] Console: colour dummy device 80x25
131 [ 0.014989] console [tty0] enabled
132 [ 0.016748] pid_max: default: 32768 minimum: 301
133 [ 0.018500] Security Framework initialized
134 [ 0.021966] AppArmor: AppArmor disabled by boot time parameter
135 [ 0.022018] Yama: disabled by default; enable with sysctl kernel.yama.*
136 [ 0.024790] Dentry cache hash table entries: 262144 (order: 5, 2097152 bytes)
137 [ 0.037906] Inode-cache hash table entries: 131072 (order: 4, 1048576 bytes)
138 [ 0.044210] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes)
139 [ 0.044309] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes)
140 [ 0.057531] Initializing cgroup subsys memory
141 [ 0.058793] Initializing cgroup subsys devices
142 [ 0.062342] Initializing cgroup subsys freezer
143 [ 0.062505] Initializing cgroup subsys net_cls
144 [ 0.062628] Initializing cgroup subsys blkio
145 [ 0.062729] Initializing cgroup subsys perf_event
146 [ 0.062819] Initializing cgroup subsys net_prio
147 [ 0.063556] ftrace: allocating 19452 entries in 8 pages
148 [ 0.184012] EEH: pSeries platform initialized
149 [ 0.184491] POWER7 performance monitor hardware support registered
150 [ 0.751584] Brought up 2 CPUs
151 [ 0.753947] Node 0 CPUs: 0-1
152 [ 0.755683] Enabling Asymmetric SMT scheduling
153 [ 0.781637] devtmpfs: initialized
154 [ 0.860457] EEH: devices created
155 [ 0.890259] NET: Registered protocol family 16
156 [ 0.894867] EEH: No capable adapters found
157 [ 0.896240] IBM eBus Device Driver
158 [ 0.904539] cpuidle: using governor ladder
159 [ 0.904768] cpuidle: using governor menu
160 [ 0.915985] PCI: Probing PCI hardware
161 [ 0.917879] no ibm,pcie-link-speed-stats property
162 [ 0.919431] PCI host bridge to bus 0000:00
163 [ 0.919853] pci_bus 0000:00: root bus resource [io 0x10000-0x1ffff] (bus address [0x0000-0xffff])
164 [ 0.919975] pci_bus 0000:00: root bus resource [mem 0x100a0000000-0x1101fffffff] (bus address [0x80000000-0xfffffffff])
165 [ 0.920199] pci_bus 0000:00: root bus resource [bus 00-ff]
166 [ 0.934921] IOMMU table initialized, virtual merging enabled
167 [ 0.957593] PCI: Probing PCI hardware done
168 [ 0.957881] opal: Node not found
169 [ 0.957994] opal_async_comp_init: Opal node not found
170 [ 1.068654] vgaarb: device added: PCI:0000:00:06.0,decodes=io+mem,owns=mem,locks=none
171 [ 1.068755] vgaarb: loaded
172 [ 1.068811] vgaarb: bridge control possible 0000:00:06.0
173 [ 1.084667] SCSI subsystem initialized
174 [ 1.086205] libata version 3.00 loaded.
175 [ 1.106689] Switched to clocksource timebase
176 [ 1.285639] NET: Registered protocol family 2
177 [ 1.325801] TCP established hash table entries: 16384 (order: 1, 131072 bytes)
178 [ 1.326813] TCP bind hash table entries: 16384 (order: 2, 262144 bytes)
179 [ 1.329251] TCP: Hash tables configured (established 16384 bind 16384)
180 [ 1.330103] TCP: reno registered
181 [ 1.330292] UDP hash table entries: 2048 (order: 0, 65536 bytes)
182 [ 1.331073] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes)
183 [ 1.343933] NET: Registered protocol family 1
184 [ 1.402765] PCI: CLS 0 bytes, default 128
185 [ 1.408278] Unpacking initramfs...
186 [ 3.824598] Freeing initrd memory: 15616K (c000000002f00000 - c000000003e40000)
187 [ 3.827574] RTAS daemon started
188 [ 3.850567] Hypercall H_BEST_ENERGY not supported
189 [ 3.870435] futex hash table entries: 512 (order: 0, 65536 bytes)
190 [ 3.875072] audit: initializing netlink subsys (disabled)
191 [ 3.876188] audit: type=2000 audit(1489574672.324:1): initialized
192 [ 3.897565] HugeTLB registered 16 MB page size, pre-allocated 0 pages
193 [ 3.898287] zbud: loaded
194 [ 3.955364] VFS: Disk quotas dquot_6.5.2
195 [ 3.957415] Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
196 [ 3.962329] msgmni has been set to 4036
197 [ 3.991438] alg: No test for stdrng (krng)
198 [ 3.993562] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
199 [ 3.995908] io scheduler noop registered
200 [ 3.996000] io scheduler deadline registered
201 [ 3.999199] io scheduler cfq registered (default)
202 [ 4.002993] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
203 [ 4.003323] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
204 [ 4.005685] Using unsupported 800x600 vga at 100a0000000, depth=32, pitch=3200
205 [ 4.038614] Console: switching to colour frame buffer device 100x37
206 [ 4.050446] fb0: Open Firmware frame buffer device on /pci@800000020000000/vga@6
207 [ 4.064118] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
208 [ 4.069855] Linux agpgart interface v0.103
209 [ 4.074416] mousedev: PS/2 mouse device common for all mice
210 [ 4.076553] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
211 [ 4.078500] pseries_idle_driver registered
212 [ 4.078781] ledtrig-cpu: registered to indicate activity on CPUs
213 [ 4.079478] TCP: cubic registered
214 [ 4.236623] NET: Registered protocol family 10
215 [ 4.297808] mip6: Mobile IPv6
216 [ 4.298028] NET: Registered protocol family 17
217 [ 4.298291] mpls_gso: MPLS GSO support
218 [ 4.306632] registered taskstats version 1
219 [ 4.326061] rtc-generic rtc-generic: setting system clock to 2017-03-15 10:44:33 UTC (1489574673)
220 [ 4.326427] PM: Hibernation image not present or could not be loaded.
221 [ 4.378547] Freeing unused kernel memory: 896K (c0000000008c0000 - c0000000009a0000)
222 [ 5.397702] systemd-udevd[62]: starting version 215
223 [ 5.465837] random: systemd-udevd: uninitialized urandom read (16 bytes read, 12 bits of entropy available)
224 [ 6.151699] virtio-pci 0000:00:05.0: enabling device (0100 -> 0101)
225 [ 6.199143] virtio-pci 0000:00:04.0: enabling device (0100 -> 0103)
226 [ 6.201578] virtio-pci 0000:00:03.0: enabling device (0100 -> 0103)
227 [ 6.376882] 8139cp: 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
228 [ 6.383373] 8139cp 0000:00:01.0: enabling device (0100 -> 0103)
229 [ 6.391941] usbcore: registered new interface driver usbfs
230 [ 6.392361] usbcore: registered new interface driver hub
231 [ 6.395494] 8139cp 0000:00:01.0 eth0: RTL-8139C+ at 0xd000080080022100, 52:54:00:f7:51:69, IRQ 17
232 [ 6.422151] usbcore: registered new device driver usb
233 [ 6.489837] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
234 [ 6.545154] 8139too: 8139too Fast Ethernet driver 0.9.28
235 [ 6.558285] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
236 [ 6.563301] ehci-pci: EHCI PCI platform driver
237 [ 6.577800] ohci-pci: OHCI PCI platform driver
238 [ 6.583639] ohci-pci 0000:00:02.0: OHCI PCI host controller
239 [ 6.584250] ohci-pci 0000:00:02.0: new USB bus registered, assigned bus number 1
240 [ 6.588455] ohci-pci 0000:00:02.0: irq 20, io mem 0x100e0022000
241 [ 6.683252] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
242 [ 6.683315] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
243 [ 6.684539] usb usb1: Product: OHCI PCI host controller
244 [ 6.684614] usb usb1: Manufacturer: Linux 3.16.0-4-powerpc64le ohci_hcd
245 [ 6.684655] usb usb1: SerialNumber: 0000:00:02.0
246 [ 6.706756] hub 1-0:1.0: USB hub found
247 [ 6.709342] hub 1-0:1.0: 3 ports detected
248 [ 6.856073] ibmvscsi 2000: SRP_VERSION: 16.a
249 [ 6.858663] scsi0 : IBM POWER Virtual SCSI Adapter 1.5.9
250 [ 6.890482] ibmvscsi 2000: partner initialization complete
251 [ 6.892225] ibmvscsi 2000: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
252 [ 6.892445] ibmvscsi 2000: sent SRP login
253 [ 6.892623] ibmvscsi 2000: SRP_LOGIN succeeded
254 [ 6.960435] scsi 0:0:0:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
255 [ 7.110257] usb 1-1: new full-speed USB device number 2 using ohci-pci
256 [ 7.354618] usb 1-1: New USB device found, idVendor=0627, idProduct=0001
257 [ 7.354884] usb 1-1: New USB device strings: Mfr=1, Product=4, SerialNumber=5
258 [ 7.354915] usb 1-1: Product: QEMU USB Keyboard
259 [ 7.354941] usb 1-1: Manufacturer: QEMU
260 [ 7.354965] usb 1-1: SerialNumber: 42
261 [ 7.593230] usb 1-2: new full-speed USB device number 3 using ohci-pci
262 [ 7.803140] usb 1-2: New USB device found, idVendor=0627, idProduct=0001
263 [ 7.803189] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
264 [ 7.803217] usb 1-2: Product: QEMU USB Mouse
265 [ 7.803243] usb 1-2: Manufacturer: QEMU
266 [ 7.803271] usb 1-2: SerialNumber: 42
267 [ 8.001788] usb 1-3: new full-speed USB device number 4 using ohci-pci
268 [ 8.236126] usb 1-3: New USB device found, idVendor=0409, idProduct=55aa
269 [ 8.236170] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
270 [ 8.236197] usb 1-3: Product: QEMU USB Hub
271 [ 8.236221] usb 1-3: Manufacturer: QEMU
272 [ 8.236246] usb 1-3: SerialNumber: 314159-pci@800000020000000:02.0-3
273 [ 8.247796] hub 1-3:1.0: USB hub found
274 [ 8.252272] vda: vda1 vda2 vda3
275 [ 8.255820] hub 1-3:1.0: 8 ports detected
276 [ 8.575937] hidraw: raw HID events driver (C) Jiri Kosina
277 [ 8.710814] usbcore: registered new interface driver usbhid
278 [ 8.710897] usbhid: USB HID core driver
279 [ 8.800556] input: QEMU QEMU USB Keyboard as /devices/pci0000:00/0000:00:02.0/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input0
280 [ 8.813522] hid-generic 0003:0627:0001.0001: input,hidraw0: USB HID v1.11 Keyboard [QEMU QEMU USB Keyboard] on usb-0000:00:02.0-1/input0
281 [ 8.838628] input: QEMU QEMU USB Mouse as /devices/pci0000:00/0000:00:02.0/usb1/1-2/1-2:1.0/0003:0627:0001.0002/input/input1
282 [ 8.852773] hid-generic 0003:0627:0001.0002: input,hidraw1: USB HID v0.01 Mouse [QEMU QEMU USB Mouse] on usb-0000:00:02.0-2/input0
283 [ 9.684157] sr0: scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
284 [ 9.684447] cdrom: Uniform CD-ROM driver Revision: 3.20
285 [ 9.694687] sr 0:0:0:0: Attached scsi CD-ROM sr0
286 [ 9.733955] sr 0:0:0:0: Attached scsi generic sg0 type 5
287 [ 12.126890] EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: (null)
288 [ 13.780089] random: systemd: uninitialized urandom read (16 bytes read, 86 bits of entropy available)
289 [ 13.820325] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
290 [ 13.827143] systemd[1]: Detected architecture 'ppc64-le'.
291 [ 13.993889] systemd[1]: Inserted module 'autofs4'
292 [ 14.005253] systemd[1]: Set hostname to <debian>.
293 [ 14.043401] systemd[1]: /etc/mtab is not a symlink or not pointing to /proc/self/mounts. This is not supported anymore. Please make sure to replace this file by a symlink to avoid incorrect or misleading mount(8) output.
294 [ 15.192167] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 97 bits of entropy available)
295 [ 15.731488] random: systemd: uninitialized urandom read (16 bytes read, 106 bits of entropy available)
296 [ 15.735903] random: systemd: uninitialized urandom read (16 bytes read, 106 bits of entropy available)
297 [ 15.738841] random: systemd: uninitialized urandom read (16 bytes read, 106 bits of entropy available)
298 [ 15.835926] random: systemd: uninitialized urandom read (16 bytes read, 108 bits of entropy available)
299 [ 15.838244] random: systemd: uninitialized urandom read (16 bytes read, 108 bits of entropy available)
300 [ 15.839286] random: systemd: uninitialized urandom read (16 bytes read, 108 bits of entropy available)
301 [ 15.950852] random: systemd: uninitialized urandom read (16 bytes read, 108 bits of entropy available)
302 [ 16.361318] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
303 [ 16.365674] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
304 [ 16.370172] systemd[1]: Expecting device dev-hvc0.device...
305 [ 16.373395] systemd[1]: Starting Remote File Systems (Pre).
306 [ 16.373853] systemd[1]: Reached target Remote File Systems (Pre).
307 [ 16.375171] systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point.
308 [ 16.385704] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
309 [ 16.386238] systemd[1]: Starting Encrypted Volumes.
310 [ 16.386600] systemd[1]: Reached target Encrypted Volumes.
311 [ 16.387000] systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.
312 [ 16.388184] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
313 [ 16.388464] systemd[1]: Starting Paths.
314 [ 16.388712] systemd[1]: Reached target Paths.
315 [ 16.391942] systemd[1]: Expecting device dev-vda3.device...
316 [ 16.392254] systemd[1]: Expecting device dev-disk-by\x2duuid-5a63f1d4\x2ddd93\x2d45fa\x2d8b04\x2d531d13b2f573.device...
317 [ 16.392543] systemd[1]: Starting Root Slice.
318 [ 16.394191] systemd[1]: Created slice Root Slice.
319 [ 16.394525] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
320 [ 16.397746] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
321 [ 16.398476] systemd[1]: Starting Delayed Shutdown Socket.
322 [ 16.400495] systemd[1]: Listening on Delayed Shutdown Socket.
323 [ 16.401265] systemd[1]: Starting Journal Socket (/dev/log).
324 [ 16.402434] systemd[1]: Listening on Journal Socket (/dev/log).
325 [ 16.402815] systemd[1]: Starting udev Control Socket.
326 [ 16.403586] systemd[1]: Listening on udev Control Socket.
327 [ 16.403922] systemd[1]: Starting udev Kernel Socket.
328 [ 16.404558] systemd[1]: Listening on udev Kernel Socket.
329 [ 16.405281] systemd[1]: Starting User and Session Slice.
330 [ 16.407097] systemd[1]: Created slice User and Session Slice.
331 [ 16.407376] systemd[1]: Starting Journal Socket.
332 [ 16.408701] systemd[1]: Listening on Journal Socket.
333 [ 16.409425] systemd[1]: Starting System Slice.
334 [ 16.411517] systemd[1]: Created slice System Slice.
335 [ 16.412696] systemd[1]: Starting Increase datagram queue length...
336 [ 16.471051] systemd[1]: Mounting Debug File System...
337 [ 16.534646] systemd[1]: Mounting Huge Pages File System...
338 [ 16.609411] systemd[1]: Started Set Up Additional Binary Formats.
339 [ 16.624922] systemd[1]: Starting Create list of required static device nodes for the current kernel...
340 [ 16.699997] systemd[1]: Mounting POSIX Message Queue File System...
341 [ 16.858052] systemd[1]: Starting Load Kernel Modules...
342 [ 16.997970] systemd[1]: Starting udev Coldplug all Devices...
343 [ 17.162057] systemd[1]: Starting system-getty.slice.
344 [ 17.170940] systemd[1]: Created slice system-getty.slice.
345 [ 17.182649] systemd[1]: Starting system-serial\x2dgetty.slice.
346 [ 17.202996] systemd[1]: Created slice system-serial\x2dgetty.slice.
347 [ 17.225948] systemd[1]: Started File System Check on Root Device.
348 [ 17.227635] systemd[1]: Starting Slices.
349 [ 17.227932] systemd[1]: Reached target Slices.
350 [ 17.474563] systemd[1]: Started Increase datagram queue length.
351 [ 17.576418] systemd[1]: Started Create list of required static device nodes for the current kernel.
352 [ 17.643118] systemd[1]: Mounted Debug File System.
353 [ 17.698436] systemd[1]: Mounted Huge Pages File System.
354 [ 17.790500] systemd[1]: Mounted POSIX Message Queue File System.
355 [ 18.208240] fuse init (API version 7.23)
356 [ 18.405814] systemd[1]: Started Load Kernel Modules.
357 [ 19.057106] systemd[1]: Mounting FUSE Control File System...
358 [ 19.099902] systemd[1]: Starting Apply Kernel Variables...
359 [ 19.175166] systemd[1]: Mounted Configuration File System.
360 [ 19.191354] systemd[1]: Starting Create Static Device Nodes in /dev...
361 [ 19.252059] systemd[1]: Starting Syslog Socket.
362 [ 19.264507] systemd[1]: Listening on Syslog Socket.
363 [ 19.293762] systemd[1]: Starting Journal Service...
364 [ 19.424427] systemd[1]: Started Journal Service.
365 [ 21.339528] systemd-udevd[153]: starting version 215
366 [ 22.636196] random: nonblocking pool is initialized
367 [ 26.801725] [drm] Initialized drm 1.1.0 20060810
368 [ 27.190191] checking generic (100a0000000 1d4c00) vs hw (100a0000000 1000000)
369 [ 27.190254] fb: switching to bochsdrmfb from OFfb vga
370 [ 27.192042] Console: switching to colour dummy device 80x25
371 [ 27.316647] [drm] Found bochs VGA, ID 0xb0c5.
372 [ 27.316718] [drm] Framebuffer size 16384 kB @ 0x100a0000000, mmio @ 0x100e0000000.
373 [ 27.352534] [TTM] Zone kernel: Available graphics memory: 1033696 kiB
374 [ 27.352610] [TTM] Initializing pool allocator
375 [ 27.699633] Console: switching to colour frame buffer device 128x48
376 [ 28.241859] bochs-drm 0000:00:06.0: fb0: bochsdrmfb frame buffer device
377 [ 28.241914] bochs-drm 0000:00:06.0: registered panic notifier
378 [ 28.270473] [drm] Initialized bochs-drm 1.0.0 20130925 for 0000:00:06.0 on minor 0
379 [ 32.871945] Adding 2187200k swap on /dev/vda3. Priority:-1 extents:1 across:2187200k FS
380 [ 37.271870] EXT4-fs (vda2): re-mounted. Opts: errors=remount-ro
381 [ 39.257446] systemd-journald[148]: Received request to flush runtime journal from PID 1
382 [ 66.682979] RPC: Registered named UNIX socket transport module.
383 [ 66.683180] RPC: Registered udp transport module.
384 [ 66.683239]
385
386
387 '''
388 return returncode, output
389
390 @staticmethod
391 def lscpu():
392 returncode = 0
393 output = r'''
394 Architecture: ppc64le
395 Byte Order: Little Endian
396 CPU(s): 2
397 On-line CPU(s) list: 0,1
398 Thread(s) per core: 1
399 Core(s) per socket: 1
400 Socket(s): 2
401 NUMA node(s): 1
402 Model: IBM pSeries (emulated by qemu)
403 L1d cache: 32K
404 L1i cache: 32K
405 NUMA node0 CPU(s): 0,1
406
407
408 '''
409 return returncode, output
410
411
412 class TestLinuxDebian_8_7_1_ppc64le(unittest.TestCase):
413 def setUp(self):
414 helpers.backup_data_source(cpuinfo)
415 helpers.monkey_patch_data_source(cpuinfo, MockDataSource)
416
417 def tearDown(self):
418 helpers.restore_data_source(cpuinfo)
419
420 '''
421 Make sure calls return the expected number of fields.
422 '''
423 def test_returns(self):
424 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_registry()))
425 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpufreq_info()))
426 self.assertEqual(3, len(cpuinfo._get_cpu_info_from_lscpu()))
427 self.assertEqual(5, len(cpuinfo._get_cpu_info_from_proc_cpuinfo()))
428 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysctl()))
429 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_kstat()))
430 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_dmesg()))
431 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cat_var_run_dmesg_boot()))
432 self.assertEqual(1, len(cpuinfo._get_cpu_info_from_ibm_pa_features()))
433 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysinfo()))
434 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpuid()))
435 self.assertEqual(15, len(cpuinfo._get_cpu_info_internal()))
436
437 def test_get_cpu_info_from_lscpu(self):
438 info = cpuinfo._get_cpu_info_from_lscpu()
439 self.assertEqual('IBM pSeries (emulated by qemu)', info['brand_raw'])
440 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
441 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
442 self.assertEqual(3, len(info))
443
444 def test_get_cpu_info_from_ibm_pa_features(self):
445 info = cpuinfo._get_cpu_info_from_ibm_pa_features()
446 self.assertEqual(
447 ['dabr', 'dabrx', 'dsisr', 'fpu', 'lp', 'mmu', 'pp', 'rislb', 'run', 'slb', 'sprg3'],
448 info['flags']
449 )
450
451 def test_get_cpu_info_from_proc_cpuinfo(self):
452 info = cpuinfo._get_cpu_info_from_proc_cpuinfo()
453
454 self.assertEqual('POWER7 (raw), altivec supported', info['brand_raw'])
455 self.assertEqual('1.0000 GHz', info['hz_advertised_friendly'])
456 self.assertEqual('1.0000 GHz', info['hz_actual_friendly'])
457 self.assertEqual((1000000000, 0), info['hz_advertised'])
458 self.assertEqual((1000000000, 0), info['hz_actual'])
459
460 def test_all(self):
461 info = cpuinfo._get_cpu_info_internal()
462
463 self.assertEqual('POWER7 (raw), altivec supported', info['brand_raw'])
464 self.assertEqual('1.0000 GHz', info['hz_advertised_friendly'])
465 self.assertEqual('1.0000 GHz', info['hz_actual_friendly'])
466 self.assertEqual((1000000000, 0), info['hz_advertised'])
467 self.assertEqual((1000000000, 0), info['hz_actual'])
468 self.assertEqual('PPC_64', info['arch'])
469 self.assertEqual(64, info['bits'])
470 self.assertEqual(2, info['count'])
471 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
472 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
473 self.assertEqual('ppc64le', info['arch_string_raw'])
474 self.assertEqual(
475 ['dabr', 'dabrx', 'dsisr', 'fpu', 'lp', 'mmu', 'pp', 'rislb', 'run', 'slb', 'sprg3'],
476 info['flags']
477 )