| 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 |
bugs : |
| 52 |
bogomips : 5587.30 |
| 53 |
clflush size : 64 |
| 54 |
cache_alignment : 64 |
| 55 |
address sizes : 36 bits physical, 48 bits virtual |
| 56 |
power management: |
| 57 |
|
| 58 |
processor : 1 |
| 59 |
vendor_id : GenuineIntel |
| 60 |
cpu family : 6 |
| 61 |
model : 42 |
| 62 |
model name : Intel(R) Pentium(R) CPU G640 @ 2.80GHz |
| 63 |
stepping : 7 |
| 64 |
cpu MHz : 2793.652 |
| 65 |
cache size : 3072 KB |
| 66 |
physical id : 0 |
| 67 |
siblings : 2 |
| 68 |
core id : 1 |
| 69 |
cpu cores : 2 |
| 70 |
apicid : 1 |
| 71 |
initial apicid : 1 |
| 72 |
fpu : yes |
| 73 |
fpu_exception : yes |
| 74 |
cpuid level : 13 |
| 75 |
wp : yes |
| 76 |
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 |
| 77 |
bugs : |
| 78 |
bogomips : 5587.30 |
| 79 |
clflush size : 64 |
| 80 |
cache_alignment : 64 |
| 81 |
address sizes : 36 bits physical, 48 bits virtual |
| 82 |
power management: |
| 83 |
|
| 84 |
|
| 85 |
''' |
| 86 |
return returncode, output |
| 87 |
|
| 88 |
@staticmethod |
| 89 |
def dmesg_a(): |
| 90 |
returncode = 0 |
| 91 |
output = r''' |
| 92 |
=============================================================================== |
| 93 |
[ 0.000000] Linux version 4.5.2-aufs-r1 (root@jasmin) (gcc version 5.4.0 (Gentoo 5.4.0 p1.0, pie-0.6.5) ) #1 SMP Sun Jul 3 17:17:11 UTC 2016 |
| 94 |
[ 0.000000] Command line: BOOT_IMAGE=/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap aufs looptype=squashfs loop=/image.squashfs cdroot initrd=/isolinux/gentoo.xz console=tty1 |
| 95 |
[ 0.000000] KERNEL supported cpus: |
| 96 |
[ 0.000000] Intel GenuineIntel |
| 97 |
[ 0.000000] AMD AuthenticAMD |
| 98 |
[ 0.000000] Centaur CentaurHauls |
| 99 |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x01: 'x87 floating point registers' |
| 100 |
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x02: 'SSE registers' |
| 101 |
[ 0.000000] x86/fpu: Enabled xstate features 0x3, context size is 576 bytes, using 'standard' format. |
| 102 |
[ 0.000000] x86/fpu: Using 'lazy' FPU context switches. |
| 103 |
[ 0.000000] e820: BIOS-provided physical RAM map: |
| 104 |
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable |
| 105 |
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved |
| 106 |
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved |
| 107 |
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable |
| 108 |
[ 0.000000] BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data |
| 109 |
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved |
| 110 |
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved |
| 111 |
[ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved |
| 112 |
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable |
| 113 |
[ 0.000000] NX (Execute Disable) protection: active |
| 114 |
[ 0.000000] SMBIOS 2.5 present. |
| 115 |
[ 0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 |
| 116 |
[ 0.000000] Hypervisor detected: KVM |
| 117 |
[ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved |
| 118 |
[ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable |
| 119 |
[ 0.000000] e820: last_pfn = 0x120000 max_arch_pfn = 0x400000000 |
| 120 |
[ 0.000000] MTRR default type: uncachable |
| 121 |
[ 0.000000] MTRR variable ranges disabled: |
| 122 |
[ 0.000000] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT |
| 123 |
[ 0.000000] MTRR: Disabled |
| 124 |
[ 0.000000] CPU MTRRs all blank - virtualized system. |
| 125 |
[ 0.000000] e820: last_pfn = 0xdfff0 max_arch_pfn = 0x400000000 |
| 126 |
[ 0.000000] found SMP MP-table at [mem 0x0009fff0-0x0009ffff] mapped at [ffff88000009fff0] |
| 127 |
[ 0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576 |
| 128 |
[ 0.000000] BRK [0x13b4e000, 0x13b4efff] PGTABLE |
| 129 |
[ 0.000000] BRK [0x13b4f000, 0x13b4ffff] PGTABLE |
| 130 |
[ 0.000000] BRK [0x13b50000, 0x13b50fff] PGTABLE |
| 131 |
[ 0.000000] BRK [0x13b51000, 0x13b51fff] PGTABLE |
| 132 |
[ 0.000000] RAMDISK: [mem 0x7f894000-0x7fffffff] |
| 133 |
[ 0.000000] ACPI: Early table checksum verification disabled |
| 134 |
[ 0.000000] ACPI: RSDP 0x00000000000E0000 000024 (v02 VBOX ) |
| 135 |
[ 0.000000] ACPI: XSDT 0x00000000DFFF0030 00003C (v01 VBOX VBOXXSDT 00000001 ASL 00000061) |
| 136 |
[ 0.000000] ACPI: FACP 0x00000000DFFF00F0 0000F4 (v04 VBOX VBOXFACP 00000001 ASL 00000061) |
| 137 |
[ 0.000000] ACPI: DSDT 0x00000000DFFF0470 00210F (v01 VBOX VBOXBIOS 00000002 INTL 20160108) |
| 138 |
[ 0.000000] ACPI: FACS 0x00000000DFFF0200 000040 |
| 139 |
[ 0.000000] ACPI: FACS 0x00000000DFFF0200 000040 |
| 140 |
[ 0.000000] ACPI: APIC 0x00000000DFFF0240 00005C (v02 VBOX VBOXAPIC 00000001 ASL 00000061) |
| 141 |
[ 0.000000] ACPI: SSDT 0x00000000DFFF02A0 0001CC (v01 VBOX VBOXCPUT 00000002 INTL 20160108) |
| 142 |
[ 0.000000] ACPI: Local APIC address 0xfee00000 |
| 143 |
[ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00 |
| 144 |
[ 0.000000] kvm-clock: cpu 0, msr 1:1fffb001, primary cpu clock |
| 145 |
[ 0.000000] kvm-clock: using sched offset of 7895112535 cycles |
| 146 |
[ 0.000000] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns |
| 147 |
[ 0.000000] Zone ranges: |
| 148 |
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff] |
| 149 |
[ 0.000000] DMA32 [mem 0x0000000001000000-0x00000000ffffffff] |
| 150 |
[ 0.000000] Normal [mem 0x0000000100000000-0x000000011fffffff] |
| 151 |
[ 0.000000] Movable zone start for each node |
| 152 |
[ 0.000000] Early memory node ranges |
| 153 |
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009efff] |
| 154 |
[ 0.000000] node 0: [mem 0x0000000000100000-0x00000000dffeffff] |
| 155 |
[ 0.000000] node 0: [mem 0x0000000100000000-0x000000011fffffff] |
| 156 |
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000011fffffff] |
| 157 |
[ 0.000000] On node 0 totalpages: 1048462 |
| 158 |
[ 0.000000] DMA zone: 56 pages used for memmap |
| 159 |
[ 0.000000] DMA zone: 21 pages reserved |
| 160 |
[ 0.000000] DMA zone: 3998 pages, LIFO batch:0 |
| 161 |
[ 0.000000] DMA32 zone: 12488 pages used for memmap |
| 162 |
[ 0.000000] DMA32 zone: 913392 pages, LIFO batch:31 |
| 163 |
[ 0.000000] Normal zone: 1792 pages used for memmap |
| 164 |
[ 0.000000] Normal zone: 131072 pages, LIFO batch:31 |
| 165 |
[ 0.000000] ACPI: PM-Timer IO Port: 0x4008 |
| 166 |
[ 0.000000] ACPI: Local APIC address 0xfee00000 |
| 167 |
[ 0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23 |
| 168 |
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) |
| 169 |
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) |
| 170 |
[ 0.000000] ACPI: IRQ0 used by override. |
| 171 |
[ 0.000000] ACPI: IRQ9 used by override. |
| 172 |
[ 0.000000] Using ACPI (MADT) for SMP configuration information |
| 173 |
[ 0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs |
| 174 |
[ 0.000000] e820: [mem 0xe0000000-0xfebfffff] available for PCI devices |
| 175 |
[ 0.000000] Booting paravirtualized kernel on KVM |
| 176 |
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns |
| 177 |
[ 0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:2 nr_node_ids:1 |
| 178 |
[ 0.000000] PERCPU: Embedded 32 pages/cpu @ffff88011fc00000 s90328 r8192 d32552 u1048576 |
| 179 |
[ 0.000000] pcpu-alloc: s90328 r8192 d32552 u1048576 alloc=1*2097152 |
| 180 |
[ 0.000000] pcpu-alloc: [0] 0 1 |
| 181 |
[ 0.000000] PV qspinlock hash table entries: 256 (order: 0, 4096 bytes) |
| 182 |
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1034105 |
| 183 |
[ 0.000000] Kernel command line: BOOT_IMAGE=/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap aufs looptype=squashfs loop=/image.squashfs cdroot initrd=/isolinux/gentoo.xz console=tty1 |
| 184 |
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) |
| 185 |
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes) |
| 186 |
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes) |
| 187 |
[ 0.000000] Calgary: detecting Calgary via BIOS EBDA area |
| 188 |
[ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing! |
| 189 |
[ 0.000000] Memory: 4026248K/4193848K available (5358K kernel code, 481K rwdata, 2712K rodata, 1016K init, 16188K bss, 167600K reserved, 0K cma-reserved) |
| 190 |
[ 0.000000] Hierarchical RCU implementation. |
| 191 |
[ 0.000000] Build-time adjustment of leaf fanout to 64. |
| 192 |
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=2. |
| 193 |
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=2 |
| 194 |
[ 0.000000] NR_IRQS:4352 nr_irqs:440 16 |
| 195 |
[ 0.000000] Console: colour VGA+ 80x25 |
| 196 |
[ 0.000000] console [tty1] enabled |
| 197 |
[ 0.000000] tsc: Detected 2793.652 MHz processor |
| 198 |
[ 0.141160] Calibrating delay loop (skipped) preset value.. 5587.30 BogoMIPS (lpj=2793652) |
| 199 |
[ 0.142104] pid_max: default: 32768 minimum: 301 |
| 200 |
[ 0.142638] ACPI: Core revision 20160108 |
| 201 |
[ 0.144223] ACPI: 2 ACPI AML tables successfully acquired and loaded |
| 202 |
|
| 203 |
[ 0.145332] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes) |
| 204 |
[ 0.145866] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes) |
| 205 |
[ 0.147608] CPU: Physical Processor ID: 0 |
| 206 |
[ 0.148126] CPU: Processor Core ID: 0 |
| 207 |
[ 0.148586] mce: CPU supports 0 MCE banks |
| 208 |
[ 0.149092] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8 |
| 209 |
[ 0.149586] Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0 |
| 210 |
[ 0.152341] Freeing SMP alternatives memory: 24K (ffffffff92b78000 - ffffffff92b7e000) |
| 211 |
[ 0.163230] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 |
| 212 |
[ 0.265101] smpboot: CPU0: Intel(R) Pentium(R) CPU G640 @ 2.80GHz (family: 0x6, model: 0x2a, stepping: 0x7) |
| 213 |
[ 0.266299] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only. |
| 214 |
[ 0.267306] KVM setup paravirtual spinlock |
| 215 |
[ 0.267966] x86: Booting SMP configuration: |
| 216 |
[ 0.269313] .... node #0, CPUs: #1 |
| 217 |
[ 0.270050] kvm-clock: cpu 1, msr 1:1fffb041, secondary cpu clock |
| 218 |
[ 0.270195] mce: CPU supports 0 MCE banks |
| 219 |
[ 0.272308] x86: Booted up 1 node, 2 CPUs |
| 220 |
[ 0.274066] smpboot: Total of 2 processors activated (11174.60 BogoMIPS) |
| 221 |
[ 0.277750] devtmpfs: initialized |
| 222 |
[ 0.278904] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns |
| 223 |
[ 0.280007] NET: Registered protocol family 16 |
| 224 |
[ 0.282919] cpuidle: using governor ladder |
| 225 |
[ 0.287045] cpuidle: using governor menu |
| 226 |
[ 0.287596] ACPI: bus type PCI registered |
| 227 |
[ 0.288197] PCI: Using configuration type 1 for base access |
| 228 |
[ 0.296438] ACPI: Added _OSI(Module Device) |
| 229 |
[ 0.296920] ACPI: Added _OSI(Processor Device) |
| 230 |
[ 0.297365] ACPI: Added _OSI(3.0 _SCP Extensions) |
| 231 |
[ 0.297812] ACPI: Added _OSI(Processor Aggregator Device) |
| 232 |
[ 0.298811] ACPI: Executed 1 blocks of module-level executable AML code |
| 233 |
[ 0.301871] ACPI: Interpreter enabled |
| 234 |
[ 0.302325] ACPI: (supports S0 S5) |
| 235 |
[ 0.302733] ACPI: Using IOAPIC for interrupt routing |
| 236 |
[ 0.303373] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug |
| 237 |
[ 0.311397] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) |
| 238 |
[ 0.311943] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI] |
| 239 |
[ 0.312695] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM |
| 240 |
[ 0.313427] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge. |
| 241 |
[ 0.314671] PCI host bridge to bus 0000:00 |
| 242 |
[ 0.315139] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] |
| 243 |
[ 0.315651] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] |
| 244 |
[ 0.316170] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] |
| 245 |
[ 0.316921] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xffdfffff window] |
| 246 |
[ 0.317667] pci_bus 0000:00: root bus resource [bus 00-ff] |
| 247 |
[ 0.318183] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 |
| 248 |
[ 0.318651] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100 |
| 249 |
[ 0.319190] pci 0000:00:01.1: [8086:7111] type 00 class 0x01018a |
| 250 |
[ 0.319507] pci 0000:00:01.1: reg 0x20: [io 0xd000-0xd00f] |
| 251 |
[ 0.319637] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7] |
| 252 |
[ 0.320177] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6] |
| 253 |
[ 0.320691] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177] |
| 254 |
[ 0.321218] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376] |
| 255 |
[ 0.321916] pci 0000:00:02.0: [80ee:beef] type 00 class 0x030000 |
| 256 |
[ 0.331110] pci 0000:00:02.0: reg 0x10: [mem 0xe0000000-0xe0ffffff pref] |
| 257 |
[ 0.355210] pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 |
| 258 |
[ 0.362376] pci 0000:00:03.0: reg 0x10: [mem 0xf0000000-0xf001ffff] |
| 259 |
[ 0.368405] pci 0000:00:03.0: reg 0x18: [io 0xd010-0xd017] |
| 260 |
[ 0.382823] pci 0000:00:04.0: [80ee:cafe] type 00 class 0x088000 |
| 261 |
[ 0.385993] pci 0000:00:04.0: reg 0x10: [io 0xd020-0xd03f] |
| 262 |
[ 0.390088] pci 0000:00:04.0: reg 0x14: [mem 0xf0400000-0xf07fffff] |
| 263 |
[ 0.396674] pci 0000:00:04.0: reg 0x18: [mem 0xf0800000-0xf0803fff pref] |
| 264 |
[ 0.408760] pci 0000:00:05.0: [8086:2415] type 00 class 0x040100 |
| 265 |
[ 0.408846] pci 0000:00:05.0: reg 0x10: [io 0xd100-0xd1ff] |
| 266 |
[ 0.408903] pci 0000:00:05.0: reg 0x14: [io 0xd200-0xd23f] |
| 267 |
[ 0.409378] pci 0000:00:06.0: [106b:003f] type 00 class 0x0c0310 |
| 268 |
[ 0.412327] pci 0000:00:06.0: reg 0x10: [mem 0xf0804000-0xf0804fff] |
| 269 |
[ 0.438003] pci 0000:00:07.0: [8086:7113] type 00 class 0x068000 |
| 270 |
[ 0.438389] pci 0000:00:07.0: quirk: [io 0x4000-0x403f] claimed by PIIX4 ACPI |
| 271 |
[ 0.439849] pci 0000:00:07.0: quirk: [io 0x4100-0x410f] claimed by PIIX4 SMB |
| 272 |
[ 0.440790] pci 0000:00:0d.0: [8086:2829] type 00 class 0x010601 |
| 273 |
[ 0.446112] pci 0000:00:0d.0: reg 0x10: [io 0xd240-0xd247] |
| 274 |
[ 0.453981] pci 0000:00:0d.0: reg 0x18: [io 0xd250-0xd257] |
| 275 |
[ 0.465205] pci 0000:00:0d.0: reg 0x20: [io 0xd260-0xd26f] |
| 276 |
[ 0.468499] pci 0000:00:0d.0: reg 0x24: [mem 0xf0806000-0xf0807fff] |
| 277 |
[ 0.473155] pci_bus 0000:00: on NUMA node 0 |
| 278 |
[ 0.474092] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 9 10 *11) |
| 279 |
[ 0.476734] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 9 10 *11) |
| 280 |
[ 0.478927] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 9 *10 11) |
| 281 |
[ 0.480187] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 *9 10 11) |
| 282 |
[ 0.483221] ACPI: Enabled 2 GPEs in block 00 to 07 |
| 283 |
[ 0.484401] vgaarb: setting as boot device: PCI:0000:00:02.0 |
| 284 |
[ 0.484962] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none |
| 285 |
[ 0.486436] vgaarb: loaded |
| 286 |
[ 0.486866] vgaarb: bridge control possible 0000:00:02.0 |
| 287 |
[ 0.487529] SCSI subsystem initialized |
| 288 |
[ 0.488105] libata version 3.00 loaded. |
| 289 |
[ 0.488124] ACPI: bus type USB registered |
| 290 |
[ 0.488601] usbcore: registered new interface driver usbfs |
| 291 |
[ 0.489127] usbcore: registered new interface driver hub |
| 292 |
[ 0.489642] usbcore: registered new device driver usb |
| 293 |
[ 0.493140] PCI: Using ACPI for IRQ routing |
| 294 |
[ 0.493596] PCI: pci_cache_line_size set to 64 bytes |
| 295 |
[ 0.493741] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff] |
| 296 |
[ 0.493748] e820: reserve RAM buffer [mem 0xdfff0000-0xdfffffff] |
| 297 |
[ 0.501262] clocksource: Switched to clocksource kvm-clock |
| 298 |
[ 0.501975] VFS: Disk quotas dquot_6.6.0 |
| 299 |
[ 0.502483] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) |
| 300 |
[ 0.515233] pnp: PnP ACPI init |
| 301 |
[ 0.515724] pnp 00:00: Plug and Play ACPI device, IDs PNP0303 (active) |
| 302 |
[ 0.515794] pnp 00:01: Plug and Play ACPI device, IDs PNP0f03 (active) |
| 303 |
[ 0.516395] pnp: PnP ACPI: found 2 devices |
| 304 |
[ 0.521420] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns |
| 305 |
[ 0.523924] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window] |
| 306 |
[ 0.523928] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window] |
| 307 |
[ 0.523930] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window] |
| 308 |
[ 0.523932] pci_bus 0000:00: resource 7 [mem 0xe0000000-0xffdfffff window] |
| 309 |
[ 0.526813] NET: Registered protocol family 2 |
| 310 |
[ 0.527577] TCP established hash table entries: 32768 (order: 6, 262144 bytes) |
| 311 |
[ 0.528532] TCP bind hash table entries: 32768 (order: 7, 524288 bytes) |
| 312 |
[ 0.529234] TCP: Hash tables configured (established 32768 bind 32768) |
| 313 |
[ 0.529765] UDP hash table entries: 2048 (order: 4, 65536 bytes) |
| 314 |
[ 0.530287] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes) |
| 315 |
[ 0.544043] NET: Registered protocol family 1 |
| 316 |
[ 0.544613] pci 0000:00:00.0: Limiting direct PCI/PCI transfers |
| 317 |
[ 0.545245] pci 0000:00:01.0: Activating ISA DMA hang workarounds |
| 318 |
[ 0.545791] pci 0000:00:02.0: Video device with shadowed ROM |
| 319 |
[ 0.547149] PCI: CLS 0 bytes, default 64 |
| 320 |
[ 0.547884] Trying to unpack rootfs image as initramfs... |
| 321 |
[ 1.394034] Freeing initrd memory: 7600K (ffff88007f894000 - ffff880080000000) |
| 322 |
[ 1.394891] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) |
| 323 |
[ 1.395861] software IO TLB [mem 0xdbff0000-0xdfff0000] (64MB) mapped at [ffff8800dbff0000-ffff8800dffeffff] |
| 324 |
[ 1.397095] platform rtc_cmos: registered platform RTC device (no PNP device found) |
| 325 |
[ 1.397910] RAPL PMU detected, API unit is 2^-32 Joules, 3 fixed counters 10737418240 ms ovfl timer |
| 326 |
[ 1.398684] hw unit of domain pp0-core 2^-0 Joules |
| 327 |
[ 1.399166] hw unit of domain package 2^-0 Joules |
| 328 |
[ 1.399618] hw unit of domain pp1-gpu 2^-0 Joules |
| 329 |
[ 1.400492] futex hash table entries: 512 (order: 3, 32768 bytes) |
| 330 |
[ 1.401169] audit: initializing netlink subsys (disabled) |
| 331 |
[ 1.401668] audit: type=2000 audit(1488272619.420:1): initialized |
| 332 |
[ 1.402282] Initialise system trusted keyring |
| 333 |
[ 1.403474] squashfs: version 4.0 (2009/01/31) Phillip Lougher |
| 334 |
[ 1.404117] JFS: nTxBlock = 8192, nTxLock = 65536 |
| 335 |
[ 1.406745] SGI XFS with ACLs, security attributes, realtime, no debug enabled |
| 336 |
[ 1.408178] aufs 4.5-20160328 |
| 337 |
[ 1.418164] Key type asymmetric registered |
| 338 |
[ 1.418627] Asymmetric key parser 'x509' registered |
| 339 |
[ 1.419179] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) |
| 340 |
[ 1.419974] io scheduler noop registered |
| 341 |
[ 1.420429] io scheduler deadline registered (default) |
| 342 |
[ 1.421010] start plist test |
| 343 |
[ 1.422756] end plist test |
| 344 |
[ 1.422768] Running rhashtable test nelem=8, max_size=0, shrinking=0 |
| 345 |
[ 1.423312] Test 00: |
| 346 |
[ 1.425541] Adding 50000 keys |
| 347 |
[ 1.453370] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 348 |
[ 1.465493] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 349 |
[ 1.466339] Deleting 50000 keys |
| 350 |
[ 1.472526] Duration of test: 46526457 ns |
| 351 |
[ 1.473240] Test 01: |
| 352 |
[ 1.474878] Adding 50000 keys |
| 353 |
[ 1.487127] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 354 |
[ 1.496559] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 355 |
[ 1.497384] Deleting 50000 keys |
| 356 |
[ 1.506520] Duration of test: 31074162 ns |
| 357 |
[ 1.507191] Test 02: |
| 358 |
[ 1.509281] Adding 50000 keys |
| 359 |
[ 1.522531] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 360 |
[ 1.532936] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 361 |
[ 1.533744] Deleting 50000 keys |
| 362 |
[ 1.541847] Duration of test: 32005815 ns |
| 363 |
[ 1.543742] Test 03: |
| 364 |
[ 1.545394] Adding 50000 keys |
| 365 |
[ 1.560340] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 366 |
[ 1.568083] Traversal complete: counted=50000, nelems=50000, entries=50000, table-jumps=0 |
| 367 |
[ 1.568920] Deleting 50000 keys |
| 368 |
[ 1.578421] Duration of test: 32488444 ns |
| 369 |
[ 1.578926] Average test time: 35523719 |
| 370 |
[ 1.579370] Testing concurrent rhashtable access from 10 threads |
| 371 |
[ 1.649031] thread[6]: rhashtable_insert_fast failed |
| 372 |
[ 1.649033] thread[7]: rhashtable_insert_fast failed |
| 373 |
[ 1.649038] thread[9]: rhashtable_insert_fast failed |
| 374 |
[ 1.649039] thread[3]: rhashtable_insert_fast failed |
| 375 |
[ 1.649041] thread[8]: rhashtable_insert_fast failed |
| 376 |
[ 1.649043] thread[5]: rhashtable_insert_fast failed |
| 377 |
[ 1.649044] thread[1]: rhashtable_insert_fast failed |
| 378 |
[ 1.831026] Test failed: thread 1 returned: -12 |
| 379 |
[ 1.855279] Test failed: thread 3 returned: -12 |
| 380 |
[ 1.859276] Test failed: thread 5 returned: -12 |
| 381 |
[ 1.859887] Test failed: thread 6 returned: -12 |
| 382 |
[ 1.860379] Test failed: thread 7 returned: -12 |
| 383 |
[ 1.860838] Test failed: thread 8 returned: -12 |
| 384 |
[ 1.861335] Test failed: thread 9 returned: -12 |
| 385 |
[ 1.861782] Started 10 threads, 7 failed |
| 386 |
[ 1.862508] glob: 64 self-tests passed, 0 failed |
| 387 |
[ 1.863134] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled |
| 388 |
[ 1.863988] Linux agpgart interface v0.103 |
| 389 |
[ 1.864625] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0 |
| 390 |
[ 1.865411] ACPI: Power Button [PWRF] |
| 391 |
[ 1.865899] input: Sleep Button as /devices/LNXSYSTM:00/LNXSLPBN:00/input/input1 |
| 392 |
[ 1.867173] ACPI: Sleep Button [SLPF] |
| 393 |
[ 1.868220] ACPI: Video Device [GFX0] (multi-head: yes rom: no post: no) |
| 394 |
[ 1.868877] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/LNXVIDEO:00/input/input2 |
| 395 |
[ 1.870085] xenfs: not registering filesystem on non-xen platform |
| 396 |
[ 1.877055] brd: module loaded |
| 397 |
[ 1.879394] loop: module loaded |
| 398 |
[ 1.880002] usbcore: registered new interface driver hwa-rc |
| 399 |
[ 1.880518] usbcore: registered new interface driver i1480-dfu-usb |
| 400 |
[ 1.881078] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver |
| 401 |
[ 1.881591] ehci-pci: EHCI PCI platform driver |
| 402 |
[ 1.882074] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver |
| 403 |
[ 1.882586] uhci_hcd: USB Universal Host Controller Interface driver |
| 404 |
[ 1.883306] usbcore: registered new interface driver wusb-cbaf |
| 405 |
[ 1.883805] usbcore: registered new interface driver cdc_wdm |
| 406 |
[ 1.884348] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12 |
| 407 |
[ 1.885658] serio: i8042 KBD port at 0x60,0x64 irq 1 |
| 408 |
[ 1.886150] serio: i8042 AUX port at 0x60,0x64 irq 12 |
| 409 |
[ 1.887401] mousedev: PS/2 mouse d |
| 410 |
''' |
| 411 |
return returncode, output |
| 412 |
|
| 413 |
@staticmethod |
| 414 |
def lscpu(): |
| 415 |
returncode = 0 |
| 416 |
output = r''' |
| 417 |
Architecture: x86_64 |
| 418 |
CPU op-mode(s): 32-bit, 64-bit |
| 419 |
Byte Order: Little Endian |
| 420 |
CPU(s): 2 |
| 421 |
On-line CPU(s) list: 0,1 |
| 422 |
Thread(s) per core: 1 |
| 423 |
Core(s) per socket: 2 |
| 424 |
Socket(s): 1 |
| 425 |
Vendor ID: GenuineIntel |
| 426 |
CPU family: 6 |
| 427 |
Model: 42 |
| 428 |
Model name: Intel(R) Pentium(R) CPU G640 @ 2.80GHz |
| 429 |
Stepping: 7 |
| 430 |
CPU MHz: 2793.652 |
| 431 |
BogoMIPS: 5587.30 |
| 432 |
Hypervisor vendor: KVM |
| 433 |
Virtualization type: full |
| 434 |
L1d cache: 32K |
| 435 |
L1i cache: 32K |
| 436 |
L2 cache: 256K |
| 437 |
L3 cache: 3072K |
| 438 |
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 |
| 439 |
|
| 440 |
|
| 441 |
''' |
| 442 |
return returncode, output |
| 443 |
|
| 444 |
|
| 445 |
class TestLinuxGentoo_2_2_X86_64(unittest.TestCase): |
| 446 |
def setUp(self): |
| 447 |
helpers.backup_data_source(cpuinfo) |
| 448 |
helpers.monkey_patch_data_source(cpuinfo, MockDataSource) |
| 449 |
|
| 450 |
def tearDown(self): |
| 451 |
helpers.restore_data_source(cpuinfo) |
| 452 |
|
| 453 |
''' |
| 454 |
Make sure calls return the expected number of fields. |
| 455 |
''' |
| 456 |
def test_returns(self): |
| 457 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_registry())) |
| 458 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpufreq_info())) |
| 459 |
self.assertEqual(14, len(cpuinfo._get_cpu_info_from_lscpu())) |
| 460 |
self.assertEqual(11, len(cpuinfo._get_cpu_info_from_proc_cpuinfo())) |
| 461 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysctl())) |
| 462 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_kstat())) |
| 463 |
self.assertEqual(8, len(cpuinfo._get_cpu_info_from_dmesg())) |
| 464 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cat_var_run_dmesg_boot())) |
| 465 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_ibm_pa_features())) |
| 466 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysinfo())) |
| 467 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpuid())) |
| 468 |
self.assertEqual(21, len(cpuinfo._get_cpu_info_internal())) |
| 469 |
|
| 470 |
def test_get_cpu_info_from_lscpu(self): |
| 471 |
info = cpuinfo._get_cpu_info_from_lscpu() |
| 472 |
|
| 473 |
self.assertEqual('GenuineIntel', info['vendor_id_raw']) |
| 474 |
self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw']) |
| 475 |
self.assertEqual('2.7937 GHz', info['hz_advertised_friendly']) |
| 476 |
self.assertEqual('2.7937 GHz', info['hz_actual_friendly']) |
| 477 |
self.assertEqual((2793652000, 0), info['hz_advertised']) |
| 478 |
self.assertEqual((2793652000, 0), info['hz_actual']) |
| 479 |
|
| 480 |
self.assertEqual(7, info['stepping']) |
| 481 |
self.assertEqual(42, info['model']) |
| 482 |
self.assertEqual(6, info['family']) |
| 483 |
|
| 484 |
self.assertEqual(32 * 1024, info['l1_instruction_cache_size']) |
| 485 |
self.assertEqual(32 * 1024, info['l1_data_cache_size']) |
| 486 |
self.assertEqual(256 * 1024, info['l2_cache_size']) |
| 487 |
self.assertEqual(3072 * 1024, info['l3_cache_size']) |
| 488 |
|
| 489 |
self.assertEqual( |
| 490 |
['apic', 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', |
| 491 |
'fpu', 'fxsr', 'ht', 'hypervisor', 'lahf_lm', 'lm', 'mca', 'mce', |
| 492 |
'mmx', 'msr', 'mtrr', 'nonstop_tsc', 'nopl', 'nx', 'pae', 'pat', |
| 493 |
'pclmulqdq', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp', |
| 494 |
'rep_good', 'sep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', |
| 495 |
'syscall', 'tsc', 'vme', 'xsave', 'xtopology'] |
| 496 |
, |
| 497 |
info['flags'] |
| 498 |
) |
| 499 |
|
| 500 |
def test_get_cpu_info_from_dmesg(self): |
| 501 |
info = cpuinfo._get_cpu_info_from_dmesg() |
| 502 |
|
| 503 |
self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw']) |
| 504 |
self.assertEqual('2.8000 GHz', info['hz_advertised_friendly']) |
| 505 |
self.assertEqual('2.8000 GHz', info['hz_actual_friendly']) |
| 506 |
self.assertEqual((2800000000, 0), info['hz_advertised']) |
| 507 |
self.assertEqual((2800000000, 0), info['hz_actual']) |
| 508 |
|
| 509 |
self.assertEqual(7, info['stepping']) |
| 510 |
self.assertEqual(42, info['model']) |
| 511 |
self.assertEqual(6, info['family']) |
| 512 |
|
| 513 |
def test_get_cpu_info_from_proc_cpuinfo(self): |
| 514 |
info = cpuinfo._get_cpu_info_from_proc_cpuinfo() |
| 515 |
|
| 516 |
self.assertEqual('GenuineIntel', info['vendor_id_raw']) |
| 517 |
self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw']) |
| 518 |
self.assertEqual('2.8000 GHz', info['hz_advertised_friendly']) |
| 519 |
self.assertEqual('2.7937 GHz', info['hz_actual_friendly']) |
| 520 |
self.assertEqual((2800000000, 0), info['hz_advertised']) |
| 521 |
self.assertEqual((2793652000, 0), info['hz_actual']) |
| 522 |
|
| 523 |
self.assertEqual(3072 * 1024, info['l3_cache_size']) |
| 524 |
|
| 525 |
self.assertEqual(7, info['stepping']) |
| 526 |
self.assertEqual(42, info['model']) |
| 527 |
self.assertEqual(6, info['family']) |
| 528 |
self.assertEqual( |
| 529 |
['apic', 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', |
| 530 |
'fpu', 'fxsr', 'ht', 'hypervisor', 'lahf_lm', 'lm', 'mca', 'mce', |
| 531 |
'mmx', 'msr', 'mtrr', 'nonstop_tsc', 'nopl', 'nx', 'pae', 'pat', |
| 532 |
'pclmulqdq', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp', |
| 533 |
'rep_good', 'sep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', |
| 534 |
'syscall', 'tsc', 'vme', 'xsave', 'xtopology'] |
| 535 |
, |
| 536 |
info['flags'] |
| 537 |
) |
| 538 |
|
| 539 |
def test_all(self): |
| 540 |
info = cpuinfo._get_cpu_info_internal() |
| 541 |
|
| 542 |
self.assertEqual('GenuineIntel', info['vendor_id_raw']) |
| 543 |
self.assertEqual('Intel(R) Pentium(R) CPU G640 @ 2.80GHz', info['brand_raw']) |
| 544 |
self.assertEqual('2.8000 GHz', info['hz_advertised_friendly']) |
| 545 |
self.assertEqual('2.7937 GHz', info['hz_actual_friendly']) |
| 546 |
self.assertEqual((2800000000, 0), info['hz_advertised']) |
| 547 |
self.assertEqual((2793652000, 0), info['hz_actual']) |
| 548 |
self.assertEqual('X86_64', info['arch']) |
| 549 |
self.assertEqual(64, info['bits']) |
| 550 |
self.assertEqual(2, info['count']) |
| 551 |
|
| 552 |
self.assertEqual('x86_64', info['arch_string_raw']) |
| 553 |
|
| 554 |
self.assertEqual(32 * 1024, info['l1_instruction_cache_size']) |
| 555 |
self.assertEqual(32 * 1024, info['l1_data_cache_size']) |
| 556 |
self.assertEqual(256 * 1024, info['l2_cache_size']) |
| 557 |
self.assertEqual(3072 * 1024, info['l3_cache_size']) |
| 558 |
|
| 559 |
self.assertEqual(7, info['stepping']) |
| 560 |
self.assertEqual(42, info['model']) |
| 561 |
self.assertEqual(6, info['family']) |
| 562 |
self.assertEqual( |
| 563 |
['apic', 'clflush', 'cmov', 'constant_tsc', 'cx16', 'cx8', 'de', |
| 564 |
'fpu', 'fxsr', 'ht', 'hypervisor', 'lahf_lm', 'lm', 'mca', 'mce', |
| 565 |
'mmx', 'msr', 'mtrr', 'nonstop_tsc', 'nopl', 'nx', 'pae', 'pat', |
| 566 |
'pclmulqdq', 'pge', 'pni', 'popcnt', 'pse', 'pse36', 'rdtscp', |
| 567 |
'rep_good', 'sep', 'sse', 'sse2', 'sse4_1', 'sse4_2', 'ssse3', |
| 568 |
'syscall', 'tsc', 'vme', 'xsave', 'xtopology'] |
| 569 |
, |
| 570 |
info['flags'] |
| 571 |
) |