@@ -6,110 +6,9 @@ import (
6
6
"github.com/stretchr/testify/assert"
7
7
)
8
8
9
- const (
10
- amdCPUInfo = `
11
- processor : 0
12
- vendor_id : AuthenticAMD
13
- cpu family : 20
14
- model : 1
15
- model name : AMD C-50 Processor
16
- stepping : 0
17
- microcode : 0x5000026
18
- cpu MHz : 800.000
19
- cache size : 512 KB
20
- physical id : 0
21
- siblings : 2
22
- core id : 0
23
- cpu cores : 2
24
- apicid : 0
25
- initial apicid : 0
26
- fpu : yes
27
- fpu_exception : yes
28
- cpuid level : 6
29
- wp : yes
30
- 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 mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt arat hw_pstate npt lbrv svm_lock nrip_save pausefilter vmmcall
31
- bugs : fxsave_leak sysret_ss_attrs
32
- bogomips : 1995.09
33
- TLB size : 1024 4K pages
34
- clflush size : 64
35
- cache_alignment : 64
36
- address sizes : 36 bits physical, 48 bits virtual
37
- power management: ts ttp tm stc 100mhzsteps hwpstate
38
- `
39
- intelCPUInfo = `
40
- processor : 0
41
- vendor_id : GenuineIntel
42
- cpu family : 6
43
- model : 70
44
- model name : Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
45
- stepping : 1
46
- microcode : 0x19
47
- cpu MHz : 2294.688
48
- cache size : 6144 KB
49
- physical id : 0
50
- siblings : 1
51
- core id : 0
52
- cpu cores : 1
53
- apicid : 0
54
- initial apicid : 0
55
- fpu : yes
56
- fpu_exception : yes
57
- cpuid level : 13
58
- wp : yes
59
- flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr vmx pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm
60
- bugs :
61
- bogomips : 4589.37
62
- clflush size : 64
63
- cache_alignment : 64
64
- address sizes : 39 bits physical, 48 bits virtual
65
- power management:
66
- `
67
-
68
- faultyCPUInfo = `
69
- processor : 0
70
- vendor_id : GenuineIntel
71
- cpu family : 6
72
- model : 70
73
- model name : Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
74
- stepping : 1
75
- microcode : 0x19
76
- cpu MHz : 2294.688
77
- cache size : 6144 KB
78
- physical id : 0
79
- siblings : 1
80
- core id : 0
81
- cpu cores : 1
82
- apicid : 0
83
- initial apicid : 0
84
- fpu : yes
85
- fpu_exception : yes
86
- cpuid level : 13
87
- wp : yes
88
- flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm
89
- bugs :
90
- bogomips : 4589.37
91
- clflush size : 64
92
- cache_alignment : 64
93
- address sizes : 39 bits physical, 48 bits virtual
94
- power management:
95
- `
96
- )
97
-
98
9
func TestShareName (t * testing.T ) {
99
10
name , dir := getShareDriveAndName ()
100
11
101
12
assert .Equal (t , name , "hosthome" )
102
13
assert .Equal (t , dir , "/home" )
103
14
}
104
-
105
- func TestCpuInfoOnAMD (t * testing.T ) {
106
- assert .False (t , isVTXDisabled ([]byte (amdCPUInfo )))
107
- }
108
-
109
- func TestCpuInfoOnIntel (t * testing.T ) {
110
- assert .False (t , isVTXDisabled ([]byte (intelCPUInfo )))
111
- }
112
-
113
- func TestCpuInfoOnNone (t * testing.T ) {
114
- assert .True (t , isVTXDisabled ([]byte (faultyCPUInfo )))
115
- }
0 commit comments