Debian Codegraph @

tests/test_linux_ubuntu_16_04_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_lscpu():
22 return True
23
24 @staticmethod
25 def has_dmesg():
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 microcode : 0x29
39 cpu MHz : 1901.375
40 cache size : 3072 KB
41 physical id : 0
42 siblings : 2
43 core id : 0
44 cpu cores : 2
45 apicid : 0
46 initial apicid : 0
47 fpu : yes
48 fpu_exception : yes
49 cpuid level : 13
50 wp : yes
51 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave lahf_lm epb tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
52 bugs :
53 bogomips : 5587.32
54 clflush size : 64
55 cache_alignment : 64
56 address sizes : 36 bits physical, 48 bits virtual
57 power management:
58
59 processor : 1
60 vendor_id : GenuineIntel
61 cpu family : 6
62 model : 42
63 model name : Intel(R) Pentium(R) CPU G640 @ 2.80GHz
64 stepping : 7
65 microcode : 0x29
66 cpu MHz : 2070.796
67 cache size : 3072 KB
68 physical id : 0
69 siblings : 2
70 core id : 1
71 cpu cores : 2
72 apicid : 2
73 initial apicid : 2
74 fpu : yes
75 fpu_exception : yes
76 cpuid level : 13
77 wp : yes
78 flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave lahf_lm epb tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
79 bugs :
80 bogomips : 5587.32
81 clflush size : 64
82 cache_alignment : 64
83 address sizes : 36 bits physical, 48 bits virtual
84 power management:
85
86
87 '''
88 return returncode, output
89
90 @staticmethod
91 def lscpu():
92 returncode = 0
93 output = r'''
94 Architecture: x86_64
95 CPU op-mode(s): 32-bit, 64-bit
96 Byte Order: Little Endian
97 CPU(s): 2
98 On-line CPU(s) list: 0,1
99 Thread(s) per core: 1
100 Core(s) per socket: 2
101 Socket(s): 1
102 NUMA node(s): 1
103 Vendor ID: GenuineIntel
104 CPU family: 6
105 Model: 42
106 Model name: Intel(R) Pentium(R) CPU G640 @ 2.80GHz
107 Stepping: 7
108 CPU MHz: 2070.796
109 CPU max MHz: 2800.0000
110 CPU min MHz: 1600.0000
111 BogoMIPS: 5587.32
112 Virtualization: VT-x
113 L1d cache: 32K
114 L1i cache: 32K
115 L2 cache: 256K
116 L3 cache: 3072K
117 NUMA node0 CPU(s): 0,1
118 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave lahf_lm epb tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
119
120
121 '''
122 return returncode, output
123
124 @staticmethod
125 def dmesg_a():
126 returncode = 0
127 output = r'''
128 [ 0.000000] microcode: CPU0 microcode updated early to revision 0x29, date = 2013-06-12
129 [ 0.000000] Initializing cgroup subsys cpuset
130 [ 0.000000] Initializing cgroup subsys cpu
131 [ 0.000000] Initializing cgroup subsys cpuacct
132 [ 0.000000] Linux version 4.4.0-64-generic (buildd@lgw01-56) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 (Ubuntu 4.4.0-64.85-generic 4.4.44)
133 [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-64-generic root=UUID=9112213a-3570-4904-8969-d5aab8825f6b ro quiet splash vt.handoff=7
134 [ 0.000000] KERNEL supported cpus:
135 [ 0.000000] Intel GenuineIntel
136 [ 0.000000] AMD AuthenticAMD
137 [ 0.000000] Centaur CentaurHauls
138 [ 0.000000] x86/fpu: Supporting XSAVE feature 0x01: 'x87 floating point registers'
139 [ 0.000000] x86/fpu: Supporting XSAVE feature 0x02: 'SSE registers'
140 [ 0.000000] x86/fpu: Enabled xstate features 0x3, context size is 576 bytes, using 'standard' format.
141 [ 0.000000] x86/fpu: Using 'eager' FPU context switches.
142 [ 0.000000] e820: BIOS-provided physical RAM map:
143 [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009d7ff] usable
144 [ 0.000000] BIOS-e820: [mem 0x000000000009d800-0x000000000009ffff] reserved
145 [ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
146 [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
147 [ 0.000000] BIOS-e820: [mem 0x0000000020000000-0x00000000201fffff] reserved
148 [ 0.000000] BIOS-e820: [mem 0x0000000020200000-0x000000003fffffff] usable
149 [ 0.000000] BIOS-e820: [mem 0x0000000040000000-0x00000000401fffff] reserved
150 [ 0.000000] BIOS-e820: [mem 0x0000000040200000-0x00000000d878dfff] usable
151 [ 0.000000] BIOS-e820: [mem 0x00000000d878e000-0x00000000d8792fff] reserved
152 [ 0.000000] BIOS-e820: [mem 0x00000000d8793000-0x00000000d8796fff] usable
153 [ 0.000000] BIOS-e820: [mem 0x00000000d8797000-0x00000000d8db1fff] reserved
154 [ 0.000000] BIOS-e820: [mem 0x00000000d8db2000-0x00000000d9018fff] ACPI NVS
155 [ 0.000000] BIOS-e820: [mem 0x00000000d9019000-0x00000000d9024fff] ACPI data
156 [ 0.000000] BIOS-e820: [mem 0x00000000d9025000-0x00000000d9031fff] ACPI NVS
157 [ 0.000000] BIOS-e820: [mem 0x00000000d9032000-0x00000000d9036fff] ACPI data
158 [ 0.000000] BIOS-e820: [mem 0x00000000d9037000-0x00000000d9079fff] ACPI NVS
159 [ 0.000000] BIOS-e820: [mem 0x00000000d907a000-0x00000000d9d3dfff] usable
160 [ 0.000000] BIOS-e820: [mem 0x00000000d9d3e000-0x00000000d9ff1fff] reserved
161 [ 0.000000] BIOS-e820: [mem 0x00000000d9ff2000-0x00000000d9ffffff] usable
162 [ 0.000000] BIOS-e820: [mem 0x00000000db000000-0x00000000df1fffff] reserved
163 [ 0.000000] BIOS-e820: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
164 [ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
165 [ 0.000000] BIOS-e820: [mem 0x00000000fed00000-0x00000000fed03fff] reserved
166 [ 0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
167 [ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
168 [ 0.000000] BIOS-e820: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
169 [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000041fdfffff] usable
170 [ 0.000000] NX (Execute Disable) protection: active
171 [ 0.000000] SMBIOS 2.7 present.
172 [ 0.000000] DMI: Hewlett-Packard s5-1224/2ADA, BIOS 7.11 04/28/2012
173 [ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
174 [ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
175 [ 0.000000] e820: last_pfn = 0x41fe00 max_arch_pfn = 0x400000000
176 [ 0.000000] MTRR default type: uncachable
177 [ 0.000000] MTRR fixed ranges enabled:
178 [ 0.000000] 00000-9FFFF write-back
179 [ 0.000000] A0000-BFFFF uncachable
180 [ 0.000000] C0000-CFFFF write-protect
181 [ 0.000000] D0000-E7FFF uncachable
182 [ 0.000000] E8000-FFFFF write-protect
183 [ 0.000000] MTRR variable ranges enabled:
184 [ 0.000000] 0 base 000000000 mask C00000000 write-back
185 [ 0.000000] 1 base 400000000 mask FE0000000 write-back
186 [ 0.000000] 2 base 0E0000000 mask FE0000000 uncachable
187 [ 0.000000] 3 base 0DC000000 mask FFC000000 uncachable
188 [ 0.000000] 4 base 0DB000000 mask FFF000000 uncachable
189 [ 0.000000] 5 base 41FE00000 mask FFFE00000 uncachable
190 [ 0.000000] 6 disabled
191 [ 0.000000] 7 disabled
192 [ 0.000000] 8 disabled
193 [ 0.000000] 9 disabled
194 [ 0.000000] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT
195 [ 0.000000] original variable MTRRs
196 [ 0.000000] reg 0, base: 0GB, range: 16GB, type WB
197 [ 0.000000] reg 1, base: 16GB, range: 512MB, type WB
198 [ 0.000000] reg 2, base: 3584MB, range: 512MB, type UC
199 [ 0.000000] reg 3, base: 3520MB, range: 64MB, type UC
200 [ 0.000000] reg 4, base: 3504MB, range: 16MB, type UC
201 [ 0.000000] reg 5, base: 16894MB, range: 2MB, type UC
202 [ 0.000000] total RAM covered: 16302M
203 [ 0.000000] Found optimal setting for mtrr clean up
204 [ 0.000000] gran_size: 64K chunk_size: 128M num_reg: 9 lose cover RAM: 0G
205 [ 0.000000] New variable MTRRs
206 [ 0.000000] reg 0, base: 0GB, range: 2GB, type WB
207 [ 0.000000] reg 1, base: 2GB, range: 1GB, type WB
208 [ 0.000000] reg 2, base: 3GB, range: 512MB, type WB
209 [ 0.000000] reg 3, base: 3504MB, range: 16MB, type UC
210 [ 0.000000] reg 4, base: 3520MB, range: 64MB, type UC
211 [ 0.000000] reg 5, base: 4GB, range: 4GB, type WB
212 [ 0.000000] reg 6, base: 8GB, range: 8GB, type WB
213 [ 0.000000] reg 7, base: 16GB, range: 512MB, type WB
214 [ 0.000000] reg 8, base: 16894MB, range: 2MB, type UC
215 [ 0.000000] e820: update [mem 0xdb000000-0xffffffff] usable ==> reserved
216 [ 0.000000] e820: last_pfn = 0xda000 max_arch_pfn = 0x400000000
217 [ 0.000000] found SMP MP-table at [mem 0x000fcc40-0x000fcc4f] mapped at [ffff8800000fcc40]
218 [ 0.000000] Scanning 1 areas for low memory corruption
219 [ 0.000000] Base memory trampoline at [ffff880000097000] 97000 size 24576
220 [ 0.000000] reserving inaccessible SNB gfx pages
221 [ 0.000000] BRK [0x0220c000, 0x0220cfff] PGTABLE
222 [ 0.000000] BRK [0x0220d000, 0x0220dfff] PGTABLE
223 [ 0.000000] BRK [0x0220e000, 0x0220efff] PGTABLE
224 [ 0.000000] BRK [0x0220f000, 0x0220ffff] PGTABLE
225 [ 0.000000] BRK [0x02210000, 0x02210fff] PGTABLE
226 [ 0.000000] BRK [0x02211000, 0x02211fff] PGTABLE
227 [ 0.000000] RAMDISK: [mem 0x337fe000-0x35bf6fff]
228 [ 0.000000] ACPI: Early table checksum verification disabled
229 [ 0.000000] ACPI: RSDP 0x00000000000F0450 000024 (v02 HPQOEM)
230 [ 0.000000] ACPI: XSDT 0x00000000D9019078 00006C (v01 HPQOEM SLIC-CPC 01072009 AMI 00010013)
231 [ 0.000000] ACPI: FACP 0x00000000D90227B8 0000F4 (v04 HPQOEM SLIC-CPC 01072009 AMI 00010013)
232 [ 0.000000] ACPI: DSDT 0x00000000D9019170 009645 (v02 HPQOEM SLIC-CPC 00000711 INTL 20051117)
233 [ 0.000000] ACPI: FACS 0x00000000D9030F80 000040
234 [ 0.000000] ACPI: APIC 0x00000000D90228B0 000062 (v03 HPQOEM SLIC-CPC 01072009 AMI 00010013)
235 [ 0.000000] ACPI: MCFG 0x00000000D9022918 00003C (v01 HPQOEM SLIC-CPC 01072009 MSFT 00000097)
236 [ 0.000000] ACPI: SLIC 0x00000000D9022958 000176 (v01 HPQOEM SLIC-CPC 01072009 AMI 00010013)
237 [ 0.000000] ACPI: HPET 0x00000000D9022AD0 000038 (v01 HPQOEM SLIC-CPC 01072009 AMI. 00000005)
238 [ 0.000000] ACPI: SSDT 0x00000000D9022B08 00036D (v01 HPQOEM SLIC-CPC 00001000 INTL 20091112)
239 [ 0.000000] ACPI: SSDT 0x00000000D9022E78 0008E4 (v01 HPQOEM SLIC-CPC 00003000 INTL 20051117)
240 [ 0.000000] ACPI: SSDT 0x00000000D9023760 000A92 (v01 HPQOEM SLIC-CPC 00003000 INTL 20051117)
241 [ 0.000000] ACPI: DBGP 0x00000000D90241F8 000034 (v01 HPQOEM SLIC-CPC 01072009 AMI 00010013)
242 [ 0.000000] ACPI: Local APIC address 0xfee00000
243 [ 0.000000] No NUMA configuration found
244 [ 0.000000] Faking a node at [mem 0x0000000000000000-0x000000041fdfffff]
245 [ 0.000000] NODE_DATA(0) allocated [mem 0x41fdea000-0x41fdeefff]
246 [ 0.000000] Zone ranges:
247 [ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
248 [ 0.000000] DMA32 [mem 0x0000000001000000-0x00000000ffffffff]
249 [ 0.000000] Normal [mem 0x0000000100000000-0x000000041fdfffff]
250 [ 0.000000] Device empty
251 [ 0.000000] Movable zone start for each node
252 [ 0.000000] Early memory node ranges
253 [ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009cfff]
254 [ 0.000000] node 0: [mem 0x0000000000100000-0x000000001fffffff]
255 [ 0.000000] node 0: [mem 0x0000000020200000-0x000000003fffffff]
256 [ 0.000000] node 0: [mem 0x0000000040200000-0x00000000d878dfff]
257 [ 0.000000] node 0: [mem 0x00000000d8793000-0x00000000d8796fff]
258 [ 0.000000] node 0: [mem 0x00000000d907a000-0x00000000d9d3dfff]
259 [ 0.000000] node 0: [mem 0x00000000d9ff2000-0x00000000d9ffffff]
260 [ 0.000000] node 0: [mem 0x0000000100000000-0x000000041fdfffff]
261 [ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000041fdfffff]
262 [ 0.000000] On node 0 totalpages: 4165120
263 [ 0.000000] DMA zone: 64 pages used for memmap
264 [ 0.000000] DMA zone: 156 pages reserved
265 [ 0.000000] DMA zone: 3996 pages, LIFO batch:0
266 [ 0.000000] DMA32 zone: 13826 pages used for memmap
267 [ 0.000000] DMA32 zone: 884836 pages, LIFO batch:31
268 [ 0.000000] Normal zone: 51192 pages used for memmap
269 [ 0.000000] Normal zone: 3276288 pages, LIFO batch:31
270 [ 0.000000] Reserving Intel graphics stolen memory at 0xdb200000-0xdf1fffff
271 [ 0.000000] ACPI: PM-Timer IO Port: 0x408
272 [ 0.000000] ACPI: Local APIC address 0xfee00000
273 [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
274 [ 0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
275 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
276 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
277 [ 0.000000] ACPI: IRQ0 used by override.
278 [ 0.000000] ACPI: IRQ9 used by override.
279 [ 0.000000] Using ACPI (MADT) for SMP configuration information
280 [ 0.000000] ACPI: HPET id: 0x8086a701 base: 0xfed00000
281 [ 0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs
282 [ 0.000000] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
283 [ 0.000000] PM: Registered nosave memory: [mem 0x0009d000-0x0009dfff]
284 [ 0.000000] PM: Registered nosave memory: [mem 0x0009e000-0x0009ffff]
285 [ 0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000dffff]
286 [ 0.000000] PM: Registered nosave memory: [mem 0x000e0000-0x000fffff]
287 [ 0.000000] PM: Registered nosave memory: [mem 0x20000000-0x201fffff]
288 [ 0.000000] PM: Registered nosave memory: [mem 0x40000000-0x401fffff]
289 [ 0.000000] PM: Registered nosave memory: [mem 0xd878e000-0xd8792fff]
290 [ 0.000000] PM: Registered nosave memory: [mem 0xd8797000-0xd8db1fff]
291 [ 0.000000] PM: Registered nosave memory: [mem 0xd8db2000-0xd9018fff]
292 [ 0.000000] PM: Registered nosave memory: [mem 0xd9019000-0xd9024fff]
293 [ 0.000000] PM: Registered nosave memory: [mem 0xd9025000-0xd9031fff]
294 [ 0.000000] PM: Registered nosave memory: [mem 0xd9032000-0xd9036fff]
295 [ 0.000000] PM: Registered nosave memory: [mem 0xd9037000-0xd9079fff]
296 [ 0.000000] PM: Registered nosave memory: [mem 0xd9d3e000-0xd9ff1fff]
297 [ 0.000000] PM: Registered nosave memory: [mem 0xda000000-0xdaffffff]
298 [ 0.000000] PM: Registered nosave memory: [mem 0xdb000000-0xdf1fffff]
299 [ 0.000000] PM: Registered nosave memory: [mem 0xdf200000-0xf7ffffff]
300 [ 0.000000] PM: Registered nosave memory: [mem 0xf8000000-0xfbffffff]
301 [ 0.000000] PM: Registered nosave memory: [mem 0xfc000000-0xfebfffff]
302 [ 0.000000] PM: Registered nosave memory: [mem 0xfec00000-0xfec00fff]
303 [ 0.000000] PM: Registered nosave memory: [mem 0xfec01000-0xfecfffff]
304 [ 0.000000] PM: Registered nosave memory: [mem 0xfed00000-0xfed03fff]
305 [ 0.000000] PM: Registered nosave memory: [mem 0xfed04000-0xfed1bfff]
306 [ 0.000000] PM: Registered nosave memory: [mem 0xfed1c000-0xfed1ffff]
307 [ 0.000000] PM: Registered nosave memory: [mem 0xfed20000-0xfedfffff]
308 [ 0.000000] PM: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
309 [ 0.000000] PM: Registered nosave memory: [mem 0xfee01000-0xfeffffff]
310 [ 0.000000] PM: Registered nosave memory: [mem 0xff000000-0xffffffff]
311 [ 0.000000] e820: [mem 0xdf200000-0xf7ffffff] available for PCI devices
312 [ 0.000000] Booting paravirtualized kernel on bare hardware
313 [ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
314 [ 0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:2 nr_node_ids:1
315 [ 0.000000] PERCPU: Embedded 33 pages/cpu @ffff88041fa00000 s98264 r8192 d28712 u1048576
316 [ 0.000000] pcpu-alloc: s98264 r8192 d28712 u1048576 alloc=1*2097152
317 [ 0.000000] pcpu-alloc: [0] 0 1
318 [ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 4099882
319 [ 0.000000] Policy zone: Normal
320 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-64-generic root=UUID=9112213a-3570-4904-8969-d5aab8825f6b ro quiet splash vt.handoff=7
321 [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
322 [ 0.000000] Calgary: detecting Calgary via BIOS EBDA area
323 [ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
324 [ 0.000000] Memory: 16275716K/16660480K available (8452K kernel code, 1293K rwdata, 3980K rodata, 1488K init, 1316K bss, 384764K reserved, 0K cma-reserved)
325 [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
326 [ 0.000000] Hierarchical RCU implementation.
327 [ 0.000000] Build-time adjustment of leaf fanout to 64.
328 [ 0.000000] RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=2.
329 [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=2
330 [ 0.000000] NR_IRQS:33024 nr_irqs:440 16
331 [ 0.000000] vt handoff: transparent VT on vt#7
332 [ 0.000000] Console: colour dummy device 80x25
333 [ 0.000000] console [tty0] enabled
334 [ 0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484882848 ns
335 [ 0.000000] hpet clockevent registered
336 [ 0.000000] tsc: Fast TSC calibration using PIT
337 [ 0.000000] tsc: Detected 2793.634 MHz processor
338 [ 0.000031] Calibrating delay loop (skipped), value calculated using timer frequency.. 5587.26 BogoMIPS (lpj=11174536)
339 [ 0.000033] pid_max: default: 32768 minimum: 301
340 [ 0.000038] ACPI: Core revision 20150930
341 [ 0.005982] ACPI: 4 ACPI AML tables successfully acquired and loaded
342 [ 0.005999] Security Framework initialized
343 [ 0.006001] Yama: becoming mindful.
344 [ 0.006015] AppArmor: AppArmor initialized
345 [ 0.006874] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
346 [ 0.009794] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
347 [ 0.011066] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes)
348 [ 0.011082] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes)
349 [ 0.011317] Initializing cgroup subsys io
350 [ 0.011320] Initializing cgroup subsys memory
351 [ 0.011326] Initializing cgroup subsys devices
352 [ 0.011328] Initializing cgroup subsys freezer
353 [ 0.011330] Initializing cgroup subsys net_cls
354 [ 0.011332] Initializing cgroup subsys perf_event
355 [ 0.011334] Initializing cgroup subsys net_prio
356 [ 0.011337] Initializing cgroup subsys hugetlb
357 [ 0.011338] Initializing cgroup subsys pids
358 [ 0.011357] CPU: Physical Processor ID: 0
359 [ 0.011358] CPU: Processor Core ID: 0
360 [ 0.011362] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
361 [ 0.011363] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
362 [ 0.011365] mce: CPU supports 7 MCE banks
363 [ 0.011375] CPU0: Thermal monitoring enabled (TM1)
364 [ 0.011381] process: using mwait in idle threads
365 [ 0.011384] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
366 [ 0.011384] Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
367 [ 0.011758] Freeing SMP alternatives memory: 32K (ffffffff820b9000 - ffffffff820c1000)
368 [ 0.015837] ftrace: allocating 32123 entries in 126 pages
369 [ 0.029893] smpboot: APIC(0) Converting physical 0 to logical package 0
370 [ 0.029895] smpboot: Max logical packages: 1
371 [ 0.030318] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
372 [ 0.070006] TSC deadline timer enabled
373 [ 0.070009] smpboot: CPU0: Intel(R) Pentium(R) CPU G640 @ 2.80GHz (family: 0x6, model: 0x2a, stepping: 0x7)
374 [ 0.070028] Performance Events: PEBS fmt1+, 16-deep LBR, SandyBridge events, full-width counters, Intel PMU driver.
375 [ 0.070047] ... version: 3
376 [ 0.070048] ... bit width: 48
377 [ 0.070049] ... generic registers: 8
378 [ 0.070050] ... value mask: 0000ffffffffffff
379 [ 0.070051] ... max period: 00007fffffffffff
380 [ 0.070051] ... fixed-purpose events: 3
381 [ 0.070052] ... event mask: 00000007000000ff
382 [ 0.070751] x86: Booting SMP configuration:
383 [ 0.070752] .... node #0, CPUs: #1
384 [ 0.071267] microcode: CPU1 microcode updated early to revision 0x29, date = 2013-06-12
385 [ 0.073348] x86: Booted up 1 node, 2 CPUs
386 [ 0.073351] smpboot: Total of 2 processors activated (11174.53 BogoMIPS)
387 [ 0.073388] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
388 [ 0.074762] devtmpfs: initialized
389 [ 0.078897] evm: security.selinux
390 [ 0.078899] evm: security.SMACK64
391 [ 0.078899] evm: security.SMACK64EXEC
392 [ 0.078900] evm: security.SMACK64TRANSMUTE
393 [ 0.078901] evm: security.SMACK64MMAP
394 [ 0.078902] evm: security.ima
395 [ 0.078903] evm: security.capability
396 [ 0.078959] PM: Registering ACPI NVS region [mem 0xd8db2000-0xd9018fff] (2519040 bytes)
397 [ 0.078988] PM: Registering ACPI NVS region [mem 0xd9025000-0xd9031fff] (53248 bytes)
398 [ 0.078990] PM: Registering ACPI NVS region [mem 0xd9037000-0xd9079fff] (274432 bytes)
399 [ 0.079062] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
400 [ 0.079131] pinctrl core: initialized pinctrl subsystem
401 [ 0.079239] RTC time: 18:18:42, date: 03/01/17
402 [ 0.079337] NET: Registered protocol family 16
403 [ 0.090637] cpuidle: using governor ladder
404 [ 0.097353] cpuidle: using governor menu
405 [ 0.097358] PCCT header not found.
406 [ 0.097447] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
407 [ 0.097448] ACPI: bus type PCI registered
408 [ 0.097450] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
409 [ 0.097510] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xf8000000-0xfbffffff] (base 0xf8000000)
410 [ 0.097512] PCI: MMCONFIG at [mem 0xf8000000-0xfbffffff] reserved in E820
411 [ 0.097522] PCI: Using configuration type 1 for base access
412 [ 0.097611] NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.
413 [ 0.097618] core: PMU erratum BJ122, BV98, HSD29 workaround disabled, HT off
414 [ 0.109668] ACPI: Added _OSI(Module Device)
415 [ 0.109670] ACPI: Added _OSI(Processor Device)
416 [ 0.109671] ACPI: Added _OSI(3.0 _SCP Extensions)
417 [ 0.109672] ACPI: Added _OSI(Processor Aggregator Device)
418 [ 0.111896] ACPI: Executed 1 blocks of module-level executable AML code
419 [ 0.114009] ACPI: Dynamic OEM Table Load:
420 [ 0.114015] ACPI: SSDT 0xFFFF88040D710000 00083B (v01 PmRef Cpu0Cst 00003001 INTL 20051117)
421 [ 0.114446] ACPI: Dynamic OEM Table Load:
422 [ 0.114450] ACPI: SSDT 0xFFFF88040D02A000 000303 (v01 PmRef ApIst 00003000 INTL 20051117)
423 [ 0.114826] ACPI: Dynamic OEM Table Load:
424 [ 0.114829] ACPI: SSDT 0xFFFF88040D63AC00 000119 (v01 PmRef ApCst 00003000 INTL 20051117)
425 [ 0.115263] ACPI: Interpreter enabled
426 [ 0.115279] ACPI: (supports S0 S3 S4 S5)
427 [ 0.115280] ACPI: Using IOAPIC for interrupt routing
428 [ 0.115303] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
429 [ 0.120695] ACPI: Power Resource [FN00] (off)
430 [ 0.120766] ACPI: Power Resource [FN01] (off)
431 [ 0.120834] ACPI: Power Resource [FN02] (off)
432 [ 0.120902] ACPI: Power Resource [FN03] (off)
433 [ 0.120970] ACPI: Power Resource [FN04] (off)
434 [ 0.121440] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-3e])
435 [ 0.121445] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
436 [ 0.121548] \_SB_.PCI0:_OSC invalid UUID
437 [ 0.121549] _OSC request data:1 1f 0
438 [ 0.121553] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
439 [ 0.121947] PCI host bridge to bus 0000:00
440 [ 0.121950] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
441 [ 0.121951] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
442
443 '''
444 return returncode, output
445
446 class TestLinuxUbuntu_16_04_X86_64(unittest.TestCase):
447 def setUp(self):
448 helpers.backup_data_source(cpuinfo)
449 helpers.monkey_patch_data_source(cpuinfo, MockDataSource)
450
451 def tearDown(self):
452 helpers.restore_data_source(cpuinfo)
453
454 '''
455 Make sure calls return the expected number of fields.
456 '''
457 def test_returns(self):
458 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_registry()))
459 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpufreq_info()))
460 self.assertEqual(14, len(cpuinfo._get_cpu_info_from_lscpu()))
461 self.assertEqual(11, len(cpuinfo._get_cpu_info_from_proc_cpuinfo()))
462 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysctl()))
463 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_kstat()))
464 self.assertEqual(8, len(cpuinfo._get_cpu_info_from_dmesg()))
465 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cat_var_run_dmesg_boot()))
466 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_ibm_pa_features()))
467 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysinfo()))
468 self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpuid()))
469 self.assertEqual(21, len(cpuinfo._get_cpu_info_internal()))
470
471 def test_get_cpu_info_from_lscpu(self):
472 info = cpuinfo._get_cpu_info_from_lscpu()
473
474 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
475 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
476 self.assertEqual('2.0708 GHz', info['hz_advertised_friendly'])
477 self.assertEqual('2.0708 GHz', info['hz_actual_friendly'])
478 self.assertEqual((2070796000, 0), info['hz_advertised'])
479 self.assertEqual((2070796000, 0), info['hz_actual'])
480
481 self.assertEqual(7, info['stepping'])
482 self.assertEqual(42, info['model'])
483 self.assertEqual(6, info['family'])
484
485 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
486 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
487 self.assertEqual(256 * 1024, info['l2_cache_size'])
488 self.assertEqual(3072 * 1024, info['l3_cache_size'])
489 self.assertEqual(
490 ['acpi', 'aperfmperf', 'apic', 'arat', 'arch_perfmon', 'bts',
491 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', 'ds_cpl',
492 'dtes64', 'dtherm', 'dts', 'eagerfpu', 'epb', 'ept', 'est',
493 'flexpriority', 'fpu', 'fxsr', 'ht', 'lahf_lm', 'lm', 'mca',
494 'mce', 'mmx', 'monitor', 'msr', 'mtrr', 'nonstop_tsc', 'nopl',
495 'nx', 'pae', 'pat', 'pbe', 'pcid', 'pclmulqdq', 'pdcm', 'pebs',
496 'pge', 'pln', 'pni', 'popcnt', 'pse', 'pse36', 'pts', 'rdtscp',
497 'rep_good', 'sep', 'ss', 'sse', 'sse2', 'sse4_1', 'sse4_2',
498 'ssse3', 'syscall', 'tm', 'tm2', 'tpr_shadow', 'tsc',
499 'tsc_deadline_timer', 'vme', 'vmx', 'vnmi', 'vpid', 'xsave',
500 'xsaveopt', 'xtopology', 'xtpr']
501 ,
502 info['flags']
503 )
504
505 def test_get_cpu_info_from_dmesg(self):
506 info = cpuinfo._get_cpu_info_from_dmesg()
507
508 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
509 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
510 self.assertEqual('2.8000 GHz', info['hz_actual_friendly'])
511 self.assertEqual((2800000000, 0), info['hz_advertised'])
512 self.assertEqual((2800000000, 0), info['hz_actual'])
513
514 self.assertEqual(7, info['stepping'])
515 self.assertEqual(42, info['model'])
516 self.assertEqual(6, info['family'])
517
518 def test_get_cpu_info_from_proc_cpuinfo(self):
519 info = cpuinfo._get_cpu_info_from_proc_cpuinfo()
520
521 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
522 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
523 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
524 self.assertEqual('1.9014 GHz', info['hz_actual_friendly'])
525 self.assertEqual((2800000000, 0), info['hz_advertised'])
526 self.assertEqual((1901375000, 0), info['hz_actual'])
527
528 self.assertEqual(3072 * 1024, info['l3_cache_size'])
529
530 self.assertEqual(7, info['stepping'])
531 self.assertEqual(42, info['model'])
532 self.assertEqual(6, info['family'])
533 self.assertEqual(
534 ['acpi', 'aperfmperf', 'apic', 'arat', 'arch_perfmon', 'bts',
535 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', 'ds_cpl',
536 'dtes64', 'dtherm', 'dts', 'eagerfpu', 'epb', 'ept', 'est',
537 'flexpriority', 'fpu', 'fxsr', 'ht', 'lahf_lm', 'lm', 'mca',
538 'mce', 'mmx', 'monitor', 'msr', 'mtrr', 'nonstop_tsc', 'nopl',
539 'nx', 'pae', 'pat', 'pbe', 'pcid', 'pclmulqdq', 'pdcm', 'pebs',
540 'pge', 'pln', 'pni', 'popcnt', 'pse', 'pse36', 'pts', 'rdtscp',
541 'rep_good', 'sep', 'ss', 'sse', 'sse2', 'sse4_1', 'sse4_2',
542 'ssse3', 'syscall', 'tm', 'tm2', 'tpr_shadow', 'tsc',
543 'tsc_deadline_timer', 'vme', 'vmx', 'vnmi', 'vpid', 'xsave',
544 'xsaveopt', 'xtopology', 'xtpr']
545 ,
546 info['flags']
547 )
548
549 def test_all(self):
550 info = cpuinfo._get_cpu_info_internal()
551
552 self.assertEqual('GenuineIntel', info['vendor_id_raw'])
553 self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw'])
554 self.assertEqual('2.8000 GHz', info['hz_advertised_friendly'])
555 self.assertEqual('1.9014 GHz', info['hz_actual_friendly'])
556 self.assertEqual((2800000000, 0), info['hz_advertised'])
557 self.assertEqual((1901375000, 0), info['hz_actual'])
558 self.assertEqual('X86_64', info['arch'])
559 self.assertEqual(64, info['bits'])
560 self.assertEqual(2, info['count'])
561
562 self.assertEqual('x86_64', info['arch_string_raw'])
563
564 self.assertEqual(32 * 1024, info['l1_instruction_cache_size'])
565 self.assertEqual(32 * 1024, info['l1_data_cache_size'])
566
567 self.assertEqual(256 * 1024, info['l2_cache_size'])
568
569 self.assertEqual(3072 * 1024, info['l3_cache_size'])
570
571 self.assertEqual(7, info['stepping'])
572 self.assertEqual(42, info['model'])
573 self.assertEqual(6, info['family'])
574 self.assertEqual(
575 ['acpi', 'aperfmperf', 'apic', 'arat', 'arch_perfmon', 'bts',
576 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', 'ds_cpl',
577 'dtes64', 'dtherm', 'dts', 'eagerfpu', 'epb', 'ept', 'est',
578 'flexpriority', 'fpu', 'fxsr', 'ht', 'lahf_lm', 'lm', 'mca',
579 'mce', 'mmx', 'monitor', 'msr', 'mtrr', 'nonstop_tsc', 'nopl',
580 'nx', 'pae', 'pat', 'pbe', 'pcid', 'pclmulqdq', 'pdcm', 'pebs',
581 'pge', 'pln', 'pni', 'popcnt', 'pse', 'pse36', 'pts', 'rdtscp',
582 'rep_good', 'sep', 'ss', 'sse', 'sse2', 'sse4_1', 'sse4_2',
583 'ssse3', 'syscall', 'tm', 'tm2', 'tpr_shadow', 'tsc',
584 'tsc_deadline_timer', 'vme', 'vmx', 'vnmi', 'vpid', 'xsave',
585 'xsaveopt', 'xtopology', 'xtpr']
586 ,
587 info['flags']
588 )