| 1 |
|
| 2 |
|
| 3 |
import unittest |
| 4 |
from cpuinfo import * |
| 5 |
import helpers |
| 6 |
|
| 7 |
|
| 8 |
class MockDataSource: |
| 9 |
bits = '64bit' |
| 10 |
cpu_count = 2 |
| 11 |
is_windows = False |
| 12 |
arch_string_raw = 'ppc64le' |
| 13 |
uname_string_raw = '' |
| 14 |
can_cpuid = False |
| 15 |
|
| 16 |
@staticmethod |
| 17 |
def has_proc_cpuinfo(): |
| 18 |
return True |
| 19 |
|
| 20 |
@staticmethod |
| 21 |
def has_dmesg(): |
| 22 |
return True |
| 23 |
|
| 24 |
@staticmethod |
| 25 |
def has_lscpu(): |
| 26 |
return True |
| 27 |
|
| 28 |
@staticmethod |
| 29 |
def has_ibm_pa_features(): |
| 30 |
return True |
| 31 |
|
| 32 |
@staticmethod |
| 33 |
def ibm_pa_features(): |
| 34 |
returncode = 0 |
| 35 |
output = r''' |
| 36 |
/proc/device-tree/cpus/PowerPC,POWER7@1/ibm,pa-features 3ff60006 c08000c7 |
| 37 |
|
| 38 |
''' |
| 39 |
return returncode, output |
| 40 |
|
| 41 |
@staticmethod |
| 42 |
def cat_proc_cpuinfo(): |
| 43 |
returncode = 0 |
| 44 |
output = r''' |
| 45 |
processor : 0 |
| 46 |
cpu : POWER8E (raw), altivec supported |
| 47 |
clock : 3425.000000MHz |
| 48 |
revision : 2.1 (pvr 004b 0201) |
| 49 |
processor : 1 |
| 50 |
cpu : POWER8E (raw), altivec supported |
| 51 |
clock : 3425.000000MHz |
| 52 |
revision : 2.1 (pvr 004b 0201) |
| 53 |
timebase : 512000000 |
| 54 |
platform : pSeries |
| 55 |
model : IBM pSeries (emulated by qemu) |
| 56 |
machine : CHRP IBM pSeries (emulated by qemu) |
| 57 |
|
| 58 |
''' |
| 59 |
return returncode, output |
| 60 |
|
| 61 |
@staticmethod |
| 62 |
def dmesg_a(): |
| 63 |
returncode = 0 |
| 64 |
output = r''' |
| 65 |
[ 0.000000] Allocated 2359296 bytes for 1024 pacas at c00000000fdc0000 |
| 66 |
[ 0.000000] Using pSeries machine description |
| 67 |
[ 0.000000] Page sizes from device-tree: |
| 68 |
[ 0.000000] base_shift=12: shift=12, sllp=0x0000, avpnm=0x00000000, tlbiel=1, penc=0 |
| 69 |
[ 0.000000] base_shift=16: shift=16, sllp=0x0110, avpnm=0x00000000, tlbiel=1, penc=1 |
| 70 |
[ 0.000000] Page orders: linear mapping = 16, virtual = 16, io = 12, vmemmap = 16 |
| 71 |
[ 0.000000] Using 1TB segments |
| 72 |
[ 0.000000] Found initrd at 0xc000000003700000:0xc00000000492fa44 |
| 73 |
[ 0.000000] bootconsole [udbg0] enabled |
| 74 |
[ 0.000000] Partition configured for 2 cpus. |
| 75 |
[ 0.000000] CPU maps initialized for 1 thread per core |
| 76 |
[ 0.000000] (thread shift is 0) |
| 77 |
[ 0.000000] Freed 2293760 bytes for unused pacas |
| 78 |
[ 0.000000] Starting Linux ppc64le #1 SMP Tue May 24 12:23:26 UTC 2016 |
| 79 |
[ 0.000000] ----------------------------------------------------- |
| 80 |
[ 0.000000] ppc64_pft_size = 0x1a |
| 81 |
[ 0.000000] phys_mem_size = 0x140000000 |
| 82 |
[ 0.000000] cpu_features = 0x17fc7a6c18500249 |
| 83 |
[ 0.000000] possible = 0x1fffffef18500649 |
| 84 |
[ 0.000000] always = 0x0000000018100040 |
| 85 |
[ 0.000000] cpu_user_features = 0xdc0065c2 0xef000000 |
| 86 |
[ 0.000000] mmu_features = 0x58000001 |
| 87 |
[ 0.000000] firmware_features = 0x000000014052440b |
| 88 |
[ 0.000000] htab_hash_mask = 0x7ffff |
| 89 |
[ 0.000000] ----------------------------------------------------- |
| 90 |
[ 0.000000] Linux version 4.5.5-300.fc24.ppc64le ([email protected]) (gcc version 6.1.1 20160510 (Red Hat 6.1.1-2) (GCC) ) #1 SMP Tue May 24 12:23:26 UTC 2016 |
| 91 |
[ 0.000000] Node 0 Memory: 0x0-0x140000000 |
| 92 |
[ 0.000000] numa: Initmem setup node 0 [mem 0x00000000-0x13fffffff] |
| 93 |
[ 0.000000] numa: NODE_DATA [mem 0x13ffda100-0x13ffe3fff] |
| 94 |
[ 0.000000] Section 317 and 319 (node 0) have a circular dependency on usemap and pgdat allocations |
| 95 |
[ 0.000000] PCI host bridge /pci@800000020000000 ranges: |
| 96 |
[ 0.000000] IO 0x0000010080000000..0x000001008000ffff -> 0x0000000000000000 |
| 97 |
[ 0.000000] MEM 0x00000100a0000000..0x000001101fffffff -> 0x0000000080000000 |
| 98 |
[ 0.000000] PPC64 nvram contains 65536 bytes |
| 99 |
[ 0.000000] Top of RAM: 0x140000000, Total RAM: 0x140000000 |
| 100 |
[ 0.000000] Memory hole size: 0MB |
| 101 |
[ 0.000000] Zone ranges: |
| 102 |
[ 0.000000] DMA [mem 0x0000000000000000-0x000000013fffffff] |
| 103 |
[ 0.000000] DMA32 empty |
| 104 |
[ 0.000000] Normal empty |
| 105 |
[ 0.000000] Movable zone start for each node |
| 106 |
[ 0.000000] Early memory node ranges |
| 107 |
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000013fffffff] |
| 108 |
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000013fffffff] |
| 109 |
[ 0.000000] On node 0 totalpages: 81920 |
| 110 |
[ 0.000000] DMA zone: 80 pages used for memmap |
| 111 |
[ 0.000000] DMA zone: 0 pages reserved |
| 112 |
[ 0.000000] DMA zone: 81920 pages, LIFO batch:1 |
| 113 |
[ 0.000000] PERCPU: Embedded 3 pages/cpu @c00000013fe00000 s128792 r0 d67816 u524288 |
| 114 |
[ 0.000000] pcpu-alloc: s128792 r0 d67816 u524288 alloc=1*1048576 |
| 115 |
[ 0.000000] pcpu-alloc: [0] 0 1 |
| 116 |
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 81840 |
| 117 |
[ 0.000000] Policy zone: DMA |
| 118 |
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.5.5-300.fc24.ppc64le root=UUID=e310499a-7ae9-46e6-aeeb-e9babe31e019 ro no_timer_check console=tty1 console=ttyS0,115200n8 rhgb quiet console=hvc1 LANG=en_US.UTF-8 |
| 119 |
[ 0.000000] PID hash table entries: 4096 (order: -1, 32768 bytes) |
| 120 |
[ 0.000000] Sorting __ex_table... |
| 121 |
[ 0.000000] Memory: 5129088K/5242880K available (10048K kernel code, 1344K rwdata, 3028K rodata, 5312K init, 2684K bss, 113792K reserved, 0K cma-reserved) |
| 122 |
[ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 |
| 123 |
[ 0.000000] Hierarchical RCU implementation. |
| 124 |
[ 0.000000] Build-time adjustment of leaf fanout to 64. |
| 125 |
[ 0.000000] RCU restricting CPUs from NR_CPUS=1024 to nr_cpu_ids=2. |
| 126 |
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=2 |
| 127 |
[ 0.000000] NR_IRQS:512 nr_irqs:512 16 |
| 128 |
[ 0.000000] pic: no ISA interrupt controller |
| 129 |
[ 0.000000] time_init: decrementer frequency = 512.000000 MHz |
| 130 |
[ 0.000000] time_init: processor frequency = 3425.000000 MHz |
| 131 |
[ 0.000001] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x761537d007, max_idle_ns: 440795202126 ns |
| 132 |
[ 0.000003] clocksource: timebase mult[1f40000] shift[24] registered |
| 133 |
[ 0.000005] clockevent: decrementer mult[83126e98] shift[32] cpu[0] |
| 134 |
[ 0.000040] Console: colour dummy device 80x25 |
| 135 |
[ 0.000068] console [tty1] enabled |
| 136 |
[ 0.000088] pid_max: default: 32768 minimum: 301 |
| 137 |
[ 0.000125] Security Framework initialized |
| 138 |
[ 0.000127] Yama: becoming mindful. |
| 139 |
[ 0.000131] SELinux: Initializing. |
| 140 |
[ 0.000146] SELinux: Starting in permissive mode |
| 141 |
[ 0.000227] Dentry cache hash table entries: 1048576 (order: 7, 8388608 bytes) |
| 142 |
[ 0.001739] Inode-cache hash table entries: 524288 (order: 6, 4194304 bytes) |
| 143 |
[ 0.002484] Mount-cache hash table entries: 16384 (order: 1, 131072 bytes) |
| 144 |
[ 0.002486] Mountpoint-cache hash table entries: 16384 (order: 1, 131072 bytes) |
| 145 |
[ 0.002754] ftrace: allocating 25021 entries in 10 pages |
| 146 |
[ 0.012417] EEH: pSeries platform initialized |
| 147 |
[ 0.012430] POWER8 performance monitor hardware support registered |
| 148 |
[ 0.012433] power8-pmu: PMAO restore workaround active. |
| 149 |
[ 0.014048] Brought up 2 CPUs |
| 150 |
[ 0.014066] Node 0 CPUs: 0-1 |
| 151 |
[ 0.014588] devtmpfs: initialized |
| 152 |
[ 0.025860] EEH: devices created |
| 153 |
[ 0.025904] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns |
| 154 |
[ 0.025964] atomic64_test: passed |
| 155 |
[ 0.026060] NET: Registered protocol family 16 |
| 156 |
[ 0.026973] EEH: No capable adapters found |
| 157 |
[ 0.027024] IBM eBus Device Driver |
| 158 |
[ 0.052266] cpuidle: using governor menu |
| 159 |
[ 0.052392] pstore: Registered nvram as persistent store backend |
| 160 |
[ 0.053138] PCI: Probing PCI hardware |
| 161 |
[ 0.053169] PCI host bridge to bus 0000:00 |
| 162 |
[ 0.053172] pci_bus 0000:00: root bus resource [io 0x10000-0x1ffff] (bus address [0x0000-0xffff]) |
| 163 |
[ 0.053174] pci_bus 0000:00: root bus resource [mem 0x100a0000000-0x1101fffffff] (bus address [0x80000000-0xfffffffff]) |
| 164 |
[ 0.053176] pci_bus 0000:00: root bus resource [bus 00-ff] |
| 165 |
[ 0.079786] IOMMU table initialized, virtual merging enabled |
| 166 |
[ 0.080038] PCI: Probing PCI hardware done |
| 167 |
[ 0.102679] vgaarb: loaded |
| 168 |
[ 0.102739] SCSI subsystem initialized |
| 169 |
[ 0.102766] libata version 3.00 loaded. |
| 170 |
[ 0.102802] usbcore: registered new interface driver usbfs |
| 171 |
[ 0.102810] usbcore: registered new interface driver hub |
| 172 |
[ 0.102823] usbcore: registered new device driver usb |
| 173 |
[ 0.103034] NetLabel: Initializing |
| 174 |
[ 0.103035] NetLabel: domain hash size = 128 |
| 175 |
[ 0.103035] NetLabel: protocols = UNLABELED CIPSOv4 |
| 176 |
[ 0.103044] NetLabel: unlabeled traffic allowed by default |
| 177 |
[ 0.103108] clocksource: Switched to clocksource timebase |
| 178 |
[ 0.110649] VFS: Disk quotas dquot_6.6.0 |
| 179 |
[ 0.110680] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes) |
| 180 |
[ 0.110724] hugetlbfs: disabling because there are no supported hugepage sizes |
| 181 |
[ 0.113993] NET: Registered protocol family 2 |
| 182 |
[ 0.114128] TCP established hash table entries: 65536 (order: 3, 524288 bytes) |
| 183 |
[ 0.114243] TCP bind hash table entries: 65536 (order: 4, 1048576 bytes) |
| 184 |
[ 0.114372] TCP: Hash tables configured (established 65536 bind 65536) |
| 185 |
[ 0.114381] UDP hash table entries: 4096 (order: 1, 131072 bytes) |
| 186 |
[ 0.114398] UDP-Lite hash table entries: 4096 (order: 1, 131072 bytes) |
| 187 |
[ 0.114445] NET: Registered protocol family 1 |
| 188 |
[ 0.173318] PCI: CLS 0 bytes, default 128 |
| 189 |
[ 0.173399] Unpacking initramfs... |
| 190 |
[ 0.476072] Freeing initrd memory: 18560K (c000000003700000 - c000000004920000) |
| 191 |
[ 0.476263] RTAS daemon started |
| 192 |
[ 0.476812] rtas_flash: no firmware flash support |
| 193 |
[ 0.513298] futex hash table entries: 512 (order: 0, 65536 bytes) |
| 194 |
[ 0.513327] audit: initializing netlink subsys (disabled) |
| 195 |
[ 0.513355] audit: type=2000 audit(1491783180.510:1): initialized |
| 196 |
[ 0.513515] Initialise system trusted keyring |
| 197 |
[ 0.515510] zbud: loaded |
| 198 |
[ 0.516023] Key type big_key registered |
| 199 |
[ 0.516025] SELinux: Registering netfilter hooks |
| 200 |
[ 0.521239] NET: Registered protocol family 38 |
| 201 |
[ 0.521248] Key type asymmetric registered |
| 202 |
[ 0.521251] Asymmetric key parser 'x509' registered |
| 203 |
[ 0.521288] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) |
| 204 |
[ 0.521315] io scheduler noop registered |
| 205 |
[ 0.521317] io scheduler deadline registered |
| 206 |
[ 0.521350] io scheduler cfq registered (default) |
| 207 |
[ 0.521402] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 |
| 208 |
[ 0.521659] console [hvc1] enabled |
| 209 |
[ 0.521660] bootconsole [udbg0] disabled |
| 210 |
[ 0.521735] Linux agpgart interface v0.103 |
| 211 |
[ 0.521845] libphy: Fixed MDIO Bus: probed |
| 212 |
[ 0.521881] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver |
| 213 |
[ 0.521889] ehci-pci: EHCI PCI platform driver |
| 214 |
[ 0.521898] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver |
| 215 |
[ 0.521906] ohci-pci: OHCI PCI platform driver |
| 216 |
[ 0.522111] ohci-pci 0000:00:02.0: OHCI PCI host controller |
| 217 |
[ 0.522141] ohci-pci 0000:00:02.0: new USB bus registered, assigned bus number 1 |
| 218 |
[ 0.522220] ohci-pci 0000:00:02.0: irq 20, io mem 0x100e0002000 |
| 219 |
[ 0.573380] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 |
| 220 |
[ 0.573382] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 |
| 221 |
[ 0.573384] usb usb1: Product: OHCI PCI host controller |
| 222 |
[ 0.573385] usb usb1: Manufacturer: Linux 4.5.5-300.fc24.ppc64le ohci_hcd |
| 223 |
[ 0.573386] usb usb1: SerialNumber: 0000:00:02.0 |
| 224 |
[ 0.573477] hub 1-0:1.0: USB hub found |
| 225 |
[ 0.573496] hub 1-0:1.0: 3 ports detected |
| 226 |
[ 0.573656] uhci_hcd: USB Universal Host Controller Interface driver |
| 227 |
[ 0.573694] usbcore: registered new interface driver usbserial |
| 228 |
[ 0.573699] usbcore: registered new interface driver usbserial_generic |
| 229 |
[ 0.573706] usbserial: USB Serial support registered for generic |
| 230 |
[ 0.573763] mousedev: PS/2 mouse device common for all mice |
| 231 |
[ 0.573863] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0 |
| 232 |
[ 0.573932] device-mapper: uevent: version 1.0.3 |
| 233 |
[ 0.573994] device-mapper: ioctl: 4.34.0-ioctl (2015-10-28) initialised: [email protected] |
| 234 |
[ 0.574075] pseries_idle_driver registered |
| 235 |
[ 0.574087] hidraw: raw HID events driver (C) Jiri Kosina |
| 236 |
[ 0.574122] usbcore: registered new interface driver usbhid |
| 237 |
[ 0.574123] usbhid: USB HID core driver |
| 238 |
[ 0.574161] drop_monitor: Initializing network drop monitor service |
| 239 |
[ 0.574234] ip_tables: (C) 2000-2006 Netfilter Core Team |
| 240 |
[ 0.574249] Initializing XFRM netlink socket |
| 241 |
[ 0.574386] NET: Registered protocol family 10 |
| 242 |
[ 0.574535] mip6: Mobile IPv6 |
| 243 |
[ 0.574538] NET: Registered protocol family 17 |
| 244 |
[ 0.574586] Running MSI bitmap self-tests ... |
| 245 |
[ 0.574723] registered taskstats version 1 |
| 246 |
[ 0.574738] Loading compiled-in X.509 certificates |
| 247 |
[ 0.575418] Loaded X.509 cert 'Fedora kernel signing key: 5a5f33c227f5a1d54cd2ff7c19cb096bd38186c0' |
| 248 |
[ 0.575455] zswap: loaded using pool lzo/zbud |
| 249 |
[ 0.575662] rtc-generic rtc-generic: setting system clock to 2017-04-10 00:13:00 UTC (1491783180) |
| 250 |
[ 0.576274] Freeing unused kernel memory: 5312K (c000000000cd0000 - c000000001200000) |
| 251 |
[ 0.605405] random: systemd urandom read with 6 bits of entropy available |
| 252 |
[ 0.606905] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) |
| 253 |
[ 0.606941] systemd[1]: Detected virtualization kvm. |
| 254 |
[ 0.606945] systemd[1]: Detected architecture ppc64-le. |
| 255 |
[ 0.606947] systemd[1]: Running in initial RAM disk. |
| 256 |
[ 0.606954] systemd[1]: No hostname configured. |
| 257 |
[ 0.606958] systemd[1]: Set hostname to <localhost>. |
| 258 |
[ 0.606978] systemd[1]: Initializing machine ID from random generator. |
| 259 |
[ 0.668692] systemd[1]: Reached target Timers. |
| 260 |
[ 0.669077] systemd[1]: Created slice System Slice. |
| 261 |
[ 0.669110] systemd[1]: Listening on Journal Socket (/dev/log). |
| 262 |
[ 0.669126] systemd[1]: Listening on udev Kernel Socket. |
| 263 |
[ 0.669149] systemd[1]: Listening on udev Control Socket. |
| 264 |
[ 0.669175] systemd[1]: Listening on Journal Socket. |
| 265 |
[ 0.669586] systemd[1]: Starting Setup Virtual Console... |
| 266 |
[ 0.669653] systemd[1]: Listening on Journal Audit Socket. |
| 267 |
[ 0.672129] systemd[1]: Starting Journal Service... |
| 268 |
[ 0.672138] systemd[1]: Reached target Sockets. |
| 269 |
[ 0.672147] systemd[1]: Reached target Slices. |
| 270 |
[ 0.672232] systemd[1]: Reached target Local File Systems. |
| 271 |
[ 0.672240] systemd[1]: Reached target Swap. |
| 272 |
[ 0.672673] systemd[1]: Starting Create list of required static device nodes for the current kernel... |
| 273 |
[ 0.674014] systemd[1]: Starting Apply Kernel Variables... |
| 274 |
[ 0.674919] systemd[1]: Started Setup Virtual Console. |
| 275 |
[ 0.679667] audit: type=1130 audit(1491783180.590:2): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 276 |
[ 0.679905] systemd[1]: Started Create list of required static device nodes for the current kernel. |
| 277 |
[ 0.679919] audit: type=1130 audit(1491783180.590:3): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=kmod-static-nodes comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 278 |
[ 0.680081] systemd[1]: Started Apply Kernel Variables. |
| 279 |
[ 0.680092] audit: type=1130 audit(1491783180.590:4): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-sysctl comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 280 |
[ 0.680162] systemd[1]: Started Journal Service. |
| 281 |
[ 0.680185] audit: type=1130 audit(1491783180.590:5): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-journald comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 282 |
[ 0.694615] audit: type=1130 audit(1491783180.610:6): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-tmpfiles-setup-dev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 283 |
[ 0.699549] audit: type=1130 audit(1491783180.610:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-udevd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 284 |
[ 0.728515] audit: type=1130 audit(1491783180.640:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-udev-trigger comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 285 |
[ 0.739200] virtio-pci 0000:00:05.0: enabling device (0100 -> 0101) |
| 286 |
[ 0.739411] virtio-pci 0000:00:05.0: virtio_pci: leaving for legacy driver |
| 287 |
[ 0.740075] virtio-pci 0000:00:04.0: enabling device (0100 -> 0103) |
| 288 |
[ 0.740437] virtio-pci 0000:00:04.0: virtio_pci: leaving for legacy driver |
| 289 |
[ 0.757865] virtio-pci 0000:00:03.0: enabling device (0100 -> 0103) |
| 290 |
[ 0.758321] virtio-pci 0000:00:03.0: virtio_pci: leaving for legacy driver |
| 291 |
[ 0.763011] virtio-pci 0000:00:01.0: enabling device (0100 -> 0103) |
| 292 |
[ 0.763502] virtio-pci 0000:00:01.0: virtio_pci: leaving for legacy driver |
| 293 |
[ 0.768465] vdb: vdb1 vdb2 vdb3 |
| 294 |
[ 0.830235] audit: type=1130 audit(1491783180.740:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=plymouth-start comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 295 |
[ 2.148482] audit: type=1130 audit(1491783182.060:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-fsck-root comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' |
| 296 |
[ 2.189824] EXT4-fs (vdb3): mounted filesystem with ordered data mode. Opts: (null) |
| 297 |
[ 2.301223] systemd-journald[109]: Received SIGTERM from PID 1 (systemd). |
| 298 |
[ 2.351807] SELinux: 32768 avtab hash slots, 104786 rules. |
| 299 |
[ 2.365146] SELinux: 32768 avtab hash slots, 104786 rules. |
| 300 |
[ 2.383721] SELinux: 8 users, 14 roles, 5012 types, 303 bools, 1 sens, 1024 cats |
| 301 |
[ 2.383724] SELinux: 92 classes, 104786 rules |
| 302 |
[ 2.386155] SELinux: Permission validate_trans in class security not defined in policy. |
| 303 |
[ 2.386249] SELinux: the above unknown classes and permissions will be allowed |
| 304 |
[ 2.386252] SELinux: Completing initialization. |
| 305 |
[ 2.386253] SELinux: Setting up existing superblocks. |
| 306 |
[ 2.426718] systemd[1]: Successfully loaded SELinux policy in 103.506ms. |
| 307 |
[ 2.444699] systemd[1]: Relabelled /dev and /run in 11.979ms. |
| 308 |
[ 2.589401] EXT4-fs (vdb3): re-mounted. Opts: (null) |
| 309 |
[ 2.599542] systemd-journald[240]: Received request to flush runtime journal from PID 1 |
| 310 |
[ 2.779725] systemd-journald[240]: File /var/log/journal/4e9a0e2b5c824908abfd9075364301d9/system.journal corrupted or uncleanly shut down, renaming and replacing. |
| 311 |
[ 2.850831] Adding 102399936k swap on /dev/vda. Priority:-1 extents:1 across:102399936k FS |
| 312 |
[ 3.237747] EXT4-fs (vdb2): mounted filesystem with ordered data mode. Opts: (null) |
| 313 |
[ 16.065643] netlink: 12 bytes leftover after parsing attributes in process `ip'. |
| 314 |
[ 20.101004] random: nonblocking pool is initialized |
| 315 |
[ 26.987127] systemd-journald[240]: File /var/log/journal/4e9a0e2b5c824908abfd9075364301d9/user-1000.journal corrupted or uncleanly shut down, renaming and replacing. |
| 316 |
[ 95.273698] systemd-journald[240]: File /var/log/journal/4e9a0e2b5c824908abfd9075364301d9/user-1001.journal corrupted or uncleanly shut down, renaming and replacing. |
| 317 |
|
| 318 |
''' |
| 319 |
return returncode, output |
| 320 |
|
| 321 |
@staticmethod |
| 322 |
def lscpu(): |
| 323 |
returncode = 0 |
| 324 |
output = r''' |
| 325 |
Architecture: ppc64le |
| 326 |
Byte Order: Little Endian |
| 327 |
CPU(s): 2 |
| 328 |
On-line CPU(s) list: 0,1 |
| 329 |
Thread(s) per core: 1 |
| 330 |
Core(s) per socket: 1 |
| 331 |
Socket(s): 2 |
| 332 |
NUMA node(s): 1 |
| 333 |
Model: 2.1 (pvr 004b 0201) |
| 334 |
Model name: POWER8E (raw), altivec supported |
| 335 |
Hypervisor vendor: KVM |
| 336 |
Virtualization type: para |
| 337 |
L1d cache: 64K |
| 338 |
L1i cache: 32K |
| 339 |
NUMA node0 CPU(s): 0,1 |
| 340 |
|
| 341 |
''' |
| 342 |
return returncode, output |
| 343 |
|
| 344 |
|
| 345 |
class TestLinuxFedora_24_ppc64le(unittest.TestCase): |
| 346 |
def setUp(self): |
| 347 |
helpers.backup_data_source(cpuinfo) |
| 348 |
helpers.monkey_patch_data_source(cpuinfo, MockDataSource) |
| 349 |
|
| 350 |
def tearDown(self): |
| 351 |
helpers.restore_data_source(cpuinfo) |
| 352 |
|
| 353 |
''' |
| 354 |
Make sure calls return the expected number of fields. |
| 355 |
''' |
| 356 |
def test_returns(self): |
| 357 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_registry())) |
| 358 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpufreq_info())) |
| 359 |
self.assertEqual(3, len(cpuinfo._get_cpu_info_from_lscpu())) |
| 360 |
self.assertEqual(5, len(cpuinfo._get_cpu_info_from_proc_cpuinfo())) |
| 361 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysctl())) |
| 362 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_kstat())) |
| 363 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_dmesg())) |
| 364 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cat_var_run_dmesg_boot())) |
| 365 |
self.assertEqual(1, len(cpuinfo._get_cpu_info_from_ibm_pa_features())) |
| 366 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_sysinfo())) |
| 367 |
self.assertEqual(0, len(cpuinfo._get_cpu_info_from_cpuid())) |
| 368 |
self.assertEqual(15, len(cpuinfo._get_cpu_info_internal())) |
| 369 |
|
| 370 |
def test_get_cpu_info_from_lscpu(self): |
| 371 |
info = cpuinfo._get_cpu_info_from_lscpu() |
| 372 |
|
| 373 |
self.assertEqual(32 * 1024, info['l1_instruction_cache_size']) |
| 374 |
self.assertEqual(64 * 1024, info['l1_data_cache_size']) |
| 375 |
|
| 376 |
self.assertEqual('POWER8E (raw), altivec supported', info['brand_raw']) |
| 377 |
|
| 378 |
def test_get_cpu_info_from_ibm_pa_features(self): |
| 379 |
info = cpuinfo._get_cpu_info_from_ibm_pa_features() |
| 380 |
self.assertEqual( |
| 381 |
['dss_2.02', 'dss_2.05', 'dss_2.06', 'fpu', 'lsd_in_dscr', 'ppr', 'slb', 'sso_2.06', 'ugr_in_dscr'], |
| 382 |
info['flags'] |
| 383 |
) |
| 384 |
|
| 385 |
def test_get_cpu_info_from_proc_cpuinfo(self): |
| 386 |
info = cpuinfo._get_cpu_info_from_proc_cpuinfo() |
| 387 |
|
| 388 |
self.assertEqual('POWER8E (raw), altivec supported', info['brand_raw']) |
| 389 |
self.assertEqual('3.4250 GHz', info['hz_advertised_friendly']) |
| 390 |
self.assertEqual('3.4250 GHz', info['hz_actual_friendly']) |
| 391 |
self.assertEqual((3425000000, 0), info['hz_advertised']) |
| 392 |
self.assertEqual((3425000000, 0), info['hz_actual']) |
| 393 |
|
| 394 |
def test_all(self): |
| 395 |
info = cpuinfo._get_cpu_info_internal() |
| 396 |
|
| 397 |
self.assertEqual('POWER8E (raw), altivec supported', info['brand_raw']) |
| 398 |
self.assertEqual('3.4250 GHz', info['hz_advertised_friendly']) |
| 399 |
self.assertEqual('3.4250 GHz', info['hz_actual_friendly']) |
| 400 |
self.assertEqual((3425000000, 0), info['hz_advertised']) |
| 401 |
self.assertEqual((3425000000, 0), info['hz_actual']) |
| 402 |
self.assertEqual('PPC_64', info['arch']) |
| 403 |
self.assertEqual(64, info['bits']) |
| 404 |
self.assertEqual(2, info['count']) |
| 405 |
self.assertEqual(32 * 1024, info['l1_instruction_cache_size']) |
| 406 |
self.assertEqual(64 * 1024, info['l1_data_cache_size']) |
| 407 |
self.assertEqual('ppc64le', info['arch_string_raw']) |
| 408 |
self.assertEqual( |
| 409 |
['dss_2.02', 'dss_2.05', 'dss_2.06', 'fpu', 'lsd_in_dscr', 'ppr', 'slb', 'sso_2.06', 'ugr_in_dscr'], |
| 410 |
info['flags'] |
| 411 |
) |