Debian Codegraph @

tests/test_linux_debian_8_5_x86_64.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 = 'x86_64'
13 uname_string_raw = 'x86_64'
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 cat_proc_cpuinfo():
30 returncode = 0
31 output = r'''
32 processor : 0
33 vendor_id : GenuineIntel
34 cpu family : 6
35 model : 42
36 model name : Intel(R) Pentium(R) CPU G640 @ 2.80GHz
37 stepping : 7
38 cpu MHz : 2793.652
39 cache size : 3072 KB
40 physical id : 0
41 siblings : 2
42 core id : 0
43 cpu cores : 2
44 apicid : 0
45 initial apicid : 0
46 fpu : yes
47 fpu_exception : yes
48 cpuid level : 13
49 wp : yes
50 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt xsave hypervisor lahf_lm
51 bogomips : 5587.30
52 clflush size : 64
53 cache_alignment : 64
54 address sizes : 36 bits physical, 48 bits virtual
55 power management:
56
57 processor : 1
58 vendor_id : GenuineIntel
59 cpu family : 6
60 model : 42
61 model name : Intel(R) Pentium(R) CPU G640 @ 2.80GHz
62 stepping : 7
63 cpu MHz : 2793.652
64 cache size : 3072 KB
65 physical id : 0
66 siblings : 2
67 core id : 1
68 cpu cores : 2
69 apicid : 1
70 initial apicid : 1
71 fpu : yes
72 fpu_exception : yes
73 cpuid level : 13
74 wp : yes
75 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt xsave hypervisor lahf_lm
76 bogomips : 5587.30
77 clflush size : 64
78 cache_alignment : 64
79 address sizes : 36 bits physical, 48 bits virtual
80 power management:
81
82
83 '''
84 return returncode, output
85
86 @staticmethod
87 def dmesg_a():
88 returncode = 0
89 output = r'''
90 [ 0.000000] Initializing cgroup subsys cpuset
91 [ 0.000000] Initializing cgroup subsys cpu
92 [ 0.000000] Initializing cgroup subsys cpuacct
93 [ 0.000000] Linux version 3.16.0-4-amd64 ([email protected]) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19)
94 [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=12618f16-cbe6-4b2b-9f80-b71195be06e7 ro quiet
95 [ 0.000000] e820: BIOS-provided physical RAM map:
96 [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
97 [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
98 [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
99 [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable
100 [ 0.000000] BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data
101 [ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
102 [ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
103 [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
104 [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable
105 [ 0.000000] NX (Execute Disable) protection: active
106 [ 0.000000] SMBIOS 2.5 present.
107 [ 0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
108 [ 0.000000] Hypervisor detected: KVM
109 [ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
110 [ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
111 [ 0.000000] AGP: No AGP bridge found
112 [ 0.000000] e820: last_pfn = 0x120000 max_arch_pfn = 0x400000000
113 [ 0.000000] MTRR default type: uncachable
114 [ 0.000000] MTRR variable ranges disabled:
115 [ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
116 [ 0.000000] CPU MTRRs all blank - virtualized system.
117 [ 0.000000] e820: last_pfn = 0xdfff0 max_arch_pfn = 0x400000000
118 [ 0.000000] found SMP MP-table at [mem 0x0009fff0-0x0009ffff] mapped at [ffff88000009fff0]
119 [ 0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576
120 [ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
121 [ 0.000000] [mem 0x00000000-0x000fffff] page 4k
122 [ 0.000000] BRK [0x01af4000, 0x01af4fff] PGTABLE
123 [ 0.000000] BRK [0x01af5000, 0x01af5fff] PGTABLE
124 [ 0.000000] BRK [0x01af6000, 0x01af6fff] PGTABLE
125 [ 0.000000] init_memory_mapping: [mem 0x11fe00000-0x11fffffff]
126 [ 0.000000] [mem 0x11fe00000-0x11fffffff] page 2M
127 [ 0.000000] BRK [0x01af7000, 0x01af7fff] PGTABLE
128 [ 0.000000] init_memory_mapping: [mem 0x11c000000-0x11fdfffff]
129 [ 0.000000] [mem 0x11c000000-0x11fdfffff] page 2M
130 [ 0.000000] init_memory_mapping: [mem 0x100000000-0x11bffffff]
131 [ 0.000000] [mem 0x100000000-0x11bffffff] page 2M
132 [ 0.000000] init_memory_mapping: [mem 0x00100000-0xdffeffff]
133 [ 0.000000] [mem 0x00100000-0x001fffff] page 4k
134 [ 0.000000] [mem 0x00200000-0xdfdfffff] page 2M
135 [ 0.000000] [mem 0xdfe00000-0xdffeffff] page 4k
136 [ 0.000000] RAMDISK: [mem 0x3634a000-0x3719cfff]
137 [ 0.000000] ACPI: Early table checksum verification disabled
138 [ 0.000000] ACPI: RSDP 0x00000000000E0000 000024 (v02 VBOX )
139 [ 0.000000] ACPI: XSDT 0x00000000DFFF0030 00003C (v01 VBOX VBOXXSDT 00000001 ASL 00000061)
140 [ 0.000000] ACPI: FACP 0x00000000DFFF00F0 0000F4 (v04 VBOX VBOXFACP 00000001 ASL 00000061)
141 [ 0.000000] ACPI: DSDT 0x00000000DFFF0470 00210F (v01 VBOX VBOXBIOS 00000002 INTL 20160108)
142 [ 0.000000] ACPI: FACS 0x00000000DFFF0200 000040
143 [ 0.000000] ACPI: FACS 0x00000000DFFF0200 000040
144 [ 0.000000] ACPI: APIC 0x00000000DFFF0240 00005C (v02 VBOX VBOXAPIC 00000001 ASL 00000061)
145 [ 0.000000] ACPI: SSDT 0x00000000DFFF02A0 0001CC (v01 VBOX VBOXCPUT 00000002 INTL 20160108)
146 [ 0.000000] ACPI: Local APIC address 0xfee00000
147 [ 0.000000] No NUMA configuration found
148 [ 0.000000] Faking a node at [mem 0x0000000000000000-0x000000011fffffff]
149 [ 0.000000] Initmem setup node 0 [mem 0x00000000-0x11fffffff]
150 [ 0.000000] NODE_DATA [mem 0x11fff7000-0x11fffbfff]
151 [ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
152 [ 0.000000] kvm-clock: cpu 0, msr 1:1ffef001, primary cpu clock
153 [ 0.000000] [ffffea0000000000-ffffea0003ffffff] PMD -> [ffff88011b600000-ffff88011effffff] on node 0
154 [ 0.000000] Zone ranges:
155 [ 0.000000] DMA [mem 0x00001000-0x00ffffff]
156 [ 0.000000] DMA32 [mem 0x01000000-0xffffffff]
157 [ 0.000000] Normal [mem 0x100000000-0x11fffffff]
158 [ 0.000000] Movable zone start for each node
159 [ 0.000000] Early memory node ranges
160 [ 0.000000] node 0: [mem 0x00001000-0x0009efff]
161 [ 0.000000] node 0: [mem 0x00100000-0xdffeffff]
162 [ 0.000000] node 0: [mem 0x100000000-0x11fffffff]
163 [ 0.000000] On node 0 totalpages: 1048462
164 [ 0.000000] DMA zone: 56 pages used for memmap
165 [ 0.000000] DMA zone: 21 pages reserved
166 [ 0.000000] DMA zone: 3998 pages, LIFO batch:0
167 [ 0.000000] DMA32 zone: 12488 pages used for memmap
168 [ 0.000000] DMA32 zone: 913392 pages, LIFO batch:31
169 [ 0.000000] Normal zone: 1792 pages used for memmap
170 [ 0.000000] Normal zone: 131072 pages, LIFO batch:31
171 [ 0.000000] ACPI: PM-Timer IO Port: 0x4008
172 [ 0.000000] ACPI: Local APIC address 0xfee00000
173 [ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
174 [ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
175 [ 0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
176 [ 0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
177 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
178 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
179 [ 0.000000] ACPI: IRQ0 used by override.
180 [ 0.000000] ACPI: IRQ2 used by override.
181 [ 0.000000] ACPI: IRQ9 used by override.
182 [ 0.000000] Using ACPI (MADT) for SMP configuration information
183 [ 0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs
184 [ 0.000000] nr_irqs_gsi: 40
185 [ 0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
186 [ 0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
187 [ 0.000000] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
188 [ 0.000000] PM: Registered nosave memory: [mem 0xdfff0000-0xdfffffff]
189 [ 0.000000] PM: Registered nosave memory: [mem 0xe0000000-0xfebfffff]
190 [ 0.000000] PM: Registered nosave memory: [mem 0xfec00000-0xfec00fff]
191 [ 0.000000] PM: Registered nosave memory: [mem 0xfec01000-0xfedfffff]
192 [ 0.000000] PM: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
193 [ 0.000000] PM: Registered nosave memory: [mem 0xfee01000-0xfffbffff]
194 [ 0.000000] PM: Registered nosave memory: [mem 0xfffc0000-0xffffffff]
195 [ 0.000000] e820: [mem 0xe0000000-0xfebfffff] available for PCI devices
196 [ 0.000000] Booting paravirtualized kernel on KVM
197 [ 0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:2 nr_node_ids:1
198 [ 0.000000] PERCPU: Embedded 27 pages/cpu @ffff88011fc00000 s80960 r8192 d21440 u1048576
199 [ 0.000000] pcpu-alloc: s80960 r8192 d21440 u1048576 alloc=1*2097152
200 [ 0.000000] pcpu-alloc: [0] 0 1
201 [ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 1034105
202 [ 0.000000] Policy zone: Normal
203 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=12618f16-cbe6-4b2b-9f80-b71195be06e7 ro quiet
204 [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
205 [ 0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
206 [ 0.000000] AGP: Checking aperture...
207 [ 0.000000] AGP: No AGP bridge found
208 [ 0.000000] Calgary: detecting Calgary via BIOS EBDA area
209 [ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
210 [ 0.000000] Memory: 4041880K/4193848K available (5237K kernel code, 947K rwdata, 1836K rodata, 1204K init, 840K bss, 151968K reserved)
211 [ 0.000000] Hierarchical RCU implementation.
212 [ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
213 [ 0.000000] RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=2.
214 [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
215 [ 0.000000] NR_IRQS:33024 nr_irqs:512 16
216 [ 0.000000] Console: colour VGA+ 80x25
217 [ 0.000000] console [tty0] enabled
218 [ 0.000000] tsc: Detected 2793.652 MHz processor
219 [ 9.015923] Calibrating delay loop (skipped) preset value.. 5587.30 BogoMIPS (lpj=11174608)
220 [ 9.015926] pid_max: default: 32768 minimum: 301
221 [ 9.015934] ACPI: Core revision 20140424
222 [ 9.017020] ACPI: All ACPI Tables successfully acquired
223 [ 9.017050] Security Framework initialized
224 [ 9.017058] AppArmor: AppArmor disabled by boot time parameter
225 [ 9.017059] Yama: disabled by default; enable with sysctl kernel.yama.*
226 [ 9.017855] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
227 [ 9.019277] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
228 [ 9.019613] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
229 [ 9.019619] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
230 [ 9.019883] Initializing cgroup subsys memory
231 [ 9.019888] Initializing cgroup subsys devices
232 [ 9.019895] Initializing cgroup subsys freezer
233 [ 9.019897] Initializing cgroup subsys net_cls
234 [ 9.019901] Initializing cgroup subsys blkio
235 [ 9.019904] Initializing cgroup subsys perf_event
236 [ 9.019906] Initializing cgroup subsys net_prio
237 [ 9.019987] CPU: Physical Processor ID: 0
238 [ 9.019988] CPU: Processor Core ID: 0
239 [ 9.020005] mce: CPU supports 0 MCE banks
240 [ 9.020039] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
241 Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
242 tlb_flushall_shift: 6
243 [ 9.020376] Freeing SMP alternatives memory: 20K (ffffffff81a1b000 - ffffffff81a20000)
244 [ 9.024990] ftrace: allocating 21697 entries in 85 pages
245 [ 9.059874] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
246 [ 9.059878] smpboot: CPU0: Intel(R) Pentium(R) CPU G640 @ 2.80GHz (fam: 06, model: 2a, stepping: 07)
247 [ 9.164299] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only.
248 [ 9.165780] NMI watchdog: disabled (cpu0): hardware events not enabled
249 [ 9.165895] x86: Booting SMP configuration:
250 [ 9.165897] .... node #0, CPUs: #1
251 [ 9.176166] kvm-clock: cpu 1, msr 1:1ffef041, secondary cpu clock
252 [ 9.177165] mce: CPU supports 0 MCE banks
253 [ 9.179301] x86: Booted up 1 node, 2 CPUs
254 [ 9.179305] smpboot: Total of 2 processors activated (11174.60 BogoMIPS)
255 [ 9.180688] devtmpfs: initialized
256 [ 9.187316] pinctrl core: initialized pinctrl subsystem
257 [ 9.187487] NET: Registered protocol family 16
258 [ 9.187619] cpuidle: using governor ladder
259 [ 9.187623] cpuidle: using governor menu
260 [ 9.187667] ACPI: bus type PCI registered
261 [ 9.187669] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
262 [ 9.187894] PCI: Using configuration type 1 for base access
263 [ 9.204747] ACPI: Added _OSI(Module Device)
264 [ 9.204751] ACPI: Added _OSI(Processor Device)
265 [ 9.204752] ACPI: Added _OSI(3.0 _SCP Extensions)
266 [ 9.204753] ACPI: Added _OSI(Processor Aggregator Device)
267 [ 9.205356] ACPI: Executed 1 blocks of module-level executable AML code
268 [ 9.207882] ACPI: Interpreter enabled
269 [ 9.207888] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20140424/hwxface-580)
270 [ 9.207891] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20140424/hwxface-580)
271 [ 9.207894] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20140424/hwxface-580)
272 [ 9.207897] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S4_] (20140424/hwxface-580)
273 [ 9.207902] ACPI: (supports S0 S5)
274 [ 9.207904] ACPI: Using IOAPIC for interrupt routing
275 [ 9.208077] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
276 [ 9.211597] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
277 [ 9.211603] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI]
278 [ 9.211607] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
279 [ 9.211681] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
280 [ 9.211887] PCI host bridge to bus 0000:00
281 [ 9.211890] pci_bus 0000:00: root bus resource [bus 00-ff]
282 [ 9.211892] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7]
283 [ 9.211893] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff]
284 [ 9.211895] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
285 [ 9.211896] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xffdfffff]
286 [ 9.211930] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
287 [ 9.212373] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100
288 [ 9.212889] pci 0000:00:01.1: [8086:7111] type 00 class 0x01018a
289 [ 9.213393] pci 0000:00:01.1: reg 0x20: [io 0xd000-0xd00f]
290 [ 9.213530] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
291 [ 9.213532] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6]
292 [ 9.213533] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
293 [ 9.213534] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376]
294 [ 9.213732] pci 0000:00:02.0: [80ee:beef] type 00 class 0x030000
295 [ 9.216760] pci 0000:00:02.0: reg 0x10: [mem 0xe0000000-0xe0ffffff pref]
296 [ 9.239260] pci 0000:00:03.0: [8086:100e] type 00 class 0x020000
297 [ 9.242528] pci 0000:00:03.0: reg 0x10: [mem 0xf0000000-0xf001ffff]
298 [ 9.250446] pci 0000:00:03.0: reg 0x18: [io 0xd010-0xd017]
299 [ 9.267404] pci 0000:00:04.0: [80ee:cafe] type 00 class 0x088000
300 [ 9.270818] pci 0000:00:04.0: reg 0x10: [io 0xd020-0xd03f]
301 [ 9.276122] pci 0000:00:04.0: reg 0x14: [mem 0xf0400000-0xf07fffff]
302 [ 9.279813] pci 0000:00:04.0: reg 0x18: [mem 0xf0800000-0xf0803fff pref]
303 [ 9.293767] pci 0000:00:05.0: [8086:2415] type 00 class 0x040100
304 [ 9.293857] pci 0000:00:05.0: reg 0x10: [io 0xd100-0xd1ff]
305 [ 9.293917] pci 0000:00:05.0: reg 0x14: [io 0xd200-0xd23f]
306 [ 9.294374] pci 0000:00:06.0: [106b:003f] type 00 class 0x0c0310
307 [ 9.297803] pci 0000:00:06.0: reg 0x10: [mem 0xf0804000-0xf0804fff]
308 [ 9.317868] pci 0000:00:07.0: [8086:7113] type 00 class 0x068000
309 [ 9.318252] pci 0000:00:07.0: quirk: [io 0x4000-0x403f] claimed by PIIX4 ACPI
310 [ 9.318262] pci 0000:00:07.0: quirk: [io 0x4100-0x410f] claimed by PIIX4 SMB
311 [ 9.318538] pci 0000:00:0d.0: [8086:2829] type 00 class 0x010601
312 [ 9.321461] pci 0000:00:0d.0: reg 0x10: [io 0xd240-0xd247]
313 [ 9.328895] pci 0000:00:0d.0: reg 0x18: [io 0xd250-0xd257]
314 [ 9.336455] pci 0000:00:0d.0: reg 0x20: [io 0xd260-0xd26f]
315 [ 9.339258] pci 0000:00:0d.0: reg 0x24: [mem 0xf0806000-0xf0807fff]
316 [ 9.345202] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 9 10 *11)
317 [ 9.345408] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 9 10 *11)
318 [ 9.345488] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 9 *10 11)
319 [ 9.345567] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 *9 10 11)
320 [ 9.345694] ACPI: Enabled 2 GPEs in block 00 to 07
321 [ 9.346069] vgaarb: setting as boot device: PCI:0000:00:02.0
322 [ 9.346072] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
323 [ 9.346074] vgaarb: loaded
324 [ 9.346075] vgaarb: bridge control possible 0000:00:02.0
325 [ 9.346163] PCI: Using ACPI for IRQ routing
326 [ 9.346165] PCI: pci_cache_line_size set to 64 bytes
327 [ 9.346311] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff]
328 [ 9.346317] e820: reserve RAM buffer [mem 0xdfff0000-0xdfffffff]
329 [ 9.346558] Switched to clocksource kvm-clock
330 [ 9.353995] pnp: PnP ACPI init
331 [ 9.354008] ACPI: bus type PNP registered
332 [ 9.354101] pnp 00:00: Plug and Play ACPI device, IDs PNP0303 (active)
333 [ 9.354188] pnp 00:01: Plug and Play ACPI device, IDs PNP0f03 (active)
334 [ 9.354752] pnp: PnP ACPI: found 2 devices
335 [ 9.354753] ACPI: bus type PNP unregistered
336 [ 9.371389] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7]
337 [ 9.371393] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff]
338 [ 9.371395] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
339 [ 9.371396] pci_bus 0000:00: resource 7 [mem 0xe0000000-0xffdfffff]
340 [ 9.371619] NET: Registered protocol family 2
341 [ 9.372196] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
342 [ 9.372267] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
343 [ 9.372334] TCP: Hash tables configured (established 32768 bind 32768)
344 [ 9.372351] TCP: reno registered
345 [ 9.372357] UDP hash table entries: 2048 (order: 4, 65536 bytes)
346 [ 9.372372] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
347 [ 9.372507] NET: Registered protocol family 1
348 [ 9.372527] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
349 [ 9.372559] pci 0000:00:01.0: Activating ISA DMA hang workarounds
350 [ 9.372585] pci 0000:00:02.0: Video device with shadowed ROM
351 [ 9.374015] PCI: CLS 0 bytes, default 64
352 [ 9.374087] Unpacking initramfs...
353 [ 9.647919] Freeing initrd memory: 14668K (ffff88003634a000 - ffff88003719d000)
354 [ 9.648004] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
355 [ 9.648007] software IO TLB [mem 0xdbff0000-0xdfff0000] (64MB) mapped at [ffff8800dbff0000-ffff8800dffeffff]
356 [ 9.648272] platform rtc_cmos: registered platform RTC device (no PNP device found)
357 [ 9.648443] RAPL PMU detected, hw unit 2^-0 Joules, API unit is 2^-32 Joules, 3 fixed counters 10737418240 ms ovfl timer
358 [ 9.648548] microcode: CPU0 sig=0x206a7, pf=0x10, revision=0x0
359 [ 9.648562] microcode: CPU1 sig=0x206a7, pf=0x10, revision=0x0
360 [ 9.648612] microcode: Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
361 [ 9.649451] futex hash table entries: 512 (order: 3, 32768 bytes)
362 [ 9.649573] audit: initializing netlink subsys (disabled)
363 [ 9.649598] audit: type=2000 audit(1488395362.069:1): initialized
364 [ 9.650419] HugeTLB registered 2 MB page size, pre-allocated 0 pages
365 [ 9.650441] zbud: loaded
366 [ 9.650973] VFS: Disk quotas dquot_6.5.2
367 [ 9.651008] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
368 [ 9.651084] msgmni has been set to 7922
369 [ 9.651798] alg: No test for stdrng (krng)
370 [ 9.651846] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
371 [ 9.651937] io scheduler noop registered
372 [ 9.651941] io scheduler deadline registered
373 [ 9.652016] io scheduler cfq registered (default)
374 [ 9.652115] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
375 [ 9.652132] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
376 [ 9.652154] intel_idle: does not run on family 6 model 42
377 [ 9.652172] GHES: HEST is not enabled!
378 [ 9.652242] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
379 [ 9.652548] Linux agpgart interface v0.103
380 [ 9.652677] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
381 [ 9.653166] serio: i8042 KBD port at 0x60,0x64 irq 1
382 [ 9.653171] serio: i8042 AUX port at 0x60,0x64 irq 12
383 [ 9.653271] mousedev: PS/2 mouse device common for all mice
384 [ 9.653687] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
385 [ 9.653824] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
386 [ 9.653882] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram
387 [ 9.653896] ledtrig-cpu: registered to indicate activity on CPUs
388 [ 9.653961] AMD IOMMUv2 driver by Joerg Roedel <[email protected]>
389 [ 9.653962] AMD IOMMUv2 functionality not available on this system
390 [ 9.654038] TCP: cubic registered
391 [ 9.654234] NET: Registered protocol family 10
392 [ 9.654554] mip6: Mobile IPv6
393 [ 9.654558] NET: Registered protocol family 17
394 [ 9.654564] mpls_gso: MPLS GSO support
395 [ 9.654770] registered taskstats version 1
396 [ 9.656357] rtc_cmos rtc_cmos: setting system clock to 2017-03-01 19:09:11 UTC (1488395351)
397 [ 9.656427] PM: Hibernation image not present or could not be loaded.
398 [ 9.663167] Freeing unused kernel memory: 1204K (ffffffff818ee000 - ffffffff81a1b000)
399 [ 9.663171] Write protecting the kernel read-only data: 8192k
400 [ 9.663645] Freeing unused kernel memory: 896K (ffff880001520000 - ffff880001600000)
401 [ 9.664120] Freeing unused kernel memory: 212K (ffff8800017cb000 - ffff880001800000)
402 [ 9.677467] systemd-udevd[60]: starting version 215
403 [ 9.677730] random: systemd-udevd urandom read with 2 bits of entropy available
404 [ 9.698416] ACPI: bus type USB registered
405 [ 9.698445] usbcore: registered new interface driv
406
407 '''
408 return returncode, output
409
410 @staticmethod
411 def lscpu():
412 returncode = 0
413 output = r'''
414 Architecture: x86_64
415 CPU op-mode(s): 32-bit, 64-bit
416 Byte Order: Little Endian
417 CPU(s): 2
418 On-line CPU(s) list: 0,1
419 Thread(s) per core: 1
420 Core(s) per socket: 2
421 Socket(s): 1
422 NUMA node(s): 1
423 Vendor ID: GenuineIntel
424 CPU family: 6
425 Model: 42
426 Model name: Intel(R) Pentium(R) CPU G640 @ 2.80GHz
427 Stepping: 7
428 CPU MHz: 2793.652
429 BogoMIPS: 5587.30
430 Hypervisor vendor: KVM
431 Virtualization type: full
432 L1d cache: 32K
433 L1i cache: 32K
434 L2 cache: 256K
435 L3 cache: 3072K
436 NUMA node0 CPU(s): 0,1
437
438 '''
439 return returncode, output
440
441
442 class TestLinuxDebian_8_5_X86_64(unittest.TestCase):
443 def setUp(self):
444 helpers.backup_data_source(cpuinfo)
445 helpers.monkey_patch_data_source(cpuinfo, MockDataSource)
446
447 def tearDown(self):
448 helpers.restore_data_source(cpuinfo)
449
450 '''
451 Make sure calls return the expected number of fields.
452 '''
453 def test_returns(self):
454 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_registry()))
455 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpufreq_info()))
456 self.assertEqual(13, len(cpuinfo._get_cpu_info_from_lscpu()))
457 self.assertEqual(11, len(cpuinfo._get_cpu_info_from_proc_cpuinfo()))
458 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysctl()))
459 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_kstat()))
460 self.assertEqual(8, len(cpuinfo._get_cpu_info_from_dmesg()))
461 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cat_var_run_dmesg_boot()))
462 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_ibm_pa_features()))
463 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysinfo()))
464 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpuid()))
465 self.assertEqual(21, len(cpuinfo._get_cpu_info_internal()))
466
467 def test_get_cpu_info_from_lscpu(self):
468 info = cpuinfo._get_cpu_info_from_lscpu()
469
470 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
471 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
472 self.assertEqual('2.7937 GHz', info['hz_advertised_friendly'])
473 self.assertEqual('2.7937 GHz', info['hz_actual_friendly'])
474 self.assertEqual((2793652000, 0), info['hz_advertised'])
475 self.assertEqual((2793652000, 0), info['hz_actual'])
476
477 self.assertEqual(7, info['stepping'])
478 self.assertEqual(42, info['model'])
479 self.assertEqual(6, info['family'])
480
481 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
482 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
483
484 self.assertEqual(256 * 1024, info['l2_cache_size'])
485 self.assertEqual(3072 * 1024, info['l3_cache_size'])
486
487 def test_get_cpu_info_from_dmesg(self):
488 info = cpuinfo._get_cpu_info_from_dmesg()
489
490 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
491 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
492 self.assertEqual('2.8000 GHz', info['hz_actual_friendly'])
493 self.assertEqual((2800000000, 0), info['hz_advertised'])
494 self.assertEqual((2800000000, 0), info['hz_actual'])
495
496 self.assertEqual(7, info['stepping'])
497 self.assertEqual(42, info['model'])
498 self.assertEqual(6, info['family'])
499
500 def test_get_cpu_info_from_proc_cpuinfo(self):
501 info = cpuinfo._get_cpu_info_from_proc_cpuinfo()
502
503 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
504 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
505 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
506 self.assertEqual('2.7937 GHz', info['hz_actual_friendly'])
507 self.assertEqual((2800000000, 0), info['hz_advertised'])
508 self.assertEqual((2793652000, 0), info['hz_actual'])
509
510 self.assertEqual(3072 * 1024, info['l3_cache_size'])
511
512 self.assertEqual(7, info['stepping'])
513 self.assertEqual(42, info['model'])
514 self.assertEqual(6, info['family'])
515 self.assertEqual(
516 ['apic', 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de',
517 'fpu', 'fxsr', 'ht', 'hypervisor', 'lahf_lm', 'lm', 'mca', 'mce',
518 'mmx', 'msr', 'mtrr', 'nonstop_tsc', 'nopl', 'nx', 'pae', 'pat',
519 'pclmulqdq', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp',
520 'rep_good', 'sep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3',
521 'syscall', 'tsc', 'vme', 'xsave', 'xtopology']
522 ,
523 info['flags']
524 )
525
526 def test_all(self):
527 info = cpuinfo._get_cpu_info_internal()
528
529 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
530 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
531 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
532 self.assertEqual('2.7937 GHz', info['hz_actual_friendly'])
533 self.assertEqual((2800000000, 0), info['hz_advertised'])
534 self.assertEqual((2793652000, 0), info['hz_actual'])
535 self.assertEqual('X86_64', info['arch'])
536 self.assertEqual(64, info['bits'])
537 self.assertEqual(2, info['count'])
538
539 self.assertEqual('x86_64', info['arch_string_raw'])
540
541 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
542 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
543
544 self.assertEqual(256 * 1024, info['l2_cache_size'])
545 self.assertEqual(3072 * 1024, info['l3_cache_size'])
546
547 self.assertEqual(7, info['stepping'])
548 self.assertEqual(42, info['model'])
549 self.assertEqual(6, info['family'])
550 self.assertEqual(
551 ['apic', 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de',
552 'fpu', 'fxsr', 'ht', 'hypervisor', 'lahf_lm', 'lm', 'mca', 'mce',
553 'mmx', 'msr', 'mtrr', 'nonstop_tsc', 'nopl', 'nx', 'pae', 'pat',
554 'pclmulqdq', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp',
555 'rep_good', 'sep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3',
556 'syscall', 'tsc', 'vme', 'xsave', 'xtopology']
557 ,
558 info['flags']
559 )